]>
Commit | Line | Data |
---|---|---|
457e2170 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* | |
17 | $Log$ | |
e6add757 | 18 | Revision 1.1 2007/06/24 20:56:19 hristov |
19 | TPC version for the krypton runs (Marek) | |
20 | ||
457e2170 | 21 | */ |
22 | ||
23 | // | |
24 | /////////////////////////////////////////////////////////////////////////////// | |
25 | // // | |
26 | // Time Projection Chamber version 4 -- detailed TPC and slow simulation // | |
27 | // of Krypton decays // | |
28 | // // | |
29 | //Begin_Html // | |
30 | /* | |
31 | <img src="picts/AliTPCv2Class.gif"> | |
32 | */ | |
33 | //End_Html | |
34 | // // | |
35 | // // | |
36 | /////////////////////////////////////////////////////////////////////////////// | |
37 | ||
38 | //#include <stdlib.h> | |
39 | ||
40 | #include <TLorentzVector.h> | |
41 | #include <TPDGCode.h> | |
42 | #include <TString.h> | |
43 | #include "AliLog.h" | |
b40afa5e | 44 | #include "AliMathBase.h" |
457e2170 | 45 | #include "AliTPCParam.h" |
46 | #include "AliTPCTrackHitsV2.h" | |
47 | #include "AliTPCv4.h" | |
48 | #include "TGeoVolume.h" | |
49 | #include "TGeoPcon.h" | |
50 | #include "TGeoTube.h" | |
51 | #include "TGeoPgon.h" | |
52 | #include "TGeoTrd1.h" | |
53 | #include "TGeoCompositeShape.h" | |
54 | #include "TGeoPara.h" | |
55 | #include "TGeoPhysicalNode.h" | |
56 | ||
57 | ClassImp(AliTPCv4) | |
58 | ||
59 | //_____________________________________________________________________________ | |
60 | AliTPCv4::AliTPCv4(const char *name, const char *title) : | |
61 | AliTPC(name, title), | |
62 | fIdSens(0), | |
63 | fIDrift(0), | |
64 | fSecOld(0) | |
65 | { | |
66 | // | |
67 | // Standard constructor for Time Projection Chamber version 2 | |
68 | // | |
69 | ||
70 | ||
71 | SetBufferSize(128000); | |
72 | ||
73 | ||
74 | if (fTPCParam) | |
75 | fTPCParam->Write(fTPCParam->GetTitle()); | |
76 | } | |
77 | ||
78 | //_____________________________________________________________________________ | |
79 | void AliTPCv4::CreateGeometry() | |
80 | { | |
81 | // | |
82 | // Create the geometry of Time Projection Chamber version 2 | |
83 | // | |
84 | //Begin_Html | |
85 | /* | |
86 | <img src="picts/AliTPC.gif"> | |
87 | */ | |
88 | //End_Html | |
89 | //Begin_Html | |
90 | /* | |
91 | <img src="picts/AliTPCv2Tree.gif"> | |
92 | */ | |
93 | //End_Html | |
94 | ||
95 | //---------------------------------------------------------- | |
96 | // This geometry is written using TGeo class | |
97 | // Firstly the shapes are defined, and only then the volumes | |
98 | // What is recognized by the MC are volumes | |
99 | //---------------------------------------------------------- | |
100 | // | |
101 | // tpc - this will be the mother volume | |
102 | // | |
103 | ||
104 | // | |
105 | // here I define a volume TPC | |
106 | // retrive the medium name with "TPC_" as a leading string | |
107 | // | |
78134e48 | 108 | TGeoPcon *tpc = new TGeoPcon(0.,360.,20); //20 sections |
457e2170 | 109 | // |
78134e48 | 110 | tpc->DefineSection(0,-291.,77.,278.); |
111 | tpc->DefineSection(1,-270,77.,278.); | |
457e2170 | 112 | // |
78134e48 | 113 | tpc->DefineSection(2,-270.,77.,278.); |
114 | tpc->DefineSection(3,-259.6,70.,278.); | |
457e2170 | 115 | // |
78134e48 | 116 | tpc->DefineSection(4,-259.6,68.1,278.); |
117 | tpc->DefineSection(5,-253.6,68.1,278.); | |
457e2170 | 118 | // |
78134e48 | 119 | tpc->DefineSection(6,-253.6,68.,278.); |
120 | tpc->DefineSection(7,-74.0,60.8,278.); | |
457e2170 | 121 | // |
78134e48 | 122 | tpc->DefineSection(8,-74.0,60.1,278.); |
123 | tpc->DefineSection(9,-73.3,60.1,278.); | |
457e2170 | 124 | // |
78134e48 | 125 | tpc->DefineSection(10,-73.3,56.9,278.); |
126 | tpc->DefineSection(11,73.3,56.9,278.); | |
457e2170 | 127 | // |
78134e48 | 128 | tpc->DefineSection(12,73.3,60.1,278.); |
129 | tpc->DefineSection(13,74.0,60.1,278.); | |
457e2170 | 130 | // |
78134e48 | 131 | tpc->DefineSection(14,74.0,60.8,278.); |
132 | tpc->DefineSection(15,253.6,65.5,278.); | |
133 | // | |
134 | tpc->DefineSection(16,253.6,65.6,278.); | |
135 | tpc->DefineSection(17,259.6,65.6,278.); | |
136 | // | |
137 | tpc->DefineSection(18,259.6,70.0,278.); | |
138 | tpc->DefineSection(19,291.,77.,278.); | |
457e2170 | 139 | // |
140 | TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air"); | |
141 | TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1); | |
142 | // | |
143 | // drift volume - sensitive volume, extended beyond the | |
144 | // endcaps, because of the alignment | |
145 | // | |
146 | TGeoPcon *dvol = new TGeoPcon(0.,360.,6); | |
147 | dvol->DefineSection(0,-260.,74.5,264.4); | |
148 | dvol->DefineSection(1,-253.6,74.5,264.4); | |
149 | // | |
150 | dvol->DefineSection(2,-253.6,76.6774,258.); | |
151 | dvol->DefineSection(3,253.6,76.6774,258.); | |
152 | // | |
153 | dvol->DefineSection(4,253.6,74.5,264.4); | |
154 | dvol->DefineSection(5,260.,74.5,264.4); | |
155 | // | |
156 | TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-N-3"); | |
157 | TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5); | |
158 | // | |
159 | v1->AddNode(v9,1); | |
160 | // | |
161 | // outer insulator | |
162 | // | |
163 | TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator | |
164 | // | |
165 | tpco->DefineSection(0,-256.6,264.8,278.); | |
166 | tpco->DefineSection(1,-253.6,264.8,278.); | |
167 | // | |
168 | tpco->DefineSection(2,-253.6,258.,278.); | |
169 | tpco->DefineSection(3,250.6,258.,278.); | |
170 | // | |
171 | tpco->DefineSection(4,250.6,258.,275.5); | |
172 | tpco->DefineSection(5,253.6,258.,275.5); | |
173 | // | |
174 | TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2"); | |
175 | TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2); | |
176 | // | |
177 | // outer containment vessel | |
178 | // | |
179 | TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel | |
180 | // | |
181 | tocv->DefineSection(0,-256.6,264.8,278.); | |
182 | tocv->DefineSection(1,-253.6,264.8,278.); | |
183 | // | |
184 | tocv->DefineSection(2,-253.6,274.8124,278.); | |
185 | tocv->DefineSection(3,247.6,274.8124,278.); | |
186 | // | |
187 | tocv->DefineSection(4,247.6,270.4,278.); | |
188 | tocv->DefineSection(5,250.6,270.4,278.); | |
189 | // | |
190 | TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al"); | |
191 | TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3); | |
192 | // | |
193 | TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy | |
194 | TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar | |
195 | TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2 | |
196 | TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex | |
197 | // | |
198 | TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy"); | |
199 | TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar"); | |
200 | TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2"); | |
201 | TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex"); | |
202 | // | |
203 | TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1); | |
204 | TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2); | |
205 | TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3); | |
206 | TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4); | |
207 | //------------------------------------------------------- | |
208 | // Tpc Outer Field Cage | |
209 | // daughters - composite (sandwich) | |
210 | //------------------------------------------------------- | |
211 | ||
212 | TGeoPcon *tofc = new TGeoPcon(0.,360.,6); | |
213 | // | |
214 | tofc->DefineSection(0,-253.6,258.,269.6); | |
215 | tofc->DefineSection(1,-250.6,258.,269.6); | |
216 | // | |
217 | tofc->DefineSection(2,-250.6,258.,260.0676); | |
218 | tofc->DefineSection(3,250.6,258.,260.0676); | |
219 | // | |
220 | tofc->DefineSection(4,250.6,258.,275.5); | |
221 | tofc->DefineSection(5,253.6,258.,275.5); | |
222 | // | |
223 | TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3); | |
224 | //sandwich | |
225 | TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar | |
226 | TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3 | |
227 | TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex | |
228 | // | |
229 | TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3"); | |
230 | // | |
231 | TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2); | |
232 | TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5); | |
233 | TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4); | |
234 | // | |
235 | // outer part - positioning | |
236 | // | |
237 | tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1); | |
238 | // | |
239 | tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1); | |
240 | // | |
241 | v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1); | |
242 | // | |
243 | v2->AddNode(v3,1); v2->AddNode(v4,1); | |
244 | // | |
245 | v1->AddNode(v2,1); | |
246 | //-------------------------------------------------------------------- | |
247 | // Tpc Inner INsulator (CO2) | |
248 | // the cones, the central drum and the inner f.c. sandwich with a piece | |
249 | // of the flane will be placed in the TPC | |
250 | //-------------------------------------------------------------------- | |
251 | TGeoPcon *tpci = new TGeoPcon(0.,360.,4); | |
252 | // | |
253 | tpci->DefineSection(0,-253.6,68.4,76.6774); | |
254 | tpci->DefineSection(1,-74.0,61.2,76.6774); | |
255 | // | |
256 | tpci->DefineSection(2,74.0,61.2,76.6774); | |
257 | // | |
258 | tpci->DefineSection(3,253.6,65.9,76.6774); | |
259 | // | |
260 | TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2); | |
261 | // | |
262 | // now the inner field cage - only part of flanges (2 copies) | |
263 | // | |
264 | TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5); | |
265 | TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3); | |
266 | // | |
267 | //--------------------------------------------------------- | |
268 | // Tpc Inner Containment vessel - Muon side | |
269 | //--------------------------------------------------------- | |
270 | TGeoPcon *tcms = new TGeoPcon(0.,360.,10); | |
271 | // | |
272 | tcms->DefineSection(0,-259.1,68.1,74.2); | |
273 | tcms->DefineSection(1,-253.6,68.1,74.2); | |
274 | // | |
275 | tcms->DefineSection(2,-253.6,68.1,68.4); | |
276 | tcms->DefineSection(3,-74.0,60.9,61.2); | |
277 | // | |
278 | tcms->DefineSection(4,-74.0,60.1,61.2); | |
279 | tcms->DefineSection(5,-73.3,60.1,61.2); | |
280 | // | |
281 | tcms->DefineSection(6,-73.3,56.9,61.2); | |
282 | tcms->DefineSection(7,-73.0,56.9,61.2); | |
283 | // | |
284 | tcms->DefineSection(8,-73.0,56.9,58.8); | |
285 | tcms->DefineSection(9,-71.3,56.9,58.8); | |
286 | // | |
287 | TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3); | |
288 | //----------------------------------------------- | |
289 | // inner containment vessel - shaft side | |
290 | //----------------------------------------------- | |
291 | TGeoPcon *tcss = new TGeoPcon(0.,360.,10); | |
292 | // | |
293 | tcss->DefineSection(0,71.3,56.9,58.8); | |
294 | tcss->DefineSection(1,73.0,56.9,58.8); | |
295 | // | |
296 | tcss->DefineSection(2,73.0,56.9,61.2); | |
297 | tcss->DefineSection(3,73.3,56.9,61.2); | |
298 | // | |
299 | tcss->DefineSection(4,73.3,60.1,61.2); | |
300 | tcss->DefineSection(5,74.0,60.1,61.2); | |
301 | // | |
302 | tcss->DefineSection(6,74.0,60.9,61.2); | |
303 | tcss->DefineSection(7,253.6,65.6,65.9); | |
304 | // | |
305 | tcss->DefineSection(8,253.6,65.6,74.2); | |
306 | tcss->DefineSection(9,258.1,65.6,74.2); | |
307 | // | |
308 | TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3); | |
309 | //----------------------------------------------- | |
310 | // Inner field cage | |
311 | // define 4 parts and make an assembly | |
312 | //----------------------------------------------- | |
313 | // part1 - Al - 2 copies | |
314 | TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75); | |
315 | TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3); | |
316 | // sandwich - outermost parts - 2 copies | |
317 | TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns | |
318 | TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns | |
319 | TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns | |
320 | TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm | |
321 | // | |
322 | TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2); | |
323 | TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3); | |
324 | TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5); | |
325 | TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4); | |
326 | // | |
327 | // middle parts - 2 copies | |
328 | TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns | |
329 | TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns | |
330 | TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns | |
331 | TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm | |
332 | // | |
333 | TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2); | |
334 | TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3); | |
335 | TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5); | |
336 | TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4); | |
337 | // central part - 1 copy | |
338 | TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns | |
339 | TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns | |
340 | TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm | |
341 | // | |
342 | TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2); | |
343 | TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5); | |
344 | TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4); | |
345 | // | |
346 | // inner part - positioning | |
347 | // | |
348 | // creating a sandwich | |
349 | tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1); | |
350 | // | |
351 | tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1); | |
352 | // | |
353 | tv10->AddNode(tv11,1); tv11->AddNode(tv12,1); | |
354 | // | |
355 | TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC"); | |
356 | // | |
357 | tv100->AddNode(tv10,1); | |
358 | tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75)); | |
359 | tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75)); | |
360 | tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925)); | |
361 | tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925)); | |
362 | tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85)); | |
363 | tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85)); | |
364 | // | |
365 | v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1)); | |
366 | v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1)); | |
367 | v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1); | |
368 | v9->AddNode(tv100,1); | |
369 | // | |
370 | // central drum | |
371 | // | |
372 | // flange + sandwich | |
373 | // | |
374 | TGeoPcon *cfl = new TGeoPcon(0.,360.,6); | |
375 | cfl->DefineSection(0,-71.1,59.7,61.2); | |
376 | cfl->DefineSection(1,-68.6,59.7,61.2); | |
377 | // | |
378 | cfl->DefineSection(2,-68.6,60.6324,61.2); | |
379 | cfl->DefineSection(3,68.6,60.6324,61.2); | |
380 | // | |
381 | cfl->DefineSection(4,68.6,59.7,61.2); | |
382 | cfl->DefineSection(5,71.1,59.7,61.2); | |
383 | // | |
384 | TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3); | |
385 | // sandwich | |
386 | TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1); | |
387 | TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1); | |
388 | TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1); | |
389 | // | |
390 | TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1"); | |
391 | TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar | |
392 | TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1 | |
393 | TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex | |
394 | // | |
395 | // seals for central drum 2 copies | |
396 | // | |
397 | TGeoTube *cs = new TGeoTube(56.9,61.2,0.1); | |
398 | TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar"); | |
399 | TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7); | |
78134e48 | 400 | v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2)); |
401 | v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2)); | |
457e2170 | 402 | // |
403 | // seal collars | |
404 | TGeoPcon *se = new TGeoPcon(0.,360.,6); | |
405 | se->DefineSection(0,-72.8,59.7,61.2); | |
406 | se->DefineSection(1,-72.3,59.7,61.2); | |
407 | // | |
408 | se->DefineSection(2,-72.3,58.85,61.2); | |
409 | se->DefineSection(3,-71.6,58.85,61.2); | |
410 | // | |
411 | se->DefineSection(4,-71.6,59.7,61.2); | |
412 | se->DefineSection(5,-71.3,59.7,61.2); | |
413 | // | |
414 | TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3); | |
415 | // | |
416 | TGeoTube *si = new TGeoTube(56.9,58.8,1.); | |
417 | TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3); | |
418 | // | |
419 | // define reflection matrix | |
420 | // | |
421 | TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.); | |
422 | // | |
423 | cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1); | |
424 | // | |
425 | v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9)); | |
426 | v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9)); | |
427 | v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1); | |
428 | // | |
429 | // central membrane - 2 rings and a mylar membrane - assembly | |
430 | // | |
431 | TGeoTube *ih = new TGeoTube(81.05,84.05,0.3); | |
432 | TGeoTube *oh = new TGeoTube(250.,256.,.5); | |
433 | TGeoTube *mem = new TGeoTube(84.05,250,0.01); | |
434 | TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3); | |
435 | TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3); | |
436 | TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7); | |
437 | // | |
438 | TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM"); | |
439 | cm->AddNode(ihv,1); | |
440 | cm->AddNode(ohv,1); | |
441 | cm->AddNode(memv,1); | |
442 | v9->AddNode(cm,1); | |
443 | // | |
444 | // end caps - they are make as an assembly of single segments | |
445 | // containing both readout chambers | |
446 | // | |
447 | Double_t openingAngle = 10.*TMath::DegToRad(); | |
448 | Double_t thick=1.5; // rib | |
449 | Double_t shift = thick/TMath::Sin(openingAngle); | |
450 | // | |
451 | Double_t lowEdge = 86.3; // hole in the wheel | |
452 | Double_t upEdge = 240.4; // hole in the wheel | |
453 | // | |
454 | new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.); | |
455 | // | |
456 | TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4); | |
457 | // | |
458 | hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift); | |
459 | hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift); | |
460 | // | |
461 | hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift); | |
462 | hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift); | |
463 | // | |
464 | Double_t ys = shift*TMath::Sin(openingAngle); | |
465 | Double_t xs = shift*TMath::Cos(openingAngle); | |
466 | TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.); | |
467 | tr->RegisterYourself(); | |
468 | TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr"); | |
469 | TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3); | |
470 | TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2); | |
471 | bar->DefineSection(0,-3.,131.5-shift,136.5-shift); | |
472 | bar->DefineSection(1,1.5,131.5-shift,136.5-shift); | |
473 | TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3); | |
474 | TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment | |
475 | // | |
476 | ch->AddNode(sv,1); ch->AddNode(barv,1,tr); | |
477 | // | |
478 | // readout chambers | |
479 | // | |
480 | // IROC first | |
481 | // | |
482 | TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15); | |
483 | TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3); | |
484 | // empty space | |
485 | TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65); | |
486 | TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1); | |
487 | ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.)); | |
488 | //bars | |
489 | Double_t tga = (19.8328-12.3742)/39.3; | |
490 | Double_t xmin,xmax; | |
491 | xmin = 9.55*tga+12.3742; | |
492 | xmax = 9.95*tga+12.3742; | |
493 | TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2); | |
494 | TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3); | |
495 | empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9)); | |
496 | xmin=19.4*tga+12.3742; | |
497 | xmax=19.9*tga+12.3742; | |
498 | TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25); | |
499 | TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3); | |
500 | empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.)); | |
501 | xmin=29.35*tga+12.3742; | |
502 | xmax=29.75*tga+12.3742; | |
503 | TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2); | |
504 | TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3); | |
505 | empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9)); | |
506 | // | |
507 | // holes for connectors | |
508 | // | |
509 | TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc | |
510 | TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1); | |
511 | TString fileName(gSystem->Getenv("ALICE_ROOT")); | |
512 | fileName += "/TPC/conn_iroc.dat"; | |
513 | ifstream in; | |
514 | in.open(fileName.Data(), ios_base::in); // asci file | |
515 | for(Int_t i =0;i<86;i++){ | |
516 | Double_t y = 3.99; | |
517 | Double_t x,z,ang; | |
518 | in>>x>>z>>ang; | |
519 | z-=26.5; | |
520 | TGeoRotation *rrr = new TGeoRotation(); | |
521 | rrr->RotateY(ang); | |
522 | TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr); | |
523 | ibdv->AddNode(connv,i+1,trans); | |
524 | } | |
525 | in.close(); | |
526 | // "cap" | |
527 | new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825); | |
528 | // "hole" | |
529 | new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15); | |
530 | TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725); | |
531 | tr1->RegisterYourself(); | |
532 | TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1"); | |
533 | TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3); | |
534 | // | |
535 | // pad plane and wire fixations | |
536 | // | |
537 | TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso | |
538 | TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10"); | |
539 | TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4); | |
540 | TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.); | |
541 | TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4); | |
542 | TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.); | |
543 | TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4); | |
544 | // | |
545 | TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC"); | |
546 | // | |
547 | iroc->AddNode(ibdv,1); | |
548 | iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725)); | |
549 | iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725)); | |
550 | tga =(23.3521-14.5974)/49.65; | |
551 | Double_t xx = 24.825*tga+14.5974-0.6; | |
552 | iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725)); | |
553 | iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725)); | |
554 | // | |
555 | // OROC | |
556 | // | |
557 | TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65); | |
558 | TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3); | |
559 | TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65); | |
560 | TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1); | |
561 | obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.)); | |
562 | //horizontal bars | |
563 | tga=(38.5084-20.2938)/99.3; | |
564 | xmin=tga*10.2+20.2938; | |
565 | xmax=tga*10.6+20.2938; | |
566 | TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2); | |
567 | TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3); | |
568 | // | |
569 | xmin=22.55*tga+20.2938; | |
570 | xmax=24.15*tga+20.2938; | |
571 | TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8); | |
572 | TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3); | |
573 | // | |
574 | xmin=36.1*tga+20.2938; | |
575 | xmax=36.5*tga+20.2938; | |
576 | TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2); | |
577 | TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3); | |
578 | // | |
579 | xmin=49.0*tga+20.2938; | |
580 | xmax=50.6*tga+20.2938; | |
581 | TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8); | |
582 | TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3); | |
583 | // | |
584 | xmin=63.6*tga+20.2938; | |
585 | xmax=64.0*tga+20.2938; | |
586 | TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2); | |
587 | TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3); | |
588 | // | |
589 | xmin=75.5*tga+20.2938; | |
590 | xmax=77.15*tga+20.2938; | |
591 | TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8); | |
592 | TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3); | |
593 | // | |
594 | xmin=88.7*tga+20.2938; | |
595 | xmax=89.1*tga+20.2938; | |
596 | TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2); | |
597 | TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3); | |
598 | // | |
599 | oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25)); | |
600 | oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3)); | |
601 | oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35)); | |
602 | oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15)); | |
603 | oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15)); | |
604 | oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7)); | |
605 | oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25)); | |
606 | // vertical bars | |
607 | TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1); | |
608 | TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975); | |
609 | TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775); | |
610 | TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25); | |
611 | TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5); | |
612 | // | |
613 | TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3); | |
614 | TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3); | |
615 | TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3); | |
616 | TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3); | |
617 | TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3); | |
618 | // | |
619 | oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55)); | |
620 | oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55)); | |
621 | oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075)); | |
622 | oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525)); | |
623 | oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125)); | |
624 | oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275)); | |
625 | oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9)); | |
626 | oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45)); | |
627 | // | |
628 | // holes for connectors | |
629 | // | |
630 | fileName = gSystem->Getenv("ALICE_ROOT"); | |
631 | fileName += "/TPC/conn_oroc.dat"; | |
632 | in.open(fileName.Data(), ios_base::in); // asci file | |
633 | for(Int_t i =0;i<78;i++){ | |
634 | Double_t y =3.89; | |
635 | Double_t x,z,ang; | |
636 | Double_t x1,z1,x2,z2; | |
637 | in>>x>>z>>ang; | |
638 | Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad()); | |
639 | Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad()); | |
640 | // | |
641 | x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z; | |
642 | // | |
643 | TGeoRotation *rr = new TGeoRotation(); | |
644 | rr->RotateY(ang); | |
645 | z1-=54.95; | |
646 | z2-=54.95; | |
647 | TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr); | |
648 | TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr); | |
649 | obdv->AddNode(connv,i+1,trans1); | |
650 | obdv->AddNode(connv,i+79,trans2); | |
651 | } | |
652 | in.close(); | |
653 | // cap | |
654 | new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1); | |
655 | new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65); | |
656 | TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15); | |
657 | tr5->RegisterYourself(); | |
658 | TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5"); | |
659 | TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3); | |
660 | // | |
661 | // pad plane and wire fixations | |
662 | // | |
663 | TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1); | |
664 | TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4); | |
665 | // | |
666 | tga=(43.5239-23.3874)/114.2; | |
667 | TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.); | |
668 | TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.); | |
669 | xx = 57.1*tga+23.3874-0.7; | |
670 | TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4); | |
671 | TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4); | |
672 | // | |
673 | TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC"); | |
674 | // | |
675 | oroc->AddNode(obdv,1); | |
676 | oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15)); | |
677 | oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15)); | |
678 | oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15)); | |
679 | oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15)); | |
680 | // | |
681 | // now iroc and oroc are placed into a sector... | |
682 | // | |
683 | TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side | |
684 | TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side | |
685 | TGeoRotation rot1("rot1",90.,90.,0.); | |
686 | TGeoRotation rot2("rot2"); | |
687 | rot2.RotateY(10.); | |
688 | TGeoRotation *rot = new TGeoRotation("rot"); | |
689 | *rot=rot1*rot2; | |
690 | // | |
691 | Double_t x0,y0; | |
692 | x0=110.2*TMath::Cos(openingAngle); | |
693 | y0=110.2*TMath::Sin(openingAngle); | |
20527578 | 694 | TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side |
695 | TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side | |
457e2170 | 696 | x0=188.45*TMath::Cos(openingAngle); |
697 | y0=188.45*TMath::Sin(openingAngle); | |
20527578 | 698 | TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side |
699 | TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side | |
457e2170 | 700 | // |
701 | // | |
702 | // A-side | |
703 | // | |
704 | secta->AddNode(ch,1); | |
705 | secta->AddNode(iroc,1,combi1a); | |
706 | secta->AddNode(oroc,1,combi2a); | |
707 | // | |
708 | // C-side | |
709 | // | |
710 | sectc->AddNode(ch,1); | |
711 | sectc->AddNode(iroc,1,combi1c); | |
712 | sectc->AddNode(oroc,1,combi2c); | |
713 | // | |
714 | // now I try to make wheels... | |
715 | // | |
716 | TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP"); | |
717 | TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP"); | |
718 | // | |
719 | for(Int_t i =0;i<18;i++){ | |
720 | Double_t phi = (20.*i); | |
721 | TGeoRotation *r = new TGeoRotation(); | |
722 | r->RotateZ(phi); | |
723 | wheela->AddNode(secta,i+1,r); | |
724 | wheelc->AddNode(sectc,i+1,r); | |
725 | ||
726 | } | |
727 | // wheels in the drift volume! | |
728 | ||
729 | TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref); | |
730 | v9->AddNode(wheela,1,combi3); | |
731 | v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6)); | |
732 | //_____________________________________________________________ | |
733 | // service support wheel | |
734 | //_____________________________________________________________ | |
735 | TGeoPgon *sw = new TGeoPgon(0.,20.,1,2); | |
736 | sw->DefineSection(0,-4.,80.5,251.75); | |
737 | sw->DefineSection(1,4.,80.5,251.75); | |
738 | TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al | |
739 | // | |
740 | thick=1.; | |
741 | shift = thick/TMath::Sin(openingAngle); | |
742 | TGeoPgon *sh = new TGeoPgon(0.,20.,1,2); | |
743 | sh->DefineSection(0,-4.,81.5-shift,250.75-shift); | |
744 | sh->DefineSection(1,4.,81.5-shift,250.75-shift); | |
745 | TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air | |
746 | // | |
747 | TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si"); | |
748 | TGeoPgon *el = new TGeoPgon(0.,20.,1,2); | |
749 | el->DefineSection(0,-1.872,81.5-shift,250.75-shift); | |
750 | el->DefineSection(1,1.872,81.5-shift,250.75-shift); | |
751 | TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si | |
752 | // | |
753 | shv->AddNode(elv,1); | |
754 | // | |
755 | // | |
756 | ys = shift*TMath::Sin(openingAngle); | |
757 | xs = shift*TMath::Cos(openingAngle); | |
758 | swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.)); | |
759 | // cover | |
760 | TGeoPgon *co = new TGeoPgon(0.,20.,1,2); | |
761 | co->DefineSection(0,-0.5,77.,255.25); | |
762 | co->DefineSection(1,0.5,77.,255.25); | |
763 | TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al | |
764 | // hole in a cover | |
765 | TGeoPgon *coh = new TGeoPgon(0.,20.,1,2); | |
766 | shift=4./TMath::Sin(openingAngle); | |
767 | coh->DefineSection(0,-0.5,85.-shift,247.25-shift); | |
768 | coh->DefineSection(1,0.5,85.-shift,247.25-shift); | |
769 | // | |
770 | TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1); | |
771 | // | |
772 | ys = shift*TMath::Sin(openingAngle); | |
773 | xs = shift*TMath::Cos(openingAngle); | |
774 | cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.)); | |
775 | // | |
776 | // Sector as an Assembly | |
777 | // | |
778 | TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC"); | |
779 | swhs->AddNode(swv,1); | |
780 | swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5)); | |
781 | swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5)); | |
782 | // | |
783 | // SSW as an Assembly of sectors | |
784 | // | |
785 | TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL"); | |
786 | for(Int_t i =0;i<18;i++){ | |
787 | Double_t phi = (20.*i); | |
788 | TGeoRotation *r = new TGeoRotation(); | |
789 | r->RotateZ(phi); | |
790 | swheel->AddNode(swhs,i+1,r); | |
791 | } | |
792 | v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6)); | |
793 | v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6)); | |
794 | ||
795 | // sensitive strips - strip "0" is always set | |
796 | // conditional | |
797 | Int_t totrows; | |
798 | totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp(); | |
799 | Double_t *upar; | |
800 | upar=NULL; | |
801 | gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar); | |
802 | upar=new Double_t [10]; | |
803 | upar[0]=0.; | |
804 | upar[1]=360.; | |
805 | upar[2]=18.; | |
806 | upar[3]=2.; | |
807 | // | |
808 | upar[4]=-124.8; | |
809 | upar[7]=124.8; | |
810 | ||
811 | Double_t rlow=fTPCParam->GetPadRowRadiiLow(0); | |
812 | ||
813 | upar[5]=rlow; | |
814 | upar[6]=rlow+.01; | |
815 | upar[8]=upar[5]; | |
816 | upar[9]=upar[6]; | |
817 | // | |
818 | gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10); | |
819 | gGeoManager->Node("TPC_Strip",totrows+1, | |
820 | "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10); | |
821 | // | |
822 | // now, strips optionally | |
823 | // | |
824 | if(fSens){ | |
825 | //lower sectors | |
826 | for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){ | |
827 | rlow=fTPCParam->GetPadRowRadiiLow(i-1); | |
828 | upar[5]=rlow; | |
829 | upar[6]=rlow+.01; | |
830 | upar[8]=upar[5]; | |
831 | upar[9]=upar[6]; | |
832 | gGeoManager->Node("TPC_Strip",i, | |
833 | "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10); | |
834 | gGeoManager->Node("TPC_Strip",totrows+i, | |
835 | "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10); | |
836 | } | |
837 | //upper sectors | |
838 | for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){ | |
839 | rlow=fTPCParam->GetPadRowRadiiUp(i-1); | |
840 | upar[5]=rlow; | |
841 | upar[6]=rlow+.01; | |
842 | upar[8]=upar[5]; | |
843 | upar[9]=upar[6]; | |
844 | gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(), | |
845 | "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10); | |
846 | gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(), | |
847 | "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10); | |
848 | } | |
849 | }//strips | |
850 | //---------------------------------------------------------- | |
851 | // TPc Support Rods - MAKROLON | |
852 | //---------------------------------------------------------- | |
853 | TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon"); | |
854 | TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu"); | |
78134e48 | 855 | TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina"); |
856 | TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek"); | |
857 | TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water"); | |
457e2170 | 858 | // upper and lower rods differ in length! |
859 | delete [] upar; | |
860 | upar=NULL; | |
861 | gGeoManager->Volume("TPC_Rod","TUBE",m6->GetId(),upar); | |
862 | upar=new Double_t [3]; | |
863 | upar[0]=1.8; | |
864 | upar[1]=2.2; | |
865 | ||
866 | // | |
867 | //HV rods - makrolon + 0.58cm (diameter) Cu | |
868 | TGeoTube *hvr = new TGeoTube(0.,2.2,126.64); | |
869 | TGeoTube *hvc = new TGeoTube(0.,0.29,126.64); | |
870 | // | |
871 | TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6); | |
872 | TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7); | |
873 | hvrv->AddNode(hvcv,1); | |
78134e48 | 874 | // |
875 | // resistor rods | |
876 | // | |
877 | TGeoTube *cri = new TGeoTube(0.,0.45,126.64); //inner | |
878 | TGeoTube *cro = new TGeoTube(0.,0.45,126.54); //outer | |
879 | TGeoTube *cwi = new TGeoTube(0.,0.15,126.64); // water inner | |
880 | TGeoTube *cwo = new TGeoTube(0.,0.15,126.54); // water outer | |
881 | // | |
882 | TGeoVolume *criv = new TGeoVolume("TPC_CR_I",cri,m10); | |
883 | TGeoVolume *crov = new TGeoVolume("TPC_CR_O",cro,m10); | |
884 | TGeoVolume *cwiv = new TGeoVolume("TPC_W_I",cwi,m11); | |
885 | TGeoVolume *cwov = new TGeoVolume("TPC_W_O",cwo,m11); | |
886 | // | |
887 | // ceramic rod with water | |
888 | // | |
889 | criv->AddNode(cwiv,1); | |
890 | crov->AddNode(cwov,1); | |
891 | // | |
892 | TGeoTube *pri =new TGeoTube(0.2,0.35,126.64); //inner | |
893 | TGeoTube *pro = new TGeoTube(0.2,0.35,126.54); //outer | |
894 | // | |
895 | // peek rod | |
896 | // | |
897 | TGeoVolume *priv = new TGeoVolume("TPC_PR_I",pri,m12); | |
898 | TGeoVolume *prov = new TGeoVolume("TPC_PR_O",pro,m12); | |
899 | // | |
900 | // resistor rods assembly | |
901 | // | |
be53328e | 902 | TGeoRotation *rotr = new TGeoRotation("rotr"); |
903 | rotr->RotateZ(-21.); | |
78134e48 | 904 | // |
905 | TGeoTube *rri = new TGeoTube(1.8,2.2,126.64);//inner | |
906 | TGeoTube *rro = new TGeoTube(1.8,2.2,126.54);//inner | |
907 | // | |
908 | TGeoVolume *rriv = new TGeoVolume("TPC_RR_I",rri,m6); | |
909 | TGeoVolume *rrov = new TGeoVolume("TPC_RR_O",rro,m6); | |
910 | // | |
a3d2be59 | 911 | TGeoVolumeAssembly *rrin = new TGeoVolumeAssembly("TPC_RROD_I"); |
912 | TGeoVolumeAssembly *rrou = new TGeoVolumeAssembly("TPC_RROD_O"); | |
913 | rrin->AddNode(rriv,1); | |
914 | rrin->AddNode(criv,1,new TGeoTranslation(0.5,0.866, 0.)); | |
915 | rrin->AddNode(criv,2,new TGeoTranslation(0.5,-0.866, 0.)); | |
916 | rrin->AddNode(priv,1); | |
917 | // | |
918 | rrou->AddNode(rrov,1); | |
919 | rrou->AddNode(crov,1,new TGeoTranslation(0.5,0.866, 0.)); | |
920 | rrou->AddNode(crov,2,new TGeoTranslation(0.5,-0.866, 0.)); | |
921 | rrou->AddNode(prov,1); | |
457e2170 | 922 | for(Int_t i=0;i<18;i++){ |
923 | Double_t angle,x,y; | |
924 | Double_t z,r; | |
925 | angle=TMath::DegToRad()*20.*(Double_t)i; | |
926 | r=81.5; | |
927 | x=r * TMath::Cos(angle); | |
928 | y=r * TMath::Sin(angle); | |
929 | upar[2]=126.64; //lower | |
930 | z= 126.96; | |
78134e48 | 931 | // |
932 | if(i==3){ | |
be53328e | 933 | v9->AddNode(rrin,1,new TGeoCombiTrans(x,y,z,rotr)); //A |
934 | v9->AddNode(rrin,2,new TGeoCombiTrans(x,y,-z,rotr)); //C | |
78134e48 | 935 | } |
936 | else { | |
937 | gGeoManager->Node("TPC_Rod",i+1,"TPC_Drift",x,y,z,0,kTRUE,upar,3);//shaft | |
938 | gGeoManager->Node("TPC_Rod",i+19,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon | |
457e2170 | 939 | } |
78134e48 | 940 | |
941 | ||
942 | // | |
457e2170 | 943 | r=254.25; |
944 | x=r * TMath::Cos(angle); | |
945 | y=r * TMath::Sin(angle); | |
946 | upar[2]=126.54; //upper | |
947 | z=127.06; | |
78134e48 | 948 | if(i==15){ |
39ae7605 | 949 | //v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z));//A-side only |
950 | v9->AddNode(hvrv,1,new TGeoTranslation(x,y,127.14));//A-side only | |
78134e48 | 951 | gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3); |
952 | } | |
953 | else if(i==11){ | |
be53328e | 954 | v9->AddNode(rrou,1,new TGeoCombiTrans(x,y,z,rotr)); //A |
955 | v9->AddNode(rrou,2,new TGeoCombiTrans(x,y,-z,rotr)); //C | |
78134e48 | 956 | } |
957 | else{ | |
958 | // | |
959 | gGeoManager->Node("TPC_Rod",i+37,"TPC_Drift",x,y,z,0,kTRUE,upar,3); | |
960 | gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3); | |
961 | } | |
457e2170 | 962 | } |
963 | ||
964 | TGeoVolume *alice = gGeoManager->GetVolume("ALIC"); | |
965 | alice->AddNode(v1,1); | |
966 | ||
967 | } // end of function | |
968 | ||
969 | //_____________________________________________________________________________ | |
970 | void AliTPCv4::AddAlignableVolumes() const | |
971 | { | |
972 | // | |
973 | // Create entries for alignable volumes associating the symbolic volume | |
974 | // name with the corresponding volume path. Needs to be syncronized with | |
975 | // eventual changes in the geometry. | |
976 | // | |
977 | SetInnerChambersAlignable(); | |
978 | SetOuterChambersAlignable(); | |
979 | } | |
980 | ||
981 | //_____________________________________________________________________________ | |
982 | void AliTPCv4::SetInnerChambersAlignable() const | |
983 | { | |
984 | // | |
985 | Int_t modnum = 0; | |
986 | TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_"; | |
987 | TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_"; | |
988 | TString vpappend = "/TPC_IROC_1"; | |
989 | TString snstr1="TPC/EndcapA/Sector"; | |
990 | TString snstr2="TPC/EndcapC/Sector"; | |
991 | TString snappend="/InnerChamber"; | |
992 | TString volpath, symname; | |
993 | ||
994 | for(Int_t cnt=1; cnt<=18; cnt++){ | |
995 | volpath = vpstr1; | |
996 | volpath += cnt; | |
997 | volpath += vpappend; | |
998 | symname = snstr1; | |
999 | symname += cnt; | |
1000 | symname += snappend; | |
1001 | if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data())) | |
1002 | AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data())); | |
1003 | // | |
1004 | TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data()); | |
1005 | const char *path = alignableEntry->GetTitle(); | |
1006 | if (!gGeoManager->cd(path)) | |
1007 | AliFatal(Form("Volume path %s not valid!",path)); | |
1008 | TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix(); | |
1009 | TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1); | |
1010 | alignableEntry->SetMatrix(matTtoL); | |
1011 | modnum++; | |
1012 | } | |
1013 | ||
1014 | for(Int_t cnt=1; cnt<=18; cnt++){ | |
1015 | volpath = vpstr2; | |
1016 | volpath += cnt; | |
1017 | volpath += vpappend; | |
1018 | symname = snstr2; | |
1019 | symname += cnt; | |
1020 | symname += snappend; | |
1021 | if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data())) | |
1022 | AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data())); | |
1023 | TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data()); | |
1024 | const char *path = alignableEntry->GetTitle(); | |
1025 | if (!gGeoManager->cd(path)) | |
1026 | AliFatal(Form("Volume path %s not valid!",path)); | |
1027 | TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix(); | |
1028 | TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1); | |
1029 | alignableEntry->SetMatrix(matTtoL); | |
1030 | modnum++; | |
1031 | } | |
1032 | } | |
1033 | ||
1034 | //_____________________________________________________________________________ | |
1035 | void AliTPCv4::SetOuterChambersAlignable() const | |
1036 | { | |
1037 | // | |
1038 | Int_t modnum = 0; | |
1039 | TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_"; | |
1040 | TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_"; | |
1041 | TString vpappend = "/TPC_OROC_1"; | |
1042 | TString snstr1="TPC/EndcapA/Sector"; | |
1043 | TString snstr2="TPC/EndcapC/Sector"; | |
1044 | TString snappend="/OuterChamber"; | |
1045 | TString volpath, symname; | |
1046 | ||
1047 | for(Int_t cnt=1; cnt<=18; cnt++){ | |
1048 | volpath = vpstr1; | |
1049 | volpath += cnt; | |
1050 | volpath += vpappend; | |
1051 | symname = snstr1; | |
1052 | symname += cnt; | |
1053 | symname += snappend; | |
1054 | if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data())) | |
1055 | AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data())); | |
1056 | TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data()); | |
1057 | const char *path = alignableEntry->GetTitle(); | |
1058 | if (!gGeoManager->cd(path)) | |
1059 | AliFatal(Form("Volume path %s not valid!",path)); | |
1060 | TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix(); | |
1061 | TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1); | |
1062 | alignableEntry->SetMatrix(matTtoL); | |
1063 | modnum++; | |
1064 | } | |
1065 | ||
1066 | for(Int_t cnt=1; cnt<=18; cnt++){ | |
1067 | volpath = vpstr2; | |
1068 | volpath += cnt; | |
1069 | volpath += vpappend; | |
1070 | symname = snstr2; | |
1071 | symname += cnt; | |
1072 | symname += snappend; | |
1073 | if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data())) | |
1074 | AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data())); | |
1075 | TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data()); | |
1076 | const char *path = alignableEntry->GetTitle(); | |
1077 | if (!gGeoManager->cd(path)) | |
1078 | AliFatal(Form("Volume path %s not valid!",path)); | |
1079 | TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix(); | |
1080 | TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1); | |
1081 | alignableEntry->SetMatrix(matTtoL); | |
1082 | modnum++; | |
1083 | } | |
1084 | } | |
1085 | ||
457e2170 | 1086 | |
1087 | //_____________________________________________________________________________ | |
1088 | void AliTPCv4::CreateMaterials() | |
1089 | { | |
1090 | // | |
1091 | // Define materials for version 2 of the Time Projection Chamber | |
1092 | // | |
1093 | ||
1094 | AliTPC::CreateMaterials(); | |
1095 | } | |
1096 | ||
1097 | //_____________________________________________________________________________ | |
1098 | void AliTPCv4::Init() | |
1099 | { | |
1100 | // | |
1101 | // Initialises version 2 of the TPC after that it has been built | |
1102 | // | |
1103 | ||
8d888a91 | 1104 | //Int_t *idtmed = fIdtmed->GetArray(); |
457e2170 | 1105 | |
1106 | AliTPC::Init(); | |
1107 | ||
1108 | ||
1109 | fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected... | |
1110 | ||
1111 | fIDrift=gMC->VolId("TPC_Drift"); | |
1112 | fSecOld=-100; // fake number | |
1113 | ||
d9888f70 | 1114 | gMC->SetMaxNStep(-30000); // max. number of steps increased |
457e2170 | 1115 | |
098dfc1a | 1116 | // specific energy loss set in galice.cuts |
457e2170 | 1117 | |
1118 | AliInfo("*** TPC version 4 initialized ***"); | |
1119 | AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep())); | |
1120 | ||
1121 | // | |
1122 | ||
1123 | } | |
1124 | ||
1125 | //_____________________________________________________________________________ | |
1126 | void AliTPCv4::StepManager() | |
1127 | { | |
1128 | // | |
1129 | // Called for every step in the Time Projection Chamber | |
1130 | // | |
1131 | ||
1132 | // | |
1133 | // parameters used for the energy loss calculations | |
1134 | // | |
1135 | const Float_t kprim = 14.35; // number of primary collisions per 1 cm | |
1136 | const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2 | |
1137 | const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation | |
1138 | ||
1139 | ||
1140 | const Float_t kbig = 1.e10; | |
1141 | ||
1142 | Int_t id,copy; | |
1143 | Float_t hits[5]; | |
1144 | Int_t vol[2]; | |
1145 | TLorentzVector p; | |
1146 | ||
1147 | vol[1]=0; // preset row number to 0 | |
1148 | // | |
1149 | gMC->SetMaxStep(kbig); | |
1150 | ||
1151 | ||
1152 | ||
1153 | Float_t charge = gMC->TrackCharge(); | |
1154 | ||
1155 | if(TMath::Abs(charge)<=0.) return; // take only charged particles | |
1156 | ||
1157 | // check the sensitive volume | |
1158 | ||
1159 | id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!) | |
1160 | if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume | |
1161 | ||
1162 | gMC->TrackPosition(p); | |
1163 | Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]); | |
1164 | // | |
1165 | ||
1166 | // | |
1167 | Double_t angle = TMath::ACos(p[0]/r); | |
1168 | angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle; | |
1169 | // | |
1170 | // angular segment, it is not a real sector number... | |
1171 | // | |
1172 | Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/ | |
1173 | fTPCParam->GetInnerAngle()); | |
1174 | // rotate to segment "0" | |
1175 | Float_t cos,sin; | |
1176 | fTPCParam->AdjustCosSin(sector,cos,sin); | |
1177 | Float_t x1=p[0]*cos + p[1]*sin; | |
1178 | // check if within sector's limits | |
5bd5dbc4 | 1179 | if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp()) |
1180 | ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){ | |
457e2170 | 1181 | // calculate real sector number... |
1182 | if (x1>fTPCParam->GetOuterRadiusLow()){ | |
1183 | sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/ | |
1184 | fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector(); | |
1185 | if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1); | |
1186 | } | |
1187 | else | |
1188 | if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1); | |
1189 | // | |
1190 | // here I have a sector number | |
1191 | // | |
1192 | ||
1193 | vol[0]=sector; | |
1194 | // check if change of sector | |
1195 | if(sector != fSecOld){ | |
1196 | fSecOld=sector; | |
1197 | // add track reference | |
20527578 | 1198 | AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber()); |
457e2170 | 1199 | } |
1200 | // track is in the sensitive strip | |
1201 | if(id == fIdSens){ | |
1202 | // track is entering the strip | |
1203 | if (gMC->IsTrackEntering()){ | |
1204 | Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp(); | |
1205 | vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows; | |
1206 | // row numbers are autonomous for lower and upper sectors | |
1207 | if(vol[0] > fTPCParam->GetNInnerSector()) { | |
1208 | vol[1] -= fTPCParam->GetNRowLow(); | |
1209 | } | |
1210 | // | |
1211 | if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){ | |
1212 | ||
1213 | // lower sector, row 0, because Jouri wants to have this | |
1214 | ||
1215 | gMC->TrackMomentum(p); | |
1216 | hits[0]=p[0]; | |
1217 | hits[1]=p[1]; | |
1218 | hits[2]=p[2]; | |
1219 | hits[3]=0.; // this hit has no energy loss | |
1220 | // Get also the track time for pileup simulation | |
1221 | hits[4]=gMC->TrackTime(); | |
1222 | ||
1223 | AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); | |
1224 | } | |
1225 | // | |
1226 | ||
1227 | gMC->TrackPosition(p); | |
1228 | hits[0]=p[0]; | |
1229 | hits[1]=p[1]; | |
1230 | hits[2]=p[2]; | |
1231 | hits[3]=0.; // this hit has no energy loss | |
1232 | // Get also the track time for pileup simulation | |
1233 | hits[4]=gMC->TrackTime(); | |
1234 | ||
1235 | AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); | |
1236 | ||
1237 | } | |
1238 | else return; | |
1239 | } | |
1240 | //----------------------------------------------------------------- | |
1241 | // charged particle is in the sensitive drift volume | |
1242 | //----------------------------------------------------------------- | |
1243 | ||
1244 | if(gMC->TrackStep() > 0){ | |
1245 | ||
1246 | Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; | |
20527578 | 1247 | nel=TMath::Min(nel,30); // 30 electrons corresponds to 1 keV |
457e2170 | 1248 | // |
1249 | gMC->TrackPosition(p); | |
1250 | hits[0]=p[0]; | |
1251 | hits[1]=p[1]; | |
1252 | hits[2]=p[2]; | |
1253 | hits[3]=(Float_t)nel; | |
1254 | ||
1255 | // Add this hit | |
1256 | ||
1257 | if (fHitType&&2){ | |
1258 | gMC->TrackMomentum(p); | |
1259 | Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]); | |
1260 | Float_t precision = (momentum>0.1) ? 0.002 :0.01; | |
1261 | fTrackHits->SetHitPrecision(precision); | |
1262 | } | |
1263 | ||
1264 | // Get also the track time for pileup simulation | |
1265 | hits[4]=gMC->TrackTime(); | |
1266 | ||
1267 | AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); | |
1268 | ||
1269 | } // step>0 | |
1270 | } //within sector's limits | |
1271 | // Stemax calculation for the next step | |
1272 | if(!gMC->IsTrackAlive()) return; // particle has disappeared | |
1273 | Float_t pp; | |
1274 | TLorentzVector mom; | |
1275 | gMC->TrackMomentum(mom); | |
1276 | Float_t ptot=mom.Rho(); | |
1277 | Float_t betaGamma = ptot/gMC->TrackMass(); | |
1278 | ||
1279 | Int_t pid=gMC->TrackPid(); | |
1280 | if((pid==kElectron || pid==kPositron) && ptot > 0.002) | |
1281 | { | |
1282 | pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau! | |
1283 | } | |
1284 | else | |
1285 | { | |
1286 | ||
1287 | betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg | |
b40afa5e | 1288 | pp=kprim*AliMathBase::BetheBlochAleph(betaGamma); |
457e2170 | 1289 | |
1290 | if(TMath::Abs(charge) > 1.) pp *= (charge*charge); | |
1291 | } | |
1292 | ||
1293 | Double_t rnd = gMC->GetRandom()->Rndm(); | |
1294 | ||
1295 | gMC->SetMaxStep(-TMath::Log(rnd)/pp); | |
1296 | ||
1297 | ||
1298 | } | |
1299 |