CGEM BOSS 6.6.5.i
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)
95 return *this;
96
97 m_Part = other.m_Part;
98 m_Segment = other.m_Segment;
99 m_Layer = other.m_Layer;
100 m_UpDown = other.m_UpDown;
101 m_RpcId = other.m_RpcId;
102 m_ID = other.m_ID;
103
104 m_Theta = other.m_Theta;
105 m_Thin = other.m_Thin;
106 m_W = other.m_W;
107 m_H = other.m_H;
108 m_L = other.m_L;
109 m_Wu = other.m_Wu;
110 m_Wd = other.m_Wd;
111 m_Area = other.m_Area;
112
113 for(int i=0; i<3; i++)
114 {
115 m_LocOrgInBes[i] = other.m_LocOrgInBes[i];
116 m_ObjRotToMot[i] = other.m_ObjRotToMot[i];
117 m_ObjOrgInBes[i] = other.m_ObjOrgInBes[i];
118 m_ObjOrgInLoc[i] = other.m_ObjOrgInLoc[i];
119 }
120
121 return *this;
122}
123
124// Destructor
126{
127 delete [] m_LocOrgInBes;
128 delete [] m_ObjRotToMot;
129 delete [] m_ObjOrgInBes;
130 delete [] m_ObjOrgInLoc;
131}
132
133// Get methods
134int MucEntity::GetPart() { return m_Part; }
139int MucEntity::GetID() { return m_ID; }
140double MucEntity::GetTheta() { return m_Theta; }
141double MucEntity::GetRin() { return m_Rin; }
142double MucEntity::GetRout() { return m_Rout; }
143double MucEntity::GetRc() { return m_Rc; }
144double MucEntity::GetThin() { return m_Thin; }
145double MucEntity::GetW() { return m_W; }
146double MucEntity::GetH() { return m_H; }
147double MucEntity::GetL() { return m_L; }
148double MucEntity::GetWu() { return m_Wu; }
149double MucEntity::GetWd() { return m_Wd; }
150double MucEntity::GetArea() { return m_Area; }
151
153{
154 if( i<1 || i>3 ) i=1;
155 return m_LocOrgInBes[i-1];
156}
157
159{
160 if( i<1 || i>3 ) i=1;
161 return m_ObjRotToMot[i-1];
162}
163
165{
166 if( i<1 || i>3 ) i=1;
167 return m_ObjOrgInBes[i-1];
168}
169
171{
172 if( i<1 || i>3 ) i=1;
173 return m_ObjOrgInLoc[i-1];
174}
175
180
181
182// Set methods
201
203void MucEntity::SetRin() { m_Rin = 0.; }
205void MucEntity::SetRc() { m_Rc = 0.; }
207void MucEntity::SetW() { m_W = 0.; }
208void MucEntity::SetWu() { m_Wu = 0.; }
209void MucEntity::SetWd() { m_Wd = 0.; }
210void MucEntity::SetH() { m_H = 0.; }
211void MucEntity::SetL() { m_L = 0.; }
213
214void MucEntity::SetLocOrgInBes() { for( int i=0; i<3; i++) m_LocOrgInBes[i] = 0.; }
215void MucEntity::SetObjRotToMot() { for( int i=0; i<3; i++) m_ObjRotToMot[i] = 0.; }
216void MucEntity::SetObjOrgInBes() { for( int i=0; i<3; i++) m_ObjOrgInBes[i] = 0.; }
217void MucEntity::SetObjOrgInLoc() { for( int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.; }
218
219void MucEntity::SetAlignment( double dx, double dy, double dz ) { ; }
220
221// Coordinate transform function, from global(BES) to local
222// Z coordinate is parellel, phi is the inclination angle of the BES coordinate x direction and the Loc one
223void MucEntity::TransBesToLoc( double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z )
224{
225 LocCoord[0] = (BesCoord[0] - LocOrgInBes[0])*cos(Rot_z) + (BesCoord[1] - LocOrgInBes[1])*sin(Rot_z);
226 LocCoord[1] = -(BesCoord[0] - LocOrgInBes[0])*sin(Rot_z) + (BesCoord[1] - LocOrgInBes[1])*cos(Rot_z);
227 LocCoord[2] = BesCoord[2] - LocOrgInBes[2];
228}
229
230// Coordinate transform function, from local to global(BES)
231// Z coordinate is parellel, phi is the inclination angle of the BES coordinate x direction and the Loc one
232void MucEntity::TransLocToBes( double BesCoord[], double LocCoord[], double LocOrgInBes[], double Rot_z )
233{
234 BesCoord[0] = LocCoord[0]*cos(Rot_z) - LocCoord[1]*sin(Rot_z) + LocOrgInBes[0];
235 BesCoord[1] = LocCoord[0]*sin(Rot_z) + LocCoord[1]*cos(Rot_z) + LocOrgInBes[1];
236 BesCoord[2] = LocCoord[2] + LocOrgInBes[2];
237}
238
239
240// END
241
242
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
double GetWu()
virtual void SetArea()
double GetW()
virtual void SetObjOrgInBes()
virtual void SetObjRotToMot()
int m_RpcId
Definition MucEntity.h:92
double GetThin()
MucEntity(int part, int segment, int layer)
Definition MucEntity.cxx:17
double m_W
Definition MucEntity.h:102
virtual void SetWd()
double m_Area
Definition MucEntity.h:107
MucEntity & operator=(const MucEntity &other)
Definition MucEntity.cxx:92
virtual ~MucEntity()
double m_Thin
Definition MucEntity.h:101
double m_Rin
Definition MucEntity.h:98
virtual void SetW()
virtual void SetL()
double GetWd()
double m_H
Definition MucEntity.h:103
double GetH()
virtual void SetLocOrgInBes()
virtual void SetAlignment(double dx, double dy, double dz)
int m_Layer
Definition MucEntity.h:90
double GetArea()
int GetID()
virtual void SetH()
double m_ObjOrgInLoc[3]
Definition MucEntity.h:119
double * GetLocOrgInBes()
double m_Rout
Definition MucEntity.h:99
virtual void SetThin()
double * GetObjRotToMot()
double m_ObjRotToMot[3]
Definition MucEntity.h:111
virtual void SetObjOrgInLoc()
double m_Wd
Definition MucEntity.h:106
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:89
double m_Theta
Definition MucEntity.h:95
virtual void SetRout()
int GetUpDown()
int m_Part
Definition MucEntity.h:88
double m_LocOrgInBes[3]
Definition MucEntity.h:109
double m_Rc
Definition MucEntity.h:100
virtual void SetRin()
virtual void SetTheta()
int GetRpcId()
double * GetObjOrgInBes()
double m_ObjOrgInBes[3]
Definition MucEntity.h:118
double GetRin()
int GetLayer()
int m_UpDown
Definition MucEntity.h:91
void TransLocToBes(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
double GetL()
double * GetObjOrgInLoc()
double GetRout()
double m_Wu
Definition MucEntity.h:105
virtual void SetWu()
int GetPart()
virtual void Init()
double m_L
Definition MucEntity.h:104