BOSS 7.1.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, <[email protected]> |
5// [Date ]: Mar 28, 2006 |
6//------------------------------------------------------------------------------|
7
8#include<iostream>
9#include<string>
10#include<cmath>
11
13
14using namespace std;
15
16// Constructor
17MucEntity::MucEntity( int part, int segment, int layer )
18{
19 m_Part = part;
20 m_Segment = segment;
21 m_Layer = layer;
22 m_UpDown = -1; // no up/down distinction
23 m_RpcId = 0;
24 m_ID = 0; // only 1 entity, default
25
27}
28
29MucEntity::MucEntity( int part, int segment, int layer, int id )
30{
31 m_Part = part;
32 m_Segment = segment;
33 m_Layer = layer;
34 m_ID = id;
35 m_UpDown = -1;
36 m_RpcId = 0;
37
38 Init();
39}
40
41MucEntity::MucEntity( int part, int segment, int layer, int upDown, int id )
42{
43 m_Part = part;
44 m_Segment = segment;
45 m_Layer = layer;
46 m_UpDown = upDown;
47 m_ID = id;
48 m_RpcId = id;
49
51}
52
53MucEntity::MucEntity( int part, int segment, int layer, int upDown, int rpcId, int id )
54{
55 m_Part = part;
56 m_Segment = segment;
57 m_Layer = layer;
58 m_UpDown = upDown;
59 m_RpcId = rpcId;
60 m_ID = id;
61
63}
64
66{
67 m_Part = other.m_Part;
68 m_Segment = other.m_Segment;
69 m_Layer = other.m_Layer;
70 m_UpDown = other.m_UpDown;
71 m_RpcId = other.m_RpcId;
72 m_ID = other.m_ID;
73
74 m_Theta = other.m_Theta;
75 m_Thin = other.m_Thin;
76 m_W = other.m_W;
77 m_H = other.m_H;
78 m_L = other.m_L;
79 m_Wu = other.m_Wu;
80 m_Wd = other.m_Wd;
81 m_Area = other.m_Area;
82
83 for(int i=0; i<3; i++)
84 {
85 m_LocOrgInBes[i] = other.m_LocOrgInBes[i];
86 m_ObjRotToMot[i] = other.m_ObjRotToMot[i];
87 m_ObjOrgInBes[i] = other.m_ObjOrgInBes[i];
88 m_ObjOrgInLoc[i] = other.m_ObjOrgInLoc[i];
89 }
90}
91
93{
94 if( this == &other) return *this;
95
96 m_Part = other.m_Part;
97 m_Segment = other.m_Segment;
98 m_Layer = other.m_Layer;
99 m_UpDown = other.m_UpDown;
100 m_RpcId = other.m_RpcId;
101 m_ID = other.m_ID;
102
103 m_Theta = other.m_Theta;
104 m_Thin = other.m_Thin;
105 m_W = other.m_W;
106 m_H = other.m_H;
107 m_L = other.m_L;
108 m_Wu = other.m_Wu;
109 m_Wd = other.m_Wd;
110 m_Area = other.m_Area;
111
112 for(int i=0; i<3; i++)
113 {
114 m_LocOrgInBes[i] = other.m_LocOrgInBes[i];
115 m_ObjRotToMot[i] = other.m_ObjRotToMot[i];
116 m_ObjOrgInBes[i] = other.m_ObjOrgInBes[i];
117 m_ObjOrgInLoc[i] = other.m_ObjOrgInLoc[i];
118 }
119
120 return *this;
121}
122
123// Destructor
125{
126 delete [] m_LocOrgInBes;
127 delete [] m_ObjRotToMot;
128 delete [] m_ObjOrgInBes;
129 delete [] m_ObjOrgInLoc;
130}
131
132// Get methods
133int MucEntity::GetPart() { return m_Part; }
138int MucEntity::GetID() { return m_ID; }
139double MucEntity::GetTheta(){ return m_Theta; }
140double MucEntity::GetRin() { return m_Rin; }
141double MucEntity::GetRout() { return m_Rout; }
142double MucEntity::GetRc() { return m_Rc; }
143double MucEntity::GetThin() { return m_Thin; }
144double MucEntity::GetW() { return m_W; }
145double MucEntity::GetH() { return m_H; }
146double MucEntity::GetL() { return m_L; }
147double MucEntity::GetWu() { return m_Wu; }
148double MucEntity::GetWd() { return m_Wd; }
149double MucEntity::GetArea() { return m_Area; }
150
152{
153 if( i<1 || i>3 ) i=1;
154 return m_LocOrgInBes[i-1];
155}
156
158{
159 if( i<1 || i>3 ) i=1;
160 return m_ObjRotToMot[i-1];
161}
162
164{
165 if( i<1 || i>3 ) i=1;
166 return m_ObjOrgInBes[i-1];
167}
168
170{
171 if( i<1 || i>3 ) i=1;
172 return m_ObjOrgInLoc[i-1];
173}
174
179
180
181// Set methods
183{
199}
200
202void MucEntity::SetRin() { m_Rin = 0.; }
204void MucEntity::SetRc() { m_Rc = 0.; }
206void MucEntity::SetW() { m_W = 0.; }
207void MucEntity::SetWu() { m_Wu = 0.; }
208void MucEntity::SetWd() { m_Wd = 0.; }
209void MucEntity::SetH() { m_H = 0.; }
210void MucEntity::SetL() { m_L = 0.; }
212
213void MucEntity::SetLocOrgInBes() { for( int i=0; i<3; i++) m_LocOrgInBes[i] = 0.; }
214void MucEntity::SetObjRotToMot() { for( int i=0; i<3; i++) m_ObjRotToMot[i] = 0.; }
215void MucEntity::SetObjOrgInBes() { for( int i=0; i<3; i++) m_ObjOrgInBes[i] = 0.; }
216void MucEntity::SetObjOrgInLoc() { for( int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.; }
217
218void MucEntity::SetAlignment( double dx, double dy, double dz ) { ; }
219
220// Coordinate transform function, from global(BES) to local
221// Z coordinate is parellel, phi is the inclination angle of the BES coordinate x direction and the Loc one
222void MucEntity::TransBesToLoc( double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z )
223{
224 LocCoord[0] = (BesCoord[0] - LocOrgInBes[0])*cos(Rot_z) + (BesCoord[1] - LocOrgInBes[1])*sin(Rot_z);
225 LocCoord[1] = -(BesCoord[0] - LocOrgInBes[0])*sin(Rot_z) + (BesCoord[1] - LocOrgInBes[1])*cos(Rot_z);
226 LocCoord[2] = BesCoord[2] - LocOrgInBes[2];
227}
228
229// Coordinate transform function, from local to global(BES)
230// Z coordinate is parellel, phi is the inclination angle of the BES coordinate x direction and the Loc one
231void MucEntity::TransLocToBes( double BesCoord[], double LocCoord[], double LocOrgInBes[], double Rot_z )
232{
233 BesCoord[0] = LocCoord[0]*cos(Rot_z) - LocCoord[1]*sin(Rot_z) + LocOrgInBes[0];
234 BesCoord[1] = LocCoord[0]*sin(Rot_z) + LocCoord[1]*cos(Rot_z) + LocOrgInBes[1];
235 BesCoord[2] = LocCoord[2] + LocOrgInBes[2];
236}
237
238// END
239
240
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
double GetWu()
Definition: MucEntity.cxx:147
virtual void SetArea()
Definition: MucEntity.cxx:211
double GetW()
Definition: MucEntity.cxx:144
virtual void SetObjOrgInBes()
Definition: MucEntity.cxx:215
virtual void SetObjRotToMot()
Definition: MucEntity.cxx:214
int m_RpcId
Definition: MucEntity.h:91
double GetThin()
Definition: MucEntity.cxx:143
MucEntity(int part, int segment, int layer)
Definition: MucEntity.cxx:17
double m_W
Definition: MucEntity.h:101
virtual void SetWd()
Definition: MucEntity.cxx:208
double m_Area
Definition: MucEntity.h:106
MucEntity & operator=(const MucEntity &other)
Definition: MucEntity.cxx:92
virtual ~MucEntity()
Definition: MucEntity.cxx:124
double m_Thin
Definition: MucEntity.h:100
double m_Rin
Definition: MucEntity.h:97
virtual void SetW()
Definition: MucEntity.cxx:206
virtual void SetL()
Definition: MucEntity.cxx:210
double GetWd()
Definition: MucEntity.cxx:148
double m_H
Definition: MucEntity.h:102
double GetH()
Definition: MucEntity.cxx:145
virtual void SetLocOrgInBes()
Definition: MucEntity.cxx:213
virtual void SetAlignment(double dx, double dy, double dz)
Definition: MucEntity.cxx:218
int m_Layer
Definition: MucEntity.h:89
double GetArea()
Definition: MucEntity.cxx:149
int GetID()
Definition: MucEntity.cxx:138
virtual void SetH()
Definition: MucEntity.cxx:209
double m_ObjOrgInLoc[3]
Definition: MucEntity.h:118
double * GetLocOrgInBes()
Definition: MucEntity.cxx:175
double m_Rout
Definition: MucEntity.h:98
virtual void SetThin()
Definition: MucEntity.cxx:205
double * GetObjRotToMot()
Definition: MucEntity.cxx:176
double m_ObjRotToMot[3]
Definition: MucEntity.h:110
virtual void SetObjOrgInLoc()
Definition: MucEntity.cxx:216
double m_Wd
Definition: MucEntity.h:105
double GetRc()
Definition: MucEntity.cxx:142
virtual void SetRc()
Definition: MucEntity.cxx:204
double GetTheta()
Definition: MucEntity.cxx:139
void TransBesToLoc(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
Definition: MucEntity.cxx:222
int GetSegment()
Definition: MucEntity.cxx:134
int m_Segment
Definition: MucEntity.h:88
double m_Theta
Definition: MucEntity.h:94
virtual void SetRout()
Definition: MucEntity.cxx:203
int GetUpDown()
Definition: MucEntity.cxx:136
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()
Definition: MucEntity.cxx:202
virtual void SetTheta()
Definition: MucEntity.cxx:201
int GetRpcId()
Definition: MucEntity.cxx:137
double * GetObjOrgInBes()
Definition: MucEntity.cxx:177
double m_ObjOrgInBes[3]
Definition: MucEntity.h:117
double GetRin()
Definition: MucEntity.cxx:140
int GetLayer()
Definition: MucEntity.cxx:135
int m_UpDown
Definition: MucEntity.h:90
void TransLocToBes(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
Definition: MucEntity.cxx:231
double GetL()
Definition: MucEntity.cxx:146
double * GetObjOrgInLoc()
Definition: MucEntity.cxx:178
int m_ID
Definition: MucEntity.h:92
double GetRout()
Definition: MucEntity.cxx:141
double m_Wu
Definition: MucEntity.h:104
virtual void SetWu()
Definition: MucEntity.cxx:207
int GetPart()
Definition: MucEntity.cxx:133
virtual void Init()
Definition: MucEntity.cxx:182
double m_L
Definition: MucEntity.h:103