BOSS 7.0.3
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
12#include "MucGeoCreateAlg/MucEntity.h"
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
184{
200}
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)
double cos(const BesAngle a)
double GetWu()
Definition: MucEntity.cxx:148
virtual void SetArea()
Definition: MucEntity.cxx:212
double GetW()
Definition: MucEntity.cxx:145
virtual void SetObjOrgInBes()
Definition: MucEntity.cxx:216
virtual void SetObjRotToMot()
Definition: MucEntity.cxx:215
double GetThin()
Definition: MucEntity.cxx:144
MucEntity(int part, int segment, int layer)
Definition: MucEntity.cxx:17
virtual void SetWd()
Definition: MucEntity.cxx:209
MucEntity & operator=(const MucEntity &other)
Definition: MucEntity.cxx:92
virtual ~MucEntity()
Definition: MucEntity.cxx:125
virtual void SetW()
Definition: MucEntity.cxx:207
virtual void SetL()
Definition: MucEntity.cxx:211
double GetWd()
Definition: MucEntity.cxx:149
double GetH()
Definition: MucEntity.cxx:146
virtual void SetLocOrgInBes()
Definition: MucEntity.cxx:214
virtual void SetAlignment(double dx, double dy, double dz)
Definition: MucEntity.cxx:219
double GetArea()
Definition: MucEntity.cxx:150
int GetID()
Definition: MucEntity.cxx:139
virtual void SetH()
Definition: MucEntity.cxx:210
double * GetLocOrgInBes()
Definition: MucEntity.cxx:176
virtual void SetThin()
Definition: MucEntity.cxx:206
double * GetObjRotToMot()
Definition: MucEntity.cxx:177
virtual void SetObjOrgInLoc()
Definition: MucEntity.cxx:217
double GetRc()
Definition: MucEntity.cxx:143
virtual void SetRc()
Definition: MucEntity.cxx:205
double GetTheta()
Definition: MucEntity.cxx:140
void TransBesToLoc(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
Definition: MucEntity.cxx:223
int GetSegment()
Definition: MucEntity.cxx:135
virtual void SetRout()
Definition: MucEntity.cxx:204
int GetUpDown()
Definition: MucEntity.cxx:137
virtual void SetRin()
Definition: MucEntity.cxx:203
virtual void SetTheta()
Definition: MucEntity.cxx:202
int GetRpcId()
Definition: MucEntity.cxx:138
double * GetObjOrgInBes()
Definition: MucEntity.cxx:178
double GetRin()
Definition: MucEntity.cxx:141
int GetLayer()
Definition: MucEntity.cxx:136
void TransLocToBes(double LocCoord[], double BesCoord[], double LocOrgInBes[], double Rot_z)
Definition: MucEntity.cxx:232
double GetL()
Definition: MucEntity.cxx:147
double * GetObjOrgInLoc()
Definition: MucEntity.cxx:179
double GetRout()
Definition: MucEntity.cxx:142
virtual void SetWu()
Definition: MucEntity.cxx:208
int GetPart()
Definition: MucEntity.cxx:134
virtual void Init()
Definition: MucEntity.cxx:183