BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MucEntity.cxx
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucEntity.cxx |
3// [Brief ]: MUC geometry entity class |
4// [Author]: Xie Yuguang, <ygxie@mail.ihep.ac.cn> |
5// [Date ]: Mar 28, 2006 |
6//------------------------------------------------------------------------------|
7
8#include <cmath>
9#include <iostream>
10#include <string>
11
13
14using namespace std;
15
16// Constructor
17MucEntity::MucEntity( int part, int segment, int layer ) {
18 m_Part = part;
19 m_Segment = segment;
20 m_Layer = layer;
21 m_UpDown = -1; // no up/down distinction
22 m_RpcId = 0;
23 m_ID = 0; // only 1 entity, default
24
26}
27
28MucEntity::MucEntity( int part, int segment, int layer, int id ) {
29 m_Part = part;
30 m_Segment = segment;
31 m_Layer = layer;
32 m_ID = id;
33 m_UpDown = -1;
34 m_RpcId = 0;
35
36 Init();
37}
38
39MucEntity::MucEntity( int part, int segment, int layer, int upDown, int id ) {
40 m_Part = part;
41 m_Segment = segment;
42 m_Layer = layer;
43 m_UpDown = upDown;
44 m_ID = id;
45 m_RpcId = id;
46
48}
49
50MucEntity::MucEntity( int part, int segment, int layer, int upDown, int rpcId, int id ) {
51 m_Part = part;
52 m_Segment = segment;
53 m_Layer = layer;
54 m_UpDown = upDown;
55 m_RpcId = rpcId;
56 m_ID = id;
57
59}
60
62 m_Part = other.m_Part;
63 m_Segment = other.m_Segment;
64 m_Layer = other.m_Layer;
65 m_UpDown = other.m_UpDown;
66 m_RpcId = other.m_RpcId;
67 m_ID = other.m_ID;
68
69 m_Theta = other.m_Theta;
70 m_Thin = other.m_Thin;
71 m_W = other.m_W;
72 m_H = other.m_H;
73 m_L = other.m_L;
74 m_Wu = other.m_Wu;
75 m_Wd = other.m_Wd;
76 m_Area = other.m_Area;
77
78 for ( int i = 0; i < 3; i++ )
79 {
80 m_LocOrgInBes[i] = other.m_LocOrgInBes[i];
81 m_ObjRotToMot[i] = other.m_ObjRotToMot[i];
82 m_ObjOrgInBes[i] = other.m_ObjOrgInBes[i];
83 m_ObjOrgInLoc[i] = other.m_ObjOrgInLoc[i];
84 }
85}
86
88 if ( this == &other ) return *this;
89
90 m_Part = other.m_Part;
91 m_Segment = other.m_Segment;
92 m_Layer = other.m_Layer;
93 m_UpDown = other.m_UpDown;
94 m_RpcId = other.m_RpcId;
95 m_ID = other.m_ID;
96
97 m_Theta = other.m_Theta;
98 m_Thin = other.m_Thin;
99 m_W = other.m_W;
100 m_H = other.m_H;
101 m_L = other.m_L;
102 m_Wu = other.m_Wu;
103 m_Wd = other.m_Wd;
104 m_Area = other.m_Area;
105
106 for ( int i = 0; i < 3; i++ )
107 {
108 m_LocOrgInBes[i] = other.m_LocOrgInBes[i];
109 m_ObjRotToMot[i] = other.m_ObjRotToMot[i];
110 m_ObjOrgInBes[i] = other.m_ObjOrgInBes[i];
111 m_ObjOrgInLoc[i] = other.m_ObjOrgInLoc[i];
112 }
113
114 return *this;
115}
116
117// Destructor
119 delete[] m_LocOrgInBes;
120 delete[] m_ObjRotToMot;
121 delete[] m_ObjOrgInBes;
122 delete[] m_ObjOrgInLoc;
123}
124
125// Get methods
126int MucEntity::GetPart() { return m_Part; }
131int MucEntity::GetID() { return m_ID; }
132double MucEntity::GetTheta() { return m_Theta; }
133double MucEntity::GetRin() { return m_Rin; }
134double MucEntity::GetRout() { return m_Rout; }
135double MucEntity::GetRc() { return m_Rc; }
136double MucEntity::GetThin() { return m_Thin; }
137double MucEntity::GetW() { return m_W; }
138double MucEntity::GetH() { return m_H; }
139double MucEntity::GetL() { return m_L; }
140double MucEntity::GetWu() { return m_Wu; }
141double MucEntity::GetWd() { return m_Wd; }
142double MucEntity::GetArea() { return m_Area; }
143
145 if ( i < 1 || i > 3 ) i = 1;
146 return m_LocOrgInBes[i - 1];
147}
148
150 if ( i < 1 || i > 3 ) i = 1;
151 return m_ObjRotToMot[i - 1];
152}
153
155 if ( i < 1 || i > 3 ) i = 1;
156 return m_ObjOrgInBes[i - 1];
157}
158
160 if ( i < 1 || i > 3 ) i = 1;
161 return m_ObjOrgInLoc[i - 1];
162}
163
168
169// Set methods
187
189void MucEntity::SetRin() { m_Rin = 0.; }
191void MucEntity::SetRc() { m_Rc = 0.; }
193void MucEntity::SetW() { m_W = 0.; }
194void MucEntity::SetWu() { m_Wu = 0.; }
195void MucEntity::SetWd() { m_Wd = 0.; }
196void MucEntity::SetH() { m_H = 0.; }
197void MucEntity::SetL() { m_L = 0.; }
199
201 for ( int i = 0; i < 3; i++ ) m_LocOrgInBes[i] = 0.;
202}
204 for ( int i = 0; i < 3; i++ ) m_ObjRotToMot[i] = 0.;
205}
207 for ( int i = 0; i < 3; i++ ) m_ObjOrgInBes[i] = 0.;
208}
210 for ( int i = 0; i < 3; i++ ) m_ObjOrgInLoc[i] = 0.;
211}
212
213void MucEntity::SetAlignment( double dx, double dy, double dz ) { ; }
214
215// Coordinate transform function, from global(BES) to local
216// Z coordinate is parellel, phi is the inclination angle of the BES coordinate x direction and
217// the Loc one
218void MucEntity::TransBesToLoc( double LocCoord[], double BesCoord[], double LocOrgInBes[],
219 double Rot_z ) {
220 LocCoord[0] = ( BesCoord[0] - LocOrgInBes[0] ) * cos( Rot_z ) +
221 ( BesCoord[1] - LocOrgInBes[1] ) * sin( Rot_z );
222 LocCoord[1] = -( BesCoord[0] - LocOrgInBes[0] ) * sin( Rot_z ) +
223 ( BesCoord[1] - LocOrgInBes[1] ) * cos( Rot_z );
224 LocCoord[2] = BesCoord[2] - LocOrgInBes[2];
225}
226
227// Coordinate transform function, from local to global(BES)
228// Z coordinate is parellel, phi is the inclination angle of the BES coordinate x direction and
229// the Loc one
230void MucEntity::TransLocToBes( double BesCoord[], double LocCoord[], double LocOrgInBes[],
231 double Rot_z ) {
232 BesCoord[0] = LocCoord[0] * cos( Rot_z ) - LocCoord[1] * sin( Rot_z ) + LocOrgInBes[0];
233 BesCoord[1] = LocCoord[0] * sin( Rot_z ) + LocCoord[1] * cos( Rot_z ) + LocOrgInBes[1];
234 BesCoord[2] = LocCoord[2] + LocOrgInBes[2];
235}
236
237// END
double GetWu()
virtual void SetArea()
double GetW()
virtual void SetObjOrgInBes()
virtual void SetObjRotToMot()
int m_RpcId
Definition MucEntity.h:91
double GetThin()
MucEntity(int part, int segment, int layer)
Definition MucEntity.cxx:17
double m_W
Definition MucEntity.h:101
virtual void SetWd()
double m_Area
Definition MucEntity.h:106
MucEntity & operator=(const MucEntity &other)
Definition MucEntity.cxx:87
virtual ~MucEntity()
double m_Thin
Definition MucEntity.h:100
double m_Rin
Definition MucEntity.h:97
virtual void SetW()
virtual void SetL()
double GetWd()
double m_H
Definition MucEntity.h:102
double GetH()
virtual void SetLocOrgInBes()
virtual void SetAlignment(double dx, double dy, double dz)
int m_Layer
Definition MucEntity.h:89
double GetArea()
int GetID()
virtual void SetH()
double m_ObjOrgInLoc[3]
Definition MucEntity.h:118
double * GetLocOrgInBes()
double m_Rout
Definition MucEntity.h:98
virtual void SetThin()
double * GetObjRotToMot()
double m_ObjRotToMot[3]
Definition MucEntity.h:110
virtual void SetObjOrgInLoc()
double m_Wd
Definition MucEntity.h:105
double GetRc()
virtual void SetRc()
double GetTheta()
void TransBesToLoc(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
int GetSegment()
int m_Segment
Definition MucEntity.h:88
double m_Theta
Definition MucEntity.h:94
virtual void SetRout()
int GetUpDown()
int m_Part
Definition MucEntity.h:87
double m_LocOrgInBes[3]
Definition MucEntity.h:108
double m_Rc
Definition MucEntity.h:99
virtual void SetRin()
virtual void SetTheta()
int GetRpcId()
double * GetObjOrgInBes()
double m_ObjOrgInBes[3]
Definition MucEntity.h:117
double GetRin()
int GetLayer()
int m_UpDown
Definition MucEntity.h:90
void TransLocToBes(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
double GetL()
double * GetObjOrgInLoc()
double GetRout()
double m_Wu
Definition MucEntity.h:104
virtual void SetWu()
int GetPart()
virtual void Init()
double m_L
Definition MucEntity.h:103