BOSS 7.1.1
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, <[email protected]> |
5// [Date ]: May 22, 2005 |
6//------------------------------------------------------------------------------|
7
8#include <iostream>
9#include <cmath>
10
13
14using namespace std;
15
16// Constructor
17MucAbsorber::MucAbsorber( int part, int segment, int layer, int id ) : MucEntity( part, segment, layer, id )
18{
20}
21
22// Copy constructor
23MucAbsorber::MucAbsorber( const MucAbsorber &other ) : MucEntity( other ) { ; }
24
25// Operator =
27{
28 if( this == &other) return *this;
30 return *this;
31}
32
33// Destructor
35
36// Initialize
38{
39 SetTheta();
40 SetRin();
41 SetRout();
42 SetRc();
43
44 SetThin();
45 SetW();
46 SetWu();
47 SetWd();
48 SetH();
49 SetL();
54}
55
56// -------------------------- Set motheds -------------------
58{
59 if( m_Part == BRID )
60 m_Theta = m_Segment * ( MUC_PI/4.0 );
61 else {
62 if( m_ID == -1 ) m_Theta = ( 2*m_Segment + 1 ) * ( MUC_PI/4.0 );
63 else m_Theta = ( MUC_PI/4.0 ) + ( m_ID - 1) * MUC_PI / 8.0 ;
64 }
65}
66
68{
69 if( m_Part == BRID )
70 m_Rin = B_AS_RMIN[m_Layer];
71 else {
72 if( m_ID == -1 ) m_Rin = 0.0;
73 else m_Rin = E_AS_RMIN[m_Layer];
74 }
75}
76
78{
79 if( m_Part == BRID ) m_Rout = B_AS_RMIN[m_Layer] + B_AS_TH[m_Layer] ;
80 else m_Rout = E_AS_RMAX;
81}
82
84{
85 if( m_Part == BRID )
86 m_Rc = B_AS_RMIN[m_Layer] + B_AS_TH[m_Layer]/2.0;
87 else {
88 if( m_ID == -1 ) m_Rc = sqrt(2.0) * E_AS_RMAX / 2.0;
89 else m_Rc = (m_Rin + m_Rout)/2.0;
90 }
91}
92
94{
95 if( m_Part == BRID ) m_Thin = B_AS_TH[m_Layer];
96 else m_Thin = E_AS_TH[m_Layer];
97}
98
100{
101 if( m_Part == BRID)
102 m_W = 2.0 * VALUE * m_Rout;
103 else
104 {
105 if( m_ID == -1 ) // temporary local
106 m_W = E_AS_RMAX;
107 else
108 m_W = 0;
109 }
110}
111
113{
114 if( m_Part == BRID )
115 m_H = B_AS_TH[m_Layer];
116 else
117 {
118 if( m_ID == -1 ) // temporary local
119 m_H = E_AS_RMAX;
120 else
121 m_H = E_AS_RMAX - E_AS_RMIN[m_Layer];
122 }
123}
124
126{
127 if( m_Part == BRID ) m_L = B_AS_LMAX;
128 else m_L = E_AS_TH[m_Layer];
129}
130
132{
133 if( m_Part == BRID )
134 m_Wu = 2 * VALUE * m_Rin;
135 else
136 {
137 if( m_ID == -1 ) // temporary local
138 m_Wu = m_W;
139 else if( m_ID == 1 ) // center panel
140 m_Wu = 2 * VALUE * m_Rin;
141 else
142 m_Wu = VALUE * m_Rin;
143 }
144
145 m_Wu -= 0.8; //mm, avoid overlaping
146}
147
149{
150 if( m_Part == BRID )
151 m_Wd = 2.0 * VALUE * m_Rout;
152 else
153 {
154 if( m_ID == -1 ) // temporary local
155 m_Wd = m_W;
156 if( m_ID == 1 ) // center panel
157 m_Wd = 2.0 * VALUE * E_AS_RMAX;
158 else
159 m_Wd = VALUE * E_AS_RMAX;
160 }
161
162 m_Wd -= 0.8; //mm, avoid overlaping
163}
164
166{
167 double x, y, z;
168 x = y = z = 0.0;
169
170 //---------- set x and y --------
171 if( m_Part == BRID || m_ID == -1 ) // the local(mother) in BES
172 {
173 x = m_Rc * cos( m_Theta );
174 y = m_Rc * sin( m_Theta );
175 } // barrel
176 else // for endcap panel, calculate the origin of temporary local in BES
177 {
178 // set x and y
179 double tempR, tempTheta;
180 tempR = sqrt(2.0) * E_AS_RMAX / 2.0;
181 tempTheta = ( 2*m_Segment + 1 ) * ( MUC_PI / 4.0 );
182
183 x = tempR * cos( tempTheta );
184 y = tempR * sin( tempTheta );
185 }// endcap
186
187 //---------- set z -----------
188 if( m_Part == BRID ) z = 0.;
189 else
190 {
191 for( int i=0; i<m_Layer+1; i++ ) z += E_AS_TH[i];
192
193 z += m_Layer * AS_GAP;
194 z += (E_AS_ZMAX - E_AS_TOTAL_TH ) - m_Thin/2.0;
195 z *= cos( m_Part*MUC_PI/2.0 );
196 }
197
198 m_LocOrgInBes[0] = x;
199 m_LocOrgInBes[1] = y;
200 m_LocOrgInBes[2] = z;
201
202 // limit cut
203 for(int i=0; i<3; i++) {
204 if( fabs(m_LocOrgInBes[i]) < ERR_LIMIT ) m_LocOrgInBes[i] = 0;
205 }
206}
207
209{
210 m_ObjRotToMot[0] = 0.;
211 m_ObjRotToMot[1] = 0.;
212
213 if( m_Part == BRID )
214 m_ObjRotToMot[2] = MUC_PI * (m_Segment - 2) / 4.0;
215 else
216 m_ObjRotToMot[2] = 0.;
217}
218
220{
221 double x, y;
222
223 if( m_Part == BRID || m_ID == -1 ) // object is concided with local
224 {
228 } // local
229 else
230 {
231 //-------- set x and y ------------
232 // endcap panels
233 // setting segment 0 as reference
234 if( m_ID == 0 )
235 {
236 x = m_Rc;
237 y = m_Rc * tan( m_Theta ) / 2.0;
238 } else if ( m_ID ==1 )
239 {
240 x = m_Rc * cos( m_Theta );
241 y = m_Rc * sin( m_Theta );
242 } else // m_ID == 2
243 {
244 x = m_Rc / tan( m_Theta ) / 2.0;
245 y = m_Rc;
246 }
247
248 // x, y signs of coordinate different by segment
249 if ( m_Segment == 0 ) { ; }
250 else if ( m_Segment == 1 ) { x = -x; }
251 else if ( m_Segment == 2 ) { x = -x; y = -y; }
252 else { y = -y; }
253
254 m_ObjOrgInBes[0] = x;
255 m_ObjOrgInBes[1] = y;
256
257 // limit cut
258 for( int i=0; i<2; i++ ) {
259 if( fabs(m_ObjOrgInBes[i]) < ERR_LIMIT ) m_ObjOrgInBes[i] = 0;
260 }
261
262 //---------- set z--------------
264
265 } // else, endcap panels
266}
267
269{
270 if( m_Part == BRID || m_ID == -1 ) // for barrel and endcap local
271 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = 0.;
272 else // for endcap panels
273 for(int i=0; i<3; i++) m_ObjOrgInLoc[i] = m_ObjOrgInBes[i] - m_LocOrgInBes[i];
274}
275
276// 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]
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()
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
double y[1000]