CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
MucAbsorber.cxx
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucAbsorber.cxx |
3// [Brief ]: MUC geometry yoke creating class |
4// [Author]: Xie Yuguang, <[email protected]> |
5// [Date ]: May 22, 2005 |
6//------------------------------------------------------------------------------|
7
8#include <iostream>
9#include <cmath>
10
13
14using namespace std;
15
16// Constructor
17MucAbsorber::MucAbsorber( int part, int segment, int layer, int id ) : MucEntity( part, segment, layer, id )
18{
20}
21
22// Copy constructor
23MucAbsorber::MucAbsorber( const MucAbsorber &other ) : MucEntity( other ) { ; }
24
25// Operator =
27{
28 if( this == &other)
29 return *this;
30
32
33 return *this;
34}
35
36// Destructor
38
39// Initialize
41{
42 SetTheta();
43 SetRin();
44 SetRout();
45 SetRc();
46
47 SetThin();
48 SetW();
49 SetWu();
50 SetWd();
51 SetH();
52 SetL();
57}
58
59
60// -------------------------- Set motheds -------------------
62{
63 if( m_Part == BRID )
64 m_Theta = m_Segment * ( MUC_PI/4.0 );
65 else
66 {
67 if( m_ID == -1 )
68 m_Theta = ( 2*m_Segment + 1 ) * ( MUC_PI/4.0 );
69 else
70 m_Theta = ( MUC_PI/4.0 ) + ( m_ID - 1) * MUC_PI / 8.0 ;
71 }
72}
73
75{
76 if( m_Part == BRID )
77 m_Rin = B_AS_RMIN[m_Layer];
78 else
79 {
80 if( m_ID == -1 )
81 m_Rin = 0.0;
82 else
83 m_Rin = E_AS_RMIN[m_Layer];
84 }
85}
86
88{
89 if( m_Part == BRID )
90 m_Rout = B_AS_RMIN[m_Layer] + B_AS_TH[m_Layer] ;
91 else
92 m_Rout = E_AS_RMAX;
93}
94
95
97{
98 if( m_Part == BRID )
99 m_Rc = B_AS_RMIN[m_Layer] + B_AS_TH[m_Layer]/2.0;
100 else
101 {
102 if( m_ID == -1 )
103 m_Rc = sqrt(2.0) * E_AS_RMAX / 2.0;
104 else
105 m_Rc = (m_Rin + m_Rout)/2.0;
106 }
107}
108
110{
111 if( m_Part == BRID )
112 m_Thin = B_AS_TH[m_Layer];
113 else
114 m_Thin = E_AS_TH[m_Layer];
115}
116
118{
119 if( m_Part == BRID)
120 m_W = 2.0 * VALUE * m_Rout;
121 else
122 {
123 if( m_ID == -1 ) // temporary local
124 m_W = E_AS_RMAX;
125 else
126 m_W = 0;
127 }
128}
129
131{
132 if( m_Part == BRID )
133 m_H = B_AS_TH[m_Layer];
134 else
135 {
136 if( m_ID == -1 ) // temporary local
137 m_H = E_AS_RMAX;
138 else
139 m_H = E_AS_RMAX - E_AS_RMIN[m_Layer];
140 }
141}
142
144{
145 if( m_Part == BRID )
146 m_L = B_AS_LMAX;
147 else
148 m_L = E_AS_TH[m_Layer];
149}
150
152{
153 if( m_Part == BRID )
154 m_Wu = 2 * VALUE * m_Rin;
155 else
156 {
157 if( m_ID == -1 ) // temporary local
158 m_Wu = m_W;
159 else if( m_ID == 1 ) // center panel
160 m_Wu = 2 * VALUE * m_Rin;
161 else
162 m_Wu = VALUE * m_Rin;
163 }
164
165 m_Wu -= 0.8; //mm, avoid overlaping
166}
167
169{
170 if( m_Part == BRID )
171 m_Wd = 2.0 * VALUE * m_Rout;
172 else
173 {
174 if( m_ID == -1 ) // temporary local
175 m_Wd = m_W;
176 if( m_ID == 1 ) // center panel
177 m_Wd = 2.0 * VALUE * E_AS_RMAX;
178 else
179 m_Wd = VALUE * E_AS_RMAX;
180 }
181
182 m_Wd -= 0.8; //mm, avoid overlaping
183}
184
185
187{
188 double x, y, z;
189 x = y = z = 0.0;
190
191 //---------- set x and y --------
192 if( m_Part == BRID || m_ID == -1 ) // the local(mother) in BES
193 {
194 x = m_Rc * cos( m_Theta );
195 y = m_Rc * sin( m_Theta );
196 } // barrel
197 else // for endcap panel, calculate the origin of temporary local in BES
198 {
199 // set x and y
200 double tempR, tempTheta;
201 tempR = sqrt(2.0) * E_AS_RMAX / 2.0;
202 tempTheta = ( 2*m_Segment + 1 ) * ( MUC_PI / 4.0 );
203
204 x = tempR * cos( tempTheta );
205 y = tempR * sin( tempTheta );
206
207 }// endcap
208
209 //---------- set z -----------
210 if( m_Part == BRID ) z = 0.;
211 else
212 {
213 for( int i=0; i<m_Layer+1; i++ ) z += E_AS_TH[i];
214
215 z += m_Layer * AS_GAP;
216 z += (E_AS_ZMAX - E_AS_TOTAL_TH ) - m_Thin/2.0;
217 z *= cos( m_Part*MUC_PI/2.0 );
218 }
219
220 m_LocOrgInBes[0] = x;
221 m_LocOrgInBes[1] = y;
222 m_LocOrgInBes[2] = z;
223
224 // limit cut
225 for(int i=0; i<3; i++) {
226 if( fabs(m_LocOrgInBes[i]) < ERR_LIMIT ) m_LocOrgInBes[i] = 0;
227 }
228}
229
231{
232 m_ObjRotToMot[0] = 0.;
233 m_ObjRotToMot[1] = 0.;
234
235 if( m_Part == BRID )
236 m_ObjRotToMot[2] = MUC_PI * (m_Segment - 2) / 4.0;
237 else
238 m_ObjRotToMot[2] = 0.;
239}
240
242{
243 double x, y;
244
245 if( m_Part == BRID || m_ID == -1 ) // object is concided with local
246 {
250
251 } // local
252 else
253 {
254 //-------- set x and y ------------
255 // endcap panels
256 // setting segment 0 as reference
257 if( m_ID == 0 )
258 {
259 x = m_Rc;
260 y = m_Rc * tan( m_Theta ) / 2.0;
261 }
262 else if ( m_ID ==1 )
263 {
264 x = m_Rc * cos( m_Theta );
265 y = m_Rc * sin( m_Theta );
266 }
267 else // m_ID == 2
268 {
269 x = m_Rc / tan( m_Theta ) / 2.0;
270 y = m_Rc;
271 }
272
273 // x, y signs of coordinate different by segment
274 if( m_Segment == 0 ) { ; }
275 else if ( m_Segment == 1 ) { x = -x; }
276 else if ( m_Segment == 2 ) { x = -x; y = -y; }
277 else { y = -y; }
278
279 m_ObjOrgInBes[0] = x;
280 m_ObjOrgInBes[1] = y;
281
282 // limit cut
283 for( int i=0; i<2; i++ ) {
284 if( fabs(m_ObjOrgInBes[i]) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0;
285 }
286
287 //---------- set z--------------
289
290 } // else, endcap panels
291}
292
294{
295 if( m_Part == BRID || m_ID == -1 ) // for barrel and endcap local
296 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.;
297 else // for endcap panels
298 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
299}
300
301
302// END
double tan(const BesAngle a)
Definition: BesAngle.h:216
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
Double_t x[10]
virtual void SetThin()
MucAbsorber & operator=(const MucAbsorber &other)
Definition: MucAbsorber.cxx:26
virtual void SetObjOrgInBes()
virtual void SetLocOrgInBes()
virtual void SetTheta()
Definition: MucAbsorber.cxx:61
virtual ~MucAbsorber()
Definition: MucAbsorber.cxx:37
virtual void SetWd()
virtual void SetW()
virtual void SetH()
virtual void Init()
Definition: MucAbsorber.cxx:40
MucAbsorber(int part, int segment, int layer, int id)
Definition: MucAbsorber.cxx:17
virtual void SetObjRotToMot()
virtual void SetWu()
virtual void SetRin()
Definition: MucAbsorber.cxx:74
virtual void SetL()
virtual void SetObjOrgInLoc()
virtual void SetRout()
Definition: MucAbsorber.cxx:87
virtual void SetRc()
Definition: MucAbsorber.cxx:96
double m_W
Definition: MucEntity.h:102
MucEntity & operator=(const MucEntity &other)
Definition: MucEntity.cxx:92
double m_Thin
Definition: MucEntity.h:101
double m_Rin
Definition: MucEntity.h:98
double m_H
Definition: MucEntity.h:103
int m_Layer
Definition: MucEntity.h:90
double m_ObjOrgInLoc[3]
Definition: MucEntity.h:119
double m_Rout
Definition: MucEntity.h:99
double m_ObjRotToMot[3]
Definition: MucEntity.h:111
double m_Wd
Definition: MucEntity.h:106
int m_Segment
Definition: MucEntity.h:89
double m_Theta
Definition: MucEntity.h:95
int m_Part
Definition: MucEntity.h:88
double m_LocOrgInBes[3]
Definition: MucEntity.h:109
double m_Rc
Definition: MucEntity.h:100
double m_ObjOrgInBes[3]
Definition: MucEntity.h:118
int m_ID
Definition: MucEntity.h:93
double m_Wu
Definition: MucEntity.h:105
double m_L
Definition: MucEntity.h:104