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"
54 #include "TGeoCompositeShape.h"
56 #include "TGeoPhysicalNode.h"
57 #include "TGeoHalfSpace.h"
58 #include "TTreeStream.h"
69 //_____________________________________________________________________________
70 AliTPCv4::AliTPCv4(const char *name, const char *title) :
77 // Standard constructor for Time Projection Chamber version 2
81 SetBufferSize(128000);
83 if(!fTPCParam) {AliFatal("TPC parameters not set");
88 gaspar1_.fpot=fTPCParam->GetFpot();
90 gaspar1_.eexpo=fTPCParam->GetExp();
94 //_____________________________________________________________________________
95 void AliTPCv4::CreateGeometry()
98 // Create the geometry of Time Projection Chamber version 2
102 <img src="picts/AliTPC.gif">
107 <img src="picts/AliTPCv2Tree.gif">
111 //----------------------------------------------------------
112 // This geometry is written using TGeo class
113 // Firstly the shapes are defined, and only then the volumes
114 // What is recognized by the MC are volumes
115 //----------------------------------------------------------
117 // tpc - this will be the mother volume
121 // here I define a volume TPC
122 // retrive the medium name with "TPC_" as a leading string
124 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
126 tpc->DefineSection(0,-289.6,77.,278.);
127 tpc->DefineSection(1,-262.1,77.,278.);
129 tpc->DefineSection(2,-262.1,83.1,278.);
130 tpc->DefineSection(3,-260.,83.1,278.);
132 tpc->DefineSection(4,-260.,70.,278.);
133 tpc->DefineSection(5,-259.6,70.,278.);
135 tpc->DefineSection(6,-259.6,68.1,278.);
136 tpc->DefineSection(7,-253.6,68.1,278.);
138 tpc->DefineSection(8,-253.6,67.88,278.);//hs
139 tpc->DefineSection(9,-74.0,60.68,278.);// hs
141 tpc->DefineSection(10,-74.0,60.1,278.);
142 tpc->DefineSection(11,-73.3,60.1,278.);
144 tpc->DefineSection(12,-73.3,56.9,278.);
145 tpc->DefineSection(13,-68.5,56.9,278.);
147 tpc->DefineSection(14,-68.5,60.,278.);
148 tpc->DefineSection(15,-64.7,60.,278.);
150 tpc->DefineSection(16,-64.7,56.9,278.);
151 tpc->DefineSection(17,73.3,56.9,278.);
153 tpc->DefineSection(18,73.3,60.1,278.);
154 tpc->DefineSection(19,74.0,60.1,278.);
156 tpc->DefineSection(20,74.0,60.68,278.);// hs
157 tpc->DefineSection(21,253.6,65.38,278.);// hs
159 tpc->DefineSection(22,253.6,65.6,278.);
160 tpc->DefineSection(23,259.6,65.6,278.);
162 tpc->DefineSection(24,259.6,70.0,278.);
163 tpc->DefineSection(25,260.,70.0,278.);
165 tpc->DefineSection(26,260.,83.1,278.);
166 tpc->DefineSection(27,262.1,83.1,278.);
168 tpc->DefineSection(28,262.1,77.,278);
169 tpc->DefineSection(29,289.6,77.,278.);
172 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
173 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
175 // drift volume - sensitive volume, extended beyond the
176 // endcaps, because of the alignment
178 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
179 dvol->DefineSection(0,-260.,74.5,264.4);
180 dvol->DefineSection(1,-253.6,74.5,264.4);
182 dvol->DefineSection(2,-253.6,76.6774,258.);
183 dvol->DefineSection(3,253.6,76.6774,258.);
185 dvol->DefineSection(4,253.6,74.5,264.4);
186 dvol->DefineSection(5,260.,74.5,264.4);
188 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_DriftGas3");
189 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
195 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
197 tpco->DefineSection(0,-256.6,264.8,278.);
198 tpco->DefineSection(1,-253.6,264.8,278.);
200 tpco->DefineSection(2,-253.6,258.,278.);
201 tpco->DefineSection(3,250.6,258.,278.);
203 tpco->DefineSection(4,250.6,258.,275.5);
204 tpco->DefineSection(5,253.6,258.,275.5);
206 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
207 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
209 // outer containment vessel
211 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
213 tocv->DefineSection(0,-256.6,264.8,278.);
214 tocv->DefineSection(1,-253.6,264.8,278.);
216 tocv->DefineSection(2,-253.6,274.8124,278.);
217 tocv->DefineSection(3,247.6,274.8124,278.);
219 tocv->DefineSection(4,247.6,270.4,278.);
220 tocv->DefineSection(5,250.6,270.4,278.);
222 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
223 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
225 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
226 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
227 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
228 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
230 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
231 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
232 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
233 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
235 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
236 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
237 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
238 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
239 TGeoMedium *mhs = gGeoManager->GetMedium("TPC_Steel");
240 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
241 //-------------------------------------------------------
242 // Tpc Outer Field Cage
243 // daughters - composite (sandwich)
244 //-------------------------------------------------------
246 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
248 tofc->DefineSection(0,-253.6,258.,269.6);
249 tofc->DefineSection(1,-250.6,258.,269.6);
251 tofc->DefineSection(2,-250.6,258.,260.0676);
252 tofc->DefineSection(3,250.6,258.,260.0676);
254 tofc->DefineSection(4,250.6,258.,275.5);
255 tofc->DefineSection(5,253.6,258.,275.5);
257 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
259 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
260 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
261 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
263 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
265 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
266 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
267 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
269 // outer part - positioning
271 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
273 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
275 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
277 v2->AddNode(v3,1); v2->AddNode(v4,1);
280 //--------------------------------------------------------------------
281 // Tpc Inner INsulator (CO2)
282 // the cones, the central drum and the inner f.c. sandwich with a piece
283 // of the flane will be placed in the TPC
284 //--------------------------------------------------------------------
285 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
287 tpci->DefineSection(0,-253.6,68.4,76.6774);
288 tpci->DefineSection(1,-74.0,61.2,76.6774);
290 tpci->DefineSection(2,74.0,61.2,76.6774);
292 tpci->DefineSection(3,253.6,65.9,76.6774);
294 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
296 // now the inner field cage - only part of flanges (2 copies)
298 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
299 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
301 //---------------------------------------------------------
302 // Tpc Inner Containment vessel - Muon side
303 //---------------------------------------------------------
304 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
306 tcms->DefineSection(0,-259.1,68.1,74.2);
307 tcms->DefineSection(1,-253.6,68.1,74.2);
309 tcms->DefineSection(2,-253.6,68.1,68.4);
310 tcms->DefineSection(3,-74.0,60.9,61.2);
312 tcms->DefineSection(4,-74.0,60.1,61.2);
313 tcms->DefineSection(5,-73.3,60.1,61.2);
315 tcms->DefineSection(6,-73.3,56.9,61.2);
316 tcms->DefineSection(7,-73.0,56.9,61.2);
318 tcms->DefineSection(8,-73.0,56.9,58.8);
319 tcms->DefineSection(9,-71.3,56.9,58.8);
321 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
322 //------------------------------------------------
323 // Heat screen muon side
324 //------------------------------------------------
326 TGeoCone *thsm = new TGeoCone(89.8,67.88,68.1,60.68,60.9);
327 TGeoCone *thsmw = new TGeoCone(89.8,67.94,68.04,60.74,60.84);
328 TGeoVolume *hvsm = new TGeoVolume("TPC_HSM",thsm,mhs); //steel
329 TGeoVolume *hvsmw = new TGeoVolume("TPC_HSMW",thsmw,m12); //water
330 // assembly heat screen muon
331 hvsm->AddNode(hvsmw,1);
332 //-----------------------------------------------
333 // inner containment vessel - shaft side
334 //-----------------------------------------------
335 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
337 tcss->DefineSection(0,71.3,56.9,58.8);
338 tcss->DefineSection(1,73.0,56.9,58.8);
340 tcss->DefineSection(2,73.0,56.9,61.2);
341 tcss->DefineSection(3,73.3,56.9,61.2);
343 tcss->DefineSection(4,73.3,60.1,61.2);
344 tcss->DefineSection(5,74.0,60.1,61.2);
346 tcss->DefineSection(6,74.0,60.9,61.2);
347 tcss->DefineSection(7,253.6,65.6,65.9);
349 tcss->DefineSection(8,253.6,65.6,74.2);
350 tcss->DefineSection(9,258.1,65.6,74.2);
352 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
353 //-------------------------------------------------
354 // Heat screen shaft side
355 //--------------------------------------------------
356 TGeoCone *thss = new TGeoCone(89.8,60.68,60.9,65.38,65.6);
357 TGeoCone *thssw = new TGeoCone(89.8,60.74,60.84,65.44,65.54);
358 TGeoVolume *hvss = new TGeoVolume("TPC_HSS",thss,mhs); //steel
359 TGeoVolume *hvssw = new TGeoVolume("TPC_HSSW",thssw,m12); //water
360 //assembly heat screen shaft
361 hvss->AddNode(hvssw,1);
362 //-----------------------------------------------
364 // define 4 parts and make an assembly
365 //-----------------------------------------------
366 // part1 - Al - 2 copies
367 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
368 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
369 // sandwich - outermost parts - 2 copies
370 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
371 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
372 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
373 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
375 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
376 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
377 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
378 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
380 // middle parts - 2 copies
381 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
382 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
383 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
384 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
386 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
387 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
388 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
389 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
390 // central part - 1 copy
391 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
392 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
393 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
395 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
396 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
397 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
399 // inner part - positioning
401 // creating a sandwich
402 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
404 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
406 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
408 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
410 tv100->AddNode(tv10,1);
411 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
412 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
413 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
414 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
415 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
416 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
418 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
419 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
420 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
421 v1->AddNode(hvsm,1,new TGeoTranslation(0.,0.,-163.8));
422 v1->AddNode(hvss,1,new TGeoTranslation(0.,0.,163.8));
423 v9->AddNode(tv100,1);
429 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
430 cfl->DefineSection(0,-71.1,59.7,61.2);
431 cfl->DefineSection(1,-68.6,59.7,61.2);
433 cfl->DefineSection(2,-68.6,60.6324,61.2);
434 cfl->DefineSection(3,68.6,60.6324,61.2);
436 cfl->DefineSection(4,68.6,59.7,61.2);
437 cfl->DefineSection(5,71.1,59.7,61.2);
439 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
441 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
442 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
443 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
445 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
446 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
447 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
448 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
450 // seals for central drum 2 copies
452 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
453 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
454 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
455 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
456 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
459 TGeoPcon *se = new TGeoPcon(0.,360.,6);
460 se->DefineSection(0,-72.8,59.7,61.2);
461 se->DefineSection(1,-72.3,59.7,61.2);
463 se->DefineSection(2,-72.3,58.85,61.2);
464 se->DefineSection(3,-71.6,58.85,61.2);
466 se->DefineSection(4,-71.6,59.7,61.2);
467 se->DefineSection(5,-71.3,59.7,61.2);
469 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
471 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
472 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
474 // define reflection matrix
476 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
478 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
480 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
481 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
482 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
484 // central membrane - 2 rings and a mylar membrane - assembly
486 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
487 TGeoTube *oh = new TGeoTube(250.,256.,.5);
488 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
489 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
490 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
491 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
493 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
499 // end caps - they are make as an assembly of single segments
500 // containing both readout chambers
502 Double_t openingAngle = 10.*TMath::DegToRad();
503 Double_t thick=1.5; // rib
504 Double_t shift = thick/TMath::Sin(openingAngle);
506 Double_t lowEdge = 86.3; // hole in the wheel
507 Double_t upEdge = 240.4; // hole in the wheel
509 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
511 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
513 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
514 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
516 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
517 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
519 Double_t ys = shift*TMath::Sin(openingAngle);
520 Double_t xs = shift*TMath::Cos(openingAngle);
521 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
522 tr->RegisterYourself();
523 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
524 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
525 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
526 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
527 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
528 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
529 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
531 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
537 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
538 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
540 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
541 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
542 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
544 Double_t tga = (19.8328-12.3742)/39.3;
546 xmin = 9.55*tga+12.3742;
547 xmax = 9.95*tga+12.3742;
548 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
549 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
550 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
551 xmin=19.4*tga+12.3742;
552 xmax=19.9*tga+12.3742;
553 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
554 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
555 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
556 xmin=29.35*tga+12.3742;
557 xmax=29.75*tga+12.3742;
558 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
559 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
560 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
562 // holes for connectors
564 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
565 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
566 TString fileName(gSystem->Getenv("ALICE_ROOT"));
567 fileName += "/TPC/conn_iroc.dat";
569 in.open(fileName.Data(), ios_base::in); // asci file
570 for(Int_t i =0;i<86;i++){
575 TGeoRotation *rrr = new TGeoRotation();
577 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
578 ibdv->AddNode(connv,i+1,trans);
582 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
584 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
585 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
586 tr1->RegisterYourself();
587 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
588 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
590 // pad plane and wire fixations
592 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
593 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
594 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
595 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
596 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
597 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
598 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
600 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
602 iroc->AddNode(ibdv,1);
603 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
604 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
605 tga =(23.3521-14.5974)/49.65;
606 Double_t xx = 24.825*tga+14.5974-0.6;
607 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
608 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
612 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
613 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
614 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
615 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
616 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
618 tga=(38.5084-20.2938)/99.3;
619 xmin=tga*10.2+20.2938;
620 xmax=tga*10.6+20.2938;
621 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
622 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
624 xmin=22.55*tga+20.2938;
625 xmax=24.15*tga+20.2938;
626 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
627 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
629 xmin=36.1*tga+20.2938;
630 xmax=36.5*tga+20.2938;
631 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
632 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
634 xmin=49.0*tga+20.2938;
635 xmax=50.6*tga+20.2938;
636 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
637 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
639 xmin=63.6*tga+20.2938;
640 xmax=64.0*tga+20.2938;
641 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
642 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
644 xmin=75.5*tga+20.2938;
645 xmax=77.15*tga+20.2938;
646 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
647 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
649 xmin=88.7*tga+20.2938;
650 xmax=89.1*tga+20.2938;
651 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
652 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
654 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
655 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
656 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
657 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
658 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
659 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
660 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
662 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
663 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
664 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
665 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
666 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
668 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
669 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
670 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
671 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
672 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
674 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
675 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
676 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
677 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
678 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
679 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
680 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
681 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
683 // holes for connectors
685 fileName = gSystem->Getenv("ALICE_ROOT");
686 fileName += "/TPC/conn_oroc.dat";
687 in.open(fileName.Data(), ios_base::in); // asci file
688 for(Int_t i =0;i<78;i++){
691 Double_t x1,z1,x2,z2;
693 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
694 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
696 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
698 TGeoRotation *rr = new TGeoRotation();
702 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
703 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
704 obdv->AddNode(connv,i+1,trans1);
705 obdv->AddNode(connv,i+79,trans2);
709 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
710 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
711 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
712 tr5->RegisterYourself();
713 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
714 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
716 // pad plane and wire fixations
718 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
719 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
721 tga=(43.5239-23.3874)/114.2;
722 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
723 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
724 xx = 57.1*tga+23.3874-0.7;
725 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
726 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
728 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
730 oroc->AddNode(obdv,1);
731 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
732 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
733 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
734 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
736 // now iroc and oroc are placed into a sector...
738 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
739 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
740 TGeoRotation rot1("rot1",90.,90.,0.);
741 TGeoRotation rot2("rot2");
743 TGeoRotation *rot = new TGeoRotation("rot");
747 x0=110.2*TMath::Cos(openingAngle);
748 y0=110.2*TMath::Sin(openingAngle);
749 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
750 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
751 x0=188.45*TMath::Cos(openingAngle);
752 y0=188.45*TMath::Sin(openingAngle);
753 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
754 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
759 secta->AddNode(ch,1);
760 secta->AddNode(iroc,1,combi1a);
761 secta->AddNode(oroc,1,combi2a);
765 sectc->AddNode(ch,1);
766 sectc->AddNode(iroc,1,combi1c);
767 sectc->AddNode(oroc,1,combi2c);
769 // now I try to make wheels...
771 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
772 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
774 for(Int_t i =0;i<18;i++){
775 Double_t phi = (20.*i);
776 TGeoRotation *r = new TGeoRotation();
778 wheela->AddNode(secta,i+1,r);
779 wheelc->AddNode(sectc,i+1,r);
782 // wheels in the drift volume!
784 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
785 v9->AddNode(wheela,1,combi3);
786 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
787 //_____________________________________________________________
788 // service support wheel
789 //_____________________________________________________________
790 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
791 sw->DefineSection(0,-4.,80.5,251.75);
792 sw->DefineSection(1,4.,80.5,251.75);
793 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
796 shift = thick/TMath::Sin(openingAngle);
797 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
798 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
799 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
800 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
802 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
803 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
804 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
805 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
806 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
811 ys = shift*TMath::Sin(openingAngle);
812 xs = shift*TMath::Cos(openingAngle);
813 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
815 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
816 co->DefineSection(0,-0.5,77.,255.25);
817 co->DefineSection(1,0.5,77.,255.25);
818 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
820 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
821 shift=4./TMath::Sin(openingAngle);
822 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
823 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
825 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
827 ys = shift*TMath::Sin(openingAngle);
828 xs = shift*TMath::Cos(openingAngle);
829 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
831 // Sector as an Assembly
833 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
834 swhs->AddNode(swv,1);
835 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
836 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
838 // SSW as an Assembly of sectors
840 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
841 for(Int_t i =0;i<18;i++){
842 Double_t phi = (20.*i);
843 TGeoRotation *r = new TGeoRotation();
845 swheel->AddNode(swhs,i+1,r);
847 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
848 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
850 // sensitive strips - strip "0" is always set
853 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
856 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
857 upar=new Double_t [10];
866 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
873 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
874 gGeoManager->Node("TPC_Strip",totrows+1,
875 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
877 // now, strips optionally
881 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
882 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
887 gGeoManager->Node("TPC_Strip",i,
888 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
889 gGeoManager->Node("TPC_Strip",totrows+i,
890 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
893 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
894 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
899 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
900 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
901 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
902 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
905 //----------------------------------------------------------
906 // TPc Support Rods - MAKROLON
907 //----------------------------------------------------------
908 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
909 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
910 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
911 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
912 TGeoMedium *m14 = gGeoManager->GetMedium("TPC_Alumina1");
914 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
916 // tpc rod is an assembly of 10 long parts and 2 short parts
917 // connected with alu rings and plagged on both sides.
922 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
923 rod->DefineSection(0,-10.43,1.92,2.08);
924 rod->DefineSection(1,-9.75,1.92,2.08);
926 rod->DefineSection(2,-9.75,1.8,2.2);
927 rod->DefineSection(3,9.75,1.8,2.2);
929 rod->DefineSection(4,9.75,1.92,2.08);
930 rod->DefineSection(5,10.43,1.92,2.08);
932 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
936 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
937 rod1->DefineSection(0,-8.93,1.92,2.08);
938 rod1->DefineSection(1,-8.25,1.92,2.08);
940 rod1->DefineSection(2,-8.25,1.8,2.2);
941 rod1->DefineSection(3,8.25,1.8,2.2);
943 rod1->DefineSection(4,8.25,1.92,2.08);
944 rod1->DefineSection(5,8.93,1.92,2.08);
946 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
948 // below is for the resistor rod
950 // hole for the brass connectors
953 new TGeoTube("hhole",0.,0.3,0.3);
955 //transformations for holes - initialy they
956 // are placed at x=0 and negative y
958 TGeoRotation *rhole = new TGeoRotation();
960 TGeoCombiTrans *transf[13];
962 for(Int_t i=0;i<13;i++){
963 //sprintf(name,"transf%d",i);
964 snprintf(name,30,"transf%d",i);
965 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
966 transf[i]->RegisterYourself();
968 // union expression for holes
969 TString operl("hhole:transf0");
970 for (Int_t i=1;i<13;i++){
971 //sprintf(name,"+hhole:transf%d",i);
972 snprintf(name,30,"+hhole:transf%d",i);
976 TString opers("hhole:transf1");
977 for (Int_t i=2;i<12;i++){
978 //sprintf(name,"+hhole:transf%d",i);
979 snprintf(name,30,"+hhole:transf%d",i);
983 new TGeoCompositeShape("hlv",operl.Data());
984 new TGeoCompositeShape("hsv",opers.Data());
986 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
987 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
988 //rods - volumes - makrolon rods with holes
989 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
990 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
993 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
994 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
996 // hooks holding strips
998 new TGeoBBox("hk1",0.625,0.015,0.75);
999 new TGeoBBox("hk2",0.625,0.015,0.15);
1000 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
1001 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
1002 tr21->RegisterYourself();
1003 tr12->RegisterYourself();
1005 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
1006 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
1008 // assembly of the short rod with connectors and hooks
1013 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1015 spart->AddNode( rodsv,1);
1016 for(Int_t i=1;i<12;i++){
1017 spart->AddNode(bconv,i,transf[i]);
1019 for(Int_t i =0;i<11;i++){
1020 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
1025 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1027 lpart->AddNode( rodlv,1);
1028 for(Int_t i=0;i<13;i++){
1029 lpart->AddNode(bconv,i+12,transf[i]);
1031 for(Int_t i =0;i<13;i++){
1032 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
1037 new TGeoTube("ring1",2.1075,2.235,0.53);
1038 new TGeoTube("ring2",1.7925,1.89,0.43);
1039 new TGeoTube("ring3",1.89,2.1075,0.05);
1040 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1041 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1045 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
1046 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1048 for(Int_t i=0;i<11;i++){
1049 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
1050 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1052 for(Int_t i=0;i<10;i++){
1053 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//resistor rod
1054 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//makrolon rod
1057 // right plug - identical for all rods
1059 TGeoPcon *tpcrp = new TGeoPcon(0.,360.,6);
1061 tpcrp->DefineSection(0,123.05,1.89,2.1075);
1062 tpcrp->DefineSection(1,123.59,1.89,2.1075);
1064 tpcrp->DefineSection(2,123.59,1.8,2.2);
1065 tpcrp->DefineSection(3,127.,1.8,2.2);
1067 tpcrp->DefineSection(4,127.,0.,2.2);
1068 tpcrp->DefineSection(5,127.5,0.,2.2);
1070 TGeoVolume *tpcrpv = new TGeoVolume("TPC_RP",tpcrp,m6);
1072 // adding short pieces and right plug
1074 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1075 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1076 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1077 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
1078 tpcrrod->AddNode(tpcrpv,1);
1080 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1081 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1082 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1083 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1084 tpcmrod->AddNode(tpcrpv,2);
1086 // from the ringv position to the CM is 3.0 cm!
1087 //----------------------------------------
1090 //HV rods - makrolon + 0.58cm (diameter) Cu ->check the length
1091 TGeoTube *hvr = new TGeoTube(0.,1.465,123.);
1092 TGeoTube *hvc = new TGeoTube(0.,0.29,123.);
1094 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1095 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1096 hvrv->AddNode(hvcv,1);
1100 TGeoTube *cr = new TGeoTube(0.,0.45,123.);
1101 TGeoTube *cw = new TGeoTube(0.,0.15,123.);
1102 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
1103 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
1105 // ceramic rod with water
1107 crv->AddNode(cwv,1);
1111 TGeoTube *pr =new TGeoTube(0.2,0.35,123.);
1112 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
1114 // copper plates with connectors
1116 new TGeoTube("tub",0.,1.7,0.025);
1118 // half space - points on the plane and a normal vector
1121 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1122 Double_t intp = 1.245;
1124 Double_t b = slope*slope+1.;
1133 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1137 new TGeoHalfSpace("sp1",p,n);
1146 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1150 new TGeoHalfSpace("sp2",p,n);
1153 new TGeoTube("h1",0.,0.5,0.025);
1154 new TGeoTube("h2",0.,0.35,0.025);
1156 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1157 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1158 ttr11->RegisterYourself();
1159 ttr22->RegisterYourself();
1160 // elastic connector
1161 new TGeoBBox("elcon",0.72,0.005,0.3);
1162 TGeoRotation *crr1 = new TGeoRotation();
1163 crr1->RotateZ(-22.);
1164 TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1165 ctr1->RegisterYourself();
1166 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1167 "(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1169 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1171 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1174 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
1176 rrod->AddNode(crv,1,ttr11);
1177 rrod->AddNode(crv,2,ttr22);
1178 rrod->AddNode(prv,1);
1180 for(Int_t i=0;i<165;i++){
1181 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1184 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1185 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m14);
1186 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1187 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1188 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1190 TGeoRotation *crr2 = new TGeoRotation();
1192 TGeoRotation *crr3 = new TGeoRotation();
1193 crr3->RotateY(-30.);
1195 for(Int_t i=0;i<164;i+=2){
1196 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1197 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1200 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
1202 // rod left head with holders - inner
1204 // first element - support for inner holder TPC_IHS
1205 Double_t shift1[3] = {0.0,-0.175,0.0};
1207 new TGeoBBox("tpcihs1", 4.7, 0.66, 2.35);
1208 new TGeoBBox("tpcihs2", 4.7, 0.485, 1.0, shift1);
1209 new TGeoBBox("tpcihs3", 1.5, 0.485, 2.35, shift1);
1210 new TGeoTube("tpcihs4", 0.0, 2.38, 0.1);
1212 Double_t pointstrap[16];
1216 pointstrap[3]= 1.08;
1218 pointstrap[5]= 1.08;
1219 pointstrap[6]= 3.38;
1223 pointstrap[10]= 0.0;
1224 pointstrap[11]= 1.08;
1225 pointstrap[12]= 2.3;
1226 pointstrap[13]= 1.08;
1227 pointstrap[14]= 3.38;
1228 pointstrap[15]= 0.0;
1230 TGeoArb8 *tpcihs5 = new TGeoArb8("tpcihs5", 0.6, pointstrap);
1232 // half space - cutting "legs"
1242 new TGeoHalfSpace("cutil1", p, n);
1247 TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0.0, 2.84, 2.25);
1248 trans2->RegisterYourself();
1249 TGeoTranslation*trans3= new TGeoTranslation("trans3", 0.0, 2.84, -2.25);
1250 trans3->RegisterYourself();
1251 //support - composite volume
1253 TGeoCompositeShape *tpcihs6 = new TGeoCompositeShape("tpcihs6", "tpcihs1-(tpcihs2+tpcihs3)-(tpcihs4:trans2)-(tpcihs4:trans3)-cutil1");
1255 // volumes - all makrolon
1257 TGeoVolume *tpcihss = new TGeoVolume("TPC_IHSS", tpcihs6, m6); //support
1258 TGeoVolume *tpcihst = new TGeoVolume("TPC_IHSTR",tpcihs5 , m6); //trapesoid
1260 TGeoRotation *rot111 = new TGeoRotation();
1261 rot111->RotateY(180.0);
1263 TGeoVolumeAssembly *tpcihs = new TGeoVolumeAssembly("TPC_IHS"); // assembly of the support
1264 tpcihs->AddNode(tpcihss, 1);
1265 tpcihs->AddNode(tpcihst, 1, new TGeoTranslation(-4.7, 0.66, 0.0));
1266 tpcihs->AddNode(tpcihst, 2, new TGeoCombiTrans(4.7, 0.66, 0.0, rot111));
1268 // two rod holders (TPC_IRH) assembled with the support
1270 new TGeoBBox("tpcirh1", 4.7, 1.33, 0.5);
1274 new TGeoBBox("tpcirh2", 1.05, 0.8, 0.5, shift1);
1278 new TGeoBBox("tpcirh3", 1.05, 0.8, 0.5, shift1);
1282 new TGeoBBox("tpcirh4", 1.9, 0.25, 0.5, shift1);
1283 new TGeoTube("tpcirh5", 0, 1.9, 5);
1285 TGeoTranslation *trans4 = new TGeoTranslation("trans4", 0, 0.83, 0.0);
1286 trans4->RegisterYourself();
1288 TGeoCompositeShape *tpcirh6 = new TGeoCompositeShape("tpcirh6", "tpcirh1-tpcirh2-tpcirh3-(tpcirh5:trans4)-tpcirh4");
1292 TGeoVolume *tpcirh = new TGeoVolume("TPC_IRH", tpcirh6, m6);
1294 // and all together...
1296 TGeoVolume *tpciclamp = new TGeoVolumeAssembly("TPC_ICLP");
1297 tpciclamp->AddNode(tpcihs, 1);
1298 tpciclamp->AddNode(tpcirh, 1, new TGeoTranslation(0, 1.99, 1.1));
1299 tpciclamp->AddNode(tpcirh, 2, new TGeoTranslation(0, 1.99, -1.1));
1301 // and now left inner "head"
1303 TGeoPcon *inplug = new TGeoPcon("inplug", 0.0, 360.0, 14);
1305 inplug->DefineSection(0, 0.3, 0.0, 2.2);
1306 inplug->DefineSection(1, 0.6, 0.0, 2.2);
1308 inplug->DefineSection(2, 0.6, 0.0, 1.75);
1309 inplug->DefineSection(3, 0.7, 0.0, 1.75);
1311 inplug->DefineSection(4, 0.7, 1.55, 1.75);
1312 inplug->DefineSection(5, 1.6, 1.55, 1.75);
1314 inplug->DefineSection(6, 1.6, 1.55, 2.2);
1315 inplug->DefineSection(7, 1.875, 1.55, 2.2);
1317 inplug->DefineSection(8, 1.875, 1.55, 2.2);
1318 inplug->DefineSection(9, 2.47, 1.75, 2.2);
1320 inplug->DefineSection(10, 2.47, 1.75, 2.08);
1321 inplug->DefineSection(11, 2.57, 1.8, 2.08);
1323 inplug->DefineSection(12, 2.57, 1.92, 2.08);
1324 inplug->DefineSection(13, 2.95, 1.92, 2.08);
1330 new TGeoBBox("pcuti", 1.5, 0.11, 1.075, shift1);
1332 TGeoCompositeShape *inplleft = new TGeoCompositeShape("inplleft", "inplug-pcuti");
1333 TGeoVolume *tpcinlplug = new TGeoVolume("TPC_INPLL", inplleft, m6);
1337 TGeoVolume *tpcihpl = new TGeoVolumeAssembly("TPC_IHPL"); //holder+2 plugs (reflected)
1338 tpcihpl->AddNode(tpcinlplug, 1);
1339 tpcihpl->AddNode(tpcinlplug, 2,ref);
1340 tpcihpl->AddNode(tpciclamp,1,new TGeoTranslation(0.0, -2.765, 0.0));
1342 // outer holders and clamps
1345 // outer membrane holder (between rods)
1351 pointstrap[5]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1356 pointstrap[10]= 0.0;
1357 pointstrap[11]= 2.8;
1358 pointstrap[12]= 3.1;
1359 pointstrap[13]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1360 pointstrap[14]= 3.1;
1361 pointstrap[15]= 0.0;
1363 TGeoArb8 *tpcomh1 = new TGeoArb8("tpcomh1", 1.05, pointstrap);
1364 TGeoBBox *tpcomh2 = new TGeoBBox("tpcomh2", 0.8, 1.4, 6);
1366 TGeoVolume *tpcomh1v = new TGeoVolume("TPC_OMH1", tpcomh1, m7);
1367 TGeoVolume *tpcomh2v = new TGeoVolume("TPC_OMH2", tpcomh2, m7);
1369 TGeoVolume *tpcomh3v = new TGeoVolumeAssembly("TPC_OMH3"); // assembly1
1370 tpcomh3v->AddNode(tpcomh1v, 1, new TGeoTranslation(0.8, -1.4, 4.95));
1371 tpcomh3v->AddNode(tpcomh1v, 2, new TGeoTranslation(0.8, -1.4, -4.95));
1372 tpcomh3v->AddNode(tpcomh2v, 1);
1378 new TGeoBBox("tpcomh3", 1.65, 1.15, 3.4);
1379 TGeoBBox *tpcomh4 = new TGeoBBox("tpcomh4", 0.75, 0.7, 3.4, shift1);
1388 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1391 new TGeoHalfSpace("cutomh1", p, n);
1400 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1403 new TGeoHalfSpace("cutomh2", p, n);
1411 n[0] = 1.0*TMath::Tan(75.*TMath::DegToRad());
1415 new TGeoHalfSpace("cutomh3", p, n);
1423 n[0] = 1.0*TMath::Tan(75*TMath::DegToRad());
1427 new TGeoHalfSpace("cutomh4", p, n);
1436 n[1] = -1.0*TMath::Tan(20.*TMath::DegToRad());
1439 new TGeoHalfSpace("cutomh5", p, n);
1441 TGeoCompositeShape *tpcomh5 = new TGeoCompositeShape("tpcomh5", "tpcomh3-cutomh1-cutomh2-cutomh3-cutomh4-cutomh5");
1443 TGeoVolume *tpcomh5v = new TGeoVolume("TPC_OMH5",tpcomh5,m6);
1444 TGeoVolume *tpcomh4v = new TGeoVolume("TPC_OMH6",tpcomh4,m6);
1446 TGeoVolumeAssembly *tpcomh7v = new TGeoVolumeAssembly("TPC_OMH7");
1447 tpcomh7v->AddNode(tpcomh5v,1);
1448 tpcomh7v->AddNode(tpcomh4v,1);
1450 // full membrane holder - tpcomh3v + tpcomh7v
1452 TGeoVolumeAssembly *tpcomh = new TGeoVolumeAssembly("TPC_OMH");
1453 tpcomh->AddNode(tpcomh3v,1,new TGeoTranslation(1.5,0.,0.));
1454 tpcomh->AddNode(tpcomh3v,2,new TGeoCombiTrans(-1.5,0.,0.,rot111));
1455 tpcomh->AddNode(tpcomh7v,1,new TGeoTranslation(0.65+1.5, 2.55, 0.0));
1456 tpcomh->AddNode(tpcomh7v,2,new TGeoCombiTrans(-0.65-1.5, 2.55, 0.0,rot111));
1458 // outer rod holder support
1460 new TGeoBBox("tpcohs1", 3.8, 0.675, 2.35);
1466 new TGeoBBox("tpcohs2", 1.5, 0.5, 2.35, shift1);
1467 new TGeoBBox("tpcohs3", 3.8, 0.5, 0.85, shift1);
1473 TGeoBBox *tpcohs4 = new TGeoBBox("tpsohs4", 3.1, 0.5, 0.7, shift1);
1475 TGeoVolume *tpcohs4v = new TGeoVolume("TPC_OHS4", tpcohs4, m6);
1485 new TGeoHalfSpace("cutohs1", p, n);
1487 TGeoCompositeShape *tpcohs5 = new TGeoCompositeShape("tpcohs5", "tpcohs1-tpcohs2-tpcohs3-cutohs1");
1488 TGeoVolume *tpcohs5v = new TGeoVolume("TPC_OHS5", tpcohs5, m6);
1490 TGeoVolumeAssembly *tpcohs = new TGeoVolumeAssembly("TPC_OHS");
1491 tpcohs->AddNode(tpcohs5v, 1);
1492 tpcohs->AddNode(tpcohs4v, 1);
1494 // outer rod holder itself
1499 new TGeoBBox("tpcorh1", 3.1, 1.825, 0.55); //from this box we cut pieces...
1505 new TGeoBBox("tpcorh2", 0.5, 2.75, 1.1, shift1);
1511 new TGeoBBox("tpcorh3", 0.5, 2.75, 1.1, shift1);
1517 new TGeoBBox("tpcorh4", 3.9, 2.75, 0.5, shift1);
1523 new TGeoBBox("tpcorh5", 1.95, 0.5, 1.1, shift1);
1529 new TGeoBBox("tpcorh6", 2.4, 0.5, 0.6, shift1);
1531 new TGeoTube("tpcorh7", 0, 1.95, 0.85);
1532 new TGeoTube("tpcorh8", 0, 2.4, 0.6);
1534 TGeoTranslation *trans33 = new TGeoTranslation("trans33", 0.0, 0.0, 0.55);
1535 trans33->RegisterYourself();
1537 TGeoCompositeShape *tpcorh9 = new TGeoCompositeShape("tpcorh9", "tpcorh1-tpcorh2-tpcorh3-tpcorh4-tpcorh5-tpcorh6-(tpcorh8:trans33)-tpcorh7");
1539 TGeoVolume *tpcorh9v = new TGeoVolume("TPC_ORH",tpcorh9,m6); //outer rod holder
1541 // now 2 holders together
1543 TGeoVolumeAssembly *tpcorh = new TGeoVolumeAssembly("TPC_ORH2");
1545 tpcorh->AddNode(tpcorh9v,1,new TGeoTranslation(0.0, 0.0, 1.25));
1546 tpcorh->AddNode(tpcorh9v,2,new TGeoCombiTrans(0.0, 0.0, -1.25,rot111));
1548 // outer rod plug left
1550 TGeoPcon *outplug = new TGeoPcon("outplug", 0.0, 360.0, 14);
1552 outplug->DefineSection(0, 0.5, 0.0, 2.2);
1553 outplug->DefineSection(1, 0.7, 0.0, 2.2);
1555 outplug->DefineSection(2, 0.7, 1.55, 2.2);
1556 outplug->DefineSection(3, 0.8, 1.55, 2.2);
1558 outplug->DefineSection(4, 0.8, 1.55, 1.75);
1559 outplug->DefineSection(5, 1.2, 1.55, 1.75);
1561 outplug->DefineSection(6, 1.2, 1.55, 2.2);
1562 outplug->DefineSection(7, 1.875, 1.55, 2.2);
1564 outplug->DefineSection(8, 1.875, 1.55, 2.2);
1565 outplug->DefineSection(9, 2.47, 1.75, 2.2);
1567 outplug->DefineSection(10, 2.47, 1.75, 2.08);
1568 outplug->DefineSection(11, 2.57, 1.8, 2.08);
1570 outplug->DefineSection(12, 2.57, 1.92, 2.08);
1571 outplug->DefineSection(13, 2.95, 1.92, 2.08);
1577 new TGeoBBox("cutout", 2.5, 0.11, 1.01, shift1);
1580 TGeoCompositeShape *outplleft = new TGeoCompositeShape("outplleft", "outplug-cutout");
1581 TGeoVolume *outplleftv = new TGeoVolume("TPC_OPLL", outplleft, m6);
1583 // support + holder + plug
1587 TGeoVolumeAssembly *tpcohpl = new TGeoVolumeAssembly("TPC_OHPL");
1589 tpcohpl->AddNode(outplleftv,1); //plug
1590 tpcohpl->AddNode(outplleftv,2,ref); //plug reflected
1591 tpcohpl->AddNode(tpcorh,1); //rod holder
1592 tpcohpl->AddNode(tpcohs,1,new TGeoTranslation(0.0, 3.925, 0)); // support
1596 // main membrane holder
1603 pointstrap[5]= 1.96;
1608 pointstrap[10]= 0.0;
1609 pointstrap[11]= 2.8;
1610 pointstrap[12]= 3.1;
1611 pointstrap[13]= 1.96;
1612 pointstrap[14]= 3.1;
1613 pointstrap[15]= 0.0;
1615 TGeoArb8 *tpcmmh1 = new TGeoArb8("tpcmmh1", 1.75, pointstrap);
1616 TGeoBBox *tpcmmh2 = new TGeoBBox("tpcmmh2", 0.8, 1.4, 12.5);
1618 TGeoVolume *tpcmmh1v = new TGeoVolume("TPC_MMH1", tpcmmh1, m6);
1619 TGeoVolume *tpcmmh2v = new TGeoVolume("TPC_MMH2", tpcmmh2, m6);
1621 TGeoVolumeAssembly *tpcmmhs = new TGeoVolumeAssembly("TPC_MMHS");
1622 tpcmmhs->AddNode(tpcmmh1v,1,new TGeoTranslation(0.8, -1.4, 10.75));
1623 tpcmmhs->AddNode(tpcmmh1v,2,new TGeoTranslation(0.8, -1.4, -10.75));
1624 tpcmmhs->AddNode(tpcmmh2v,1);
1626 // main membrahe holder clamp
1632 new TGeoBBox("tpcmmhc1", 1.65, 1.85, 8.9);
1633 new TGeoBBox("tpcmmhc2", 0.9, 0.7, 8.9, shift1);
1635 // half spaces - cuts
1643 n[2] = 8.0*TMath::Tan(13.*TMath::DegToRad());
1645 new TGeoHalfSpace("cutmmh1", p, n);
1653 n[2] = -8.0*TMath::Tan(13.*TMath::DegToRad());
1655 new TGeoHalfSpace("cutmmh2", p, n);
1663 n[2] = 6.1*TMath::Tan(20.*TMath::DegToRad());
1665 new TGeoHalfSpace("cutmmh3", p, n);
1673 n[2] = -6.1*TMath::Tan(20*TMath::DegToRad());
1675 new TGeoHalfSpace("cutmmh4", p, n);
1681 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1685 new TGeoHalfSpace("cutmmh5", p, n);
1691 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1695 new TGeoHalfSpace("cutmmh6", p, n);
1697 TGeoCompositeShape *tpcmmhc = new TGeoCompositeShape("TPC_MMHC", "tpcmmhc1-tpcmmhc2-cutmmh1-cutmmh2-cutmmh3-cutmmh4-cutmmh5-cutmmh6");
1699 TGeoVolume *tpcmmhcv = new TGeoVolume("TPC_MMHC",tpcmmhc,m6);
1701 TGeoVolume *tpcmmh = new TGeoVolumeAssembly("TPC_MMH");
1703 tpcmmh->AddNode(tpcmmhcv,1,new TGeoTranslation(0.65+1.5, 1.85, 0.0));
1704 tpcmmh->AddNode(tpcmmhcv,2,new TGeoCombiTrans(-0.65-1.5, 1.85, 0.0,rot111));
1705 tpcmmh->AddNode(tpcmmhs,1,new TGeoTranslation(1.5, 0.0, 0.0));
1706 tpcmmh->AddNode(tpcmmhs,2,new TGeoCombiTrans(-1.5, 0.0, 0.0,rot111));
1711 //--------------------------------------------
1713 // guard ring resistor chain
1716 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
1718 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m14);
1723 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1724 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1726 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1727 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1729 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1730 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
1732 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1733 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
1734 //------------------------------------------------------------------
1735 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1736 TGeoRotation rotrod("rotrod");
1738 TGeoRotation *rotpos[2];
1740 TGeoRotation *rotrod1[2];
1745 TGeoRotation rot102("rot102");
1746 rot102.RotateY(-90.);
1748 for(Int_t i=0;i<18;i++){
1751 angle=TMath::DegToRad()*20.*(Double_t)i;
1754 x=r * TMath::Cos(angle);
1755 y=r * TMath::Sin(angle);
1757 TGeoRotation *rot12 = new TGeoRotation();
1758 rot12->RotateZ(-90.0+i*20.);
1759 v9->AddNode(tpcihpl,i+1,new TGeoCombiTrans(x, y, 0., rot12));
1761 if(i==11){//resistor rod inner
1762 rotrod.RotateZ(-90.+angle);
1763 rotrod1[0]= new TGeoRotation();
1764 rotpos[0]= new TGeoRotation();
1766 rotrod1[0]->RotateZ(-90.+angle);
1767 *rotpos[0] = refl*rotrod; //rotation+reflection
1768 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1769 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
1772 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1773 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
1777 x=r * TMath::Cos(angle);
1778 y=r * TMath::Sin(angle);
1781 // outer rod holder + outer left plug
1783 TGeoRotation *rot33 = new TGeoRotation();
1784 rot33->RotateZ(-90+i*20.);
1786 v9->AddNode(tpcohpl,i+1,new TGeoCombiTrans(x, y, 0., rot33));
1788 Double_t xxx = 256.297*TMath::Cos((i*20.+10.)*TMath::DegToRad());
1789 Double_t yyy = 256.297*TMath::Sin((i*20.+10.)*TMath::DegToRad());
1791 TGeoRotation rot101("rot101");
1792 rot101.RotateZ(90.+i*20.+10.);
1793 TGeoRotation *rot103 = new TGeoRotation("rot103");
1794 *rot103 = rot101*rot102;
1796 TGeoCombiTrans *trh100 = new TGeoCombiTrans(xxx,yyy,0.,rot103);
1799 //main membrane holder
1800 v9->AddNode(tpcmmh,1,trh100);
1803 // "normal" membrane holder
1804 v9->AddNode(tpcomh,i+1,trh100);
1808 if(i==3){//resistor rod outer
1809 rotrod.RotateZ(90.+angle);
1810 rotrod1[1]= new TGeoRotation();
1811 rotpos[1]= new TGeoRotation();
1812 rotrod1[1]->RotateZ(90.+angle);
1813 *rotpos[1] = refl*rotrod;//rotation+reflection
1814 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1815 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
1818 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1819 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
1822 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
1826 } //end of rods positioning
1829 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1830 alice->AddNode(v1,1);
1832 } // end of function
1834 //_____________________________________________________________________________
1835 void AliTPCv4::AddAlignableVolumes() const
1838 // Create entries for alignable volumes associating the symbolic volume
1839 // name with the corresponding volume path. Needs to be syncronized with
1840 // eventual changes in the geometry.
1842 SetInnerChambersAlignable();
1843 SetOuterChambersAlignable();
1846 //_____________________________________________________________________________
1847 void AliTPCv4::SetInnerChambersAlignable() const
1851 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1852 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1853 TString vpappend = "/TPC_IROC_1";
1854 TString snstr1="TPC/EndcapA/Sector";
1855 TString snstr2="TPC/EndcapC/Sector";
1856 TString snappend="/InnerChamber";
1857 TString volpath, symname;
1859 for(Int_t cnt=1; cnt<=18; cnt++){
1862 volpath += vpappend;
1865 symname += snappend;
1866 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1867 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1869 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1870 const char *path = alignableEntry->GetTitle();
1871 if (!gGeoManager->cd(path))
1872 AliFatal(Form("Volume path %s not valid!",path));
1873 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1874 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1875 alignableEntry->SetMatrix(matTtoL);
1879 for(Int_t cnt=1; cnt<=18; cnt++){
1882 volpath += vpappend;
1885 symname += snappend;
1886 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1887 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1888 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1889 const char *path = alignableEntry->GetTitle();
1890 if (!gGeoManager->cd(path))
1891 AliFatal(Form("Volume path %s not valid!",path));
1892 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1893 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1894 alignableEntry->SetMatrix(matTtoL);
1899 //_____________________________________________________________________________
1900 void AliTPCv4::SetOuterChambersAlignable() const
1904 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1905 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1906 TString vpappend = "/TPC_OROC_1";
1907 TString snstr1="TPC/EndcapA/Sector";
1908 TString snstr2="TPC/EndcapC/Sector";
1909 TString snappend="/OuterChamber";
1910 TString volpath, symname;
1912 for(Int_t cnt=1; cnt<=18; cnt++){
1915 volpath += vpappend;
1918 symname += snappend;
1919 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1920 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1921 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1922 const char *path = alignableEntry->GetTitle();
1923 if (!gGeoManager->cd(path))
1924 AliFatal(Form("Volume path %s not valid!",path));
1925 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1926 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1927 alignableEntry->SetMatrix(matTtoL);
1931 for(Int_t cnt=1; cnt<=18; cnt++){
1934 volpath += vpappend;
1937 symname += snappend;
1938 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1939 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1940 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1941 const char *path = alignableEntry->GetTitle();
1942 if (!gGeoManager->cd(path))
1943 AliFatal(Form("Volume path %s not valid!",path));
1944 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1945 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1946 alignableEntry->SetMatrix(matTtoL);
1952 //_____________________________________________________________________________
1953 void AliTPCv4::CreateMaterials()
1956 // Define materials for version 2 of the Time Projection Chamber
1959 AliTPC::CreateMaterials();
1962 //_____________________________________________________________________________
1963 void AliTPCv4::Init()
1966 // Initialises version 2 of the TPC after that it has been built
1969 //Int_t *idtmed = fIdtmed->GetArray();
1974 fIdSens=TVirtualMC::GetMC()->VolId("TPC_Strip"); // one strip is always selected...
1976 fIDrift=TVirtualMC::GetMC()->VolId("TPC_Drift");
1977 fSecOld=-100; // fake number
1979 TVirtualMC::GetMC()->SetMaxNStep(-30000); // max. number of steps increased
1981 // specific energy loss set in galice.cuts
1983 AliInfo("*** TPC version 4 initialized ***");
1984 AliInfo(Form("Maximum number of steps = %d",TVirtualMC::GetMC()->GetMaxNStep()));
1990 //_____________________________________________________________________________
1991 void AliTPCv4::StepManager()
1994 // Called for every step in the Time Projection Chamber
1998 // parameters used for the energy loss calculations
2000 Float_t prim = fTPCParam->GetNprim();
2001 Float_t poti = fTPCParam->GetFpot();
2002 Float_t wIon = fTPCParam->GetWmean();
2005 const Float_t kbig = 1.e10;
2012 vol[1]=0; // preset row number to 0
2014 TVirtualMC::GetMC()->SetMaxStep(kbig);
2018 Float_t charge = TVirtualMC::GetMC()->TrackCharge();
2020 if(TMath::Abs(charge)<=0.) return; // take only charged particles
2022 // check the sensitive volume
2024 id = TVirtualMC::GetMC()->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
2025 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
2027 TVirtualMC::GetMC()->TrackPosition(p);
2028 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2032 Double_t angle = TMath::ACos(p[0]/r);
2033 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
2035 // angular segment, it is not a real sector number...
2037 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
2038 fTPCParam->GetInnerAngle());
2039 // rotate to segment "0"
2041 fTPCParam->AdjustCosSin(sector,cos,sin);
2042 Float_t x1=p[0]*cos + p[1]*sin;
2043 // check if within sector's limits
2044 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
2045 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
2046 // calculate real sector number...
2047 if (x1>fTPCParam->GetOuterRadiusLow()){
2048 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
2049 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
2050 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
2053 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
2055 // here I have a sector number
2059 // check if change of sector
2060 if(sector != fSecOld){
2062 // add track reference
2063 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
2065 // track is in the sensitive strip
2067 // track is entering the strip
2068 if (TVirtualMC::GetMC()->IsTrackEntering()){
2069 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
2070 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
2071 // row numbers are autonomous for lower and upper sectors
2072 if(vol[0] > fTPCParam->GetNInnerSector()) {
2073 vol[1] -= fTPCParam->GetNRowLow();
2076 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
2078 // lower sector, row 0, because Jouri wants to have this
2080 TVirtualMC::GetMC()->TrackMomentum(p);
2084 hits[3]=0.; // this hit has no energy loss
2085 // Get also the track time for pileup simulation
2086 hits[4]=TVirtualMC::GetMC()->TrackTime();
2088 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2092 TVirtualMC::GetMC()->TrackPosition(p);
2096 hits[3]=0.; // this hit has no energy loss
2097 // Get also the track time for pileup simulation
2098 hits[4]=TVirtualMC::GetMC()->TrackTime();
2100 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2105 //-----------------------------------------------------------------
2106 // charged particle is in the sensitive drift volume
2107 //-----------------------------------------------------------------
2109 if(TVirtualMC::GetMC()->TrackStep() > 0){
2111 Int_t nel = (Int_t)(((TVirtualMC::GetMC()->Edep())-poti)/wIon) + 1;
2112 nel=TMath::Min(nel,30); // 30 electrons corresponds to 1 keV
2114 TVirtualMC::GetMC()->TrackPosition(p);
2118 hits[3]=(Float_t)nel;
2124 TVirtualMC::GetMC()->TrackMomentum(p);
2125 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2126 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2127 fTrackHits->SetHitPrecision(precision);
2130 // Get also the track time for pileup simulation
2131 hits[4]=TVirtualMC::GetMC()->TrackTime();
2133 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2136 } //within sector's limits
2137 // Stemax calculation for the next step
2138 if(!TVirtualMC::GetMC()->IsTrackAlive()) return; // particle has disappeared
2141 TVirtualMC::GetMC()->TrackMomentum(mom);
2142 Float_t ptot=mom.Rho();
2143 Float_t betaGamma = ptot/TVirtualMC::GetMC()->TrackMass();
2145 Int_t pid=TVirtualMC::GetMC()->TrackPid();
2146 // if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2148 // pp = prim*1.58; // electrons above 20 MeV/c are on the plateau!
2153 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
2154 TVectorD* bbpar = fTPCParam->GetBetheBlochParameters(); //get parametrization from OCDB
2155 pp=prim*AliMathBase::BetheBlochAleph(betaGamma,(*bbpar)(0),(*bbpar)(1),(*bbpar)(2),(*bbpar)(3),(*bbpar)(4));
2156 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2159 Double_t rnd = TVirtualMC::GetMC()->GetRandom()->Rndm();
2161 TVirtualMC::GetMC()->SetMaxStep(-TMath::Log(rnd)/pp);