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