]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ALIFAST/AliFDet.cxx
Correcting coding convention violations
[u/mrichter/AliRoot.git] / ALIFAST / AliFDet.cxx
1 ////////////////////////////////////////////////////////////////////////////
2 //                                                                        //
3 // AliFast Detector Class                                                 //
4 //                                                                        //
5 // to provide information of effective material (X/Xo) of the detector    //
6 // needed for the multiple scattering formula used in AliFTrackMaker.     // 
7 //                                                                        // 
8 // the number and dimensions of cylindrical layers of material are        //
9 // initialised here for the TP status and are to be updated accordingly.  //
10 //                                                                        //
11 //                                                                        //
12 // origin: "init_geometry" routine in "res.f" fortran by Karel Safarik    //
13 //         which was used to calculate the track resolution for TP.       // 
14 //                                                                        // 
15 //                                                                        //
16 // AliFast: E. Richter-Was and Y. Foka                                    //
17 //          following general structure of Makers in ATLFast              //
18 //          by R. Brun  and E. R. Was                                     //
19 //                                                                        //
20 ////////////////////////////////////////////////////////////////////////////
21
22 #include "AliFDet.h"
23 #include "TMath.h"
24
25 ClassImp(AliFDet)
26
27
28 //_____________________________________________________________________________
29 AliFDet::AliFDet(const char *name, const char *title) : TNamed(name,title)
30 {
31    for(Int_t idDet=0; idDet<kNMaxDet; idDet++){
32       fRDet[idDet]       = 0;
33       fRDetSQ[idDet]     = 0;
34       fThickDet[idDet]   = 0;
35       fErrorRPhi[idDet]  = 0;
36       fErrorZ[idDet]     = 0;
37       fErrorR[idDet]     = 0;
38       fIFlagDet[idDet]   = 0;
39       fIFlagGas[idDet]   = 0;
40    }
41    fBMag       = 0;
42    fConstMag   = 0;
43    fNDetActive = 0;
44    fNDet       = 0;
45 }
46
47 //_____________________________________________________________________________
48 void AliFDet::InitDetParam()
49 {
50   //initialisation of the detector material to the TP status.
51   //needed for multiple scattering formula used in AliFTrackMaker 
52   //for track resolution calculation
53   //  
54   //errorRPhi, errorZ:    
55   //the errors in bending and r direction are due to detector precision and alignement
56   //the error  in radial direction r is due to alignement only
57   //the errors are momentum dependent; for iFlagDet=2 as for TPC are calculated properly
58   //
59   //fErrorVertexX,fErrorVertexY, fErrorVertexZ
60   //errors of vertex  
61   //the vertex precision depends on particle multiplicity mult_density
62   //optimistic errors for/high multiplicity
63  
64    Double_t   rDet[kNMaxDet];         // radius of detector material in cm
65    Double_t   thickDet[kNMaxDet];     // thickness divided by X
66    Double_t   errorRPhi[kNMaxDet];    // error in bending direction
67    Double_t   errorZ[kNMaxDet];       // error in z direction
68    Double_t   errorR[kNMaxDet];       // error in r direction,from alignement only
69    Int_t      iFlagDet[kNMaxDet];     // 1: sensitive detector 
70                                       // 2: errors will be calculated
71    Int_t      iFlagGas[kNMaxDet];     // for gas detectors
72
73    Int_t     nDet;
74
75    //dummy
76    nDet            = 0;
77    rDet[nDet]      = 0;
78    thickDet[nDet]  = 0;
79    iFlagDet[nDet]  = 0;
80    iFlagGas[nDet]  = 0;
81    //vacum pipe
82    nDet            = 1;
83    rDet[nDet]      = 3.0;
84    thickDet[nDet]  = 0.06/35.3;       // berylium
85    iFlagDet[nDet]  = 0;               // no detection
86    iFlagGas[nDet]  = 0;
87    //
88    nDet            = 2;
89    rDet[nDet]      = 3.5;
90    thickDet[nDet]  = 1.0000/30420.0;  // air
91    iFlagDet[nDet]  = 0;               // no detection
92    iFlagGas[nDet]  = 1;
93    //
94    nDet            = 3;
95    rDet[nDet]      = 4.0;
96    thickDet[nDet]  = 0.06/9.36;       // silicon
97    errorRPhi[nDet] = 0.0015 + 0.0005;
98    errorZ[nDet]    = 0.009  + 0.0005;
99    errorR[nDet]    = 0.001;
100    iFlagDet[nDet]  = 1;              
101    iFlagGas[nDet]  = 0;
102    //
103    nDet            = 4;
104    rDet[nDet]      = 5.75;
105    thickDet[nDet]  = 3.5/30420.0;       // silicon
106    iFlagDet[nDet]  = 0;              
107    iFlagGas[nDet]  = 1;
108    //
109    nDet            = 5;
110    rDet[nDet]      = 7.5;
111    thickDet[nDet]  = 0.06/9.36;          // silicon
112    errorRPhi[nDet] = 0.0015 + 0.0005;
113    errorZ[nDet]    = 0.009  + 0.0005;
114    errorR[nDet]    = 0.001;
115    iFlagDet[nDet]  = 1;              
116    iFlagGas[nDet]  = 0;
117    //
118    nDet            = 6;
119    rDet[nDet]      = 10.75;
120    thickDet[nDet]  = 6.5/30420.0;        // air
121    iFlagDet[nDet]  = 0;              
122    iFlagGas[nDet]  = 1;
123    // first silicon drift
124    nDet            = 7;
125    rDet[nDet]      = 14.0;
126    thickDet[nDet]  = 0.06/9.36;          // silicon
127    errorRPhi[nDet] = 0.0025 + 0.0005;
128    errorZ[nDet]    = 0.0025  + 0.0005;
129    errorR[nDet]    = 0.001;
130    iFlagDet[nDet]  = 1;              
131    iFlagGas[nDet]  = 0;
132    //
133    nDet            = 8;
134    rDet[nDet]      = 19.0;
135    thickDet[nDet]  = 10.0/30420.0;        // air
136    iFlagDet[nDet]  = 0;              
137    iFlagGas[nDet]  = 1;
138    // second silicon drift
139    nDet            =  9;
140    rDet[nDet]      = 24.0;
141    thickDet[nDet]  = 0.06/9.36;          // silicon
142    errorRPhi[nDet] = 0.0025 + 0.0005;
143    errorZ[nDet]    = 0.0025  + 0.0005;
144    errorR[nDet]    = 0.001;
145    iFlagDet[nDet]  = 1;              
146    iFlagGas[nDet]  = 0;
147    //
148    nDet            = 10;
149    rDet[nDet]      = 32.0;
150    thickDet[nDet]  = 16.0/30420.0;        // air
151    iFlagDet[nDet]  = 0;              
152    iFlagGas[nDet]  = 1;
153    // first silicon strips
154    nDet            = 11;
155    rDet[nDet]      = 40.0;
156    thickDet[nDet]  = 0.06/9.36;          // silicon
157    errorRPhi[nDet] = 0.003 + 0.0005;
158    errorZ[nDet]    = 0.100 + 0.0005;
159    errorR[nDet]    = 0.001;
160    iFlagDet[nDet]  = 1;              
161    iFlagGas[nDet]  = 0;
162    //
163    nDet            = 12;
164    rDet[nDet]      = 42.5;
165    thickDet[nDet]  = 5.0/30420.0;        // air
166    iFlagDet[nDet]  = 0;              
167    iFlagGas[nDet]  = 1;
168    // second silicon strips
169    nDet            = 13;
170    rDet[nDet]      = 45.0;
171    thickDet[nDet]  = 0.06/9.36;          // silicon
172    errorRPhi[nDet] = 0.003 + 0.0005;
173    errorZ[nDet]    = 0.100 + 0.0005;
174    errorR[nDet]    = 0.001;
175    iFlagDet[nDet]  = 1;              
176    iFlagGas[nDet]  = 0;
177    //
178    nDet            = 14;
179    rDet[nDet]      = 47.5;
180    thickDet[nDet]  = 5.0/30420.0;        // air
181    iFlagDet[nDet]  = 0;              
182    iFlagGas[nDet]  = 1;
183    //
184    nDet            = 15;
185    rDet[nDet]      = 50.0;
186    thickDet[nDet]  = 0.01;              // 1% of something ITS
187    iFlagDet[nDet]  = 0;              
188    iFlagGas[nDet]  = 0;
189    //
190    nDet            = 16;
191    rDet[nDet]      = 51.0;
192    thickDet[nDet]  = 2.0/30420.0;        // air
193    iFlagDet[nDet]  = 0;              
194    iFlagGas[nDet]  = 1;
195    // TPC HV degrager
196    nDet            = 17;
197    rDet[nDet]      = 52.0;
198    thickDet[nDet]  = 0.0018;           // 0.18 % of something TPC
199    iFlagDet[nDet]  = 0;              
200    iFlagGas[nDet]  = 0;
201    //
202    nDet            = 18;
203    rDet[nDet]      = 68.75;
204    thickDet[nDet]  = 12.5/18310.0;          // CO2
205    iFlagDet[nDet]  = 0;              
206    iFlagGas[nDet]  = 1;
207    //
208    nDet            = 19;
209    rDet[nDet]      = 71.25;
210    thickDet[nDet]  = 12.5/18310.0;          // CO2
211    iFlagDet[nDet]  = 0;              
212    iFlagGas[nDet]  = 1;
213    // TPC inner field cage
214    nDet            = 20;
215    rDet[nDet]      = 78.0;
216    thickDet[nDet]  = 0.0041;                // 0.41 % of something
217    iFlagDet[nDet]  = 0;              
218    iFlagGas[nDet]  = 0;
219    //
220    nDet            = 21;
221    rDet[nDet]      = 83.5;
222    thickDet[nDet]  = 11.0/32155.6;          // neon
223    iFlagDet[nDet]  = 0;              
224    iFlagGas[nDet]  = 1;
225    //
226    nDet            = 22;
227    rDet[nDet]      = 94.5;
228    thickDet[nDet]  = 11.0/32155.6;          // neon
229    iFlagDet[nDet]  = 0;              
230    iFlagGas[nDet]  = 1;
231    // TPC
232    Int_t    nPadRow = 75;
233    Double_t rCurrent = 99.0;
234    Double_t deltaR   =  2.0;
235    for(Int_t ipad=1; ipad<nPadRow+1; ipad++){
236       nDet=nDet+1;
237       rCurrent = rCurrent + deltaR;
238       rDet[nDet] = rCurrent;
239       thickDet[nDet]  = 2.0/32155.6;        // neon
240       errorRPhi[nDet] = 0.0;                //errors are momentum dependent
241       errorZ[nDet]    = 0.0;                //to be calculated latter
242       errorR[nDet]    = 0.0075;
243       iFlagDet[nDet]  = 2;                  //means error defined latter              
244       iFlagGas[nDet]  = 1;
245    }
246
247    // vertex precision
248    Double_t multDensity = 3906.25;
249
250    fErrorVertexX = 0.010/TMath::Sqrt(multDensity) + 0.00060;
251    fErrorVertexY = fErrorVertexX;
252    fErrorVertexZ = 0.025/TMath::Sqrt(multDensity) + 0.00075;
253
254
255    // magnetic field
256    fBMag = 2.0;
257    fConstMag = 1.0/(fBMag*0.297792458e-3);
258
259
260    // prepare more suitables variables
261
262    Int_t nDetActive = 0;
263      
264    for(Int_t idDet=0; idDet<nDet+1; idDet++){
265       fRDet[idDet]     = rDet[idDet]; 
266       fRDetSQ[idDet]   = rDet[idDet]*rDet[idDet];
267       fThickDet[idDet] = 0.0136* TMath::Sqrt(thickDet[idDet]);
268       fIFlagDet[idDet]    = iFlagDet[idDet];
269       fIFlagGas[idDet]    = iFlagGas[idDet];
270       if(iFlagDet[idDet] > 0){
271          nDetActive = nDetActive+1;
272          fErrorR[idDet] = errorR[idDet]*errorR[idDet];
273          if(iFlagDet[idDet] == 1){
274             fErrorRPhi[idDet] = errorRPhi[idDet]*errorRPhi[idDet];
275             fErrorZ[idDet] = errorZ[idDet]*errorZ[idDet];
276          }
277       }
278    }
279
280    fErrorVertexX = fErrorVertexX*fErrorVertexX;
281    fErrorVertexY = fErrorVertexY*fErrorVertexY;
282    fErrorVertexZ = fErrorVertexZ*fErrorVertexZ;
283
284    fNDetActive   = nDetActive;
285    fNDet         = nDet;
286
287   
288 }
289
290 //_____________________________________________________________________________
291 void AliFDet::PrintDetInfo()
292 {
293   //to print information for the initialisation of the detector 
294    printf("**************************************************************\n");
295    printf("*                                                            *\n");
296    printf("*                        ALICE detector                      *\n");
297    printf("*                                                            *\n");
298    printf("**************************************************************\n");
299
300    for(Int_t idDet=0; idDet<fNDet+1; idDet++){
301      if(fIFlagDet[idDet] == 0){
302        printf("%5s %3d %8.1f %2s %10.5f %20s\n",
303               "det=",idDet,fRDet[idDet],"cm",
304               TMath::Power(fThickDet[idDet]/0.0136,2),
305               "of X0 <---- pasive material");
306      } else{
307        printf("%5s %3d %8.1f %2s %10.5f %6s  %6.4f %6.4f \n",
308               "det=",idDet,fRDet[idDet],"cm",
309               TMath::Power(fThickDet[idDet]/0.0136,2),"of X0, errors",
310               TMath::Sqrt(fErrorRPhi[idDet]),TMath::Sqrt(fErrorZ[idDet]));
311      } 
312    }
313    printf("%20s %10.4f %10.4f %10.4f\n","vertex precision(x,y,z)",
314           TMath::Sqrt(fErrorVertexX),
315           TMath::Sqrt(fErrorVertexY),
316           TMath::Sqrt(fErrorVertexZ));
317    printf("%20s %10.4f %10s %8.1f %5s\n","magnetic field (kGauss)",fBMag,
318           "(constant",fConstMag,")");
319
320 }