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 3 -- detailed TPC and slow simulation //
25 <img src="picts/AliTPCv3Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
34 #include <TInterpreter.h>
35 #include <TLorentzVector.h>
37 #include <TVirtualMC.h>
44 #include "AliMathBase.h"
45 #include "AliTPCDigitsArray.h"
46 #include "AliTPCParam.h"
47 #include "AliTPCParamSR.h"
48 #include "AliTPCTrackHitsV2.h"
51 #include "TGeoManager.h"
52 #include "TGeoVolume.h"
57 #include "TGeoCompositeShape.h"
61 //_____________________________________________________________________________
63 AliTPCv3::AliTPCv3():AliTPC(),fIdSens(0)
70 //_____________________________________________________________________________
71 AliTPCv3::AliTPCv3(const char *name, const char *title) :
72 AliTPC(name, title), fIdSens(0)
75 // Standard constructor for Time Projection Chamber version 3
78 SetBufferSize(128000);
81 fTPCParam->Write(fTPCParam->GetTitle());
86 //_____________________________________________________________________________
87 void AliTPCv3::CreateGeometry()
90 // Creation of the TPC coarse geometry (version 3)
91 // The whole drift volume is sensitive
92 // Origin Marek Kowalski Cracow
96 <img src="picts/AliTPCgif">
101 <img src="picts/AliTPCv3Tree.gif">
104 //----------------------------------------------------------
105 // This geometry is written using TGeo class
106 // Firstly the shapes are defined, and only then the volumes
107 // What is recognized by the MC are volumes
108 //----------------------------------------------------------
110 // tpc - this will be the mother volume
114 // here I define a volume TPC
115 // retrive the medium name with "TPC_" as a leading string
117 TGeoPcon *tpc = new TGeoPcon(0.,360.,28); //28 sections
119 tpc->DefineSection(0,-291.,77.,278.);
120 tpc->DefineSection(1,-270,77.,278.);
122 tpc->DefineSection(2,-270.,77.,278.);
123 tpc->DefineSection(3,-262.1,77.,278.);
125 tpc->DefineSection(4,-262.1,83.1,278.);
126 tpc->DefineSection(5,-260.,83.1,278.);
128 tpc->DefineSection(6,-260.,70.,278.);
129 tpc->DefineSection(7,-259.6,70.,278.);
131 tpc->DefineSection(8,-259.6,68.1,278.);
132 tpc->DefineSection(9,-253.6,68.1,278.);
134 tpc->DefineSection(10,-253.6,68.,278.);
135 tpc->DefineSection(11,-74.0,60.8,278.);
137 tpc->DefineSection(12,-74.0,60.1,278.);
138 tpc->DefineSection(13,-73.3,60.1,278.);
140 tpc->DefineSection(14,-73.3,56.9,278.);
141 tpc->DefineSection(15,-68.5,56.9,278.);
143 tpc->DefineSection(16,-68.5,60.,278.);
144 tpc->DefineSection(17,-65.,60.,278.);
146 tpc->DefineSection(18,-65.,56.9,278.);
147 tpc->DefineSection(19,73.3,56.9,278.);
149 tpc->DefineSection(20,73.3,60.1,278.);
150 tpc->DefineSection(21,74.0,60.1,278.);
152 tpc->DefineSection(22,74.0,60.8,278.);
153 tpc->DefineSection(23,253.6,65.5,278.);
155 tpc->DefineSection(24,253.6,65.6,278.);
156 tpc->DefineSection(25,259.6,65.6,278.);
158 tpc->DefineSection(26,259.6,70.0,278.);
159 tpc->DefineSection(27,291.,77.,278.);
161 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
162 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
164 // drift volume - sensitive volume, extended beyond the
165 // endcaps, because of the alignment
167 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
168 dvol->DefineSection(0,-260.,74.5,264.4);
169 dvol->DefineSection(1,-253.6,74.5,264.4);
171 dvol->DefineSection(2,-253.6,76.6774,258.);
172 dvol->DefineSection(3,253.6,76.6774,258.);
174 dvol->DefineSection(4,253.6,74.5,264.4);
175 dvol->DefineSection(5,260.,74.5,264.4);
177 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-2");
178 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
184 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
186 tpco->DefineSection(0,-256.6,264.8,278.);
187 tpco->DefineSection(1,-253.6,264.8,278.);
189 tpco->DefineSection(2,-253.6,258.,278.);
190 tpco->DefineSection(3,250.6,258.,278.);
192 tpco->DefineSection(4,250.6,258.,275.5);
193 tpco->DefineSection(5,253.6,258.,275.5);
195 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
196 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
198 // outer containment vessel
200 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
202 tocv->DefineSection(0,-256.6,264.8,278.);
203 tocv->DefineSection(1,-253.6,264.8,278.);
205 tocv->DefineSection(2,-253.6,274.8124,278.);
206 tocv->DefineSection(3,247.6,274.8124,278.);
208 tocv->DefineSection(4,247.6,270.4,278.);
209 tocv->DefineSection(5,250.6,270.4,278.);
211 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
212 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
214 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
215 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
216 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
217 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
219 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
220 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
221 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
222 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
224 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
225 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
226 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
227 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
229 //-------------------------------------------------------
230 // Tpc Outer Field Cage
231 // daughters - composite (sandwich)
232 //-------------------------------------------------------
234 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
236 tofc->DefineSection(0,-253.6,258.,269.6);
237 tofc->DefineSection(1,-250.6,258.,269.6);
239 tofc->DefineSection(2,-250.6,258.,260.0676);
240 tofc->DefineSection(3,250.6,258.,260.0676);
242 tofc->DefineSection(4,250.6,258.,275.5);
243 tofc->DefineSection(5,253.6,258.,275.5);
245 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
247 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
248 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
249 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
251 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
253 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
254 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
255 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
257 // outer part - positioning
259 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
261 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
263 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
265 v2->AddNode(v3,1); v2->AddNode(v4,1);
268 //-----------------------------------------------------------
275 //--------------------------------------------------------------------
276 // Tpc Inner INsulator (CO2)
277 // the cones, the central drum and the inner f.c. sandwich with a piece
278 // of the flane will be placed in the TPC
279 //--------------------------------------------------------------------
280 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
282 tpci->DefineSection(0,-253.6,68.4,76.6774);
283 tpci->DefineSection(1,-74.0,61.2,76.6774);
285 tpci->DefineSection(2,74.0,61.2,76.6774);
287 tpci->DefineSection(3,253.6,65.9,76.6774);
289 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
291 // now the inner field cage - only part of flanges (2 copies)
293 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
294 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
296 //---------------------------------------------------------
297 // Tpc Inner Containment vessel - Muon side
298 //---------------------------------------------------------
299 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
301 tcms->DefineSection(0,-259.1,68.1,74.2);
302 tcms->DefineSection(1,-253.6,68.1,74.2);
304 tcms->DefineSection(2,-253.6,68.1,68.4);
305 tcms->DefineSection(3,-74.0,60.9,61.2);
307 tcms->DefineSection(4,-74.0,60.1,61.2);
308 tcms->DefineSection(5,-73.3,60.1,61.2);
310 tcms->DefineSection(6,-73.3,56.9,61.2);
311 tcms->DefineSection(7,-73.0,56.9,61.2);
313 tcms->DefineSection(8,-73.0,56.9,58.8);
314 tcms->DefineSection(9,-71.3,56.9,58.8);
316 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
317 //-----------------------------------------------
318 // inner containment vessel - shaft side
319 //-----------------------------------------------
320 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
322 tcss->DefineSection(0,71.3,56.9,58.8);
323 tcss->DefineSection(1,73.0,56.9,58.8);
325 tcss->DefineSection(2,73.0,56.9,61.2);
326 tcss->DefineSection(3,73.3,56.9,61.2);
328 tcss->DefineSection(4,73.3,60.1,61.2);
329 tcss->DefineSection(5,74.0,60.1,61.2);
331 tcss->DefineSection(6,74.0,60.9,61.2);
332 tcss->DefineSection(7,253.6,65.6,65.9);
334 tcss->DefineSection(8,253.6,65.6,74.2);
335 tcss->DefineSection(9,258.1,65.6,74.2);
337 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
338 //-----------------------------------------------
340 // define 4 parts and make an assembly
341 //-----------------------------------------------
342 // part1 - Al - 2 copies
343 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
344 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
345 // sandwich - outermost parts - 2 copies
346 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
347 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
348 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
349 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
351 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
352 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
353 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
354 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
356 // middle parts - 2 copies
357 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
358 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
359 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
360 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
362 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
363 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
364 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
365 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
366 // central part - 1 copy
367 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
368 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
369 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
371 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
372 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
373 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
375 // inner part - positioning
377 // creating a sandwich
378 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
380 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
382 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
384 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
386 tv100->AddNode(tv10,1);
387 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
388 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
389 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
390 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
391 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
392 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
394 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
395 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
396 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
397 v9->AddNode(tv100,1);
403 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
404 cfl->DefineSection(0,-71.1,59.7,61.2);
405 cfl->DefineSection(1,-68.6,59.7,61.2);
407 cfl->DefineSection(2,-68.6,60.6324,61.2);
408 cfl->DefineSection(3,68.6,60.6324,61.2);
410 cfl->DefineSection(4,68.6,59.7,61.2);
411 cfl->DefineSection(5,71.1,59.7,61.2);
413 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
415 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
416 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
417 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
419 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
420 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
421 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
422 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
424 // seals for central drum 2 copies
426 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
427 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
428 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
429 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
430 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
433 TGeoPcon *se = new TGeoPcon(0.,360.,6);
434 se->DefineSection(0,-72.8,59.7,61.2);
435 se->DefineSection(1,-72.3,59.7,61.2);
437 se->DefineSection(2,-72.3,58.85,61.2);
438 se->DefineSection(3,-71.6,58.85,61.2);
440 se->DefineSection(4,-71.6,59.7,61.2);
441 se->DefineSection(5,-71.3,59.7,61.2);
443 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
445 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
446 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
448 // define reflection matrix
450 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
452 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
454 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
455 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
456 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
458 // central membrane - 2 rings and a mylar membrane - assembly
460 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
461 TGeoTube *oh = new TGeoTube(250.,256.,.5);
462 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
463 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
464 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
465 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
467 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
473 // end caps - they are make as an assembly of single segments
474 // containing both readout chambers
476 Double_t openingAngle = 10.*TMath::DegToRad();
477 Double_t thick=1.5; // rib
478 Double_t shift = thick/TMath::Sin(openingAngle);
480 Double_t lowEdge = 86.3; // hole in the wheel
481 Double_t upEdge = 240.4; // hole in the wheel
483 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
485 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
487 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
488 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
490 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
491 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
493 Double_t ys = shift*TMath::Sin(openingAngle);
494 Double_t xs = shift*TMath::Cos(openingAngle);
495 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
496 tr->RegisterYourself();
497 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
498 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
499 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
500 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
501 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
502 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
503 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
505 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
511 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
512 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
514 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
515 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
516 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
518 Double_t tga = (19.8328-12.3742)/39.3;
520 xmin = 9.55*tga+12.3742;
521 xmax = 9.95*tga+12.3742;
522 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
523 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
524 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
525 xmin=19.4*tga+12.3742;
526 xmax=19.9*tga+12.3742;
527 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
528 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
529 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
530 xmin=29.35*tga+12.3742;
531 xmax=29.75*tga+12.3742;
532 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
533 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
534 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
536 // holes for connectors
538 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
539 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
540 TString fileName(gSystem->Getenv("ALICE_ROOT"));
541 fileName += "/TPC/conn_iroc.dat";
543 in.open(fileName.Data(), ios_base::in); // asci file
544 for(Int_t i =0;i<86;i++){
549 TGeoRotation *rrr = new TGeoRotation();
551 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
552 ibdv->AddNode(connv,i+1,trans);
556 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
558 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
559 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
560 tr1->RegisterYourself();
561 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
562 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
564 // pad plane and wire fixations
566 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
567 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
568 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
569 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
570 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
571 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
572 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
574 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
576 iroc->AddNode(ibdv,1);
577 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
578 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
579 tga =(23.3521-14.5974)/49.65;
580 Double_t xx = 24.825*tga+14.5974-0.6;
581 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
582 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
586 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
587 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
588 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
589 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
590 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
592 tga=(38.5084-20.2938)/99.3;
593 xmin=tga*10.2+20.2938;
594 xmax=tga*10.6+20.2938;
595 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
596 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
598 xmin=22.55*tga+20.2938;
599 xmax=24.15*tga+20.2938;
600 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
601 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
603 xmin=36.1*tga+20.2938;
604 xmax=36.5*tga+20.2938;
605 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
606 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
608 xmin=49.0*tga+20.2938;
609 xmax=50.6*tga+20.2938;
610 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
611 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
613 xmin=63.6*tga+20.2938;
614 xmax=64.0*tga+20.2938;
615 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
616 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
618 xmin=75.5*tga+20.2938;
619 xmax=77.15*tga+20.2938;
620 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
621 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
623 xmin=88.7*tga+20.2938;
624 xmax=89.1*tga+20.2938;
625 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
626 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
628 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
629 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
630 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
631 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
632 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
633 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
634 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
636 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
637 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
638 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
639 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
640 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
642 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
643 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
644 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
645 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
646 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
648 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
649 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
650 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
651 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
652 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
653 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
654 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
655 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
657 // holes for connectors
659 fileName = gSystem->Getenv("ALICE_ROOT");
660 fileName += "/TPC/conn_oroc.dat";
661 in.open(fileName.Data(), ios_base::in); // asci file
662 for(Int_t i =0;i<78;i++){
665 Double_t x1,z1,x2,z2;
667 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
668 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
670 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
672 TGeoRotation *rr = new TGeoRotation();
676 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
677 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
678 obdv->AddNode(connv,i+1,trans1);
679 obdv->AddNode(connv,i+79,trans2);
683 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
684 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
685 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
686 tr5->RegisterYourself();
687 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
688 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
690 // pad plane and wire fixations
692 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
693 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
695 tga=(43.5239-23.3874)/114.2;
696 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
697 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
698 xx = 57.1*tga+23.3874-0.7;
699 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
700 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
702 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
704 oroc->AddNode(obdv,1);
705 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
706 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
707 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
708 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
710 // now iroc and oroc are placed into a sector...
712 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
713 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
714 TGeoRotation rot1("rot1",90.,90.,0.);
715 TGeoRotation rot2("rot2");
717 TGeoRotation *rot = new TGeoRotation("rot");
721 x0=110.2*TMath::Cos(openingAngle);
722 y0=110.2*TMath::Sin(openingAngle);
723 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
724 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
725 x0=188.45*TMath::Cos(openingAngle);
726 y0=188.45*TMath::Sin(openingAngle);
727 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
728 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
732 secta->AddNode(ch,1);
733 secta->AddNode(iroc,1,combi1a);
734 secta->AddNode(oroc,1,combi2a);
738 sectc->AddNode(ch,1);
739 sectc->AddNode(iroc,1,combi1c);
740 sectc->AddNode(oroc,1,combi2c);
742 // now I try to make wheels...
744 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
745 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
747 for(Int_t i =0;i<18;i++){
748 Double_t phi = (20.*i);
749 TGeoRotation *r = new TGeoRotation();
751 wheela->AddNode(secta,i+1,r);
752 wheelc->AddNode(sectc,i+1,r);
755 // wheels in the drift volume!
756 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
757 v9->AddNode(wheela,1,combi3);
758 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
760 //_____________________________________________________________
761 // service support wheel
762 //_____________________________________________________________
763 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
764 sw->DefineSection(0,-4.,80.5,251.75);
765 sw->DefineSection(1,4.,80.5,251.75);
766 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
769 shift = thick/TMath::Sin(openingAngle);
770 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
771 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
772 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
773 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
775 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
776 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
777 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
778 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
779 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
783 ys = shift*TMath::Sin(openingAngle);
784 xs = shift*TMath::Cos(openingAngle);
785 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
787 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
788 co->DefineSection(0,-0.5,77.,255.25);
789 co->DefineSection(1,0.5,77.,255.25);
790 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
792 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
793 shift=4./TMath::Sin(openingAngle);
794 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
795 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
797 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
799 ys = shift*TMath::Sin(openingAngle);
800 xs = shift*TMath::Cos(openingAngle);
801 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
803 // Sector as an Assembly
805 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
806 swhs->AddNode(swv,1);
807 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
808 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
810 // SSW as an Assembly of sectors
812 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
813 for(Int_t i =0;i<18;i++){
814 Double_t phi = (20.*i);
815 TGeoRotation *r = new TGeoRotation();
817 swheel->AddNode(swhs,i+1,r);
819 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
820 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
822 //----------------------------------------------------------
823 // TPc Support Rods - MAKROLON
824 //----------------------------------------------------------
825 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
826 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
827 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
828 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
829 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
830 // upper and lower rods differ in length!
833 gGeoManager->Volume("TPC_Rod","TUBE",m6->GetId(),upar);
834 upar=new Double_t [3];
839 //HV rods - makrolon + 0.58cm (diameter) Cu
840 TGeoTube *hvr = new TGeoTube(0.,2.2,126.64);
841 TGeoTube *hvc = new TGeoTube(0.,0.29,126.64);
843 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
844 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
845 hvrv->AddNode(hvcv,1);
849 TGeoTube *cri = new TGeoTube(0.,0.45,126.64); //inner
850 TGeoTube *cro = new TGeoTube(0.,0.45,126.54); //outer
851 TGeoTube *cwi = new TGeoTube(0.,0.15,126.64); // water inner
852 TGeoTube *cwo = new TGeoTube(0.,0.15,126.54); // water outer
854 TGeoVolume *criv = new TGeoVolume("TPC_CR_I",cri,m10);
855 TGeoVolume *crov = new TGeoVolume("TPC_CR_O",cro,m10);
856 TGeoVolume *cwiv = new TGeoVolume("TPC_W_I",cwi,m11);
857 TGeoVolume *cwov = new TGeoVolume("TPC_W_O",cwo,m11);
859 // ceramic rod with water
861 criv->AddNode(cwiv,1);
862 crov->AddNode(cwov,1);
864 TGeoTube *pri =new TGeoTube(0.2,0.35,126.64); //inner
865 TGeoTube *pro = new TGeoTube(0.2,0.35,126.54); //outer
869 TGeoVolume *priv = new TGeoVolume("TPC_PR_I",pri,m12);
870 TGeoVolume *prov = new TGeoVolume("TPC_PR_O",pro,m12);
872 // resistor rods assembly
874 TGeoRotation *rotr = new TGeoRotation("rotr");
877 TGeoTube *rri = new TGeoTube(1.8,2.2,126.64);//inner
878 TGeoTube *rro = new TGeoTube(1.8,2.2,126.54);//inner
880 TGeoVolume *rriv = new TGeoVolume("TPC_RR_I",rri,m6);
881 TGeoVolume *rrov = new TGeoVolume("TPC_RR_O",rro,m6);
883 TGeoVolumeAssembly *rrin = new TGeoVolumeAssembly("TPC_RROD_I");
884 TGeoVolumeAssembly *rrou = new TGeoVolumeAssembly("TPC_RROD_O");
885 rrin->AddNode(rriv,1);
886 rrin->AddNode(criv,1,new TGeoTranslation(0.5,0.866, 0.));
887 rrin->AddNode(criv,2,new TGeoTranslation(0.5,-0.866, 0.));
888 rrin->AddNode(priv,1);
890 rrou->AddNode(rrov,1);
891 rrou->AddNode(crov,1,new TGeoTranslation(0.5,0.866, 0.));
892 rrou->AddNode(crov,2,new TGeoTranslation(0.5,-0.866, 0.));
893 rrou->AddNode(prov,1);
894 for(Int_t i=0;i<18;i++){
897 angle=TMath::DegToRad()*20.*(Double_t)i;
899 x=r * TMath::Cos(angle);
900 y=r * TMath::Sin(angle);
901 upar[2]=126.64; //lower
905 v9->AddNode(rrin,1,new TGeoCombiTrans(x,y,z,rotr)); //A
906 v9->AddNode(rrin,2,new TGeoCombiTrans(x,y,-z,rotr)); //C
909 gGeoManager->Node("TPC_Rod",i+1,"TPC_Drift",x,y,z,0,kTRUE,upar,3);//shaft
910 gGeoManager->Node("TPC_Rod",i+19,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon
916 x=r * TMath::Cos(angle);
917 y=r * TMath::Sin(angle);
918 upar[2]=126.54; //upper
921 //v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z));//A-side only
922 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,127.14));//A-side only
923 gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
926 v9->AddNode(rrou,1,new TGeoCombiTrans(x,y,z,rotr)); //A
927 v9->AddNode(rrou,2,new TGeoCombiTrans(x,y,-z,rotr)); //C
931 gGeoManager->Node("TPC_Rod",i+37,"TPC_Drift",x,y,z,0,kTRUE,upar,3);
932 gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
936 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
937 alice->AddNode(v1,1);
944 //_____________________________________________________________________________
945 void AliTPCv3::CreateMaterials()
948 // Define materials for version 2 of the Time Projection Chamber
953 AliTPC::CreateMaterials();
956 //_____________________________________________________________________________
957 void AliTPCv3::Init()
960 // Initialises version 3 of the TPC after that it has been built
962 //Int_t *idtmed = fIdtmed->GetArray();
966 fIdSens=gMC->VolId("TPC_Drift"); // drift gas as a sensitive volume
968 gMC->SetMaxNStep(-30000); // max. number of steps increased
970 // specific energy loss is now set in galice.cuts
972 printf("%s: *** TPC version 3 initialized***\n",ClassName());
974 printf("%s: Maximum number of steps = %d\n",ClassName(),gMC->GetMaxNStep());
976 // printf("*** TPC version 3 initialized ***\n");
977 // printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
983 //_____________________________________________________________________________
984 void AliTPCv3::StepManager()
987 // Called for every step in the Time Projection Chamber
991 // parameters used for the energy loss calculations
993 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
994 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
995 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
998 const Float_t kbig = 1.e10;
1010 gMC->SetMaxStep(kbig);
1012 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1014 Float_t charge = gMC->TrackCharge();
1016 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1019 id=gMC->CurrentVolID(copy);
1022 if (id != fIdSens) return;
1025 // charged particle is in the sensitive volume
1028 if(gMC->TrackStep() > 0) {
1031 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1032 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1034 gMC->TrackPosition(pos);
1039 // Get also the track time for pileup simulation
1040 hits[4]=gMC->TrackTime();
1043 // check the selected side of the TPC
1046 if(fSide && fSide*hits[2]<=0.) return;
1048 hits[3]=(Float_t)nel;
1052 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
1056 // Stemax calculation for the next step
1060 gMC->TrackMomentum(mom);
1061 Float_t ptot=mom.Rho();
1062 Float_t betaGamma = ptot/gMC->TrackMass();
1064 Int_t pid=gMC->TrackPid();
1065 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1067 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1071 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3);
1072 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
1073 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1076 Double_t rnd = gMC->GetRandom()->Rndm();
1078 gMC->SetMaxStep(-TMath::Log(rnd)/pp);