1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 ///////////////////////////////////////////////////////////////////////////////
21 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
25 <img src="picts/AliTPCv2Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
34 #include <TLorentzVector.h>
38 #include "AliMathBase.h"
39 #include "AliTrackReference.h"
40 #include "AliTPCParam.h"
41 #include "AliTPCTrackHitsV2.h"
43 #include "AliGeomManager.h"
44 #include "TGeoVolume.h"
49 #include "TGeoCompositeShape.h"
51 #include "TGeoPhysicalNode.h"
52 #include "TGeoHalfSpace.h"
53 #include "TTreeStream.h"
57 //_____________________________________________________________________________
58 AliTPCv2::AliTPCv2(const char *name, const char *title) :
65 // Standard constructor for Time Projection Chamber version 2
69 SetBufferSize(128000);
73 // fTPCParam->Write(fTPCParam->GetTitle());
76 //_____________________________________________________________________________
77 void AliTPCv2::CreateGeometry()
80 // Create the geometry of Time Projection Chamber version 2
84 <img src="picts/AliTPC.gif">
89 <img src="picts/AliTPCv2Tree.gif">
93 //----------------------------------------------------------
94 // This geometry is written using TGeo class
95 // Firstly the shapes are defined, and only then the volumes
96 // What is recognized by the MC are volumes
97 //----------------------------------------------------------
99 // tpc - this will be the mother volume
103 // here I define a volume TPC
104 // retrive the medium name with "TPC_" as a leading string
106 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
108 tpc->DefineSection(0,-289.6,77.,278.);
109 tpc->DefineSection(1,-262.1,77.,278.);
111 tpc->DefineSection(2,-262.1,83.1,278.);
112 tpc->DefineSection(3,-260.,83.1,278.);
114 tpc->DefineSection(4,-260.,70.,278.);
115 tpc->DefineSection(5,-259.6,70.,278.);
117 tpc->DefineSection(6,-259.6,68.1,278.);
118 tpc->DefineSection(7,-253.6,68.1,278.);
120 tpc->DefineSection(8,-253.6,68.,278.);
121 tpc->DefineSection(9,-74.0,60.8,278.);
123 tpc->DefineSection(10,-74.0,60.1,278.);
124 tpc->DefineSection(11,-73.3,60.1,278.);
126 tpc->DefineSection(12,-73.3,56.9,278.);
127 tpc->DefineSection(13,-68.5,56.9,278.);
129 tpc->DefineSection(14,-68.5,60.,278.);
130 tpc->DefineSection(15,-64.7,60.,278.);
132 tpc->DefineSection(16,-64.7,56.9,278.);
133 tpc->DefineSection(17,73.3,56.9,278.);
135 tpc->DefineSection(18,73.3,60.1,278.);
136 tpc->DefineSection(19,74.0,60.1,278.);
138 tpc->DefineSection(20,74.0,60.8,278.);
139 tpc->DefineSection(21,253.6,65.5,278.);
141 tpc->DefineSection(22,253.6,65.6,278.);
142 tpc->DefineSection(23,259.6,65.6,278.);
144 tpc->DefineSection(24,259.6,70.0,278.);
145 tpc->DefineSection(25,260.,70.0,278.);
147 tpc->DefineSection(26,260.,83.1,278.);
148 tpc->DefineSection(27,262.1,83.1,278.);
150 tpc->DefineSection(28,262.1,77.,278);
151 tpc->DefineSection(29,289.6,77.,278.);
153 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
154 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
156 // drift volume - sensitive volume, extended beyond the
157 // endcaps, because of the alignment
159 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
160 dvol->DefineSection(0,-260.,74.5,264.4);
161 dvol->DefineSection(1,-253.6,74.5,264.4);
163 dvol->DefineSection(2,-253.6,76.6774,258.);
164 dvol->DefineSection(3,253.6,76.6774,258.);
166 dvol->DefineSection(4,253.6,74.5,264.4);
167 dvol->DefineSection(5,260.,74.5,264.4);
169 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-2");
170 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
176 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
178 tpco->DefineSection(0,-256.6,264.8,278.);
179 tpco->DefineSection(1,-253.6,264.8,278.);
181 tpco->DefineSection(2,-253.6,258.,278.);
182 tpco->DefineSection(3,250.6,258.,278.);
184 tpco->DefineSection(4,250.6,258.,275.5);
185 tpco->DefineSection(5,253.6,258.,275.5);
187 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
188 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
190 TGeoRotation *segrot;//segment rotations
192 // outer containment vessel
194 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
196 tocv->DefineSection(0,-256.6,264.8,278.);
197 tocv->DefineSection(1,-253.6,264.8,278.);
199 tocv->DefineSection(2,-253.6,274.8124,278.);
200 tocv->DefineSection(3,247.6,274.8124,278.);
202 tocv->DefineSection(4,247.6,270.4,278.);
203 tocv->DefineSection(5,250.6,270.4,278.);
205 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
206 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
208 TGeoTubeSeg *to1 = new TGeoTubeSeg(274.8174,277.995,252.1,0.,59.9); //epoxy
209 TGeoTubeSeg *to2 = new TGeoTubeSeg(274.8274,277.985,252.1,0.,59.9); //tedlar
210 TGeoTubeSeg *to3 = new TGeoTubeSeg(274.8312,277.9812,252.1,0.,59.9);//prepreg2
211 TGeoTubeSeg *to4 = new TGeoTubeSeg(274.9062,277.9062,252.1,0.,59.9);//nomex
212 TGeoTubeSeg *tog5 = new TGeoTubeSeg(274.8174,277.995,252.1,59.9,60.);//epoxy
214 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
215 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
216 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
217 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
219 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
220 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
221 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
222 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
223 TGeoVolume *togv5 = new TGeoVolume("TPC_OCVG5",tog5,sm1);
224 //-------------------------------------------------------
225 // Tpc Outer Field Cage
226 // daughters - composite (sandwich)
227 //-------------------------------------------------------
229 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
231 tofc->DefineSection(0,-253.6,258.,269.6);
232 tofc->DefineSection(1,-250.6,258.,269.6);
234 tofc->DefineSection(2,-250.6,258.,260.0676);
235 tofc->DefineSection(3,250.6,258.,260.0676);
237 tofc->DefineSection(4,250.6,258.,275.5);
238 tofc->DefineSection(5,253.6,258.,275.5);
240 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
242 TGeoTubeSeg *tf1 = new TGeoTubeSeg(258.0,260.0676,252.1,0.,59.9); //tedlar
243 TGeoTubeSeg *tf2 = new TGeoTubeSeg(258.0038,260.0638,252.1,0.,59.9); //prepreg3
244 TGeoTubeSeg *tf3 = new TGeoTubeSeg(258.0338,260.0338,252.1,0.,59.9);//nomex
245 TGeoTubeSeg *tfg4 = new TGeoTubeSeg(258.0,260.0676,252.1,59.9,60.); //epoxy glue
247 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
249 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
250 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
251 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
252 TGeoVolume *tfg4v = new TGeoVolume("TPC_OFCG4",tfg4,sm1);
254 // outer part - positioning
256 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);//ocv
258 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);//ofc
260 TGeoVolumeAssembly *t200 = new TGeoVolumeAssembly("TPC_OCVSEG");
261 TGeoVolumeAssembly *t300 = new TGeoVolumeAssembly("TPC_OFCSEG");
263 // assembly OCV and OFC
266 t200->AddNode(tov1,1); t200->AddNode(togv5,1);
267 t300->AddNode(tf1v,1); t300->AddNode(tfg4v,1);
268 // 2nd - rotation 60 deg
269 segrot = new TGeoRotation();
270 segrot->RotateZ(60.);
271 t200->AddNode(tov1,2,segrot); t200->AddNode(togv5,2,segrot);
272 t300->AddNode(tf1v,2,segrot); t300->AddNode(tfg4v,2,segrot);
273 // 3rd rotation 120 deg
274 segrot = new TGeoRotation();
275 segrot->RotateZ(120.);
276 t200->AddNode(tov1,3,segrot); t200->AddNode(togv5,3,segrot);
277 t300->AddNode(tf1v,3,segrot); t300->AddNode(tfg4v,3,segrot);
278 //4th rotation 180 deg
279 segrot = new TGeoRotation();
280 segrot->RotateZ(180.);
281 t200->AddNode(tov1,4,segrot); t200->AddNode(togv5,4,segrot);
282 t300->AddNode(tf1v,4,segrot); t300->AddNode(tfg4v,4,segrot);
283 //5th rotation 240 deg
284 segrot = new TGeoRotation();
285 segrot->RotateZ(240.);
286 t200->AddNode(tov1,5,segrot); t200->AddNode(togv5,5,segrot);
287 t300->AddNode(tf1v,5,segrot); t300->AddNode(tfg4v,5,segrot);
288 //6th rotation 300 deg
289 segrot = new TGeoRotation();
290 segrot->RotateZ(300.);
291 t200->AddNode(tov1,6,segrot); t200->AddNode(togv5,6,segrot);
292 t300->AddNode(tf1v,6,segrot); t300->AddNode(tfg4v,6,segrot);
294 v3->AddNode(t200,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(t300,1);
296 v2->AddNode(v3,1); v2->AddNode(v4,1);
299 //--------------------------------------------------------------------
300 // Tpc Inner INsulator (CO2)
301 // the cones, the central drum and the inner f.c. sandwich with a piece
302 // of the flane will be placed in the TPC
303 //--------------------------------------------------------------------
304 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
306 tpci->DefineSection(0,-253.6,68.4,76.6774);
307 tpci->DefineSection(1,-74.0,61.2,76.6774);
309 tpci->DefineSection(2,74.0,61.2,76.6774);
311 tpci->DefineSection(3,253.6,65.9,76.6774);
313 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
315 // now the inner field cage - only part of flanges (2 copies)
317 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
318 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
320 //---------------------------------------------------------
321 // Tpc Inner Containment vessel - Muon side
322 //---------------------------------------------------------
323 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
325 tcms->DefineSection(0,-259.1,68.1,74.2);
326 tcms->DefineSection(1,-253.6,68.1,74.2);
328 tcms->DefineSection(2,-253.6,68.1,68.4);
329 tcms->DefineSection(3,-74.0,60.9,61.2);
331 tcms->DefineSection(4,-74.0,60.1,61.2);
332 tcms->DefineSection(5,-73.3,60.1,61.2);
334 tcms->DefineSection(6,-73.3,56.9,61.2);
335 tcms->DefineSection(7,-73.0,56.9,61.2);
337 tcms->DefineSection(8,-73.0,56.9,58.8);
338 tcms->DefineSection(9,-71.3,56.9,58.8);
340 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
341 //-----------------------------------------------
342 // inner containment vessel - shaft side
343 //-----------------------------------------------
344 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
346 tcss->DefineSection(0,71.3,56.9,58.8);
347 tcss->DefineSection(1,73.0,56.9,58.8);
349 tcss->DefineSection(2,73.0,56.9,61.2);
350 tcss->DefineSection(3,73.3,56.9,61.2);
352 tcss->DefineSection(4,73.3,60.1,61.2);
353 tcss->DefineSection(5,74.0,60.1,61.2);
355 tcss->DefineSection(6,74.0,60.9,61.2);
356 tcss->DefineSection(7,253.6,65.6,65.9);
358 tcss->DefineSection(8,253.6,65.6,74.2);
359 tcss->DefineSection(9,258.1,65.6,74.2);
361 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
362 //-----------------------------------------------
364 // define 4 parts and make an assembly
365 //-----------------------------------------------
366 // part1 - Al - 2 copies
367 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
368 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
369 // sandwich - outermost parts - 2 copies
373 TGeoTubeSeg *t2 = new TGeoTubeSeg(76.6774,78.845,74.175,350.,109.4); // tedlar 38 microns
374 TGeoTubeSeg *t3 = new TGeoTubeSeg(76.6812,78.8412,74.175,350.,109.4); // prepreg2 500 microns
375 TGeoTubeSeg *t4 = new TGeoTubeSeg(76.7312,78.7912,74.175,350.,109.4); // prepreg3 300 microns
376 TGeoTubeSeg *t5 = new TGeoTubeSeg(76.7612,78.7612,74.175,350.,109.4); // nomex 2 cm
377 TGeoTubeSeg *tepox1 = new TGeoTubeSeg(76.6774,78.845,74.175,109.4,110.);//epoxy
378 TGeoTubeSeg *tpr1 = new TGeoTubeSeg(78.845,78.885,74.175,109.,111.);
380 // volumes for the outer part
381 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
382 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
383 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
384 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
385 TGeoVolume *tvep1 = new TGeoVolume("TPC_IFEPOX1",tepox1,sm1);
386 TGeoVolume *tvpr1 = new TGeoVolume("TPC_PRSTR1",tpr1,sm2);
388 // middle parts - 2 copies
392 TGeoTubeSeg *t6 = new TGeoTubeSeg(76.6774,78.795,5.,350.,109.4); // tedlar 38 microns
393 TGeoTubeSeg *t7 = new TGeoTubeSeg(76.6812,78.7912,5.,350.,109.4); // prepreg2 250 microns
394 TGeoTubeSeg *t8 = new TGeoTubeSeg(76.7062,78.7662,5.,350.,109.4); // prepreg3 300 microns
395 TGeoTubeSeg *t9 = new TGeoTubeSeg(76.7362,78.7362,5.,350.,109.4); // nomex 2 cm
396 TGeoTubeSeg *tepox2 = new TGeoTubeSeg(76.6774,78.795,5.,109.4,110.);//epoxy
397 TGeoTubeSeg *tpr2 = new TGeoTubeSeg(78.795,78.835,5.,109.,111.);
398 // volumes for the middle part
399 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
400 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
401 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
402 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
403 TGeoVolume *tvep2 = new TGeoVolume("TPC_IFEPOX2",tepox2,sm1);
404 TGeoVolume *tvpr2 = new TGeoVolume("TPC_PRSTR2",tpr2,sm2);
405 // central part - 1 copy
407 // segment central part
409 TGeoTubeSeg *t10 = new TGeoTubeSeg(76.6774,78.785,93.75,350.,109.4); // tedlar 38 microns
410 TGeoTubeSeg *t11 = new TGeoTubeSeg(76.6812,78.7812,93.75,350.,109.4); // prepreg3 500 microns
411 TGeoTubeSeg *t12 = new TGeoTubeSeg(76.7312,78.7312,93.75,350.,109.4); // nomex 2 cm
412 TGeoTubeSeg *tepox3 = new TGeoTubeSeg(76.6774,78.785,93.75,109.4,110.);//epoxy
413 TGeoTubeSeg *tpr3 = new TGeoTubeSeg(78.785,78.825,93.75,109.,111.);
414 // volumes for the central part
415 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
416 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
417 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
418 TGeoVolume *tvep3 = new TGeoVolume("TPC_IFEPOX3",tepox3,sm1);
419 TGeoVolume *tvpr3 = new TGeoVolume("TPC_PRSTR3",tpr3,sm2);
421 // creating a sandwich for the outer par,t tv2 is the mother
423 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
425 // creating a sandwich for the middle part, tv6 is the mother
427 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
429 // creating a sandwich for the central part, tv10 is the mother
431 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
433 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC"); // ifc itself - 3 segments
436 // first segment - no rotation
439 tv100->AddNode(tv10,1); //sandwich
440 tv100->AddNode(tvep3,1);//epoxy
441 tv100->AddNode(tvpr3,1);//prepreg strip
443 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75)); //sandwich1
444 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75)); // sandwich2
445 tv100->AddNode(tvep2,1,new TGeoTranslation(0.,0.,-98.75)); //epoxy
446 tv100->AddNode(tvep2,2,new TGeoTranslation(0.,0.,98.75)); //epoxy
447 tv100->AddNode(tvpr2,1,new TGeoTranslation(0.,0.,-98.75));//prepreg strip
448 tv100->AddNode(tvpr2,2,new TGeoTranslation(0.,0.,98.75));
450 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925)); //sandwich
451 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
452 tv100->AddNode(tvep1,1,new TGeoTranslation(0.,0.,-177.925)); //epoxy
453 tv100->AddNode(tvep1,2,new TGeoTranslation(0.,0.,177.925));
454 tv100->AddNode(tvpr1,1,new TGeoTranslation(0.,0.,-177.925));//prepreg strip
455 tv100->AddNode(tvpr1,2,new TGeoTranslation(0.,0.,-177.925));
457 // second segment - rotation 120 deg.
459 segrot = new TGeoRotation();
460 segrot->RotateZ(120.);
463 tv100->AddNode(tv10,2,segrot); //sandwich
464 tv100->AddNode(tvep3,2,segrot);//epoxy
465 tv100->AddNode(tvpr3,2,segrot);//prepreg strip
467 tv100->AddNode(tv6,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
468 tv100->AddNode(tv6,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
469 tv100->AddNode(tvep2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
470 tv100->AddNode(tvep2,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
471 tv100->AddNode(tvpr2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
472 tv100->AddNode(tvpr2,4,new TGeoCombiTrans(0.,0.,98.75,segrot));
474 tv100->AddNode(tv2,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
475 tv100->AddNode(tv2,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
476 tv100->AddNode(tvep1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
477 tv100->AddNode(tvep1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
478 tv100->AddNode(tvpr1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
479 tv100->AddNode(tvpr1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
481 // third segment - rotation 240 deg.
483 segrot = new TGeoRotation();
484 segrot->RotateZ(240.);
487 tv100->AddNode(tv10,3,segrot); //sandwich
488 tv100->AddNode(tvep3,3,segrot);//epoxy
489 tv100->AddNode(tvpr3,3,segrot);//prepreg strip
491 tv100->AddNode(tv6,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
492 tv100->AddNode(tv6,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
493 tv100->AddNode(tvep2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
494 tv100->AddNode(tvep2,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
495 tv100->AddNode(tvpr2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
496 tv100->AddNode(tvpr2,6,new TGeoCombiTrans(0.,0.,98.75,segrot));
498 tv100->AddNode(tv2,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
499 tv100->AddNode(tv2,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
500 tv100->AddNode(tvep1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
501 tv100->AddNode(tvep1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
502 tv100->AddNode(tvpr1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
503 tv100->AddNode(tvpr1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
505 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
506 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
508 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
509 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
510 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
511 v9->AddNode(tv100,1);
517 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
518 cfl->DefineSection(0,-71.1,59.7,61.2);
519 cfl->DefineSection(1,-68.6,59.7,61.2);
521 cfl->DefineSection(2,-68.6,60.6124,61.2);
522 cfl->DefineSection(3,68.6,60.6124,61.2);
524 cfl->DefineSection(4,68.6,59.7,61.2);
525 cfl->DefineSection(5,71.1,59.7,61.2);
527 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
529 TGeoTubeSeg *cd1 = new TGeoTubeSeg(60.6224,61.19,71.1,0.1,119.9);
530 TGeoTubeSeg *cd2 = new TGeoTubeSeg(60.6262,61.1862,71.1,0.1,119.9);
531 TGeoTubeSeg *cd3 = new TGeoTubeSeg(60.6462,61.1662,71.1,0.1,119.9);
532 TGeoTubeSeg *cd4 = new TGeoTubeSeg(60.6562,61.1562,71.1,0.1,119.9);
533 TGeoTubeSeg *tepox4 = new TGeoTubeSeg(60.6224,61.19,71.1,359.9,0.1);
534 // TGeoTube *cd1 = new TGeoTube(60.6224,61.19,71.1);
535 // TGeoTube *cd2 = new TGeoTube(60.6262,61.1862,71.1);
536 // TGeoTube *cd3 = new TGeoTube(60.6462,61.1662,71.1);
537 // TGeoTube *cd4 = new TGeoTube(60.6562,61.1562,71.1);
539 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
540 TGeoMedium *sm8 = gGeoManager->GetMedium("TPC_Epoxyfm");
541 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
542 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
543 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm8); //epoxy film
544 TGeoVolume *cd4v = new TGeoVolume("TPC_CDR4",cd4,sm4); //nomex
545 TGeoVolume *tvep4 = new TGeoVolume("TPC_IFEPOX4",tepox4,sm1);
548 // seals for central drum 2 copies
550 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
551 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
552 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
553 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
554 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
557 TGeoPcon *se = new TGeoPcon(0.,360.,6);
558 se->DefineSection(0,-72.8,59.7,61.2);
559 se->DefineSection(1,-72.3,59.7,61.2);
561 se->DefineSection(2,-72.3,58.85,61.2);
562 se->DefineSection(3,-71.6,58.85,61.2);
564 se->DefineSection(4,-71.6,59.7,61.2);
565 se->DefineSection(5,-71.3,59.7,61.2);
567 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
569 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
570 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
572 // define reflection matrix
574 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
576 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cd3v->AddNode(cd4v,1); //sandwich
578 cflv->AddNode(cd1v,1); cflv->AddNode(tvep4,1);
580 segrot = new TGeoRotation();
581 segrot->RotateZ(120.);
582 cflv->AddNode(cd1v,2,segrot); cflv->AddNode(tvep4,2,segrot);
584 segrot = new TGeoRotation();
585 segrot->RotateZ(240.);
586 cflv->AddNode(cd1v,3,segrot); cflv->AddNode(tvep4,3,segrot);
588 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
589 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
590 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
592 // central membrane - 2 rings and a mylar membrane - assembly
594 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
595 TGeoTube *oh = new TGeoTube(250.,256.,0.5);
596 TGeoTube *mem = new TGeoTube(84.05,250.,0.00115);
599 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
601 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
602 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
604 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
606 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
613 // end caps - they are make as an assembly of single segments
614 // containing both readout chambers
616 Double_t openingAngle = 10.*TMath::DegToRad();
617 Double_t thick=1.5; // rib
618 Double_t shift = thick/TMath::Sin(openingAngle);
620 Double_t lowEdge = 86.3; // hole in the wheel
621 Double_t upEdge = 240.4; // hole in the wheel
623 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
625 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
627 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
628 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
630 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
631 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
633 Double_t ys = shift*TMath::Sin(openingAngle);
634 Double_t xs = shift*TMath::Cos(openingAngle);
635 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
636 tr->RegisterYourself();
637 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
638 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
639 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
640 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
641 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
642 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
643 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
645 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
651 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
652 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
654 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
655 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
656 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
658 Double_t tga = (19.8328-12.3742)/39.3;
660 xmin = 9.55*tga+12.3742;
661 xmax = 9.95*tga+12.3742;
662 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
663 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
664 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
665 xmin=19.4*tga+12.3742;
666 xmax=19.9*tga+12.3742;
667 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
668 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
669 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
670 xmin=29.35*tga+12.3742;
671 xmax=29.75*tga+12.3742;
672 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
673 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
674 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
676 // holes for connectors
678 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
679 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
680 TString fileName(gSystem->Getenv("ALICE_ROOT"));
681 fileName += "/TPC/conn_iroc.dat";
683 in.open(fileName.Data(), ios_base::in); // asci file
684 TGeoRotation *rrr[86];
685 for(Int_t i =0;i<86;i++){
690 rrr[i]= new TGeoRotation();
691 rrr[i]->RotateY(ang);
692 ibdv->AddNode(connv,i+1,new TGeoCombiTrans(x,y,z,rrr[i]));
696 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
698 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
699 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
700 tr1->RegisterYourself();
701 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
702 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
704 // pad plane and wire fixations
706 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
707 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
708 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
709 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
710 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
711 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
713 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
715 iroc->AddNode(ibdv,1);
716 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
717 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
718 tga =(23.3521-14.5974)/49.65;
719 Double_t xx = 24.825*tga+14.5974-0.6;
720 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
721 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
725 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
726 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
727 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
728 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
729 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
731 tga=(38.5084-20.2938)/99.3;
732 xmin=tga*10.2+20.2938;
733 xmax=tga*10.6+20.2938;
734 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
735 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
737 xmin=22.55*tga+20.2938;
738 xmax=24.15*tga+20.2938;
739 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
740 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
742 xmin=36.1*tga+20.2938;
743 xmax=36.5*tga+20.2938;
744 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
745 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
747 xmin=49.0*tga+20.2938;
748 xmax=50.6*tga+20.2938;
749 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
750 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
752 xmin=63.6*tga+20.2938;
753 xmax=64.0*tga+20.2938;
754 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
755 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
757 xmin=75.5*tga+20.2938;
758 xmax=77.15*tga+20.2938;
759 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
760 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
762 xmin=88.7*tga+20.2938;
763 xmax=89.1*tga+20.2938;
764 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
765 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
767 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
768 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
769 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
770 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
771 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
772 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
773 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
775 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
776 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
777 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
778 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
779 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
781 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
782 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
783 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
784 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
785 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
787 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
788 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
789 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
790 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
791 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
792 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
793 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
794 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
796 // holes for connectors
798 fileName = gSystem->Getenv("ALICE_ROOT");
799 fileName += "/TPC/conn_oroc.dat";
800 in.open(fileName.Data(), ios_base::in); // asci file
801 TGeoRotation *rr[78];
802 for(Int_t i =0;i<78;i++){
805 Double_t x1,z1,x2,z2;
807 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
808 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
810 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
812 rr[i]= new TGeoRotation();
817 obdv->AddNode(connv,i+1,new TGeoCombiTrans(x1,y,z1,rr[i]));
818 obdv->AddNode(connv,i+79,new TGeoCombiTrans(x2,y,z2,rr[i]));
822 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
823 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
824 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
825 tr5->RegisterYourself();
826 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
827 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
829 // pad plane and wire fixations
831 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
832 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
834 tga=(43.5239-23.3874)/114.2;
835 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
836 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
837 xx = 57.1*tga+23.3874-0.7;
838 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
839 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
841 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
843 oroc->AddNode(obdv,1);
844 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
845 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
846 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
847 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
849 // now iroc and oroc are placed into a sector...
851 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
852 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
853 TGeoRotation rot1("rot1",90.,90.,0.);
854 TGeoRotation rot2("rot2");
856 TGeoRotation *rot = new TGeoRotation("rot");
860 x0=110.2*TMath::Cos(openingAngle);
861 y0=110.2*TMath::Sin(openingAngle);
862 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
863 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
864 x0=188.45*TMath::Cos(openingAngle);
865 y0=188.45*TMath::Sin(openingAngle);
866 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
867 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
872 secta->AddNode(ch,1);
873 secta->AddNode(iroc,1,combi1a);
874 secta->AddNode(oroc,1,combi2a);
878 sectc->AddNode(ch,1);
879 sectc->AddNode(iroc,1,combi1c);
880 sectc->AddNode(oroc,1,combi2c);
882 // now I try to make wheels...
884 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
885 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
887 TGeoRotation *rwh[18];
888 for(Int_t i =0;i<18;i++){
889 Double_t phi = (20.*i);
890 rwh[i]=new TGeoRotation();
891 rwh[i]->RotateZ(phi);
892 wheela->AddNode(secta,i+1,rwh[i]);
893 wheelc->AddNode(sectc,i+1,rwh[i]);
896 // wheels in the drift volume!
898 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
899 v9->AddNode(wheela,1,combi3);
900 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
901 //_____________________________________________________________
902 // service support wheel
903 //_____________________________________________________________
904 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
905 sw->DefineSection(0,-4.,80.5,251.75);
906 sw->DefineSection(1,4.,80.5,251.75);
907 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
910 shift = thick/TMath::Sin(openingAngle);
911 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
912 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
913 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
914 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
916 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
917 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
918 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
919 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
920 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
925 ys = shift*TMath::Sin(openingAngle);
926 xs = shift*TMath::Cos(openingAngle);
927 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
929 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
930 co->DefineSection(0,-0.5,77.,255.25);
931 co->DefineSection(1,0.5,77.,255.25);
932 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
934 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
935 shift=4./TMath::Sin(openingAngle);
936 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
937 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
939 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
941 ys = shift*TMath::Sin(openingAngle);
942 xs = shift*TMath::Cos(openingAngle);
943 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
945 // Sector as an Assembly
947 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
948 swhs->AddNode(swv,1);
949 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
950 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
952 // SSW as an Assembly of sectors
954 TGeoRotation *rsw[18];
955 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
956 for(Int_t i =0;i<18;i++){
957 Double_t phi = (20.*i);
958 rsw[i] = new TGeoRotation();
959 rsw[i]->RotateZ(phi);
960 swheel->AddNode(swhs,i+1,rsw[i]);
962 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
963 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
965 // sensitive strips - strip "0" is always set
968 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
971 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
972 upar=new Double_t [10];
981 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
988 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
989 gGeoManager->Node("TPC_Strip",totrows+1,
990 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
992 // now, strips optionally
996 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
997 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
1002 gGeoManager->Node("TPC_Strip",i,
1003 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1004 gGeoManager->Node("TPC_Strip",totrows+i,
1005 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1008 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
1009 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
1014 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
1015 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1016 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
1017 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1020 //----------------------------------------------------------
1021 // TPC Support Rods - MAKROLON
1022 //----------------------------------------------------------
1023 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
1024 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
1025 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
1026 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
1027 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
1028 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
1030 // tpc rod is an assembly of 10 long parts and 2 short parts
1031 // connected with alu rings and plagged on both sides.
1036 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
1037 rod->DefineSection(0,-10.43,1.92,2.08);
1038 rod->DefineSection(1,-9.75,1.92,2.08);
1040 rod->DefineSection(2,-9.75,1.8,2.2);
1041 rod->DefineSection(3,9.75,1.8,2.2);
1043 rod->DefineSection(4,9.75,1.92,2.08);
1044 rod->DefineSection(5,10.43,1.92,2.08);
1046 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
1050 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
1051 rod1->DefineSection(0,-8.93,1.92,2.08);
1052 rod1->DefineSection(1,-8.25,1.92,2.08);
1054 rod1->DefineSection(2,-8.25,1.8,2.2);
1055 rod1->DefineSection(3,8.25,1.8,2.2);
1057 rod1->DefineSection(4,8.25,1.92,2.08);
1058 rod1->DefineSection(5,8.93,1.92,2.08);
1060 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
1062 // below is for the resistor rod
1064 // hole for the brass connectors
1067 new TGeoTube("hhole",0.,0.3,0.3);
1069 //transformations for holes - initialy they
1070 // are placed at x=0 and negative y
1072 TGeoRotation *rhole = new TGeoRotation();
1073 rhole->RotateX(90.);
1074 TGeoCombiTrans *transf[13];
1076 for(Int_t i=0;i<13;i++){
1077 //sprintf(name,"transf%d",i);
1078 snprintf(name,30,"transf%d",i);
1079 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
1080 transf[i]->RegisterYourself();
1082 // union expression for holes
1083 TString operl("hhole:transf0");
1084 for (Int_t i=1;i<13;i++){
1085 //sprintf(name,"+hhole:transf%d",i);
1086 snprintf(name,30,"+hhole:transf%d",i);
1090 TString opers("hhole:transf1");
1091 for (Int_t i=2;i<12;i++){
1092 //sprintf(name,"+hhole:transf%d",i);
1093 snprintf(name,30,"+hhole:transf%d",i);
1097 new TGeoCompositeShape("hlv",operl.Data());
1098 new TGeoCompositeShape("hsv",opers.Data());
1100 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
1101 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
1102 //rods - volumes - makrolon rods with holes
1103 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
1104 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
1107 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
1108 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
1110 // hooks holding strips
1112 new TGeoBBox("hk1",0.625,0.015,0.75);
1113 new TGeoBBox("hk2",0.625,0.015,0.15);
1114 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
1115 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
1116 tr21->RegisterYourself();
1117 tr12->RegisterYourself();
1119 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
1120 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
1122 // assembly of the short rod with connectors and hooks
1127 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1129 spart->AddNode( rodsv,1);
1130 for(Int_t i=1;i<12;i++){
1131 spart->AddNode(bconv,i,transf[i]);
1133 for(Int_t i =0;i<11;i++){
1134 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
1139 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1141 lpart->AddNode( rodlv,1);
1142 for(Int_t i=0;i<13;i++){
1143 lpart->AddNode(bconv,i+12,transf[i]);
1145 for(Int_t i =0;i<13;i++){
1146 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
1151 new TGeoTube("ring1",2.1075,2.235,0.53);
1152 new TGeoTube("ring2",1.7925,1.89,0.43);
1153 new TGeoTube("ring3",1.89,2.1075,0.05);
1154 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1155 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1159 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
1160 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1162 for(Int_t i=0;i<11;i++){
1163 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
1164 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1166 for(Int_t i=0;i<10;i++){
1167 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));
1168 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));
1173 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1174 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1175 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1176 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
1178 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1179 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1180 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1181 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1185 TGeoPcon *lp = new TGeoPcon(0.,360.,4);
1187 lp->DefineSection(0,-125.8,1.92,2.235);
1188 lp->DefineSection(1,-124.8,1.92,2.235);
1190 lp->DefineSection(2,-124.8,1.92,2.08);
1191 lp->DefineSection(3,-123.1,1.92,2.08);
1193 TGeoVolume *lpv1 = new TGeoVolume("TPC_lpv1",lp,m6);
1194 TGeoVolume *lpv2 = new TGeoVolume("TPC_lpv2",lp,m6);
1196 TGeoTube *lr = new TGeoTube(2.1075,2.235,0.5);
1197 TGeoVolume *lrv = new TGeoVolume("TPC_lrv",lr,m3);
1199 lpv2->AddNode(lrv,1,new TGeoTranslation(0.,0.,-125.3));
1201 tpcrrod->AddNode(lpv2,1);
1202 tpcmrod->AddNode(lpv1,1);
1206 TGeoTube *rp = new TGeoTube(1.92,2.08,2.025);
1207 TGeoVolume *rpv = new TGeoVolume("TPC_rpv",rp,m6);
1208 tpcrrod->AddNode(rpv,1, new TGeoTranslation(0.,0.,125.125));
1209 tpcmrod->AddNode(rpv,2,new TGeoTranslation(0.,0.,125.125));
1212 //HV rods - makrolon + 0.58cm (diameter) Cu
1213 TGeoTube *hvr = new TGeoTube(0.,1.465,126.5);
1214 TGeoTube *hvc = new TGeoTube(0.,0.29,126.5);
1216 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1217 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1218 hvrv->AddNode(hvcv,1);
1222 TGeoTube *cr = new TGeoTube(0.,0.45,126.2);
1223 TGeoTube *cw = new TGeoTube(0.,0.15,126.2);
1224 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
1225 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
1227 // ceramic rod with water
1229 crv->AddNode(cwv,1);
1233 TGeoTube *pr =new TGeoTube(0.2,0.35,126.2);
1234 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
1236 // copper plates with connectors
1238 new TGeoTube("tub",0.,1.7,0.025);
1240 // half space - points on the plane and a normal vector
1243 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1244 Double_t intp = 1.245;
1246 Double_t b = slope*slope+1.;
1255 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1259 new TGeoHalfSpace("sp1",p,n);
1268 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1272 new TGeoHalfSpace("sp2",p,n);
1275 new TGeoTube("h1",0.,0.5,0.025);
1276 new TGeoTube("h2",0.,0.35,0.025);
1278 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1279 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1280 ttr11->RegisterYourself();
1281 ttr22->RegisterYourself();
1282 // elastic connector
1283 new TGeoBBox("elcon",0.72,0.005,0.3);
1284 TGeoRotation *crr1 = new TGeoRotation();
1285 crr1->RotateZ(-22.);
1286 TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1287 ctr1->RegisterYourself();
1288 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1289 "(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1291 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1293 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1296 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
1298 rrod->AddNode(crv,1,ttr11);
1299 rrod->AddNode(crv,2,ttr22);
1300 rrod->AddNode(prv,1);
1302 for(Int_t i=0;i<165;i++){
1303 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1306 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1307 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m10);
1308 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1309 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1310 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1312 TGeoRotation *crr2 = new TGeoRotation();
1314 TGeoRotation *crr3 = new TGeoRotation();
1315 crr3->RotateY(-30.);
1317 for(Int_t i=0;i<164;i+=2){
1318 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1319 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1322 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
1324 // guard ring resistor chain
1327 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
1329 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m10);
1334 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1335 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1337 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1338 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1340 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1341 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
1343 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1344 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
1345 //------------------------------------------------------------------
1346 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1347 TGeoRotation rotrod("rotrod");
1349 TGeoRotation *rotpos[2];
1351 TGeoRotation *rotrod1[2];
1352 TGeoTubeSeg *irh = new TGeoTubeSeg(78.825,79.25,1.5,358.5,1.5);
1353 TGeoTubeSeg *orh = new TGeoTubeSeg(256.5,257.95,1.5,359.5,0.5);
1354 TGeoTubeSeg *ohh = new TGeoTubeSeg(256.5,257.95,1.5,9.5,10.5);
1355 TGeoVolume *irhv = new TGeoVolume("TPC_IRHH",irh,m4);
1356 TGeoVolume *orhv = new TGeoVolume("TPC_ORHH",orh,m4);
1357 TGeoVolume *ohhv = new TGeoVolume("TPC_OHVHH",ohh,m4);
1361 for(Int_t i=0;i<18;i++){
1364 angle=TMath::DegToRad()*20.*(Double_t)i;
1365 TGeoRotation *roth = new TGeoRotation(); //rotation for rod holders
1366 roth->RotateZ(angle);
1369 x=r * TMath::Cos(angle);
1370 y=r * TMath::Sin(angle);
1373 v9->AddNode(irhv,i+1,roth);
1374 v9->AddNode(orhv,i+1,roth);
1375 v9->AddNode(ohhv,i+1,roth);
1377 if(i==11){//resistor rod inner
1378 rotrod.RotateZ(-90.+angle);
1379 rotrod1[0]= new TGeoRotation();
1380 rotpos[0]= new TGeoRotation();
1382 rotrod1[0]->RotateZ(-90.+angle);
1383 *rotpos[0] = refl*rotrod; //rotation+reflection
1384 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1385 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
1388 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1389 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
1393 x=r * TMath::Cos(angle);
1394 y=r * TMath::Sin(angle);
1397 if(i==3){//resistor rod outer
1398 rotrod.RotateZ(90.+angle);
1399 rotrod1[1]= new TGeoRotation();
1400 rotpos[1]= new TGeoRotation();
1401 rotrod1[1]->RotateZ(90.+angle);
1402 *rotpos[1] = refl*rotrod;//rotation+reflection
1403 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1404 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
1407 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1408 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
1411 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
1413 } //end of rods positioning
1415 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1416 alice->AddNode(v1,1);
1418 } // end of function
1420 //_____________________________________________________________________________
1421 void AliTPCv2::AddAlignableVolumes() const
1424 // Create entries for alignable volumes associating the symbolic volume
1425 // name with the corresponding volume path. Needs to be syncronized with
1426 // eventual changes in the geometry.
1428 SetInnerChambersAlignable();
1429 SetOuterChambersAlignable();
1432 //_____________________________________________________________________________
1433 void AliTPCv2::SetInnerChambersAlignable() const
1436 AliGeomManager::ELayerID idTPC1 = AliGeomManager::kTPC1;
1437 Int_t modUID, modnum = 0;
1438 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1439 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1440 TString vpappend = "/TPC_IROC_1";
1441 TString snstr1="TPC/EndcapA/Sector";
1442 TString snstr2="TPC/EndcapC/Sector";
1443 TString snappend="/InnerChamber";
1444 TString volpath, symname;
1446 for(Int_t cnt=1; cnt<=18; cnt++){
1447 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
1450 volpath += vpappend;
1453 symname += snappend;
1454 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1455 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1456 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1457 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1458 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1459 alignableEntry->SetMatrix(matTtoL);
1462 for(Int_t cnt=1; cnt<=18; cnt++){
1463 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
1466 volpath += vpappend;
1469 symname += snappend;
1470 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1471 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1472 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1473 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1474 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1475 alignableEntry->SetMatrix(matTtoL);
1479 //_____________________________________________________________________________
1480 void AliTPCv2::SetOuterChambersAlignable() const
1483 AliGeomManager::ELayerID idTPC2 = AliGeomManager::kTPC2;
1484 Int_t modUID, modnum = 0;
1485 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1486 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1487 TString vpappend = "/TPC_OROC_1";
1488 TString snstr1="TPC/EndcapA/Sector";
1489 TString snstr2="TPC/EndcapC/Sector";
1490 TString snappend="/OuterChamber";
1491 TString volpath, symname;
1493 for(Int_t cnt=1; cnt<=18; cnt++){
1494 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
1497 volpath += vpappend;
1500 symname += snappend;
1501 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1502 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1503 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1504 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1505 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1506 alignableEntry->SetMatrix(matTtoL);
1509 for(Int_t cnt=1; cnt<=18; cnt++){
1510 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
1513 volpath += vpappend;
1516 symname += snappend;
1517 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1518 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1519 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1520 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1521 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1522 alignableEntry->SetMatrix(matTtoL);
1527 //_____________________________________________________________________________
1528 void AliTPCv2::CreateMaterials()
1531 // Define materials for version 2 of the Time Projection Chamber
1534 AliTPC::CreateMaterials();
1537 //_____________________________________________________________________________
1538 void AliTPCv2::Init()
1541 // Initialises version 2 of the TPC after that it has been built
1544 Int_t *idtmed = fIdtmed->GetArray();
1549 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
1551 fIDrift=gMC->VolId("TPC_Drift");
1552 fSecOld=-100; // fake number
1554 gMC->SetMaxNStep(-30000); // max. number of steps increased
1556 if (fPrimaryIonisation) {
1558 gMC->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential
1560 gMC->Gstpar(idtmed[2],"PRIMIO_N", 14.35);
1561 gMC->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss
1562 gMC->Gstpar(idtmed[2],"STRA",4);
1564 // specific energy loss for geant3 is now defined in galice.cuts
1567 AliDebug(1,"*** TPC version 2 initialized ***");
1568 AliDebug(1,Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1574 //_____________________________________________________________________________
1575 void AliTPCv2::StepManager()
1578 // Called for every step in the Time Projection Chamber
1582 // parameters used for the energy loss calculations
1584 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1585 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1586 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1587 const Int_t kMaxDistRef =15; // maximal difference between 2 stored references
1589 const Float_t kbig = 1.e10;
1596 vol[1]=0; // preset row number to 0
1598 if (!fPrimaryIonisation) gMC->SetMaxStep(kbig);
1600 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1602 Float_t charge = gMC->TrackCharge();
1604 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1606 // check the sensitive volume
1608 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
1609 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
1611 if ( fPrimaryIonisation && id == fIDrift ) {
1612 Double_t rnd = gMC->GetRandom()->Rndm();
1613 gMC->SetMaxStep(0.2+(2.*rnd-1.)*0.05); // 2 mm +- rndm*0.5mm step
1616 //if ( fPrimaryIonisation && id == fIDrift && gMC->IsTrackEntering()) {
1617 // gMC->SetMaxStep(0.2); // 2 mm
1620 gMC->TrackPosition(p);
1621 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1625 Double_t angle = TMath::ACos(p[0]/r);
1626 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1628 // angular segment, it is not a real sector number...
1630 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1631 fTPCParam->GetInnerAngle());
1632 // rotate to segment "0"
1634 fTPCParam->AdjustCosSin(sector,cos,sin);
1635 Float_t x1=p[0]*cos + p[1]*sin;
1636 // check if within sector's limits
1637 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
1638 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
1639 // calculate real sector number...
1640 if (x1>fTPCParam->GetOuterRadiusLow()){
1641 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1642 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1643 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
1646 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1648 // here I have a sector number
1653 static Double_t lastReferenceR=0;
1654 if (TMath::Abs(lastReferenceR-r)>kMaxDistRef){
1655 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
1659 // check if change of sector
1660 if(sector != fSecOld){
1662 // add track reference
1663 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
1665 // track is in the sensitive strip
1667 // track is entering the strip
1668 if (gMC->IsTrackEntering()){
1669 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1670 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1671 // row numbers are autonomous for lower and upper sectors
1672 if(vol[0] > fTPCParam->GetNInnerSector()) {
1673 vol[1] -= fTPCParam->GetNRowLow();
1676 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
1678 // lower sector, row 0, because Jouri wants to have this
1680 gMC->TrackMomentum(p);
1684 hits[3]=0.; // this hit has no energy loss
1685 // Get also the track time for pileup simulation
1686 hits[4]=gMC->TrackTime();
1688 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1692 gMC->TrackPosition(p);
1696 hits[3]=0.; // this hit has no energy loss
1697 // Get also the track time for pileup simulation
1698 hits[4]=gMC->TrackTime();
1700 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1705 //-----------------------------------------------------------------
1706 // charged particle is in the sensitive drift volume
1707 //-----------------------------------------------------------------
1708 if(gMC->TrackStep() > 0) {
1710 if (!fPrimaryIonisation) {
1711 nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1714 static Double_t deForNextStep = 0.;
1715 // Geant4 (the meaning of Edep as in Geant3) - wrong
1716 //nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1718 // Geant4 (the meaning of Edep as in Geant3) - NEW
1719 Double_t eAvailable = gMC->Edep() + deForNextStep;
1720 nel = (Int_t)(eAvailable/kwIon);
1721 deForNextStep = eAvailable - nel*kwIon;
1723 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1725 gMC->TrackPosition(p);
1729 hits[3]=(Float_t)nel;
1733 // if (fHitType&&2){
1735 gMC->TrackMomentum(p);
1736 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1737 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1738 fTrackHits->SetHitPrecision(precision);
1741 // Get also the track time for pileup simulation
1742 hits[4]=gMC->TrackTime();
1744 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1745 if (fDebugStreamer){
1746 // You can dump here what you need
1747 // function CreateDebugStremer() to be called in the Config.C macro
1748 // if you want to enable it
1749 // By default debug streaemer is OFF
1750 Float_t edep = gMC->Edep();
1751 Float_t tstep = gMC->TrackStep();
1752 Int_t pid=gMC->TrackPid();
1753 (*fDebugStreamer)<<"hit"<<
1754 "x="<<hits[0]<< // hit position
1757 "nel="<<hits[3]<< // number of electorns
1758 "tof="<<hits[4]<< // hit TOF
1759 "edep="<<edep<< // energy deposit
1760 "pid="<<pid<< // pid
1767 } //within sector's limits
1768 // Stemax calculation for the next step
1772 // below is valid only for Geant3 (fPromaryIonisation not set)
1773 if(!fPrimaryIonisation){
1774 gMC->TrackMomentum(mom);
1775 Float_t ptot=mom.Rho();
1776 Float_t betaGamma = ptot/gMC->TrackMass();
1778 Int_t pid=gMC->TrackPid();
1779 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1781 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1786 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
1787 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
1791 Double_t rnd = gMC->GetRandom()->Rndm();
1793 gMC->SetMaxStep(-TMath::Log(rnd)/pp);