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