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 **************************************************************************/
18 Revision 1.1 2007/06/24 20:56:19 hristov
19 TPC version for the krypton runs (Marek)
24 ///////////////////////////////////////////////////////////////////////////////
26 // Time Projection Chamber version 4 -- detailed TPC and slow simulation //
27 // of Krypton decays //
31 <img src="picts/AliTPCv2Class.gif">
36 ///////////////////////////////////////////////////////////////////////////////
40 #include <TLorentzVector.h>
44 #include "AliMathBase.h"
45 #include "AliTPCParam.h"
46 #include "AliTPCTrackHitsV2.h"
48 #include "TGeoVolume.h"
53 #include "TGeoCompositeShape.h"
55 #include "TGeoPhysicalNode.h"
59 //_____________________________________________________________________________
60 AliTPCv4::AliTPCv4(const char *name, const char *title) :
67 // Standard constructor for Time Projection Chamber version 2
71 SetBufferSize(128000);
75 fTPCParam->Write(fTPCParam->GetTitle());
78 //_____________________________________________________________________________
79 void AliTPCv4::CreateGeometry()
82 // Create the geometry of Time Projection Chamber version 2
86 <img src="picts/AliTPC.gif">
91 <img src="picts/AliTPCv2Tree.gif">
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 //----------------------------------------------------------
101 // tpc - this will be the mother volume
105 // here I define a volume TPC
106 // retrive the medium name with "TPC_" as a leading string
108 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
110 tpc->DefineSection(0,-289.6,77.,278.);
111 tpc->DefineSection(1,-262.1,77.,278.);
113 tpc->DefineSection(2,-262.1,83.1,278.);
114 tpc->DefineSection(3,-260.,83.1,278.);
116 tpc->DefineSection(4,-260.,70.,278.);
117 tpc->DefineSection(5,-259.6,70.,278.);
119 tpc->DefineSection(6,-259.6,68.1,278.);
120 tpc->DefineSection(7,-253.6,68.1,278.);
122 tpc->DefineSection(8,-253.6,68.,278.);
123 tpc->DefineSection(9,-74.0,60.8,278.);
125 tpc->DefineSection(10,-74.0,60.1,278.);
126 tpc->DefineSection(11,-73.3,60.1,278.);
128 tpc->DefineSection(12,-73.3,56.9,278.);
129 tpc->DefineSection(13,-68.5,56.9,278.);
131 tpc->DefineSection(14,-68.5,60.,278.);
132 tpc->DefineSection(15,-64.7,60.,278.);
134 tpc->DefineSection(16,-64.7,56.9,278.);
135 tpc->DefineSection(17,73.3,56.9,278.);
137 tpc->DefineSection(18,73.3,60.1,278.);
138 tpc->DefineSection(19,74.0,60.1,278.);
140 tpc->DefineSection(20,74.0,60.8,278.);
141 tpc->DefineSection(21,253.6,65.5,278.);
143 tpc->DefineSection(22,253.6,65.6,278.);
144 tpc->DefineSection(23,259.6,65.6,278.);
146 tpc->DefineSection(24,259.6,70.0,278.);
147 tpc->DefineSection(25,260.,70.0,278.);
149 tpc->DefineSection(26,260.,83.1,278.);
150 tpc->DefineSection(27,262.1,83.1,278.);
152 tpc->DefineSection(28,262.1,77.,278);
153 tpc->DefineSection(29,289.6,77.,278.);
156 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
157 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
159 // drift volume - sensitive volume, extended beyond the
160 // endcaps, because of the alignment
162 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
163 dvol->DefineSection(0,-260.,74.5,264.4);
164 dvol->DefineSection(1,-253.6,74.5,264.4);
166 dvol->DefineSection(2,-253.6,76.6774,258.);
167 dvol->DefineSection(3,253.6,76.6774,258.);
169 dvol->DefineSection(4,253.6,74.5,264.4);
170 dvol->DefineSection(5,260.,74.5,264.4);
172 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-3");
173 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
179 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
181 tpco->DefineSection(0,-256.6,264.8,278.);
182 tpco->DefineSection(1,-253.6,264.8,278.);
184 tpco->DefineSection(2,-253.6,258.,278.);
185 tpco->DefineSection(3,250.6,258.,278.);
187 tpco->DefineSection(4,250.6,258.,275.5);
188 tpco->DefineSection(5,253.6,258.,275.5);
190 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
191 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
193 // outer containment vessel
195 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
197 tocv->DefineSection(0,-256.6,264.8,278.);
198 tocv->DefineSection(1,-253.6,264.8,278.);
200 tocv->DefineSection(2,-253.6,274.8124,278.);
201 tocv->DefineSection(3,247.6,274.8124,278.);
203 tocv->DefineSection(4,247.6,270.4,278.);
204 tocv->DefineSection(5,250.6,270.4,278.);
206 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
207 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
209 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
210 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
211 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
212 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
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 //-------------------------------------------------------
224 // Tpc Outer Field Cage
225 // daughters - composite (sandwich)
226 //-------------------------------------------------------
228 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
230 tofc->DefineSection(0,-253.6,258.,269.6);
231 tofc->DefineSection(1,-250.6,258.,269.6);
233 tofc->DefineSection(2,-250.6,258.,260.0676);
234 tofc->DefineSection(3,250.6,258.,260.0676);
236 tofc->DefineSection(4,250.6,258.,275.5);
237 tofc->DefineSection(5,253.6,258.,275.5);
239 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
241 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
242 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
243 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
245 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
247 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
248 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
249 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
251 // outer part - positioning
253 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
255 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
257 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
259 v2->AddNode(v3,1); v2->AddNode(v4,1);
262 //--------------------------------------------------------------------
263 // Tpc Inner INsulator (CO2)
264 // the cones, the central drum and the inner f.c. sandwich with a piece
265 // of the flane will be placed in the TPC
266 //--------------------------------------------------------------------
267 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
269 tpci->DefineSection(0,-253.6,68.4,76.6774);
270 tpci->DefineSection(1,-74.0,61.2,76.6774);
272 tpci->DefineSection(2,74.0,61.2,76.6774);
274 tpci->DefineSection(3,253.6,65.9,76.6774);
276 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
278 // now the inner field cage - only part of flanges (2 copies)
280 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
281 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
283 //---------------------------------------------------------
284 // Tpc Inner Containment vessel - Muon side
285 //---------------------------------------------------------
286 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
288 tcms->DefineSection(0,-259.1,68.1,74.2);
289 tcms->DefineSection(1,-253.6,68.1,74.2);
291 tcms->DefineSection(2,-253.6,68.1,68.4);
292 tcms->DefineSection(3,-74.0,60.9,61.2);
294 tcms->DefineSection(4,-74.0,60.1,61.2);
295 tcms->DefineSection(5,-73.3,60.1,61.2);
297 tcms->DefineSection(6,-73.3,56.9,61.2);
298 tcms->DefineSection(7,-73.0,56.9,61.2);
300 tcms->DefineSection(8,-73.0,56.9,58.8);
301 tcms->DefineSection(9,-71.3,56.9,58.8);
303 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
304 //-----------------------------------------------
305 // inner containment vessel - shaft side
306 //-----------------------------------------------
307 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
309 tcss->DefineSection(0,71.3,56.9,58.8);
310 tcss->DefineSection(1,73.0,56.9,58.8);
312 tcss->DefineSection(2,73.0,56.9,61.2);
313 tcss->DefineSection(3,73.3,56.9,61.2);
315 tcss->DefineSection(4,73.3,60.1,61.2);
316 tcss->DefineSection(5,74.0,60.1,61.2);
318 tcss->DefineSection(6,74.0,60.9,61.2);
319 tcss->DefineSection(7,253.6,65.6,65.9);
321 tcss->DefineSection(8,253.6,65.6,74.2);
322 tcss->DefineSection(9,258.1,65.6,74.2);
324 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
325 //-----------------------------------------------
327 // define 4 parts and make an assembly
328 //-----------------------------------------------
329 // part1 - Al - 2 copies
330 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
331 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
332 // sandwich - outermost parts - 2 copies
333 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
334 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
335 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
336 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
338 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
339 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
340 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
341 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
343 // middle parts - 2 copies
344 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
345 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
346 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
347 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
349 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
350 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
351 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
352 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
353 // central part - 1 copy
354 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
355 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
356 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
358 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
359 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
360 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
362 // inner part - positioning
364 // creating a sandwich
365 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
367 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
369 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
371 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
373 tv100->AddNode(tv10,1);
374 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
375 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
376 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
377 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
378 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
379 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
381 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
382 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
383 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
384 v9->AddNode(tv100,1);
390 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
391 cfl->DefineSection(0,-71.1,59.7,61.2);
392 cfl->DefineSection(1,-68.6,59.7,61.2);
394 cfl->DefineSection(2,-68.6,60.6324,61.2);
395 cfl->DefineSection(3,68.6,60.6324,61.2);
397 cfl->DefineSection(4,68.6,59.7,61.2);
398 cfl->DefineSection(5,71.1,59.7,61.2);
400 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
402 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
403 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
404 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
406 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
407 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
408 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
409 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
411 // seals for central drum 2 copies
413 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
414 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
415 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
416 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
417 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
420 TGeoPcon *se = new TGeoPcon(0.,360.,6);
421 se->DefineSection(0,-72.8,59.7,61.2);
422 se->DefineSection(1,-72.3,59.7,61.2);
424 se->DefineSection(2,-72.3,58.85,61.2);
425 se->DefineSection(3,-71.6,58.85,61.2);
427 se->DefineSection(4,-71.6,59.7,61.2);
428 se->DefineSection(5,-71.3,59.7,61.2);
430 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
432 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
433 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
435 // define reflection matrix
437 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
439 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
441 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
442 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
443 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
445 // central membrane - 2 rings and a mylar membrane - assembly
447 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
448 TGeoTube *oh = new TGeoTube(250.,256.,.5);
449 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
450 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
451 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
452 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
454 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
460 // end caps - they are make as an assembly of single segments
461 // containing both readout chambers
463 Double_t openingAngle = 10.*TMath::DegToRad();
464 Double_t thick=1.5; // rib
465 Double_t shift = thick/TMath::Sin(openingAngle);
467 Double_t lowEdge = 86.3; // hole in the wheel
468 Double_t upEdge = 240.4; // hole in the wheel
470 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
472 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
474 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
475 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
477 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
478 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
480 Double_t ys = shift*TMath::Sin(openingAngle);
481 Double_t xs = shift*TMath::Cos(openingAngle);
482 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
483 tr->RegisterYourself();
484 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
485 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
486 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
487 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
488 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
489 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
490 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
492 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
498 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
499 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
501 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
502 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
503 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
505 Double_t tga = (19.8328-12.3742)/39.3;
507 xmin = 9.55*tga+12.3742;
508 xmax = 9.95*tga+12.3742;
509 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
510 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
511 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
512 xmin=19.4*tga+12.3742;
513 xmax=19.9*tga+12.3742;
514 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
515 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
516 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
517 xmin=29.35*tga+12.3742;
518 xmax=29.75*tga+12.3742;
519 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
520 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
521 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
523 // holes for connectors
525 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
526 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
527 TString fileName(gSystem->Getenv("ALICE_ROOT"));
528 fileName += "/TPC/conn_iroc.dat";
530 in.open(fileName.Data(), ios_base::in); // asci file
531 for(Int_t i =0;i<86;i++){
536 TGeoRotation *rrr = new TGeoRotation();
538 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
539 ibdv->AddNode(connv,i+1,trans);
543 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
545 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
546 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
547 tr1->RegisterYourself();
548 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
549 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
551 // pad plane and wire fixations
553 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
554 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
555 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
556 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
557 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
558 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
559 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
561 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
563 iroc->AddNode(ibdv,1);
564 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
565 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
566 tga =(23.3521-14.5974)/49.65;
567 Double_t xx = 24.825*tga+14.5974-0.6;
568 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
569 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
573 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
574 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
575 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
576 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
577 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
579 tga=(38.5084-20.2938)/99.3;
580 xmin=tga*10.2+20.2938;
581 xmax=tga*10.6+20.2938;
582 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
583 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
585 xmin=22.55*tga+20.2938;
586 xmax=24.15*tga+20.2938;
587 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
588 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
590 xmin=36.1*tga+20.2938;
591 xmax=36.5*tga+20.2938;
592 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
593 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
595 xmin=49.0*tga+20.2938;
596 xmax=50.6*tga+20.2938;
597 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
598 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
600 xmin=63.6*tga+20.2938;
601 xmax=64.0*tga+20.2938;
602 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
603 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
605 xmin=75.5*tga+20.2938;
606 xmax=77.15*tga+20.2938;
607 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
608 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
610 xmin=88.7*tga+20.2938;
611 xmax=89.1*tga+20.2938;
612 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
613 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
615 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
616 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
617 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
618 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
619 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
620 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
621 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
623 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
624 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
625 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
626 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
627 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
629 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
630 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
631 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
632 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
633 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
635 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
636 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
637 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
638 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
639 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
640 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
641 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
642 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
644 // holes for connectors
646 fileName = gSystem->Getenv("ALICE_ROOT");
647 fileName += "/TPC/conn_oroc.dat";
648 in.open(fileName.Data(), ios_base::in); // asci file
649 for(Int_t i =0;i<78;i++){
652 Double_t x1,z1,x2,z2;
654 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
655 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
657 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
659 TGeoRotation *rr = new TGeoRotation();
663 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
664 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
665 obdv->AddNode(connv,i+1,trans1);
666 obdv->AddNode(connv,i+79,trans2);
670 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
671 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
672 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
673 tr5->RegisterYourself();
674 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
675 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
677 // pad plane and wire fixations
679 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
680 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
682 tga=(43.5239-23.3874)/114.2;
683 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
684 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
685 xx = 57.1*tga+23.3874-0.7;
686 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
687 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
689 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
691 oroc->AddNode(obdv,1);
692 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
693 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
694 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
695 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
697 // now iroc and oroc are placed into a sector...
699 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
700 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
701 TGeoRotation rot1("rot1",90.,90.,0.);
702 TGeoRotation rot2("rot2");
704 TGeoRotation *rot = new TGeoRotation("rot");
708 x0=110.2*TMath::Cos(openingAngle);
709 y0=110.2*TMath::Sin(openingAngle);
710 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
711 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
712 x0=188.45*TMath::Cos(openingAngle);
713 y0=188.45*TMath::Sin(openingAngle);
714 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
715 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
720 secta->AddNode(ch,1);
721 secta->AddNode(iroc,1,combi1a);
722 secta->AddNode(oroc,1,combi2a);
726 sectc->AddNode(ch,1);
727 sectc->AddNode(iroc,1,combi1c);
728 sectc->AddNode(oroc,1,combi2c);
730 // now I try to make wheels...
732 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
733 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
735 for(Int_t i =0;i<18;i++){
736 Double_t phi = (20.*i);
737 TGeoRotation *r = new TGeoRotation();
739 wheela->AddNode(secta,i+1,r);
740 wheelc->AddNode(sectc,i+1,r);
743 // wheels in the drift volume!
745 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
746 v9->AddNode(wheela,1,combi3);
747 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
748 //_____________________________________________________________
749 // service support wheel
750 //_____________________________________________________________
751 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
752 sw->DefineSection(0,-4.,80.5,251.75);
753 sw->DefineSection(1,4.,80.5,251.75);
754 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
757 shift = thick/TMath::Sin(openingAngle);
758 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
759 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
760 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
761 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
763 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
764 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
765 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
766 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
767 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
772 ys = shift*TMath::Sin(openingAngle);
773 xs = shift*TMath::Cos(openingAngle);
774 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
776 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
777 co->DefineSection(0,-0.5,77.,255.25);
778 co->DefineSection(1,0.5,77.,255.25);
779 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
781 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
782 shift=4./TMath::Sin(openingAngle);
783 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
784 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
786 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
788 ys = shift*TMath::Sin(openingAngle);
789 xs = shift*TMath::Cos(openingAngle);
790 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
792 // Sector as an Assembly
794 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
795 swhs->AddNode(swv,1);
796 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
797 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
799 // SSW as an Assembly of sectors
801 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
802 for(Int_t i =0;i<18;i++){
803 Double_t phi = (20.*i);
804 TGeoRotation *r = new TGeoRotation();
806 swheel->AddNode(swhs,i+1,r);
808 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
809 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
811 // sensitive strips - strip "0" is always set
814 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
817 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
818 upar=new Double_t [10];
827 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
834 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
835 gGeoManager->Node("TPC_Strip",totrows+1,
836 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
838 // now, strips optionally
842 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
843 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
848 gGeoManager->Node("TPC_Strip",i,
849 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
850 gGeoManager->Node("TPC_Strip",totrows+i,
851 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
854 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
855 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
860 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
861 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
862 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
863 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
866 //----------------------------------------------------------
867 // TPc Support Rods - MAKROLON
868 //----------------------------------------------------------
869 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
870 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
871 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
872 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
873 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
874 // upper and lower rods differ in length!
877 gGeoManager->Volume("TPC_Rod","TUBE",m6->GetId(),upar);
878 upar=new Double_t [3];
883 //HV rods - makrolon + 0.58cm (diameter) Cu
884 TGeoTube *hvr = new TGeoTube(0.,2.2,126.64);
885 TGeoTube *hvc = new TGeoTube(0.,0.29,126.64);
887 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
888 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
889 hvrv->AddNode(hvcv,1);
893 TGeoTube *cri = new TGeoTube(0.,0.45,126.64); //inner
894 TGeoTube *cro = new TGeoTube(0.,0.45,126.54); //outer
895 TGeoTube *cwi = new TGeoTube(0.,0.15,126.64); // water inner
896 TGeoTube *cwo = new TGeoTube(0.,0.15,126.54); // water outer
898 TGeoVolume *criv = new TGeoVolume("TPC_CR_I",cri,m10);
899 TGeoVolume *crov = new TGeoVolume("TPC_CR_O",cro,m10);
900 TGeoVolume *cwiv = new TGeoVolume("TPC_W_I",cwi,m11);
901 TGeoVolume *cwov = new TGeoVolume("TPC_W_O",cwo,m11);
903 // ceramic rod with water
905 criv->AddNode(cwiv,1);
906 crov->AddNode(cwov,1);
908 TGeoTube *pri =new TGeoTube(0.2,0.35,126.64); //inner
909 TGeoTube *pro = new TGeoTube(0.2,0.35,126.54); //outer
913 TGeoVolume *priv = new TGeoVolume("TPC_PR_I",pri,m12);
914 TGeoVolume *prov = new TGeoVolume("TPC_PR_O",pro,m12);
916 // resistor rods assembly
918 TGeoRotation *rotr = new TGeoRotation("rotr");
921 TGeoTube *rri = new TGeoTube(1.8,2.2,126.64);//inner
922 TGeoTube *rro = new TGeoTube(1.8,2.2,126.54);//inner
924 TGeoVolume *rriv = new TGeoVolume("TPC_RR_I",rri,m6);
925 TGeoVolume *rrov = new TGeoVolume("TPC_RR_O",rro,m6);
927 TGeoVolumeAssembly *rrin = new TGeoVolumeAssembly("TPC_RROD_I");
928 TGeoVolumeAssembly *rrou = new TGeoVolumeAssembly("TPC_RROD_O");
929 rrin->AddNode(rriv,1);
930 rrin->AddNode(criv,1,new TGeoTranslation(0.5,0.866, 0.));
931 rrin->AddNode(criv,2,new TGeoTranslation(0.5,-0.866, 0.));
932 rrin->AddNode(priv,1);
934 rrou->AddNode(rrov,1);
935 rrou->AddNode(crov,1,new TGeoTranslation(0.5,0.866, 0.));
936 rrou->AddNode(crov,2,new TGeoTranslation(0.5,-0.866, 0.));
937 rrou->AddNode(prov,1);
938 for(Int_t i=0;i<18;i++){
941 angle=TMath::DegToRad()*20.*(Double_t)i;
943 x=r * TMath::Cos(angle);
944 y=r * TMath::Sin(angle);
945 upar[2]=126.64; //lower
949 v9->AddNode(rrin,1,new TGeoCombiTrans(x,y,z,rotr)); //A
950 v9->AddNode(rrin,2,new TGeoCombiTrans(x,y,-z,rotr)); //C
953 gGeoManager->Node("TPC_Rod",i+1,"TPC_Drift",x,y,z,0,kTRUE,upar,3);//shaft
954 gGeoManager->Node("TPC_Rod",i+19,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon
960 x=r * TMath::Cos(angle);
961 y=r * TMath::Sin(angle);
962 upar[2]=126.54; //upper
965 //v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z));//A-side only
966 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,127.14));//A-side only
967 gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
970 v9->AddNode(rrou,1,new TGeoCombiTrans(x,y,z,rotr)); //A
971 v9->AddNode(rrou,2,new TGeoCombiTrans(x,y,-z,rotr)); //C
975 gGeoManager->Node("TPC_Rod",i+37,"TPC_Drift",x,y,z,0,kTRUE,upar,3);
976 gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
980 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
981 alice->AddNode(v1,1);
985 //_____________________________________________________________________________
986 void AliTPCv4::AddAlignableVolumes() const
989 // Create entries for alignable volumes associating the symbolic volume
990 // name with the corresponding volume path. Needs to be syncronized with
991 // eventual changes in the geometry.
993 SetInnerChambersAlignable();
994 SetOuterChambersAlignable();
997 //_____________________________________________________________________________
998 void AliTPCv4::SetInnerChambersAlignable() const
1002 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1003 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1004 TString vpappend = "/TPC_IROC_1";
1005 TString snstr1="TPC/EndcapA/Sector";
1006 TString snstr2="TPC/EndcapC/Sector";
1007 TString snappend="/InnerChamber";
1008 TString volpath, symname;
1010 for(Int_t cnt=1; cnt<=18; cnt++){
1013 volpath += vpappend;
1016 symname += snappend;
1017 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1018 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1020 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1021 const char *path = alignableEntry->GetTitle();
1022 if (!gGeoManager->cd(path))
1023 AliFatal(Form("Volume path %s not valid!",path));
1024 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1025 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1026 alignableEntry->SetMatrix(matTtoL);
1030 for(Int_t cnt=1; cnt<=18; cnt++){
1033 volpath += vpappend;
1036 symname += snappend;
1037 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1038 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1039 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1040 const char *path = alignableEntry->GetTitle();
1041 if (!gGeoManager->cd(path))
1042 AliFatal(Form("Volume path %s not valid!",path));
1043 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1044 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1045 alignableEntry->SetMatrix(matTtoL);
1050 //_____________________________________________________________________________
1051 void AliTPCv4::SetOuterChambersAlignable() const
1055 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1056 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1057 TString vpappend = "/TPC_OROC_1";
1058 TString snstr1="TPC/EndcapA/Sector";
1059 TString snstr2="TPC/EndcapC/Sector";
1060 TString snappend="/OuterChamber";
1061 TString volpath, symname;
1063 for(Int_t cnt=1; cnt<=18; cnt++){
1066 volpath += vpappend;
1069 symname += snappend;
1070 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1071 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1072 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1073 const char *path = alignableEntry->GetTitle();
1074 if (!gGeoManager->cd(path))
1075 AliFatal(Form("Volume path %s not valid!",path));
1076 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1077 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1078 alignableEntry->SetMatrix(matTtoL);
1082 for(Int_t cnt=1; cnt<=18; cnt++){
1085 volpath += vpappend;
1088 symname += snappend;
1089 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1090 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1091 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1092 const char *path = alignableEntry->GetTitle();
1093 if (!gGeoManager->cd(path))
1094 AliFatal(Form("Volume path %s not valid!",path));
1095 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1096 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1097 alignableEntry->SetMatrix(matTtoL);
1103 //_____________________________________________________________________________
1104 void AliTPCv4::CreateMaterials()
1107 // Define materials for version 2 of the Time Projection Chamber
1110 AliTPC::CreateMaterials();
1113 //_____________________________________________________________________________
1114 void AliTPCv4::Init()
1117 // Initialises version 2 of the TPC after that it has been built
1120 //Int_t *idtmed = fIdtmed->GetArray();
1125 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
1127 fIDrift=gMC->VolId("TPC_Drift");
1128 fSecOld=-100; // fake number
1130 gMC->SetMaxNStep(-30000); // max. number of steps increased
1132 // specific energy loss set in galice.cuts
1134 AliInfo("*** TPC version 4 initialized ***");
1135 AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1141 //_____________________________________________________________________________
1142 void AliTPCv4::StepManager()
1145 // Called for every step in the Time Projection Chamber
1149 // parameters used for the energy loss calculations
1151 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1152 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1153 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1156 const Float_t kbig = 1.e10;
1163 vol[1]=0; // preset row number to 0
1165 gMC->SetMaxStep(kbig);
1169 Float_t charge = gMC->TrackCharge();
1171 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1173 // check the sensitive volume
1175 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
1176 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
1178 gMC->TrackPosition(p);
1179 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1183 Double_t angle = TMath::ACos(p[0]/r);
1184 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1186 // angular segment, it is not a real sector number...
1188 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1189 fTPCParam->GetInnerAngle());
1190 // rotate to segment "0"
1192 fTPCParam->AdjustCosSin(sector,cos,sin);
1193 Float_t x1=p[0]*cos + p[1]*sin;
1194 // check if within sector's limits
1195 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
1196 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
1197 // calculate real sector number...
1198 if (x1>fTPCParam->GetOuterRadiusLow()){
1199 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1200 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1201 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
1204 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1206 // here I have a sector number
1210 // check if change of sector
1211 if(sector != fSecOld){
1213 // add track reference
1214 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
1216 // track is in the sensitive strip
1218 // track is entering the strip
1219 if (gMC->IsTrackEntering()){
1220 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1221 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1222 // row numbers are autonomous for lower and upper sectors
1223 if(vol[0] > fTPCParam->GetNInnerSector()) {
1224 vol[1] -= fTPCParam->GetNRowLow();
1227 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
1229 // lower sector, row 0, because Jouri wants to have this
1231 gMC->TrackMomentum(p);
1235 hits[3]=0.; // this hit has no energy loss
1236 // Get also the track time for pileup simulation
1237 hits[4]=gMC->TrackTime();
1239 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1243 gMC->TrackPosition(p);
1247 hits[3]=0.; // this hit has no energy loss
1248 // Get also the track time for pileup simulation
1249 hits[4]=gMC->TrackTime();
1251 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1256 //-----------------------------------------------------------------
1257 // charged particle is in the sensitive drift volume
1258 //-----------------------------------------------------------------
1260 if(gMC->TrackStep() > 0){
1262 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1263 nel=TMath::Min(nel,30); // 30 electrons corresponds to 1 keV
1265 gMC->TrackPosition(p);
1269 hits[3]=(Float_t)nel;
1274 gMC->TrackMomentum(p);
1275 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1276 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1277 fTrackHits->SetHitPrecision(precision);
1280 // Get also the track time for pileup simulation
1281 hits[4]=gMC->TrackTime();
1283 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1286 } //within sector's limits
1287 // Stemax calculation for the next step
1288 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1291 gMC->TrackMomentum(mom);
1292 Float_t ptot=mom.Rho();
1293 Float_t betaGamma = ptot/gMC->TrackMass();
1295 Int_t pid=gMC->TrackPid();
1296 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1298 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1303 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
1304 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
1306 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1309 Double_t rnd = gMC->GetRandom()->Rndm();
1311 gMC->SetMaxStep(-TMath::Log(rnd)/pp);