BOSS 8.0.0
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, <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
17MucAbsorber::MucAbsorber( int part, int segment, int layer, int id )
18 : MucEntity( part, segment, layer, id ) {
20}
21
22// Copy constructor
23MucAbsorber::MucAbsorber( const MucAbsorber& other ) : MucEntity( other ) { ; }
24
25// Operator =
27 if ( this == &other ) return *this;
28 MucEntity::operator=( other );
29 return *this;
30}
31
32// Destructor
34
35// Initialize
37 SetTheta();
38 SetRin();
39 SetRout();
40 SetRc();
41
42 SetThin();
43 SetW();
44 SetWu();
45 SetWd();
46 SetH();
47 SetL();
52}
53
54// -------------------------- Set motheds -------------------
56 if ( m_Part == BRID ) m_Theta = m_Segment * ( MUC_PI / 4.0 );
57 else
58 {
59 if ( m_ID == -1 ) m_Theta = ( 2 * m_Segment + 1 ) * ( MUC_PI / 4.0 );
60 else m_Theta = ( MUC_PI / 4.0 ) + ( m_ID - 1 ) * MUC_PI / 8.0;
61 }
62}
63
65 if ( m_Part == BRID ) m_Rin = B_AS_RMIN[m_Layer];
66 else
67 {
68 if ( m_ID == -1 ) m_Rin = 0.0;
69 else m_Rin = E_AS_RMIN[m_Layer];
70 }
71}
72
74 if ( m_Part == BRID ) m_Rout = B_AS_RMIN[m_Layer] + B_AS_TH[m_Layer];
75 else m_Rout = E_AS_RMAX;
76}
77
79 if ( m_Part == BRID ) m_Rc = B_AS_RMIN[m_Layer] + B_AS_TH[m_Layer] / 2.0;
80 else
81 {
82 if ( m_ID == -1 ) m_Rc = sqrt( 2.0 ) * E_AS_RMAX / 2.0;
83 else m_Rc = ( m_Rin + m_Rout ) / 2.0;
84 }
85}
86
88 if ( m_Part == BRID ) m_Thin = B_AS_TH[m_Layer];
89 else m_Thin = E_AS_TH[m_Layer];
90}
91
93 if ( m_Part == BRID ) m_W = 2.0 * VALUE * m_Rout;
94 else
95 {
96 if ( m_ID == -1 ) // temporary local
97 m_W = E_AS_RMAX;
98 else m_W = 0;
99 }
100}
101
103 if ( m_Part == BRID ) m_H = B_AS_TH[m_Layer];
104 else
105 {
106 if ( m_ID == -1 ) // temporary local
107 m_H = E_AS_RMAX;
108 else m_H = E_AS_RMAX - E_AS_RMIN[m_Layer];
109 }
110}
111
113 if ( m_Part == BRID ) m_L = B_AS_LMAX;
114 else m_L = E_AS_TH[m_Layer];
115}
116
118 if ( m_Part == BRID ) m_Wu = 2 * VALUE * m_Rin;
119 else
120 {
121 if ( m_ID == -1 ) // temporary local
122 m_Wu = m_W;
123 else if ( m_ID == 1 ) // center panel
124 m_Wu = 2 * VALUE * m_Rin;
125 else m_Wu = VALUE * m_Rin;
126 }
127
128 m_Wu -= 0.8; // mm, avoid overlaping
129}
130
132 if ( m_Part == BRID ) m_Wd = 2.0 * VALUE * m_Rout;
133 else
134 {
135 if ( m_ID == -1 ) // temporary local
136 m_Wd = m_W;
137 if ( m_ID == 1 ) // center panel
138 m_Wd = 2.0 * VALUE * E_AS_RMAX;
139 else m_Wd = VALUE * E_AS_RMAX;
140 }
141
142 m_Wd -= 0.8; // mm, avoid overlaping
143}
144
146 double x, y, z;
147 x = y = z = 0.0;
148
149 //---------- set x and y --------
150 if ( m_Part == BRID || m_ID == -1 ) // the local(mother) in BES
151 {
152 x = m_Rc * cos( m_Theta );
153 y = m_Rc * sin( m_Theta );
154 } // barrel
155 else // for endcap panel, calculate the origin of temporary local in BES
156 {
157 // set x and y
158 double tempR, tempTheta;
159 tempR = sqrt( 2.0 ) * E_AS_RMAX / 2.0;
160 tempTheta = ( 2 * m_Segment + 1 ) * ( MUC_PI / 4.0 );
161
162 x = tempR * cos( tempTheta );
163 y = tempR * sin( tempTheta );
164 } // endcap
165
166 //---------- set z -----------
167 if ( m_Part == BRID ) z = 0.;
168 else
169 {
170 for ( int i = 0; i < m_Layer + 1; i++ ) z += E_AS_TH[i];
171
172 z += m_Layer * AS_GAP;
173 z += ( E_AS_ZMAX - E_AS_TOTAL_TH ) - m_Thin / 2.0;
174 z *= cos( m_Part * MUC_PI / 2.0 );
175 }
176
177 m_LocOrgInBes[0] = x;
178 m_LocOrgInBes[1] = y;
179 m_LocOrgInBes[2] = z;
180
181 // limit cut
182 for ( int i = 0; i < 3; i++ )
183 {
184 if ( fabs( m_LocOrgInBes[i] ) < ERR_LIMIT ) m_LocOrgInBes[i] = 0;
185 }
186}
187
189 m_ObjRotToMot[0] = 0.;
190 m_ObjRotToMot[1] = 0.;
191
192 if ( m_Part == BRID ) m_ObjRotToMot[2] = MUC_PI * ( m_Segment - 2 ) / 4.0;
193 else m_ObjRotToMot[2] = 0.;
194}
195
197 double x, y;
198
199 if ( m_Part == BRID || m_ID == -1 ) // object is concided with local
200 {
204 } // local
205 else
206 {
207 //-------- set x and y ------------
208 // endcap panels
209 // setting segment 0 as reference
210 if ( m_ID == 0 )
211 {
212 x = m_Rc;
213 y = m_Rc * tan( m_Theta ) / 2.0;
214 }
215 else if ( m_ID == 1 )
216 {
217 x = m_Rc * cos( m_Theta );
218 y = m_Rc * sin( m_Theta );
219 }
220 else // m_ID == 2
221 {
222 x = m_Rc / tan( m_Theta ) / 2.0;
223 y = m_Rc;
224 }
225
226 // x, y signs of coordinate different by segment
227 if ( m_Segment == 0 ) { ; }
228 else if ( m_Segment == 1 ) { x = -x; }
229 else if ( m_Segment == 2 )
230 {
231 x = -x;
232 y = -y;
233 }
234 else { y = -y; }
235
236 m_ObjOrgInBes[0] = x;
237 m_ObjOrgInBes[1] = y;
238
239 // limit cut
240 for ( int i = 0; i < 2; i++ )
241 {
242 if ( fabs( m_ObjOrgInBes[i] ) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0;
243 }
244
245 //---------- set z--------------
247
248 } // else, endcap panels
249}
250
252 if ( m_Part == BRID || m_ID == -1 ) // for barrel and endcap local
253 for ( int i = 0; i < 3; i++ ) m_ObjOrgInLoc[i] = 0.;
254 else // for endcap panels
255 for ( int i = 0; i < 3; i++ ) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
256}
257
258// END
virtual void SetThin()
MucAbsorber & operator=(const MucAbsorber &other)
virtual void SetObjOrgInBes()
virtual void SetLocOrgInBes()
virtual void SetTheta()
virtual ~MucAbsorber()
virtual void SetWd()
virtual void SetW()
virtual void SetH()
virtual void Init()
MucAbsorber(int part, int segment, int layer, int id)
virtual void SetObjRotToMot()
virtual void SetWu()
virtual void SetRin()
virtual void SetL()
virtual void SetObjOrgInLoc()
virtual void SetRout()
virtual void SetRc()
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