BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGap.cxx
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucGap.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
17MucGap::MucGap( int part, int segment, int layer, int id ) : MucEntity( part, segment, layer, id )
18{
20 m_MucBox = NULL;
21}
22
23// Copy constructor
24MucGap::MucGap( const MucGap &other ) : MucEntity( other )
25{
26 m_MucBox = other.m_MucBox;
27}
28
29// Operator =
31{
32 if( this == &other) return *this;
34 m_MucBox = other.m_MucBox;
35
36 return *this;
37}
38
39// Destructor
41{
42 delete m_MucBox;
43}
44
45// Initialize
47{
48 SetTheta();
49 SetRin();
50 SetRout();
51 SetRc();
52
53 SetThin();
54 SetW();
55 SetWu();
56 SetWd();
57 SetH();
58 SetL();
59
64}
65
66// ------------------- Get methods --------------------
67
69{
70 if( m_MucBox != NULL )
71 return m_MucBox;
72 else
73 return ( m_MucBox = new MucBox(m_Part, m_Segment, m_Layer, ((m_Part==BRID)?0:-1) ) );
74}
75
76
77// --------------------- Set motheds ----------------------
79{
80 if( m_Part == BRID ) m_Theta = m_Segment * ( MUC_PI/4.0 );
81 else {
82 if( m_ID == -1 ) m_Theta = ( 2*m_Segment + 1 ) * ( MUC_PI/4.0 );
83 else m_Theta = ( MUC_PI/4.0 ) + ( m_ID - 1) * MUC_PI / 8.0 ;
84 }
85}
86
88{
89 if( m_Part == BRID ) m_Rin = B_AS_RMIN[m_Layer] - AS_GAP;
90 else {
91 if( m_ID == -1 ) m_Rin = 0.;
92 else m_Rin = E_GP_RMIN[m_Layer];
93 }
94}
95
97{
98 if( m_Part == BRID ) m_Rout = B_AS_RMIN[m_Layer];
99 else m_Rout = E_AS_RMAX;
100}
101
103{
104 if( m_Part == BRID ) m_Rc = B_AS_RMIN[m_Layer] - AS_GAP/2.0;
105 else {
106 if( m_ID == -1 ) m_Rc = sqrt(2.0) * E_AS_RMAX / 2.0;
107 else m_Rc = (m_Rin + m_Rout)/2.0;
108 }
109}
110
112{
113 m_Thin = AS_GAP;
114}
115
117{
118 if( m_Part == BRID)
119 {
120 if( m_Segment != B_TOP )
121 m_W = B_GP_WT[m_Layer];
122 else { // top segment
123 if( m_ID == -1 || m_ID == 2 ) m_W = B_GP_WT[m_Layer];
124 else m_W = ( B_GP_WT[m_Layer] - B_GP_SLOT_WT )/2.0;
125 }
126 }
127 else
128 {
129 if( m_ID == -1 ) // virtual encap gap
130 m_W = E_AS_RMAX - E_GP_DX;
131 else
132 m_W = 0.;
133 }
134}
135
137{
138 if( m_Part == BRID )
139 m_H = AS_GAP-0.2; // avoid overlap between absorber and gap
140 else
141 {
142 if( m_ID == -1 ) // virtual encap gap
143 m_H = E_AS_RMAX - E_GP_DY;
144 else if( m_ID == 1 )
145 { // for panel logical operation "AND" valid;
146 m_H = E_AS_RMAX - E_GP_RMIN[m_Layer] +1.5*OVERLAP_WIDTH;
147 }
148 else
149 m_H = E_AS_RMAX - E_GP_RMIN[m_Layer];
150 }
151}
152
154{
155 if( m_Part == BRID )
156 {
157 if( m_Segment != B_TOP || m_ID == -1 )
158 m_L = B_AS_LMAX;
159 else { // top segment
160 if( m_ID == 2 ) m_L = B_AS_LMAX - B_GP_SLOT_LT;
161 else m_L = B_GP_SLOT_LT;
162 }
163 }
164 else
165 m_L = AS_GAP;
166}
167
169{
170 if( m_Part == BRID )
171 m_Wu = m_W;
172 else
173 {
174 if( m_ID == -1 ) // temporary local
175 m_Wu = m_W;
176 else if( m_ID == 1 ) // center fraction
177 {
178 m_Wu = 2 * VALUE * m_Rin ;
179 m_Wu -= 2*VALUE*(2.0/2); // for panel operation "AND" valid
180 m_Wu += 1.5*OVERLAP_WIDTH;
181 }
182 else if( m_ID == 0 )
183 m_Wu = VALUE * m_Rin - E_GP_DY;
184 else
185 m_Wu = VALUE * m_Rin - E_GP_DX;
186
187 if( m_ID != -1 ) m_Wu+=OVERLAP_WIDTH; // avoid panels overlap
188 }
189}
190
192{
193 if( m_Part == BRID ) m_Wd = m_W;
194 else
195 {
196 if( m_ID == -1 ) // temporary local
197 m_Wd = m_W;
198 else if( m_ID == 1 ) // center fraction
199 {
200 m_Wd = 2 * VALUE * m_Rout;
201 m_Wd += 2*VALUE*(2.0/2); // for panel operation "AND" valid
202 m_Wd += 1.5*OVERLAP_WIDTH;
203 }
204 else if( m_ID == 0 )
205 m_Wd = VALUE * m_Rout - E_GP_DY;
206 else
207 m_Wd = VALUE * m_Rout - E_GP_DX;
208
209 if( m_ID != -1 ) m_Wd+=OVERLAP_WIDTH; // avoid panels overlap
210 }
211}
212
214{
215 double x, y, z;
216 x = y = z = 0.;
217
218 if( m_Part == BRID )
219 {
220 x = m_Rc*cos( m_Theta );
221 y = m_Rc*sin( m_Theta );
222 z = 0.;
223 } // barrel
224 else
225 {
226 //---------- set x and y ------------
227 // segment 0 as reference
228 x = (E_AS_RMAX + E_GP_DX) / 2.0;
229 y = (E_AS_RMAX + E_GP_DY) / 2.0;
230
231 // x, y signs of coordinate different by segment
232 if( m_Segment == 0 ) { ; }
233 else if ( m_Segment == 1 ) { x = -x; }
234 else if ( m_Segment == 2 ) { x = -x; y = -y; }
235 else { y = -y; }
236
237 //----------- set z ----------------
238 for( int i=0; i<m_Layer+1; i++ ) z += E_AS_TH[i];
239
240 z += m_Layer * AS_GAP;
241 z += (E_AS_ZMAX - E_AS_TOTAL_TH ) + AS_GAP/2.0;
242 z *= cos( m_Part*MUC_PI/2.0 );
243 }// endcap
244
245 m_LocOrgInBes[0] = x;
246 m_LocOrgInBes[1] = y;
247 m_LocOrgInBes[2] = z;
248
249 // limit cut
250 for(int i=0;i<3;i++)
251 if( fabs(m_LocOrgInBes[i]) < ERR_LIMIT ) m_LocOrgInBes[i] = 0;
252}
253
255{
256 m_ObjRotToMot[0] = 0.;
257 m_ObjRotToMot[1] = 0.;
258
259 if( m_Part == BRID )
260 m_ObjRotToMot[2] = MUC_PI * (m_Segment - 2) / 4.0;
261 else
262 m_ObjRotToMot[2] = 0.;
263}
264
266{
267 double x, y, z;
268 x = y = z = 0.;
269
270 if( m_Part == BRID )
271 {
272 if( m_Segment != B_TOP || m_ID == -1 )
273 for( int i=0; i<3; i++ ) m_ObjOrgInBes[i] = m_LocOrgInBes[i];
274 else // top segment
275 {
276 // set x
277 if( m_ID == 2 ) x = 0.;
278 else x = (1-2*m_ID) * ( B_GP_WT[m_Layer] + B_GP_SLOT_WT )/4.0;
279
280 // set z
281 if( m_ID == 2 ) z = -B_GP_SLOT_LT / 2.0;
282 else z = ( B_AS_LMAX - B_GP_SLOT_LT )/2.0;
283
284 m_ObjOrgInBes[0] = x;
285 m_ObjOrgInBes[2] = z;
286
287 // set y
289
290 // limit cut
291 for( int i=0; i<3; i++ )
292 if( fabs(m_ObjOrgInBes[i]) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0;
293 }
294 } // End barrel
295 else
296 {
297 // -------------- set x and y --------------------
298 // setting segment 0 as reference
299 if( m_ID == 0 ) {
300 x = m_Rc;
301 y = ( m_Rc * tan( m_Theta ) + E_GP_DY ) / 2.0;
302 }
303 else if ( m_ID ==1 ) {
304 x = m_Rc * cos( m_Theta );
305 y = m_Rc * sin( m_Theta );
306 }
307 else { // m_ID == 2
308 x = ( m_Rc / tan( m_Theta ) + E_GP_DX ) / 2.0;
309 y = m_Rc;
310 }
311
312 // x, y signs of coordinate different by segment
313 if ( m_Segment == 0 ) { ; }
314 else if ( m_Segment == 1 ) { x = -x; }
315 else if ( m_Segment == 2 ) { x = -x; y = -y; }
316 else { y = -y; }
317
318 m_ObjOrgInBes[0] = x;
319 m_ObjOrgInBes[1] = y;
320
321 // limit cut
322 for( int i=0; i<2; i++ )
323 if( fabs(m_ObjOrgInBes[i]) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0;
324
325 // ------------- set z ------------------------
327 } // else
328}
329
331{
332 if( m_Part == BRID)
333 {
334 if( m_Segment != B_TOP )
335 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.;
336 else
337 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
338 }
339 else
340 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
341}
342
343// 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]
#define NULL
double m_W
Definition MucEntity.h:101
MucEntity & operator=(const MucEntity &other)
Definition MucEntity.cxx:92
double m_Thin
Definition MucEntity.h:100
double m_Rin
Definition MucEntity.h:97
double m_H
Definition MucEntity.h:102
int m_Layer
Definition MucEntity.h:89
double m_ObjOrgInLoc[3]
Definition MucEntity.h:118
double m_Rout
Definition MucEntity.h:98
double m_ObjRotToMot[3]
Definition MucEntity.h:110
double m_Wd
Definition MucEntity.h:105
int m_Segment
Definition MucEntity.h:88
double m_Theta
Definition MucEntity.h:94
int m_Part
Definition MucEntity.h:87
double m_LocOrgInBes[3]
Definition MucEntity.h:108
double m_Rc
Definition MucEntity.h:99
double m_ObjOrgInBes[3]
Definition MucEntity.h:117
double m_Wu
Definition MucEntity.h:104
double m_L
Definition MucEntity.h:103
virtual void SetRin()
Definition MucGap.cxx:87
virtual void SetTheta()
Definition MucGap.cxx:78
virtual void SetWd()
Definition MucGap.cxx:191
virtual void SetW()
Definition MucGap.cxx:116
virtual void SetRc()
Definition MucGap.cxx:102
MucGap & operator=(const MucGap &other)
Definition MucGap.cxx:30
virtual void SetObjOrgInBes()
Definition MucGap.cxx:265
~MucGap()
Definition MucGap.cxx:40
virtual void SetH()
Definition MucGap.cxx:136
virtual void SetLocOrgInBes()
Definition MucGap.cxx:213
virtual void Init()
Definition MucGap.cxx:46
virtual void SetRout()
Definition MucGap.cxx:96
MucGap(int part, int segment, int layer, int id)
Definition MucGap.cxx:17
virtual void SetL()
Definition MucGap.cxx:153
virtual void SetWu()
Definition MucGap.cxx:168
virtual void SetObjRotToMot()
Definition MucGap.cxx:254
MucBox * GetBox()
Definition MucGap.cxx:68
virtual void SetThin()
Definition MucGap.cxx:111
virtual void SetObjOrgInLoc()
Definition MucGap.cxx:330
double y[1000]