BOSS 7.1.1
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
13
14using namespace std;
15
16// Constructor
17MucStripPlane::MucStripPlane( int part, int segment, int layer, int id )
18 : MucEntity( part, segment, layer, id )
19{
21 m_MucStrip = NULL;
22}
23
24// Copy constructor
26{
27 m_MucStrip = other.m_MucStrip;
28}
29
30// Operator =
32{
33 if( this == &other) return *this;
35 m_MucStrip = other.m_MucStrip;
36
37 return *this;
38}
39
40// Destructor
42{
43 delete m_MucStrip;
44}
45
46// Initialize
48{
49 SetTheta();
50 SetRin();
51 SetRout();
52 SetRc();
53
54 SetThin();
55 SetW();
56 SetWu();
57 SetWd();
58 SetH();
59 SetL();
60
64}
65
66// -------------------------- Get methods ----------------------------
67
69{
70 if( m_MucStrip != NULL ) delete m_MucStrip;
71 return ( m_MucStrip = new MucStrip( m_Part, m_Segment, m_Layer, id ) );
72}
73
74// ---------------------------Set motheds -----------------------------
76{
77 if( m_Part == BRID ) m_Theta = m_Segment * ( MUC_PI/4.0 );
78 else {
79 if( m_ID == -1 ) m_Theta = ( 2*m_Segment + 1 ) * ( MUC_PI/4.0 );
80 else m_Theta = ( MUC_PI/4.0 ) + ( m_ID - 1) * MUC_PI / 8.0 ;
81 }
82}
83
85{
86 if( m_Part == BRID ) m_Rin = B_AS_RMIN[m_Layer] - ( AS_GAP + STR_TH ) / 2.0;
87 else {
88 if( m_ID == -1 ) m_Rin = 0.;
89 else m_Rin = E_GP_RMIN[m_Layer] + E_STRPLN_DR;
90 }
91}
92
94{
95 if( m_Part == BRID ) m_Rout = B_AS_RMIN[m_Layer] - ( AS_GAP - STR_TH ) / 2.0;
96 else m_Rout = E_AS_RMAX - E_BOX_DR - E_STRPLN_DB[(m_Layer==0)?0:1];
97}
98
100{
101 if( m_Part == BRID ) m_Rc = B_AS_RMIN[m_Layer] - AS_GAP/2.0;
102 else {
103 if( m_ID == -1 ) m_Rc = sqrt(2.0) * ( E_AS_RMAX - E_BOX_DR - E_STRPLN_DB[(m_Layer==0)?0:1] ) / 2.0;
104 else m_Rc = (m_Rin + m_Rout)/2.0;
105 }
106}
107
109{
110 m_Thin = STR_TH;
111}
112
114{
115 double offset = 0;
116 if( (m_Layer+1)%2 == 0 ) offset = 2*B_BOX_DZ[1]; // even layers
117 else offset = 2*B_BOX_DT[1]; // odd layers
118
119 if( m_Part == BRID)
120 {
121 if( m_Segment == B_TOP )
122 {
123 if(m_ID == -1 || m_ID == 2)
124 m_W = B_BOX_WT[m_Layer] - offset;
125 else
126 m_W = (B_BOX_WT[m_Layer] - offset - B_PHISTR_CUT)/2.0;
127 }
128 else
129 m_W = B_BOX_WT[m_Layer] - offset;
130 }
131 else
132 {
133 if( m_ID == -1 ) // temparory strip plane
134 m_W = E_AS_RMAX - E_BOX_DR - E_GP_DX - (E_STRPLN_DA + E_STRPLN_DB[(m_Layer==0)?0:1]);
135 else
136 m_W = 0.;
137 }
138}
139
141{
142 if( m_Part == BRID ) m_H = STR_TH;
143 else
144 {
145 if( m_ID == -1 ) // temparory strip plane
146 m_H = E_AS_RMAX - E_BOX_DR - E_GP_DY - (E_STRPLN_DA + E_STRPLN_DB[(m_Layer==0)?0:1]);
147 else
148 {
149 m_H = E_AS_RMAX - E_BOX_DR - E_GP_RMIN[m_Layer] - E_STRPLN_DR - E_STRPLN_DB[(m_Layer==0)?0:1];
150 if(m_ID==1) m_H += (E_STR_DST+5.0)/sqrt(2.0);
151 m_H += 4*OVERLAP_WIDTH;
152 }
153 }
154}
155
157{
158 if( m_Part == BRID )
159 {
160 if( m_Segment == B_TOP )
161 {
162 // 0,1,2,3,7: CUT = 1; 2,4,6,8: CUT = 0;
163 if( m_ID == -1) m_L = B_BOX_LT - 2*B_BOX_DZ[SL_DOWN];
164 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)];
165 else m_L = B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)];
166 }
167 else
168 m_L = B_BOX_LT - 2*B_BOX_DZ[SL_DOWN];
169 }
170 else
171 m_L = STR_TH;
172}
173
175{
176 if( m_Part == BRID ) m_Wu = m_W;
177 else
178 {
179 if( m_ID == -1 ) // temparory strip plane
180 m_Wu = m_W;
181 else if( m_ID == 1 ) // center panel
182 {
183 m_Wu = 2 * VALUE * m_Rin ;
184 m_Wu -= VALUE*(E_STR_DST+5.0)/sqrt(2.0);
185 }
186 else if( m_ID == 0 )
187 m_Wu = VALUE * m_Rin - E_GP_DY - E_STRPLN_DA;
188 else
189 m_Wu = VALUE * m_Rin - E_GP_DX - E_STRPLN_DA;
190
191 //m_Wu += (1-VALUE)*OVERLAP_WIDTH;
192 //m_Wu += 2*OVERLAP_WIDTH;
193 }
194}
195
197{
198 if( m_Part == BRID ) m_Wd = m_W;
199 else
200 {
201 if( m_ID == -1 ) // temparory strip plane
202 m_Wd = m_W;
203 else if( m_ID == 1 ) // center panel
204 {
205 m_Wd = 2 * VALUE * m_Rout;
206 // zoom in with a small dimension for covering strips
207 m_Wd += VALUE*(E_STR_DST+5.0)/sqrt(2.0);
208 }
209 else if( m_ID == 0 )
210 m_Wd = VALUE * m_Rout - E_GP_DY - E_STRPLN_DA;
211 else
212 m_Wd = VALUE * m_Rout - E_GP_DX - E_STRPLN_DA;
213
214 // for "AND" operation of panels
215 //m_Wd += (VALUE + 1.0)*OVERLAP_WIDTH;
216 m_Wd += 4*OVERLAP_WIDTH;
217 }
218}
219
221{
222 double x, y, z=0;
223
224 if( m_Part == BRID )
225 {
226 x = m_Rc*cos( m_Theta );
227 y = m_Rc*sin( m_Theta );
228 z = 0.;
229 } // barrel
230 else
231 {
232 //-------------- set x and y ----------------------
233 // segment 0 as reference
234 if( m_ID == -1 ) {
235 x = (E_AS_RMAX - E_BOX_DR + E_GP_DX) / 2.0;
236 y = (E_AS_RMAX - E_BOX_DR + E_GP_DY) / 2.0;
237 }
238 else {
239 x = (E_AS_RMAX+E_GP_DX+E_STRPLN_DA -E_BOX_DR-E_STRPLN_DB[(m_Layer==0)?0:1])/2.0;
240 y = (E_AS_RMAX+E_GP_DY+E_STRPLN_DA -E_BOX_DR-E_STRPLN_DB[(m_Layer==0)?0:1])/2.0;
241 }
242
243 // x, y signs of coordinate different by segment
244 if ( m_Segment == 0 ) { ; }
245 else if ( m_Segment == 1 ) { x = -x; }
246 else if ( m_Segment == 2 ) { x = -x; y = -y; }
247 else { y = -y; }
248
249 //-------------- set z -----------------------------
250 for( int i=0; i<m_Layer+1; i++ ) z += E_AS_TH[i];
251
252 z += m_Layer * AS_GAP;
253 z += (E_AS_ZMAX - E_AS_TOTAL_TH + z) + AS_GAP/2.0;
254 z *= cos( m_Part*MUC_PI/2.0 );
255 }// endcap
256
257 m_LocOrgInBes[0] = x;
258 m_LocOrgInBes[1] = y;
259 m_LocOrgInBes[2] = z;
260
261 // limit cut
262 for(int i=0;i<3;i++)
263 if( fabs(m_LocOrgInBes[i]) < ERR_LIMIT ) m_LocOrgInBes[i] = 0.;
264
265}
266
268{
269 if( m_Part == BRID ) {
270 for( int i=0; i<3; i++ ) m_ObjOrgInBes[i] = m_LocOrgInBes[i];
271 }
272 else // endcap
273 {
274 //------------- set x and y --------------------
275 // segment 0 as reference
276 double x, y;
277 if( m_ID == -1 ) {
278 x = E_GP_DX + E_STRPLN_DA + m_W/2.0;
279 y = E_GP_DY + E_STRPLN_DA + m_H/2.0;
280 }
281 else if( m_ID == 0 ) {
282 x = m_Rc;
283 y = ( m_Rc * tan( m_Theta ) + E_GP_DY + E_STRPLN_DA ) / 2.0;
284 }
285 else if ( m_ID ==1 ) {
286 x = m_Rc * cos( m_Theta );
287 y = m_Rc * sin( m_Theta );
288 }
289 else { // m_ID == 2
290 x = ( m_Rc / tan( m_Theta ) + E_GP_DX + E_STRPLN_DA ) / 2.0;
291 y = m_Rc;
292 }
293
294 // x, y signs of coordinate different by segment
295 if ( m_Segment == 0 ) { ; }
296 else if ( m_Segment == 1 ) { x = -x; }
297 else if ( m_Segment == 2 ) { x = -x; y = -y; }
298 else { y = -y; }
299
300 m_ObjOrgInBes[0] = x;
301 m_ObjOrgInBes[1] = y;
302
303 // limit cut
304 for( int i=0; i<2; i++ )
305 if( fabs(m_ObjOrgInBes[i]) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0.;
306
307 // ---------------- set z ----------------------
309
310 } // else, endcap
311}
312
314{
315 double x, y, z;
316 if( m_Part == BRID )
317 {
318 if( m_Segment == B_TOP && m_ID !=-1 )
319 {
320 // x
321 if(m_ID == 2) x = 0.0;
322 else if(m_ID == 0) x = (B_PHISTR_CUT + m_W)/2.0;
323 else x = -(B_PHISTR_CUT + m_W)/2.0;
324
325 // y
326 y = 0.0;
327
328 // z
329 if(m_ID == 2) z = - B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)]/2.0;
330 else z = B_BOX_LT/2.0 - B_BOX_DZ[SL_DOWN] - B_ZSTR_CUT[(m_Layer==0)?1:(m_Layer%2)]/2;
331
332 m_ObjOrgInLoc[0] = x;
333 m_ObjOrgInLoc[1] = y;
334 m_ObjOrgInLoc[2] = z;
335 }
336 else { for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.; }
337 }
338 else
339 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
340}
341
342void MucStripPlane::SetAlignment( double dx, double dy, double dz )
343{
344 if( m_Part == BRID || m_ID == -1 )
345 {
346 m_ObjOrgInLoc[0] += dx;
347 m_ObjOrgInLoc[1] += dy;
348 m_ObjOrgInLoc[2] += dz;
349 }
350}
351
352// 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_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 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()
double y[1000]