BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
MucStripPlane.cxx
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucStripPlane.cxx |
3// [Brief ]: MUC geometry strip plane creating class |
4// [Author]: Xie Yuguang, <[email protected]> |
5// [Date ]: May 22, 2005 |
6//------------------------------------------------------------------------------|
7
8#include <iostream>
9#include <cmath>
10
11#include "MucGeoCreateAlg/MucGeoConst.h"
12#include "MucGeoCreateAlg/MucStripPlane.h"
13
14using namespace std;
15
16// Constructor
17MucStripPlane::MucStripPlane( int part, int segment, int layer, int id ) : MucEntity( part, segment, layer, id )
18{
20 m_MucStrip = NULL;
21}
22
23// Copy constructor
25{
26 m_MucStrip = other.m_MucStrip;
27}
28
29// Operator =
31{
32 if( this == &other)
33 return *this;
34
36
37 m_MucStrip = other.m_MucStrip;
38
39 return *this;
40}
41
42// Destructor
44{
45 delete m_MucStrip;
46}
47
48// Initialize
50{
51 SetTheta();
52 SetRin();
53 SetRout();
54 SetRc();
55
56 SetThin();
57 SetW();
58 SetWu();
59 SetWd();
60 SetH();
61 SetL();
62
66}
67
68// -------------------------- Get methods ----------------------------
69
71{
72 if( m_MucStrip != NULL ) delete m_MucStrip;
73
74 return ( m_MucStrip = new MucStrip( m_Part, m_Segment, m_Layer, id ) );
75}
76
77// ---------------------------Set motheds -----------------------------
79{
80 if( m_Part == BRID )
81 m_Theta = m_Segment * ( MUC_PI/4.0 );
82 else
83 {
84 if( m_ID == -1 )
85 m_Theta = ( 2*m_Segment + 1 ) * ( MUC_PI/4.0 );
86 else
87 m_Theta = ( MUC_PI/4.0 ) + ( m_ID - 1) * MUC_PI / 8.0 ;
88 }
89}
90
92{
93 if( m_Part == BRID )
94 m_Rin = B_AS_RMIN[m_Layer] - ( AS_GAP + STR_TH ) / 2.0;
95 else
96 {
97 if( m_ID == -1 )
98 m_Rin = 0.;
99 else
100 m_Rin = E_GP_RMIN[m_Layer] + E_STRPLN_DR;
101 }
102}
103
105{
106 if( m_Part == BRID )
107 m_Rout = B_AS_RMIN[m_Layer] - ( AS_GAP - STR_TH ) / 2.0;
108 else
109 m_Rout = E_AS_RMAX - E_BOX_DR - E_STRPLN_DB[(m_Layer==0)?0:1];
110}
111
113{
114 if( m_Part == BRID )
115 m_Rc = B_AS_RMIN[m_Layer] - AS_GAP/2.0;
116 else
117 {
118 if( m_ID == -1 )
119 m_Rc = sqrt(2.0) * ( E_AS_RMAX - E_BOX_DR - E_STRPLN_DB[(m_Layer==0)?0:1] ) / 2.0;
120 else
121 m_Rc = (m_Rin + m_Rout)/2.0;
122 }
123}
124
126{
127 m_Thin = STR_TH;
128}
129
131{
132 double offset = 0;
133 if( (m_Layer+1)%2 == 0 ) offset = 2*B_BOX_DZ[1]; // even layers
134 else offset = 2*B_BOX_DT[1]; // odd layers
135
136 if( m_Part == BRID)
137 {
138 if( m_Segment == B_TOP )
139 {
140 if(m_ID == -1 || m_ID == 2)
141 m_W = B_BOX_WT[m_Layer] - offset;
142 else
143 m_W = (B_BOX_WT[m_Layer] - offset - B_PHISTR_CUT)/2.0;
144 }
145 else
146 m_W = B_BOX_WT[m_Layer] - offset;
147 }
148 else
149 {
150 if( m_ID == -1 ) // temparory strip plane
151 m_W = E_AS_RMAX - E_BOX_DR - E_GP_DX - (E_STRPLN_DA + E_STRPLN_DB[(m_Layer==0)?0:1]);
152 else
153 m_W = 0.;
154 }
155}
156
158{
159 if( m_Part == BRID )
160 m_H = STR_TH;
161 else
162 {
163 if( m_ID == -1 ) // temparory strip plane
164 m_H = E_AS_RMAX - E_BOX_DR - E_GP_DY - (E_STRPLN_DA + E_STRPLN_DB[(m_Layer==0)?0:1]);
165 else
166 {
167 m_H = E_AS_RMAX - E_BOX_DR - E_GP_RMIN[m_Layer] - E_STRPLN_DR - E_STRPLN_DB[(m_Layer==0)?0:1];
168 if(m_ID==1) m_H += (E_STR_DST+5.0)/sqrt(2.0);
169
170 m_H += 4*OVERLAP_WIDTH;
171 }
172 }
173}
174
176{
177 if( m_Part == BRID )
178 {
179 if( m_Segment == B_TOP )
180 {
181 // 0,1,2,3,7: CUT = 1; 2,4,6,8: CUT = 0;
182 if( m_ID == -1) m_L = B_BOX_LT - 2*B_BOX_DZ[SL_DOWN];
183 else if( m_ID == 2 ) m_L = B_BOX_LT - 2*B_BOX_DZ[SL_DOWN] - B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)];
184 else m_L = B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)];
185 }
186 else
187 m_L = B_BOX_LT - 2*B_BOX_DZ[SL_DOWN];
188 }
189 else
190 m_L = STR_TH;
191}
192
194{
195 if( m_Part == BRID )
196 m_Wu = m_W;
197 else
198 {
199 if( m_ID == -1 ) // temparory strip plane
200 m_Wu = m_W;
201 else if( m_ID == 1 ) // center panel
202 {
203 m_Wu = 2 * VALUE * m_Rin ;
204 m_Wu -= VALUE*(E_STR_DST+5.0)/sqrt(2.0);
205 }
206 else if( m_ID == 0 )
207 m_Wu = VALUE * m_Rin - E_GP_DY - E_STRPLN_DA;
208 else
209 m_Wu = VALUE * m_Rin - E_GP_DX - E_STRPLN_DA;
210
211 //m_Wu += (1-VALUE)*OVERLAP_WIDTH;
212 //m_Wu += 2*OVERLAP_WIDTH;
213 }
214}
215
217{
218 if( m_Part == BRID )
219 m_Wd = m_W;
220 else
221 {
222 if( m_ID == -1 ) // temparory strip plane
223 m_Wd = m_W;
224 else if( m_ID == 1 ) // center panel
225 {
226 m_Wd = 2 * VALUE * m_Rout;
227 // zoom in with a small dimension for covering strips
228 m_Wd += VALUE*(E_STR_DST+5.0)/sqrt(2.0);
229 }
230 else if( m_ID == 0 )
231 m_Wd = VALUE * m_Rout - E_GP_DY - E_STRPLN_DA;
232 else
233 m_Wd = VALUE * m_Rout - E_GP_DX - E_STRPLN_DA;
234
235 // for "AND" operation of panels
236 //m_Wd += (VALUE + 1.0)*OVERLAP_WIDTH;
237 m_Wd += 4*OVERLAP_WIDTH;
238 }
239}
240
241
242
243
245{
246 double x, y, z=0;
247
248 if( m_Part == BRID )
249 {
250 x = m_Rc*cos( m_Theta );
251 y = m_Rc*sin( m_Theta );
252 z = 0.;
253 } // barrel
254 else
255 {
256 //-------------- set x and y ----------------------
257 // segment 0 as reference
258 if( m_ID == -1 )
259 {
260 x = (E_AS_RMAX - E_BOX_DR + E_GP_DX) / 2.0;
261 y = (E_AS_RMAX - E_BOX_DR + E_GP_DY) / 2.0;
262 }
263 else
264 {
265 x = (E_AS_RMAX+E_GP_DX+E_STRPLN_DA -E_BOX_DR-E_STRPLN_DB[(m_Layer==0)?0:1])/2.0;
266 y = (E_AS_RMAX+E_GP_DY+E_STRPLN_DA -E_BOX_DR-E_STRPLN_DB[(m_Layer==0)?0:1])/2.0;
267 }
268
269 // x, y signs of coordinate different by segment
270 if( m_Segment == 0 ) { ; }
271 else if ( m_Segment == 1 ) { x = -x; }
272 else if ( m_Segment == 2 ) { x = -x; y = -y; }
273 else { y = -y; }
274
275 //-------------- set z -----------------------------
276 for( int i=0; i<m_Layer+1; i++ ) z += E_AS_TH[i];
277
278 z += m_Layer * AS_GAP;
279 z += (E_AS_ZMAX - E_AS_TOTAL_TH + z) + AS_GAP/2.0;
280 z *= cos( m_Part*MUC_PI/2.0 );
281
282 }// endcap
283
284 m_LocOrgInBes[0] = x;
285 m_LocOrgInBes[1] = y;
286 m_LocOrgInBes[2] = z;
287
288 // limit cut
289 for(int i=0;i<3;i++) {
290 if( fabs(m_LocOrgInBes[i]) < ERR_LIMIT ) m_LocOrgInBes[i] = 0.;
291 }
292}
293
295{
296 if( m_Part == BRID )
297 {
298 for( int i=0; i<3; i++ )
300 }
301 else // endcap
302 {
303 //------------- set x and y --------------------
304 // segment 0 as reference
305 double x, y;
306 if( m_ID == -1 )
307 {
308 x = E_GP_DX + E_STRPLN_DA + m_W/2.0;
309 y = E_GP_DY + E_STRPLN_DA + m_H/2.0;
310 }
311 else if( m_ID == 0 )
312 {
313 x = m_Rc;
314 y = ( m_Rc * tan( m_Theta ) + E_GP_DY + E_STRPLN_DA ) / 2.0;
315 }
316 else if ( m_ID ==1 )
317 {
318 x = m_Rc * cos( m_Theta );
319 y = m_Rc * sin( m_Theta );
320 }
321 else // m_ID == 2
322 {
323 x = ( m_Rc / tan( m_Theta ) + E_GP_DX + E_STRPLN_DA ) / 2.0;
324 y = m_Rc;
325 }
326
327 // x, y signs of coordinate different by segment
328 if( m_Segment == 0 ) { ; }
329 else if ( m_Segment == 1 ) { x = -x; }
330 else if ( m_Segment == 2 ) { x = -x; y = -y; }
331 else { y = -y; }
332
333 m_ObjOrgInBes[0] = x;
334 m_ObjOrgInBes[1] = y;
335
336 // limit cut
337 for( int i=0; i<2; i++ ) {
338 if( fabs(m_ObjOrgInBes[i]) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0.;
339 }
340
341 // ---------------- set z ----------------------
343
344 } // else, endcap
345}
346
348{
349 double x, y, z;
350 if( m_Part == BRID )
351 {
352 if( m_Segment == B_TOP && m_ID !=-1 )
353 {
354 // x
355 if(m_ID == 2) x = 0.0;
356 else if(m_ID == 0) x = (B_PHISTR_CUT + m_W)/2.0;
357 else x = -(B_PHISTR_CUT + m_W)/2.0;
358
359 // y
360 y = 0.0;
361
362 // z
363 if(m_ID == 2) z = - B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)]/2.0;
364 else z = B_BOX_LT/2.0 - B_BOX_DZ[SL_DOWN] - B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)]/2;
365
366 m_ObjOrgInLoc[0] = x;
367 m_ObjOrgInLoc[1] = y;
368 m_ObjOrgInLoc[2] = z;
369 }
370 else
371 { for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.; }
372 }
373 else
374 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
375}
376
377void MucStripPlane::SetAlignment( double dx, double dy, double dz )
378{
379
380 if( m_Part == BRID || m_ID == -1 )
381 {
382 m_ObjOrgInLoc[0] += dx;
383 m_ObjOrgInLoc[1] += dy;
384 m_ObjOrgInLoc[2] += dz;
385 }
386}
387
388// END
Double_t x[10]
double tan(const BesAngle a)
double sin(const BesAngle a)
double cos(const BesAngle a)
MucEntity & operator=(const MucEntity &other)
Definition: MucEntity.cxx:92
virtual void SetL()
virtual void SetRc()
virtual void SetRout()
virtual void SetH()
MucStripPlane(int part, int segment, int layer, int id)
MucStrip * GetStrip(int id)
virtual void SetTheta()
virtual void Init()
virtual void SetObjOrgInLoc()
virtual void SetObjOrgInBes()
virtual void SetLocOrgInBes()
virtual void SetThin()
virtual void SetW()
MucStripPlane & operator=(const MucStripPlane &other)
virtual ~MucStripPlane()
virtual void SetAlignment(double dx, double dy, double dz)
virtual void SetWd()
virtual void SetWu()
virtual void SetRin()