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 "AliTPCParam.h"
39 #include "AliTPCTrackHitsV2.h"
41 #include "TGeoVolume.h"
46 #include "TGeoCompositeShape.h"
48 #include "TGeoPhysicalNode.h"
52 //_____________________________________________________________________________
53 AliTPCv2::AliTPCv2(const char *name, const char *title) :
60 // Standard constructor for Time Projection Chamber version 2
64 SetBufferSize(128000);
68 fTPCParam->Write(fTPCParam->GetTitle());
71 //_____________________________________________________________________________
72 void AliTPCv2::CreateGeometry()
75 // Create the geometry of Time Projection Chamber version 2
79 <img src="picts/AliTPC.gif">
84 <img src="picts/AliTPCv2Tree.gif">
88 //----------------------------------------------------------
89 // This geometry is written using TGeo class
90 // Firstly the shapes are defined, and only then the volumes
91 // What is recognized by the MC are volumes
92 //----------------------------------------------------------
94 // tpc - this will be the mother volume
98 // here I define a volume TPC
99 // retrive the medium name with "TPC_" as a leading string
101 TGeoPcon *tpc = new TGeoPcon(0.,360.,18); //18 sections
102 tpc->DefineSection(0,-290.,77.,278.);
103 tpc->DefineSection(1,-259.6,70.,278.);
105 tpc->DefineSection(2,-259.6,68.1,278.);
106 tpc->DefineSection(3,-253.6,68.1,278.);
108 tpc->DefineSection(4,-253.6,68.,278.);
109 tpc->DefineSection(5,-74.0,60.8,278.);
111 tpc->DefineSection(6,-74.0,60.1,278.);
112 tpc->DefineSection(7,-73.3,60.1,278.);
114 tpc->DefineSection(8,-73.3,56.9,278.);
115 tpc->DefineSection(9,73.3,56.9,278.);
117 tpc->DefineSection(10,73.3,60.1,278.);
118 tpc->DefineSection(11,74.0,60.1,278.);
120 tpc->DefineSection(12,74.0,60.8,278.);
121 tpc->DefineSection(13,253.6,65.5,278.);
123 tpc->DefineSection(14,253.6,65.6,278.);
124 tpc->DefineSection(15,259.6,65.6,278.);
126 tpc->DefineSection(16,259.6,70.0,278.);
127 tpc->DefineSection(17,290.,77.,278.);
129 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
130 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
132 // drift volume - sensitive volume, extended beyond the
133 // endcaps, because of the alignment
135 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
136 dvol->DefineSection(0,-260.,74.5,264.4);
137 dvol->DefineSection(1,-253.6,74.5,264.4);
139 dvol->DefineSection(2,-253.6,76.6774,258.);
140 dvol->DefineSection(3,253.6,76.6774,258.);
142 dvol->DefineSection(4,253.6,74.5,264.4);
143 dvol->DefineSection(5,260.,74.5,264.4);
145 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-N-2");
146 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
152 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
154 tpco->DefineSection(0,-256.6,264.8,278.);
155 tpco->DefineSection(1,-253.6,264.8,278.);
157 tpco->DefineSection(2,-253.6,258.,278.);
158 tpco->DefineSection(3,250.6,258.,278.);
160 tpco->DefineSection(4,250.6,258.,275.5);
161 tpco->DefineSection(5,253.6,258.,275.5);
163 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
164 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
166 // outer containment vessel
168 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
170 tocv->DefineSection(0,-256.6,264.8,278.);
171 tocv->DefineSection(1,-253.6,264.8,278.);
173 tocv->DefineSection(2,-253.6,274.8124,278.);
174 tocv->DefineSection(3,247.6,274.8124,278.);
176 tocv->DefineSection(4,247.6,270.4,278.);
177 tocv->DefineSection(5,250.6,270.4,278.);
179 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
180 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
182 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
183 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
184 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
185 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
187 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
188 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
189 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
190 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
192 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
193 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
194 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
195 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
196 //-------------------------------------------------------
197 // Tpc Outer Field Cage
198 // daughters - composite (sandwich)
199 //-------------------------------------------------------
201 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
203 tofc->DefineSection(0,-253.6,258.,269.6);
204 tofc->DefineSection(1,-250.6,258.,269.6);
206 tofc->DefineSection(2,-250.6,258.,260.0676);
207 tofc->DefineSection(3,250.6,258.,260.0676);
209 tofc->DefineSection(4,250.6,258.,275.5);
210 tofc->DefineSection(5,253.6,258.,275.5);
212 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
214 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
215 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
216 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
218 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
220 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
221 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
222 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
224 // outer part - positioning
226 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
228 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
230 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
232 v2->AddNode(v3,1); v2->AddNode(v4,1);
235 //--------------------------------------------------------------------
236 // Tpc Inner INsulator (CO2)
237 // the cones, the central drum and the inner f.c. sandwich with a piece
238 // of the flane will be placed in the TPC
239 //--------------------------------------------------------------------
240 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
242 tpci->DefineSection(0,-253.6,68.4,76.6774);
243 tpci->DefineSection(1,-74.0,61.2,76.6774);
245 tpci->DefineSection(2,74.0,61.2,76.6774);
247 tpci->DefineSection(3,253.6,65.9,76.6774);
249 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
251 // now the inner field cage - only part of flanges (2 copies)
253 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
254 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
256 //---------------------------------------------------------
257 // Tpc Inner Containment vessel - Muon side
258 //---------------------------------------------------------
259 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
261 tcms->DefineSection(0,-259.1,68.1,74.2);
262 tcms->DefineSection(1,-253.6,68.1,74.2);
264 tcms->DefineSection(2,-253.6,68.1,68.4);
265 tcms->DefineSection(3,-74.0,60.9,61.2);
267 tcms->DefineSection(4,-74.0,60.1,61.2);
268 tcms->DefineSection(5,-73.3,60.1,61.2);
270 tcms->DefineSection(6,-73.3,56.9,61.2);
271 tcms->DefineSection(7,-73.0,56.9,61.2);
273 tcms->DefineSection(8,-73.0,56.9,58.8);
274 tcms->DefineSection(9,-71.3,56.9,58.8);
276 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
277 //-----------------------------------------------
278 // inner containment vessel - shaft side
279 //-----------------------------------------------
280 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
282 tcss->DefineSection(0,71.3,56.9,58.8);
283 tcss->DefineSection(1,73.0,56.9,58.8);
285 tcss->DefineSection(2,73.0,56.9,61.2);
286 tcss->DefineSection(3,73.3,56.9,61.2);
288 tcss->DefineSection(4,73.3,60.1,61.2);
289 tcss->DefineSection(5,74.0,60.1,61.2);
291 tcss->DefineSection(6,74.0,60.9,61.2);
292 tcss->DefineSection(7,253.6,65.6,65.9);
294 tcss->DefineSection(8,253.6,65.6,74.2);
295 tcss->DefineSection(9,258.1,65.6,74.2);
297 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
298 //-----------------------------------------------
300 // define 4 parts and make an assembly
301 //-----------------------------------------------
302 // part1 - Al - 2 copies
303 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
304 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
305 // sandwich - outermost parts - 2 copies
306 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
307 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
308 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
309 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
311 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
312 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
313 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
314 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
316 // middle parts - 2 copies
317 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
318 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
319 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
320 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
322 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
323 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
324 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
325 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
326 // central part - 1 copy
327 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
328 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
329 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
331 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
332 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
333 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
335 // inner part - positioning
337 // creating a sandwich
338 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
340 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
342 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
344 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
346 tv100->AddNode(tv10,1);
347 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
348 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
349 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
350 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
351 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
352 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
354 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
355 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
356 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
357 v9->AddNode(tv100,1);
363 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
364 cfl->DefineSection(0,-71.1,59.7,61.2);
365 cfl->DefineSection(1,-68.6,59.7,61.2);
367 cfl->DefineSection(2,-68.6,60.6324,61.2);
368 cfl->DefineSection(3,68.6,60.6324,61.2);
370 cfl->DefineSection(4,68.6,59.7,61.2);
371 cfl->DefineSection(5,71.1,59.7,61.2);
373 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
375 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
376 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
377 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
379 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
380 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
381 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
382 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
384 // seals for central drum 2 copies
386 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
387 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
388 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
389 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.));
390 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.));
393 TGeoPcon *se = new TGeoPcon(0.,360.,6);
394 se->DefineSection(0,-72.8,59.7,61.2);
395 se->DefineSection(1,-72.3,59.7,61.2);
397 se->DefineSection(2,-72.3,58.85,61.2);
398 se->DefineSection(3,-71.6,58.85,61.2);
400 se->DefineSection(4,-71.6,59.7,61.2);
401 se->DefineSection(5,-71.3,59.7,61.2);
403 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
405 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
406 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
408 // define reflection matrix
410 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
412 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
414 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
415 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
416 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
418 // central membrane - 2 rings and a mylar membrane - assembly
420 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
421 TGeoTube *oh = new TGeoTube(250.,256.,.5);
422 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
423 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
424 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
425 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
427 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
433 // end caps - they are make as an assembly of single segments
434 // containing both readout chambers
436 Double_t openingAngle = 10.*TMath::DegToRad();
437 Double_t thick=1.5; // rib
438 Double_t shift = thick/TMath::Sin(openingAngle);
440 Double_t lowEdge = 86.3; // hole in the wheel
441 Double_t upEdge = 240.4; // hole in the wheel
443 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
445 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
447 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
448 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
450 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
451 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
453 Double_t ys = shift*TMath::Sin(openingAngle);
454 Double_t xs = shift*TMath::Cos(openingAngle);
455 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
456 tr->RegisterYourself();
457 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
458 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
459 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
460 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
461 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
462 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
463 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
465 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
471 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
472 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
474 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
475 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
476 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
478 Double_t tga = (19.8328-12.3742)/39.3;
480 xmin = 9.55*tga+12.3742;
481 xmax = 9.95*tga+12.3742;
482 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
483 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
484 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
485 xmin=19.4*tga+12.3742;
486 xmax=19.9*tga+12.3742;
487 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
488 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
489 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
490 xmin=29.35*tga+12.3742;
491 xmax=29.75*tga+12.3742;
492 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
493 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
494 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
496 // holes for connectors
498 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
499 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
500 TString fileName(gSystem->Getenv("ALICE_ROOT"));
501 fileName += "/TPC/conn_iroc.dat";
503 in.open(fileName.Data(), ios_base::in); // asci file
504 for(Int_t i =0;i<86;i++){
509 TGeoRotation *rrr = new TGeoRotation();
511 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
512 ibdv->AddNode(connv,i+1,trans);
516 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
518 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
519 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
520 tr1->RegisterYourself();
521 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
522 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
524 // pad plane and wire fixations
526 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
527 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
528 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
529 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
530 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
531 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
532 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
534 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
536 iroc->AddNode(ibdv,1);
537 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
538 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
539 tga =(23.3521-14.5974)/49.65;
540 Double_t xx = 24.825*tga+14.5974-0.6;
541 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
542 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
546 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
547 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
548 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
549 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
550 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
552 tga=(38.5084-20.2938)/99.3;
553 xmin=tga*10.2+20.2938;
554 xmax=tga*10.6+20.2938;
555 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
556 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
558 xmin=22.55*tga+20.2938;
559 xmax=24.15*tga+20.2938;
560 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
561 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
563 xmin=36.1*tga+20.2938;
564 xmax=36.5*tga+20.2938;
565 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
566 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
568 xmin=49.0*tga+20.2938;
569 xmax=50.6*tga+20.2938;
570 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
571 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
573 xmin=63.6*tga+20.2938;
574 xmax=64.0*tga+20.2938;
575 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
576 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
578 xmin=75.5*tga+20.2938;
579 xmax=77.15*tga+20.2938;
580 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
581 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
583 xmin=88.7*tga+20.2938;
584 xmax=89.1*tga+20.2938;
585 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
586 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
588 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
589 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
590 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
591 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
592 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
593 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
594 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
596 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
597 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
598 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
599 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
600 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
602 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
603 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
604 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
605 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
606 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
608 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
609 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
610 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
611 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
612 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
613 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
614 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
615 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
617 // holes for connectors
619 fileName = gSystem->Getenv("ALICE_ROOT");
620 fileName += "/TPC/conn_oroc.dat";
621 in.open(fileName.Data(), ios_base::in); // asci file
622 for(Int_t i =0;i<78;i++){
625 Double_t x1,z1,x2,z2;
627 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
628 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
630 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
632 TGeoRotation *rr = new TGeoRotation();
636 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
637 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
638 obdv->AddNode(connv,i+1,trans1);
639 obdv->AddNode(connv,i+79,trans2);
643 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
644 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
645 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
646 tr5->RegisterYourself();
647 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
648 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
650 // pad plane and wire fixations
652 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
653 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
655 tga=(43.5239-23.3874)/114.2;
656 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
657 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
658 xx = 57.1*tga+23.3874-0.7;
659 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
660 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
662 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
664 oroc->AddNode(obdv,1);
665 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
666 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
667 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
668 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
670 // now iroc and oroc are placed into a sector...
672 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
673 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
674 TGeoRotation rot1("rot1",90.,90.,0.);
675 TGeoRotation rot2("rot2");
677 TGeoRotation *rot = new TGeoRotation("rot");
681 x0=110.2*TMath::Cos(openingAngle);
682 y0=110.2*TMath::Sin(openingAngle);
683 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //a-side
684 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //c-side
685 x0=188.45*TMath::Cos(openingAngle);
686 y0=188.45*TMath::Sin(openingAngle);
687 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //a-side
688 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //c-side
693 secta->AddNode(ch,1);
694 secta->AddNode(iroc,1,combi1a);
695 secta->AddNode(oroc,1,combi2a);
699 sectc->AddNode(ch,1);
700 sectc->AddNode(iroc,1,combi1c);
701 sectc->AddNode(oroc,1,combi2c);
703 // now I try to make wheels...
705 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
706 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
708 for(Int_t i =0;i<18;i++){
709 Double_t phi = (20.*i);
710 TGeoRotation *r = new TGeoRotation();
712 wheela->AddNode(secta,i+1,r);
713 wheelc->AddNode(sectc,i+1,r);
716 // wheels in the drift volume!
718 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
719 v9->AddNode(wheela,1,combi3);
720 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
721 //_____________________________________________________________
722 // service support wheel
723 //_____________________________________________________________
724 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
725 sw->DefineSection(0,-4.,80.5,251.75);
726 sw->DefineSection(1,4.,80.5,251.75);
727 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
730 shift = thick/TMath::Sin(openingAngle);
731 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
732 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
733 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
734 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
736 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
737 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
738 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
739 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
740 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
745 ys = shift*TMath::Sin(openingAngle);
746 xs = shift*TMath::Cos(openingAngle);
747 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
749 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
750 co->DefineSection(0,-0.5,77.,255.25);
751 co->DefineSection(1,0.5,77.,255.25);
752 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
754 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
755 shift=4./TMath::Sin(openingAngle);
756 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
757 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
759 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
761 ys = shift*TMath::Sin(openingAngle);
762 xs = shift*TMath::Cos(openingAngle);
763 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
765 // Sector as an Assembly
767 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
768 swhs->AddNode(swv,1);
769 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
770 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
772 // SSW as an Assembly of sectors
774 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
775 for(Int_t i =0;i<18;i++){
776 Double_t phi = (20.*i);
777 TGeoRotation *r = new TGeoRotation();
779 swheel->AddNode(swhs,i+1,r);
781 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
782 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
784 // sensitive strips - strip "0" is always set
787 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
790 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
791 upar=new Double_t [10];
800 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
807 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
808 gGeoManager->Node("TPC_Strip",totrows+1,
809 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
811 // now, strips optionally
815 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
816 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
821 gGeoManager->Node("TPC_Strip",i,
822 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
823 gGeoManager->Node("TPC_Strip",totrows+i,
824 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
827 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
828 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
833 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
834 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
835 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
836 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
839 //----------------------------------------------------------
840 // TPc Support Rods - MAKROLON
841 //----------------------------------------------------------
842 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
843 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
844 // upper and lower rods differ in length!
847 gGeoManager->Volume("TPC_Rod","TUBE",m6->GetId(),upar);
848 upar=new Double_t [3];
853 //HV rods - makrolon + 0.58cm (diameter) Cu
854 TGeoTube *hvr = new TGeoTube(0.,2.2,126.64);
855 TGeoTube *hvc = new TGeoTube(0.,0.29,126.64);
857 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
858 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
859 hvrv->AddNode(hvcv,1);
861 for(Int_t i=0;i<18;i++){
864 angle=TMath::DegToRad()*20.*(Double_t)i;
866 x=r * TMath::Cos(angle);
867 y=r * TMath::Sin(angle);
868 upar[2]=126.64; //lower
871 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z));
872 v9->AddNode(hvrv,2,new TGeoTranslation(x,y,-z));
875 gGeoManager->Node("TPC_Rod",i+1,"TPC_Drift",x,y,z,0,kTRUE,upar,3);//shaft
876 gGeoManager->Node("TPC_Rod",i+19,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon
879 x=r * TMath::Cos(angle);
880 y=r * TMath::Sin(angle);
881 upar[2]=126.54; //upper
883 gGeoManager->Node("TPC_Rod",i+37,"TPC_Drift",x,y,z,0,kTRUE,upar,3);
884 gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
887 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
888 alice->AddNode(v1,1);
892 //_____________________________________________________________________________
893 void AliTPCv2::AddAlignableVolumes() const
896 // Create entries for alignable volumes associating the symbolic volume
897 // name with the corresponding volume path. Needs to be syncronized with
898 // eventual changes in the geometry.
900 SetInnerChambersAlignable();
901 SetOuterChambersAlignable();
904 //_____________________________________________________________________________
905 void AliTPCv2::SetInnerChambersAlignable() const
909 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
910 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
911 TString vpappend = "/TPC_IROC_1";
912 TString snstr1="TPC/EndcapA/Sector";
913 TString snstr2="TPC/EndcapC/Sector";
914 TString snappend="/InnerChamber";
915 TString volpath, symname;
917 for(Int_t cnt=1; cnt<=18; cnt++){
924 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
925 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
927 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
928 const char *path = alignableEntry->GetTitle();
929 if (!gGeoManager->cd(path))
930 AliFatal(Form("Volume path %s not valid!",path));
931 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
932 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
933 alignableEntry->SetMatrix(matTtoL);
937 for(Int_t cnt=1; cnt<=18; cnt++){
944 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
945 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
946 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
947 const char *path = alignableEntry->GetTitle();
948 if (!gGeoManager->cd(path))
949 AliFatal(Form("Volume path %s not valid!",path));
950 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
951 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
952 alignableEntry->SetMatrix(matTtoL);
957 //_____________________________________________________________________________
958 void AliTPCv2::SetOuterChambersAlignable() const
962 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
963 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
964 TString vpappend = "/TPC_OROC_1";
965 TString snstr1="TPC/EndcapA/Sector";
966 TString snstr2="TPC/EndcapC/Sector";
967 TString snappend="/OuterChamber";
968 TString volpath, symname;
970 for(Int_t cnt=1; cnt<=18; cnt++){
977 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
978 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
979 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
980 const char *path = alignableEntry->GetTitle();
981 if (!gGeoManager->cd(path))
982 AliFatal(Form("Volume path %s not valid!",path));
983 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
984 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
985 alignableEntry->SetMatrix(matTtoL);
989 for(Int_t cnt=1; cnt<=18; cnt++){
996 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
997 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
998 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
999 const char *path = alignableEntry->GetTitle();
1000 if (!gGeoManager->cd(path))
1001 AliFatal(Form("Volume path %s not valid!",path));
1002 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1003 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1004 alignableEntry->SetMatrix(matTtoL);
1009 //_____________________________________________________________________________
1010 void AliTPCv2::DrawDetector() const
1013 // Draw a shaded view of the Time Projection Chamber version 1
1016 // Set everything unseen
1017 gMC->Gsatt("*", "seen", -1);
1019 // Set ALIC mother transparent
1020 gMC->Gsatt("ALIC","SEEN",0);
1022 // Set the volumes visible
1025 gMC->Gsatt("TPC ","SEEN",0);
1026 gMC->Gsatt("TOIN","SEEN",1);
1027 gMC->Gsatt("TOIN","COLO",7);
1028 gMC->Gsatt("TOCV","SEEN",1);
1029 gMC->Gsatt("TOCV","COLO",4);
1030 gMC->Gsatt("TSA1","SEEN",0);
1031 gMC->Gsatt("TSA2","SEEN",0);
1032 gMC->Gsatt("TSA3","SEEN",0);
1033 gMC->Gsatt("TSA4","SEEN",0);
1034 gMC->Gsatt("TSA5","SEEN",0);
1035 gMC->Gsatt("TOFC","SEEN",1);
1036 gMC->Gsatt("TOFC","COLO",4);
1037 gMC->Gsatt("TSA6","SEEN",0);
1038 gMC->Gsatt("TSA7","SEEN",0);
1039 gMC->Gsatt("TSA8","SEEN",0);
1040 gMC->Gsatt("TIIN","SEEN",1);
1041 gMC->Gsatt("TIIN","COLO",7);
1042 gMC->Gsatt("TII1","SEEN",0);
1043 gMC->Gsatt("TIFC","SEEN",1);
1044 gMC->Gsatt("TIFC","COLO",4);
1045 gMC->Gsatt("TSA9","SEEN",0);
1046 gMC->Gsatt("TS10","SEEN",0);
1047 gMC->Gsatt("TS11","SEEN",0);
1048 gMC->Gsatt("TS12","SEEN",0);
1049 gMC->Gsatt("TS13","SEEN",0);
1050 gMC->Gsatt("TS14","SEEN",0);
1051 gMC->Gsatt("TICC","SEEN",0);
1052 gMC->Gsatt("TICM","SEEN",0);
1053 gMC->Gsatt("TS15","SEEN",0);
1054 gMC->Gsatt("TS16","SEEN",0);
1055 gMC->Gsatt("TS17","SEEN",0);
1056 gMC->Gsatt("TS18","SEEN",0);
1057 gMC->Gsatt("TS19","SEEN",0);
1058 gMC->Gsatt("TPJ1","SEEN",0);
1059 gMC->Gsatt("TPJ2","SEEN",0);
1060 gMC->Gsatt("TICS","SEEN",0);
1061 gMC->Gsatt("TDGN","SEEN",0);
1062 gMC->Gsatt("TIRC","SEEN",0);
1063 gMC->Gsatt("TIC1","SEEN",1);
1064 gMC->Gsatt("TIPP","SEEN",0);
1065 gMC->Gsatt("TIC3","SEEN",0);
1066 gMC->Gsatt("TRCE","SEEN",0);
1067 gMC->Gsatt("TPSC","SEEN",0);
1068 gMC->Gsatt("TPCC","SEEN",0);
1069 gMC->Gsatt("TORC","SEEN",0);
1070 gMC->Gsatt("TOPP","SEEN",0);
1071 gMC->Gsatt("TOC3","SEEN",0);
1072 gMC->Gsatt("TOC1","SEEN",1);
1073 gMC->Gsatt("TSSW","SEEN",1);
1074 gMC->Gsatt("TSWC","SEEN",1);
1075 gMC->Gsatt("TSSW","COLO",3);
1076 gMC->Gsatt("TSWC","COLO",3);
1077 gMC->Gsatt("TSCE","COLO",6);
1078 gMC->Gsatt("TSCE","SEEN",1);
1079 gMC->Gsatt("TWES","SEEN",0);
1080 gMC->Gsatt("TSWB","SEEN",0);
1081 gMC->Gsatt("TPEL","SEEN",0);
1082 gMC->Gsatt("TPMW","SEEN",1);
1083 gMC->Gsatt("TESR","SEEN",1);
1084 gMC->Gsatt("TPMW","COLO",12);
1085 gMC->Gsatt("TIC1","COLO",5);
1086 gMC->Gsatt("TOC1","COLO",5);
1087 gMC->Gsatt("TESB","SEEN",0);
1088 gMC->Gsatt("THVM","SEEN",1);
1089 gMC->Gsatt("THVM","COLO",11);
1090 gMC->Gsatt("THVH","SEEN",0);
1091 gMC->Gsatt("TPSR","SEEN",0);
1092 gMC->Gsatt("THVL","SEEN",0);
1093 gMC->Gsatt("THVC","SEEN",0);
1094 gMC->Gsatt("THVE","SEEN",0);
1095 gMC->Gsatt("THVR","SEEN",0);
1096 gMC->Gsatt("TPSS","SEEN",0);
1097 gMC->Gsatt("TPUS","SEEN",0);
1098 gMC->Gsatt("TPLS","SEEN",0);
1101 gMC->Gdopt("hide", "on");
1102 gMC->Gdopt("shad", "on");
1103 gMC->Gsatt("*", "fill", 7);
1104 gMC->SetClipBox(".");
1105 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1106 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1107 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1108 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1109 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1110 gMC->DefaultRange();
1111 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1112 gMC->Gdhead(1111, "Time Projection Chamber");
1113 gMC->Gdman(18, 4, "MAN");
1114 gMC->Gdopt("hide","off");
1117 //_____________________________________________________________________________
1118 void AliTPCv2::CreateMaterials()
1121 // Define materials for version 2 of the Time Projection Chamber
1124 AliTPC::CreateMaterials();
1127 //_____________________________________________________________________________
1128 void AliTPCv2::Init()
1131 // Initialises version 2 of the TPC after that it has been built
1134 Int_t *idtmed = fIdtmed->GetArray();
1139 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
1141 fIDrift=gMC->VolId("TPC_Drift");
1142 fSecOld=-100; // fake number
1144 gMC->SetMaxNStep(30000); // max. number of steps increased
1146 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
1148 AliInfo("*** TPC version 2 initialized ***");
1149 AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1155 //_____________________________________________________________________________
1156 void AliTPCv2::StepManager()
1159 // Called for every step in the Time Projection Chamber
1163 // parameters used for the energy loss calculations
1165 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1166 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1167 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1170 const Float_t kbig = 1.e10;
1177 vol[1]=0; // preset row number to 0
1179 gMC->SetMaxStep(kbig);
1181 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1183 Float_t charge = gMC->TrackCharge();
1185 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1187 // check the sensitive volume
1189 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
1190 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
1192 gMC->TrackPosition(p);
1193 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1197 Double_t angle = TMath::ACos(p[0]/r);
1198 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1200 // angular segment, it is not a real sector number...
1202 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1203 fTPCParam->GetInnerAngle());
1204 // rotate to segment "0"
1206 fTPCParam->AdjustCosSin(sector,cos,sin);
1207 Float_t x1=p[0]*cos + p[1]*sin;
1208 // check if within sector's limits
1209 if(x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp()
1210 ||x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp()){
1211 // calculate real sector number...
1212 if (x1>fTPCParam->GetOuterRadiusLow()){
1213 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1214 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1215 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
1218 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1220 // here I have a sector number
1224 // check if change of sector
1225 if(sector != fSecOld){
1227 // add track reference
1228 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
1230 // track is in the sensitive strip
1232 // track is entering the strip
1233 if (gMC->IsTrackEntering()){
1234 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1235 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1236 // row numbers are autonomous for lower and upper sectors
1237 if(vol[0] > fTPCParam->GetNInnerSector()) {
1238 vol[1] -= fTPCParam->GetNRowLow();
1241 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
1243 // lower sector, row 0, because Jouri wants to have this
1245 gMC->TrackMomentum(p);
1249 hits[3]=0.; // this hit has no energy loss
1250 // Get also the track time for pileup simulation
1251 hits[4]=gMC->TrackTime();
1253 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1257 gMC->TrackPosition(p);
1261 hits[3]=0.; // this hit has no energy loss
1262 // Get also the track time for pileup simulation
1263 hits[4]=gMC->TrackTime();
1265 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1270 //-----------------------------------------------------------------
1271 // charged particle is in the sensitive drift volume
1272 //-----------------------------------------------------------------
1273 if(gMC->TrackStep() > 0) {
1275 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1276 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1278 gMC->TrackPosition(p);
1282 hits[3]=(Float_t)nel;
1287 gMC->TrackMomentum(p);
1288 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1289 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1290 fTrackHits->SetHitPrecision(precision);
1293 // Get also the track time for pileup simulation
1294 hits[4]=gMC->TrackTime();
1296 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1299 } //within sector's limits
1300 // Stemax calculation for the next step
1304 gMC->TrackMomentum(mom);
1305 Float_t ptot=mom.Rho();
1306 Float_t betaGamma = ptot/gMC->TrackMass();
1308 Int_t pid=gMC->TrackPid();
1309 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1311 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1316 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
1317 pp=kprim*BetheBloch(betaGamma);
1319 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1322 Double_t rnd = gMC->GetRandom()->Rndm();
1324 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1329 //_____________________________________________________________________________
1330 Float_t AliTPCv2::BetheBloch(Float_t bg)
1333 // Bethe-Bloch energy loss formula
1335 const Double_t kp1=0.76176e-1;
1336 const Double_t kp2=10.632;
1337 const Double_t kp3=0.13279e-4;
1338 const Double_t kp4=1.8631;
1339 const Double_t kp5=1.9479;
1341 Double_t dbg = (Double_t) bg;
1343 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1345 Double_t aa = TMath::Power(beta,kp4);
1346 Double_t bb = TMath::Power(1./dbg,kp5);
1348 bb=TMath::Log(kp3+bb);
1350 return ((Float_t)((kp2-aa-bb)*kp1/aa));