00001 //------------------------------------------------------------------------------| 00002 // [File ]: MucEntity.h | 00003 // [Brief ]: Head file of MUC geometry entity class | 00004 // [Author]: Xie Yuguang, <ygxie@mail.ihep.ac.cn> | 00005 // [Date ]: May 22, 2005 | 00006 //------------------------------------------------------------------------------| 00007 00008 #ifndef MUC_ENTITY_H 00009 #define MUC_ENTITY_H 00010 00011 #include<iostream> 00012 00013 //#include "CLHEP/Geometry/Vector3D.h" 00014 //#include "CLHEP/Geometry/Point3D.h" 00015 00016 using namespace std; 00017 00018 class MucEntity 00019 { 00020 public: 00021 MucEntity( int part, int segment, int layer ); 00022 MucEntity( int part, int segment, int layer, int id ); 00023 MucEntity( int part, int segment, int layer, int upDown, int id ); 00024 MucEntity( int part, int segment, int layer, int upDown, int rpcId, int id ); 00025 MucEntity( const MucEntity &other ); 00026 MucEntity &operator =( const MucEntity &other ); 00027 virtual ~MucEntity() ; 00028 00029 int GetPart(); 00030 int GetSegment(); 00031 int GetLayer(); 00032 int GetUpDown(); 00033 int GetRpcId(); 00034 int GetID(); 00035 00036 double GetTheta(); 00037 double GetRin(); 00038 double GetRout(); 00039 double GetRc(); 00040 double GetThin(); 00041 double GetW(); 00042 double GetH(); 00043 double GetL(); 00044 double GetWu(); 00045 double GetWd(); 00046 double GetArea(); 00047 00048 double GetLocOrgInBes( int i ); // 1: Bes_x, 2: Bes_y, 3, Bes_z 00049 double GetObjRotToMot( int i ); // 1: Rot_x, 2: Rot_y, 3, Rot_z 00050 double GetObjOrgInBes( int i ); // 1: Bes_x, 2: Bes_y, 3, Bes_z 00051 double GetObjOrgInLoc( int i ); // 1: Pos_x, 2: Pos_y, 3, Pos_z 00052 00053 double* GetLocOrgInBes(); 00054 double* GetObjRotToMot(); 00055 double* GetObjOrgInLoc(); 00056 double* GetObjOrgInBes(); 00057 00058 // coordinate transform function, from old to new, 00059 // Rot_z is the direction angle of new x axis in old coordinate system 00060 void TransBesToLoc( double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z ); 00061 void TransLocToBes( double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z ); 00062 00063 protected: 00064 00065 virtual void Init(); // all geometry information initilization 00066 00067 virtual void SetTheta(); // set theta 00068 virtual void SetRin(); // set r inner 00069 virtual void SetRout(); // set r outer 00070 virtual void SetRc(); // set r center 00071 virtual void SetThin(); // set thickness 00072 virtual void SetW(); // set width 00073 virtual void SetH(); // set height 00074 virtual void SetL(); // set stretching length 00075 virtual void SetWu(); // set up width 00076 virtual void SetWd(); // set down width 00077 virtual void SetArea(); // set area of entity(mm^2) 00078 virtual void SetLocOrgInBes(); // set x, y, z of local origin in BES coordinate system 00079 virtual void SetObjRotToMot(); // set rotation angles of x, y, z axises of local coordinate system 00080 // relative to BES 00081 virtual void SetObjOrgInBes(); // set x, y and z of object origin in BES coordinate system 00082 virtual void SetObjOrgInLoc(); // set x, y and z of object origin in local or 00083 // temporary local coordinate system 00084 00085 virtual void SetAlignment( double dx, double dy, double dz); // set alignment 00086 00087 protected: 00088 int m_Part; // part id 00089 int m_Segment; // segment id 00090 int m_Layer; // layer id 00091 int m_UpDown; // up or down superlayer id, only valid for superlayer objects 00092 int m_RpcId; // rpc id in up or down superlayer 00093 int m_ID; // object id 00094 00095 double m_Theta; // barrel: inclination angle of R and Bes_X 00096 // endcap: inclination angle of panel boudary and Bes_X 00097 00098 double m_Rin; // r of the inner surface relative to BES origin 00099 double m_Rout; // r of the outer surface relative to BES origin 00100 double m_Rc; // r of the center surface relative to BES orign 00101 double m_Thin; // thickness of entity 00102 double m_W; // width of cross section 00103 double m_H; // height of cross section 00104 double m_L; // stretching length of cross section 00105 double m_Wu; // up width of trapezoid cross section 00106 double m_Wd; // down width of trapezoid cross section 00107 double m_Area; // area of entity,mm^2 00108 00109 double m_LocOrgInBes[3]; // x, y, z of the mother origin in BES coordinate system 00110 // for panel, the mother is temporary local coordinate system 00111 double m_ObjRotToMot[3]; // rotation angles of x, y, z axises of the object coordinate system 00112 // relative to the mother 00113 // only rotation angle relative to Bes_z axis is useful 00114 // defined as the angle of local xy plane circling mother's z axis, 00115 // not Euler angle 00116 // for local or temparory local, the mother is BES, for panel, 00117 // the mother is the local or temparory local 00118 double m_ObjOrgInBes[3]; // x, y and z of object origin in BES coordinate system 00119 double m_ObjOrgInLoc[3]; // x, y and z of object origin in its mother coordinate system 00120 // for panel, the mother is temporary local coordinate system 00121 00122 //-------------------------------------------------------------NOTE--------------------------------------------------------------- 00123 // 1: There are four coordinate systems: BES(the world), local(the mother), temporary local(the temp, for many panels object) 00124 // and object, the posterior one is always located in the anterior one. 00125 // 2: If the local coordinate system of one entity is BES, m_MotOrgInBes is unuseful. 00126 // 3: According to the detector structure, the origin coordinates and rotation angles of geometry entities relative to BES 00127 // coordinate system can be calculated easily and conveniently, so these values will be initialized first in constructor. 00128 // 4: For objects having many panels, the id of integral object is -1, and the id of panel begins from 0 to panel number. 00129 // These objects must be added a temporary local coordinate system for locating the panels, the temporary local 00130 00131 }; 00132 00133 #endif 00134