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"
65 //_____________________________________________________________________________
66 AliTPCv4::AliTPCv4(const char *name, const char *title) :
73 // Standard constructor for Time Projection Chamber version 2
77 SetBufferSize(128000);
81 fTPCParam->Write(fTPCParam->GetTitle());
84 //_____________________________________________________________________________
85 void AliTPCv4::CreateGeometry()
88 // Create the geometry of Time Projection Chamber version 2
92 <img src="picts/AliTPC.gif">
97 <img src="picts/AliTPCv2Tree.gif">
101 //----------------------------------------------------------
102 // This geometry is written using TGeo class
103 // Firstly the shapes are defined, and only then the volumes
104 // What is recognized by the MC are volumes
105 //----------------------------------------------------------
107 // tpc - this will be the mother volume
111 // here I define a volume TPC
112 // retrive the medium name with "TPC_" as a leading string
114 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
116 tpc->DefineSection(0,-289.6,77.,278.);
117 tpc->DefineSection(1,-262.1,77.,278.);
119 tpc->DefineSection(2,-262.1,83.1,278.);
120 tpc->DefineSection(3,-260.,83.1,278.);
122 tpc->DefineSection(4,-260.,70.,278.);
123 tpc->DefineSection(5,-259.6,70.,278.);
125 tpc->DefineSection(6,-259.6,68.1,278.);
126 tpc->DefineSection(7,-253.6,68.1,278.);
128 tpc->DefineSection(8,-253.6,67.88,278.);//hs
129 tpc->DefineSection(9,-74.0,60.68,278.);// hs
131 tpc->DefineSection(10,-74.0,60.1,278.);
132 tpc->DefineSection(11,-73.3,60.1,278.);
134 tpc->DefineSection(12,-73.3,56.9,278.);
135 tpc->DefineSection(13,-68.5,56.9,278.);
137 tpc->DefineSection(14,-68.5,60.,278.);
138 tpc->DefineSection(15,-64.7,60.,278.);
140 tpc->DefineSection(16,-64.7,56.9,278.);
141 tpc->DefineSection(17,73.3,56.9,278.);
143 tpc->DefineSection(18,73.3,60.1,278.);
144 tpc->DefineSection(19,74.0,60.1,278.);
146 tpc->DefineSection(20,74.0,60.68,278.);// hs
147 tpc->DefineSection(21,253.6,65.38,278.);// hs
149 tpc->DefineSection(22,253.6,65.6,278.);
150 tpc->DefineSection(23,259.6,65.6,278.);
152 tpc->DefineSection(24,259.6,70.0,278.);
153 tpc->DefineSection(25,260.,70.0,278.);
155 tpc->DefineSection(26,260.,83.1,278.);
156 tpc->DefineSection(27,262.1,83.1,278.);
158 tpc->DefineSection(28,262.1,77.,278);
159 tpc->DefineSection(29,289.6,77.,278.);
162 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
163 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
165 // drift volume - sensitive volume, extended beyond the
166 // endcaps, because of the alignment
168 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
169 dvol->DefineSection(0,-260.,74.5,264.4);
170 dvol->DefineSection(1,-253.6,74.5,264.4);
172 dvol->DefineSection(2,-253.6,76.6774,258.);
173 dvol->DefineSection(3,253.6,76.6774,258.);
175 dvol->DefineSection(4,253.6,74.5,264.4);
176 dvol->DefineSection(5,260.,74.5,264.4);
178 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_DriftGas3");
179 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
185 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
187 tpco->DefineSection(0,-256.6,264.8,278.);
188 tpco->DefineSection(1,-253.6,264.8,278.);
190 tpco->DefineSection(2,-253.6,258.,278.);
191 tpco->DefineSection(3,250.6,258.,278.);
193 tpco->DefineSection(4,250.6,258.,275.5);
194 tpco->DefineSection(5,253.6,258.,275.5);
196 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
197 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
199 // outer containment vessel
201 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
203 tocv->DefineSection(0,-256.6,264.8,278.);
204 tocv->DefineSection(1,-253.6,264.8,278.);
206 tocv->DefineSection(2,-253.6,274.8124,278.);
207 tocv->DefineSection(3,247.6,274.8124,278.);
209 tocv->DefineSection(4,247.6,270.4,278.);
210 tocv->DefineSection(5,250.6,270.4,278.);
212 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
213 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
215 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
216 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
217 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
218 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
220 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
221 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
222 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
223 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
225 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
226 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
227 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
228 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
229 TGeoMedium *mhs = gGeoManager->GetMedium("TPC_Steel");
230 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
231 //-------------------------------------------------------
232 // Tpc Outer Field Cage
233 // daughters - composite (sandwich)
234 //-------------------------------------------------------
236 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
238 tofc->DefineSection(0,-253.6,258.,269.6);
239 tofc->DefineSection(1,-250.6,258.,269.6);
241 tofc->DefineSection(2,-250.6,258.,260.0676);
242 tofc->DefineSection(3,250.6,258.,260.0676);
244 tofc->DefineSection(4,250.6,258.,275.5);
245 tofc->DefineSection(5,253.6,258.,275.5);
247 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
249 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
250 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
251 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
253 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
255 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
256 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
257 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
259 // outer part - positioning
261 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
263 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
265 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
267 v2->AddNode(v3,1); v2->AddNode(v4,1);
270 //--------------------------------------------------------------------
271 // Tpc Inner INsulator (CO2)
272 // the cones, the central drum and the inner f.c. sandwich with a piece
273 // of the flane will be placed in the TPC
274 //--------------------------------------------------------------------
275 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
277 tpci->DefineSection(0,-253.6,68.4,76.6774);
278 tpci->DefineSection(1,-74.0,61.2,76.6774);
280 tpci->DefineSection(2,74.0,61.2,76.6774);
282 tpci->DefineSection(3,253.6,65.9,76.6774);
284 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
286 // now the inner field cage - only part of flanges (2 copies)
288 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
289 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
291 //---------------------------------------------------------
292 // Tpc Inner Containment vessel - Muon side
293 //---------------------------------------------------------
294 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
296 tcms->DefineSection(0,-259.1,68.1,74.2);
297 tcms->DefineSection(1,-253.6,68.1,74.2);
299 tcms->DefineSection(2,-253.6,68.1,68.4);
300 tcms->DefineSection(3,-74.0,60.9,61.2);
302 tcms->DefineSection(4,-74.0,60.1,61.2);
303 tcms->DefineSection(5,-73.3,60.1,61.2);
305 tcms->DefineSection(6,-73.3,56.9,61.2);
306 tcms->DefineSection(7,-73.0,56.9,61.2);
308 tcms->DefineSection(8,-73.0,56.9,58.8);
309 tcms->DefineSection(9,-71.3,56.9,58.8);
311 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
312 //------------------------------------------------
313 // Heat screen muon side
314 //------------------------------------------------
316 TGeoCone *thsm = new TGeoCone(89.8,67.88,68.1,60.68,60.9);
317 TGeoCone *thsmw = new TGeoCone(89.8,67.94,68.04,60.74,60.84);
318 TGeoVolume *hvsm = new TGeoVolume("TPC_HSM",thsm,mhs); //steel
319 TGeoVolume *hvsmw = new TGeoVolume("TPC_HSMW",thsmw,m12); //water
320 // assembly heat screen muon
321 hvsm->AddNode(hvsmw,1);
322 //-----------------------------------------------
323 // inner containment vessel - shaft side
324 //-----------------------------------------------
325 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
327 tcss->DefineSection(0,71.3,56.9,58.8);
328 tcss->DefineSection(1,73.0,56.9,58.8);
330 tcss->DefineSection(2,73.0,56.9,61.2);
331 tcss->DefineSection(3,73.3,56.9,61.2);
333 tcss->DefineSection(4,73.3,60.1,61.2);
334 tcss->DefineSection(5,74.0,60.1,61.2);
336 tcss->DefineSection(6,74.0,60.9,61.2);
337 tcss->DefineSection(7,253.6,65.6,65.9);
339 tcss->DefineSection(8,253.6,65.6,74.2);
340 tcss->DefineSection(9,258.1,65.6,74.2);
342 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
343 //-------------------------------------------------
344 // Heat screen shaft side
345 //--------------------------------------------------
346 TGeoCone *thss = new TGeoCone(89.8,60.68,60.9,65.38,65.6);
347 TGeoCone *thssw = new TGeoCone(89.8,60.74,60.84,65.44,65.54);
348 TGeoVolume *hvss = new TGeoVolume("TPC_HSS",thss,mhs); //steel
349 TGeoVolume *hvssw = new TGeoVolume("TPC_HSSW",thssw,m12); //water
350 //assembly heat screen shaft
351 hvss->AddNode(hvssw,1);
352 //-----------------------------------------------
354 // define 4 parts and make an assembly
355 //-----------------------------------------------
356 // part1 - Al - 2 copies
357 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
358 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
359 // sandwich - outermost parts - 2 copies
360 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
361 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
362 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
363 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
365 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
366 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
367 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
368 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
370 // middle parts - 2 copies
371 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
372 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
373 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
374 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
376 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
377 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
378 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
379 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
380 // central part - 1 copy
381 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
382 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
383 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
385 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
386 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
387 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
389 // inner part - positioning
391 // creating a sandwich
392 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
394 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
396 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
398 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
400 tv100->AddNode(tv10,1);
401 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
402 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
403 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
404 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
405 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
406 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
408 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
409 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
410 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
411 v1->AddNode(hvsm,1,new TGeoTranslation(0.,0.,-163.8));
412 v1->AddNode(hvss,1,new TGeoTranslation(0.,0.,163.8));
413 v9->AddNode(tv100,1);
419 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
420 cfl->DefineSection(0,-71.1,59.7,61.2);
421 cfl->DefineSection(1,-68.6,59.7,61.2);
423 cfl->DefineSection(2,-68.6,60.6324,61.2);
424 cfl->DefineSection(3,68.6,60.6324,61.2);
426 cfl->DefineSection(4,68.6,59.7,61.2);
427 cfl->DefineSection(5,71.1,59.7,61.2);
429 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
431 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
432 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
433 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
435 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
436 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
437 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
438 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
440 // seals for central drum 2 copies
442 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
443 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
444 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
445 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
446 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
449 TGeoPcon *se = new TGeoPcon(0.,360.,6);
450 se->DefineSection(0,-72.8,59.7,61.2);
451 se->DefineSection(1,-72.3,59.7,61.2);
453 se->DefineSection(2,-72.3,58.85,61.2);
454 se->DefineSection(3,-71.6,58.85,61.2);
456 se->DefineSection(4,-71.6,59.7,61.2);
457 se->DefineSection(5,-71.3,59.7,61.2);
459 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
461 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
462 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
464 // define reflection matrix
466 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
468 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
470 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
471 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
472 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
474 // central membrane - 2 rings and a mylar membrane - assembly
476 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
477 TGeoTube *oh = new TGeoTube(250.,256.,.5);
478 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
479 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
480 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
481 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
483 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
489 // end caps - they are make as an assembly of single segments
490 // containing both readout chambers
492 Double_t openingAngle = 10.*TMath::DegToRad();
493 Double_t thick=1.5; // rib
494 Double_t shift = thick/TMath::Sin(openingAngle);
496 Double_t lowEdge = 86.3; // hole in the wheel
497 Double_t upEdge = 240.4; // hole in the wheel
499 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
501 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
503 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
504 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
506 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
507 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
509 Double_t ys = shift*TMath::Sin(openingAngle);
510 Double_t xs = shift*TMath::Cos(openingAngle);
511 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
512 tr->RegisterYourself();
513 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
514 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
515 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
516 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
517 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
518 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
519 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
521 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
527 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
528 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
530 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
531 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
532 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
534 Double_t tga = (19.8328-12.3742)/39.3;
536 xmin = 9.55*tga+12.3742;
537 xmax = 9.95*tga+12.3742;
538 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
539 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
540 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
541 xmin=19.4*tga+12.3742;
542 xmax=19.9*tga+12.3742;
543 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
544 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
545 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
546 xmin=29.35*tga+12.3742;
547 xmax=29.75*tga+12.3742;
548 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
549 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
550 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
552 // holes for connectors
554 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
555 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
556 TString fileName(gSystem->Getenv("ALICE_ROOT"));
557 fileName += "/TPC/conn_iroc.dat";
559 in.open(fileName.Data(), ios_base::in); // asci file
560 for(Int_t i =0;i<86;i++){
565 TGeoRotation *rrr = new TGeoRotation();
567 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
568 ibdv->AddNode(connv,i+1,trans);
572 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
574 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
575 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
576 tr1->RegisterYourself();
577 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
578 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
580 // pad plane and wire fixations
582 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
583 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
584 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
585 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
586 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
587 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
588 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
590 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
592 iroc->AddNode(ibdv,1);
593 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
594 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
595 tga =(23.3521-14.5974)/49.65;
596 Double_t xx = 24.825*tga+14.5974-0.6;
597 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
598 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
602 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
603 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
604 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
605 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
606 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
608 tga=(38.5084-20.2938)/99.3;
609 xmin=tga*10.2+20.2938;
610 xmax=tga*10.6+20.2938;
611 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
612 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
614 xmin=22.55*tga+20.2938;
615 xmax=24.15*tga+20.2938;
616 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
617 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
619 xmin=36.1*tga+20.2938;
620 xmax=36.5*tga+20.2938;
621 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
622 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
624 xmin=49.0*tga+20.2938;
625 xmax=50.6*tga+20.2938;
626 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
627 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
629 xmin=63.6*tga+20.2938;
630 xmax=64.0*tga+20.2938;
631 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
632 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
634 xmin=75.5*tga+20.2938;
635 xmax=77.15*tga+20.2938;
636 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
637 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
639 xmin=88.7*tga+20.2938;
640 xmax=89.1*tga+20.2938;
641 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
642 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
644 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
645 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
646 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
647 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
648 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
649 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
650 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
652 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
653 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
654 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
655 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
656 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
658 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
659 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
660 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
661 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
662 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
664 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
665 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
666 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
667 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
668 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
669 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
670 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
671 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
673 // holes for connectors
675 fileName = gSystem->Getenv("ALICE_ROOT");
676 fileName += "/TPC/conn_oroc.dat";
677 in.open(fileName.Data(), ios_base::in); // asci file
678 for(Int_t i =0;i<78;i++){
681 Double_t x1,z1,x2,z2;
683 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
684 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
686 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
688 TGeoRotation *rr = new TGeoRotation();
692 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
693 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
694 obdv->AddNode(connv,i+1,trans1);
695 obdv->AddNode(connv,i+79,trans2);
699 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
700 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
701 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
702 tr5->RegisterYourself();
703 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
704 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
706 // pad plane and wire fixations
708 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
709 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
711 tga=(43.5239-23.3874)/114.2;
712 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
713 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
714 xx = 57.1*tga+23.3874-0.7;
715 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
716 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
718 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
720 oroc->AddNode(obdv,1);
721 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
722 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
723 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
724 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
726 // now iroc and oroc are placed into a sector...
728 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
729 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
730 TGeoRotation rot1("rot1",90.,90.,0.);
731 TGeoRotation rot2("rot2");
733 TGeoRotation *rot = new TGeoRotation("rot");
737 x0=110.2*TMath::Cos(openingAngle);
738 y0=110.2*TMath::Sin(openingAngle);
739 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
740 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
741 x0=188.45*TMath::Cos(openingAngle);
742 y0=188.45*TMath::Sin(openingAngle);
743 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
744 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
749 secta->AddNode(ch,1);
750 secta->AddNode(iroc,1,combi1a);
751 secta->AddNode(oroc,1,combi2a);
755 sectc->AddNode(ch,1);
756 sectc->AddNode(iroc,1,combi1c);
757 sectc->AddNode(oroc,1,combi2c);
759 // now I try to make wheels...
761 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
762 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
764 for(Int_t i =0;i<18;i++){
765 Double_t phi = (20.*i);
766 TGeoRotation *r = new TGeoRotation();
768 wheela->AddNode(secta,i+1,r);
769 wheelc->AddNode(sectc,i+1,r);
772 // wheels in the drift volume!
774 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
775 v9->AddNode(wheela,1,combi3);
776 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
777 //_____________________________________________________________
778 // service support wheel
779 //_____________________________________________________________
780 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
781 sw->DefineSection(0,-4.,80.5,251.75);
782 sw->DefineSection(1,4.,80.5,251.75);
783 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
786 shift = thick/TMath::Sin(openingAngle);
787 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
788 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
789 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
790 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
792 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
793 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
794 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
795 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
796 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
801 ys = shift*TMath::Sin(openingAngle);
802 xs = shift*TMath::Cos(openingAngle);
803 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
805 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
806 co->DefineSection(0,-0.5,77.,255.25);
807 co->DefineSection(1,0.5,77.,255.25);
808 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
810 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
811 shift=4./TMath::Sin(openingAngle);
812 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
813 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
815 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
817 ys = shift*TMath::Sin(openingAngle);
818 xs = shift*TMath::Cos(openingAngle);
819 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
821 // Sector as an Assembly
823 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
824 swhs->AddNode(swv,1);
825 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
826 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
828 // SSW as an Assembly of sectors
830 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
831 for(Int_t i =0;i<18;i++){
832 Double_t phi = (20.*i);
833 TGeoRotation *r = new TGeoRotation();
835 swheel->AddNode(swhs,i+1,r);
837 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
838 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
840 // sensitive strips - strip "0" is always set
843 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
846 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
847 upar=new Double_t [10];
856 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
863 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
864 gGeoManager->Node("TPC_Strip",totrows+1,
865 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
867 // now, strips optionally
871 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
872 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
877 gGeoManager->Node("TPC_Strip",i,
878 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
879 gGeoManager->Node("TPC_Strip",totrows+i,
880 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
883 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
884 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
889 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
890 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
891 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
892 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
895 //----------------------------------------------------------
896 // TPc Support Rods - MAKROLON
897 //----------------------------------------------------------
898 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
899 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
900 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
901 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
903 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
905 // tpc rod is an assembly of 10 long parts and 2 short parts
906 // connected with alu rings and plagged on both sides.
911 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
912 rod->DefineSection(0,-10.43,1.92,2.08);
913 rod->DefineSection(1,-9.75,1.92,2.08);
915 rod->DefineSection(2,-9.75,1.8,2.2);
916 rod->DefineSection(3,9.75,1.8,2.2);
918 rod->DefineSection(4,9.75,1.92,2.08);
919 rod->DefineSection(5,10.43,1.92,2.08);
921 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
925 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
926 rod1->DefineSection(0,-8.93,1.92,2.08);
927 rod1->DefineSection(1,-8.25,1.92,2.08);
929 rod1->DefineSection(2,-8.25,1.8,2.2);
930 rod1->DefineSection(3,8.25,1.8,2.2);
932 rod1->DefineSection(4,8.25,1.92,2.08);
933 rod1->DefineSection(5,8.93,1.92,2.08);
935 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
937 // below is for the resistor rod
939 // hole for the brass connectors
942 new TGeoTube("hhole",0.,0.3,0.3);
944 //transformations for holes - initialy they
945 // are placed at x=0 and negative y
947 TGeoRotation *rhole = new TGeoRotation();
949 TGeoCombiTrans *transf[13];
951 for(Int_t i=0;i<13;i++){
952 //sprintf(name,"transf%d",i);
953 snprintf(name,30,"transf%d",i);
954 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
955 transf[i]->RegisterYourself();
957 // union expression for holes
958 TString operl("hhole:transf0");
959 for (Int_t i=1;i<13;i++){
960 //sprintf(name,"+hhole:transf%d",i);
961 snprintf(name,30,"+hhole:transf%d",i);
965 TString opers("hhole:transf1");
966 for (Int_t i=2;i<12;i++){
967 //sprintf(name,"+hhole:transf%d",i);
968 snprintf(name,30,"+hhole:transf%d",i);
972 new TGeoCompositeShape("hlv",operl.Data());
973 new TGeoCompositeShape("hsv",opers.Data());
975 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
976 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
977 //rods - volumes - makrolon rods with holes
978 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
979 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
982 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
983 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
985 // hooks holding strips
987 new TGeoBBox("hk1",0.625,0.015,0.75);
988 new TGeoBBox("hk2",0.625,0.015,0.15);
989 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
990 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
991 tr21->RegisterYourself();
992 tr12->RegisterYourself();
994 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
995 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
997 // assembly of the short rod with connectors and hooks
1002 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1004 spart->AddNode( rodsv,1);
1005 for(Int_t i=1;i<12;i++){
1006 spart->AddNode(bconv,i,transf[i]);
1008 for(Int_t i =0;i<11;i++){
1009 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
1014 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1016 lpart->AddNode( rodlv,1);
1017 for(Int_t i=0;i<13;i++){
1018 lpart->AddNode(bconv,i+12,transf[i]);
1020 for(Int_t i =0;i<13;i++){
1021 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
1026 new TGeoTube("ring1",2.1075,2.235,0.53);
1027 new TGeoTube("ring2",1.7925,1.89,0.43);
1028 new TGeoTube("ring3",1.89,2.1075,0.05);
1029 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1030 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1034 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
1035 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1037 for(Int_t i=0;i<11;i++){
1038 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
1039 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1041 for(Int_t i=0;i<10;i++){
1042 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//resistor rod
1043 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//makrolon rod
1046 // right plug - identical for all rods
1048 TGeoPcon *tpcrp = new TGeoPcon(0.,360.,6);
1050 tpcrp->DefineSection(0,123.05,1.89,2.1075);
1051 tpcrp->DefineSection(1,123.59,1.89,2.1075);
1053 tpcrp->DefineSection(2,123.59,1.8,2.2);
1054 tpcrp->DefineSection(3,127.,1.8,2.2);
1056 tpcrp->DefineSection(4,127.,0.,2.2);
1057 tpcrp->DefineSection(5,127.5,0.,2.2);
1059 TGeoVolume *tpcrpv = new TGeoVolume("TPC_RP",tpcrp,m6);
1061 // adding short pieces and right plug
1063 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1064 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1065 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1066 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
1067 tpcrrod->AddNode(tpcrpv,1);
1069 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1070 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1071 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1072 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1073 tpcmrod->AddNode(tpcrpv,2);
1075 // from the ringv position to the CM is 3.0 cm!
1076 //----------------------------------------
1079 //HV rods - makrolon + 0.58cm (diameter) Cu ->check the length
1080 TGeoTube *hvr = new TGeoTube(0.,1.465,123.);
1081 TGeoTube *hvc = new TGeoTube(0.,0.29,123.);
1083 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1084 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1085 hvrv->AddNode(hvcv,1);
1089 TGeoTube *cr = new TGeoTube(0.,0.45,123.);
1090 TGeoTube *cw = new TGeoTube(0.,0.15,123.);
1091 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
1092 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
1094 // ceramic rod with water
1096 crv->AddNode(cwv,1);
1100 TGeoTube *pr =new TGeoTube(0.2,0.35,123.);
1101 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
1103 // copper plates with connectors
1105 new TGeoTube("tub",0.,1.7,0.025);
1107 // half space - points on the plane and a normal vector
1110 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1111 Double_t intp = 1.245;
1113 Double_t b = slope*slope+1.;
1122 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1126 new TGeoHalfSpace("sp1",p,n);
1135 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1139 new TGeoHalfSpace("sp2",p,n);
1142 new TGeoTube("h1",0.,0.5,0.025);
1143 new TGeoTube("h2",0.,0.35,0.025);
1145 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1146 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1147 ttr11->RegisterYourself();
1148 ttr22->RegisterYourself();
1149 // elastic connector
1150 new TGeoBBox("elcon",0.72,0.005,0.3);
1151 TGeoRotation *crr1 = new TGeoRotation();
1152 crr1->RotateZ(-22.);
1153 TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1154 ctr1->RegisterYourself();
1155 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1156 "(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1158 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1160 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1163 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
1165 rrod->AddNode(crv,1,ttr11);
1166 rrod->AddNode(crv,2,ttr22);
1167 rrod->AddNode(prv,1);
1169 for(Int_t i=0;i<165;i++){
1170 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1173 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1174 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m10);
1175 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1176 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1177 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1179 TGeoRotation *crr2 = new TGeoRotation();
1181 TGeoRotation *crr3 = new TGeoRotation();
1182 crr3->RotateY(-30.);
1184 for(Int_t i=0;i<164;i+=2){
1185 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1186 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1189 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
1191 // rod left head with holders - inner
1193 // first element - support for inner holder TPC_IHS
1194 Double_t shift1[3] = {0.0,-0.175,0.0};
1196 new TGeoBBox("tpcihs1", 4.7, 0.66, 2.35);
1197 new TGeoBBox("tpcihs2", 4.7, 0.485, 1.0, shift1);
1198 new TGeoBBox("tpcihs3", 1.5, 0.485, 2.35, shift1);
1199 new TGeoTube("tpcihs4", 0.0, 2.38, 0.1);
1201 Double_t pointstrap[16];
1205 pointstrap[3]= 1.08;
1207 pointstrap[5]= 1.08;
1208 pointstrap[6]= 3.38;
1212 pointstrap[10]= 0.0;
1213 pointstrap[11]= 1.08;
1214 pointstrap[12]= 2.3;
1215 pointstrap[13]= 1.08;
1216 pointstrap[14]= 3.38;
1217 pointstrap[15]= 0.0;
1219 TGeoArb8 *tpcihs5 = new TGeoArb8("tpcihs5", 0.6, pointstrap);
1221 // half space - cutting "legs"
1231 new TGeoHalfSpace("cutil1", p, n);
1236 TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0.0, 2.84, 2.25);
1237 trans2->RegisterYourself();
1238 TGeoTranslation*trans3= new TGeoTranslation("trans3", 0.0, 2.84, -2.25);
1239 trans3->RegisterYourself();
1240 //support - composite volume
1242 TGeoCompositeShape *tpcihs6 = new TGeoCompositeShape("tpcihs6", "tpcihs1-(tpcihs2+tpcihs3)-(tpcihs4:trans2)-(tpcihs4:trans3)-cutil1");
1244 // volumes - all makrolon
1246 TGeoVolume *tpcihss = new TGeoVolume("TPC_IHSS", tpcihs6, m6); //support
1247 TGeoVolume *tpcihst = new TGeoVolume("TPC_IHSTR",tpcihs5 , m6); //trapesoid
1249 TGeoRotation *rot111 = new TGeoRotation();
1250 rot111->RotateY(180.0);
1252 TGeoVolumeAssembly *tpcihs = new TGeoVolumeAssembly("TPC_IHS"); // assembly of the support
1253 tpcihs->AddNode(tpcihss, 1);
1254 tpcihs->AddNode(tpcihst, 1, new TGeoTranslation(-4.7, 0.66, 0.0));
1255 tpcihs->AddNode(tpcihst, 2, new TGeoCombiTrans(4.7, 0.66, 0.0, rot111));
1257 // two rod holders (TPC_IRH) assembled with the support
1259 new TGeoBBox("tpcirh1", 4.7, 1.33, 0.5);
1263 new TGeoBBox("tpcirh2", 1.05, 0.8, 0.5, shift1);
1267 new TGeoBBox("tpcirh3", 1.05, 0.8, 0.5, shift1);
1271 new TGeoBBox("tpcirh4", 1.9, 0.25, 0.5, shift1);
1272 new TGeoTube("tpcirh5", 0, 1.9, 5);
1274 TGeoTranslation *trans4 = new TGeoTranslation("trans4", 0, 0.83, 0.0);
1275 trans4->RegisterYourself();
1277 TGeoCompositeShape *tpcirh6 = new TGeoCompositeShape("tpcirh6", "tpcirh1-tpcirh2-tpcirh3-(tpcirh5:trans4)-tpcirh4");
1281 TGeoVolume *tpcirh = new TGeoVolume("TPC_IRH", tpcirh6, m6);
1283 // and all together...
1285 TGeoVolume *tpciclamp = new TGeoVolumeAssembly("TPC_ICLP");
1286 tpciclamp->AddNode(tpcihs, 1);
1287 tpciclamp->AddNode(tpcirh, 1, new TGeoTranslation(0, 1.99, 1.1));
1288 tpciclamp->AddNode(tpcirh, 2, new TGeoTranslation(0, 1.99, -1.1));
1290 // and now left inner "head"
1292 TGeoPcon *inplug = new TGeoPcon("inplug", 0.0, 360.0, 14);
1294 inplug->DefineSection(0, 0.3, 0.0, 2.2);
1295 inplug->DefineSection(1, 0.6, 0.0, 2.2);
1297 inplug->DefineSection(2, 0.6, 0.0, 1.75);
1298 inplug->DefineSection(3, 0.7, 0.0, 1.75);
1300 inplug->DefineSection(4, 0.7, 1.55, 1.75);
1301 inplug->DefineSection(5, 1.6, 1.55, 1.75);
1303 inplug->DefineSection(6, 1.6, 1.55, 2.2);
1304 inplug->DefineSection(7, 1.875, 1.55, 2.2);
1306 inplug->DefineSection(8, 1.875, 1.55, 2.2);
1307 inplug->DefineSection(9, 2.47, 1.75, 2.2);
1309 inplug->DefineSection(10, 2.47, 1.75, 2.08);
1310 inplug->DefineSection(11, 2.57, 1.8, 2.08);
1312 inplug->DefineSection(12, 2.57, 1.92, 2.08);
1313 inplug->DefineSection(13, 2.95, 1.92, 2.08);
1319 new TGeoBBox("pcuti", 1.5, 0.11, 1.075, shift1);
1321 TGeoCompositeShape *inplleft = new TGeoCompositeShape("inplleft", "inplug-pcuti");
1322 TGeoVolume *tpcinlplug = new TGeoVolume("TPC_INPLL", inplleft, m6);
1326 TGeoVolume *tpcihpl = new TGeoVolumeAssembly("TPC_IHPL"); //holder+2 plugs (reflected)
1327 tpcihpl->AddNode(tpcinlplug, 1);
1328 tpcihpl->AddNode(tpcinlplug, 2,ref);
1329 tpcihpl->AddNode(tpciclamp,1,new TGeoTranslation(0.0, -2.765, 0.0));
1331 // outer holders and clamps
1334 // outer membrane holder (between rods)
1340 pointstrap[5]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1345 pointstrap[10]= 0.0;
1346 pointstrap[11]= 2.8;
1347 pointstrap[12]= 3.1;
1348 pointstrap[13]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1349 pointstrap[14]= 3.1;
1350 pointstrap[15]= 0.0;
1352 TGeoArb8 *tpcomh1 = new TGeoArb8("tpcomh1", 1.05, pointstrap);
1353 TGeoBBox *tpcomh2 = new TGeoBBox("tpcomh2", 0.8, 1.4, 6);
1355 TGeoVolume *tpcomh1v = new TGeoVolume("TPC_OMH1", tpcomh1, m7);
1356 TGeoVolume *tpcomh2v = new TGeoVolume("TPC_OMH2", tpcomh2, m7);
1358 TGeoVolume *tpcomh3v = new TGeoVolumeAssembly("TPC_OMH3"); // assembly1
1359 tpcomh3v->AddNode(tpcomh1v, 1, new TGeoTranslation(0.8, -1.4, 4.95));
1360 tpcomh3v->AddNode(tpcomh1v, 2, new TGeoTranslation(0.8, -1.4, -4.95));
1361 tpcomh3v->AddNode(tpcomh2v, 1);
1367 new TGeoBBox("tpcomh3", 1.65, 1.15, 3.4);
1368 TGeoBBox *tpcomh4 = new TGeoBBox("tpcomh4", 0.75, 0.7, 3.4, shift1);
1377 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1380 new TGeoHalfSpace("cutomh1", p, n);
1389 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1392 new TGeoHalfSpace("cutomh2", p, n);
1400 n[0] = 1.0*TMath::Tan(75.*TMath::DegToRad());
1404 new TGeoHalfSpace("cutomh3", p, n);
1412 n[0] = 1.0*TMath::Tan(75*TMath::DegToRad());
1416 new TGeoHalfSpace("cutomh4", p, n);
1425 n[1] = -1.0*TMath::Tan(20.*TMath::DegToRad());
1428 new TGeoHalfSpace("cutomh5", p, n);
1430 TGeoCompositeShape *tpcomh5 = new TGeoCompositeShape("tpcomh5", "tpcomh3-cutomh1-cutomh2-cutomh3-cutomh4-cutomh5");
1432 TGeoVolume *tpcomh5v = new TGeoVolume("TPC_OMH5",tpcomh5,m6);
1433 TGeoVolume *tpcomh4v = new TGeoVolume("TPC_OMH6",tpcomh4,m6);
1435 TGeoVolumeAssembly *tpcomh7v = new TGeoVolumeAssembly("TPC_OMH7");
1436 tpcomh7v->AddNode(tpcomh5v,1);
1437 tpcomh7v->AddNode(tpcomh4v,1);
1439 // full membrane holder - tpcomh3v + tpcomh7v
1441 TGeoVolumeAssembly *tpcomh = new TGeoVolumeAssembly("TPC_OMH");
1442 tpcomh->AddNode(tpcomh3v,1,new TGeoTranslation(1.5,0.,0.));
1443 tpcomh->AddNode(tpcomh3v,2,new TGeoCombiTrans(-1.5,0.,0.,rot111));
1444 tpcomh->AddNode(tpcomh7v,1,new TGeoTranslation(0.65+1.5, 2.55, 0.0));
1445 tpcomh->AddNode(tpcomh7v,2,new TGeoCombiTrans(-0.65-1.5, 2.55, 0.0,rot111));
1447 // outer rod holder support
1449 new TGeoBBox("tpcohs1", 3.8, 0.675, 2.35);
1455 new TGeoBBox("tpcohs2", 1.5, 0.5, 2.35, shift1);
1456 new TGeoBBox("tpcohs3", 3.8, 0.5, 0.85, shift1);
1462 TGeoBBox *tpcohs4 = new TGeoBBox("tpsohs4", 3.1, 0.5, 0.7, shift1);
1464 TGeoVolume *tpcohs4v = new TGeoVolume("TPC_OHS4", tpcohs4, m6);
1474 new TGeoHalfSpace("cutohs1", p, n);
1476 TGeoCompositeShape *tpcohs5 = new TGeoCompositeShape("tpcohs5", "tpcohs1-tpcohs2-tpcohs3-cutohs1");
1477 TGeoVolume *tpcohs5v = new TGeoVolume("TPC_OHS5", tpcohs5, m6);
1479 TGeoVolumeAssembly *tpcohs = new TGeoVolumeAssembly("TPC_OHS");
1480 tpcohs->AddNode(tpcohs5v, 1);
1481 tpcohs->AddNode(tpcohs4v, 1);
1483 // outer rod holder itself
1488 new TGeoBBox("tpcorh1", 3.1, 1.825, 0.55); //from this box we cut pieces...
1494 new TGeoBBox("tpcorh2", 0.5, 2.75, 1.1, shift1);
1500 new TGeoBBox("tpcorh3", 0.5, 2.75, 1.1, shift1);
1506 new TGeoBBox("tpcorh4", 3.9, 2.75, 0.5, shift1);
1512 new TGeoBBox("tpcorh5", 1.95, 0.5, 1.1, shift1);
1518 new TGeoBBox("tpcorh6", 2.4, 0.5, 0.6, shift1);
1520 new TGeoTube("tpcorh7", 0, 1.95, 0.85);
1521 new TGeoTube("tpcorh8", 0, 2.4, 0.6);
1523 TGeoTranslation *trans33 = new TGeoTranslation("trans33", 0.0, 0.0, 0.55);
1524 trans33->RegisterYourself();
1526 TGeoCompositeShape *tpcorh9 = new TGeoCompositeShape("tpcorh9", "tpcorh1-tpcorh2-tpcorh3-tpcorh4-tpcorh5-tpcorh6-(tpcorh8:trans33)-tpcorh7");
1528 TGeoVolume *tpcorh9v = new TGeoVolume("TPC_ORH",tpcorh9,m6); //outer rod holder
1530 // now 2 holders together
1532 TGeoVolumeAssembly *tpcorh = new TGeoVolumeAssembly("TPC_ORH2");
1534 tpcorh->AddNode(tpcorh9v,1,new TGeoTranslation(0.0, 0.0, 1.25));
1535 tpcorh->AddNode(tpcorh9v,2,new TGeoCombiTrans(0.0, 0.0, -1.25,rot111));
1537 // outer rod plug left
1539 TGeoPcon *outplug = new TGeoPcon("outplug", 0.0, 360.0, 14);
1541 outplug->DefineSection(0, 0.5, 0.0, 2.2);
1542 outplug->DefineSection(1, 0.7, 0.0, 2.2);
1544 outplug->DefineSection(2, 0.7, 1.55, 2.2);
1545 outplug->DefineSection(3, 0.8, 1.55, 2.2);
1547 outplug->DefineSection(4, 0.8, 1.55, 1.75);
1548 outplug->DefineSection(5, 1.2, 1.55, 1.75);
1550 outplug->DefineSection(6, 1.2, 1.55, 2.2);
1551 outplug->DefineSection(7, 1.875, 1.55, 2.2);
1553 outplug->DefineSection(8, 1.875, 1.55, 2.2);
1554 outplug->DefineSection(9, 2.47, 1.75, 2.2);
1556 outplug->DefineSection(10, 2.47, 1.75, 2.08);
1557 outplug->DefineSection(11, 2.57, 1.8, 2.08);
1559 outplug->DefineSection(12, 2.57, 1.92, 2.08);
1560 outplug->DefineSection(13, 2.95, 1.92, 2.08);
1566 new TGeoBBox("cutout", 2.5, 0.11, 1.01, shift1);
1569 TGeoCompositeShape *outplleft = new TGeoCompositeShape("outplleft", "outplug-cutout");
1570 TGeoVolume *outplleftv = new TGeoVolume("TPC_OPLL", outplleft, m6);
1572 // support + holder + plug
1576 TGeoVolumeAssembly *tpcohpl = new TGeoVolumeAssembly("TPC_OHPL");
1578 tpcohpl->AddNode(outplleftv,1); //plug
1579 tpcohpl->AddNode(outplleftv,2,ref); //plug reflected
1580 tpcohpl->AddNode(tpcorh,1); //rod holder
1581 tpcohpl->AddNode(tpcohs,1,new TGeoTranslation(0.0, 3.925, 0)); // support
1585 // main membrane holder
1592 pointstrap[5]= 1.96;
1597 pointstrap[10]= 0.0;
1598 pointstrap[11]= 2.8;
1599 pointstrap[12]= 3.1;
1600 pointstrap[13]= 1.96;
1601 pointstrap[14]= 3.1;
1602 pointstrap[15]= 0.0;
1604 TGeoArb8 *tpcmmh1 = new TGeoArb8("tpcmmh1", 1.75, pointstrap);
1605 TGeoBBox *tpcmmh2 = new TGeoBBox("tpcmmh2", 0.8, 1.4, 12.5);
1607 TGeoVolume *tpcmmh1v = new TGeoVolume("TPC_MMH1", tpcmmh1, m6);
1608 TGeoVolume *tpcmmh2v = new TGeoVolume("TPC_MMH2", tpcmmh2, m6);
1610 TGeoVolumeAssembly *tpcmmhs = new TGeoVolumeAssembly("TPC_MMHS");
1611 tpcmmhs->AddNode(tpcmmh1v,1,new TGeoTranslation(0.8, -1.4, 10.75));
1612 tpcmmhs->AddNode(tpcmmh1v,2,new TGeoTranslation(0.8, -1.4, -10.75));
1613 tpcmmhs->AddNode(tpcmmh2v,1);
1615 // main membrahe holder clamp
1621 new TGeoBBox("tpcmmhc1", 1.65, 1.85, 8.9);
1622 new TGeoBBox("tpcmmhc2", 0.9, 0.7, 8.9, shift1);
1624 // half spaces - cuts
1632 n[2] = 8.0*TMath::Tan(13.*TMath::DegToRad());
1634 new TGeoHalfSpace("cutmmh1", p, n);
1642 n[2] = -8.0*TMath::Tan(13.*TMath::DegToRad());
1644 new TGeoHalfSpace("cutmmh2", p, n);
1652 n[2] = 6.1*TMath::Tan(20.*TMath::DegToRad());
1654 new TGeoHalfSpace("cutmmh3", p, n);
1662 n[2] = -6.1*TMath::Tan(20*TMath::DegToRad());
1664 new TGeoHalfSpace("cutmmh4", p, n);
1670 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1674 new TGeoHalfSpace("cutmmh5", p, n);
1680 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1684 new TGeoHalfSpace("cutmmh6", p, n);
1686 TGeoCompositeShape *tpcmmhc = new TGeoCompositeShape("TPC_MMHC", "tpcmmhc1-tpcmmhc2-cutmmh1-cutmmh2-cutmmh3-cutmmh4-cutmmh5-cutmmh6");
1688 TGeoVolume *tpcmmhcv = new TGeoVolume("TPC_MMHC",tpcmmhc,m6);
1690 TGeoVolume *tpcmmh = new TGeoVolumeAssembly("TPC_MMH");
1692 tpcmmh->AddNode(tpcmmhcv,1,new TGeoTranslation(0.65+1.5, 1.85, 0.0));
1693 tpcmmh->AddNode(tpcmmhcv,2,new TGeoCombiTrans(-0.65-1.5, 1.85, 0.0,rot111));
1694 tpcmmh->AddNode(tpcmmhs,1,new TGeoTranslation(1.5, 0.0, 0.0));
1695 tpcmmh->AddNode(tpcmmhs,2,new TGeoCombiTrans(-1.5, 0.0, 0.0,rot111));
1700 //--------------------------------------------
1702 // guard ring resistor chain
1705 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
1707 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m10);
1712 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1713 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1715 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1716 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1718 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1719 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
1721 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1722 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
1723 //------------------------------------------------------------------
1724 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1725 TGeoRotation rotrod("rotrod");
1727 TGeoRotation *rotpos[2];
1729 TGeoRotation *rotrod1[2];
1734 TGeoRotation rot102("rot102");
1735 rot102.RotateY(-90.);
1737 for(Int_t i=0;i<18;i++){
1740 angle=TMath::DegToRad()*20.*(Double_t)i;
1743 x=r * TMath::Cos(angle);
1744 y=r * TMath::Sin(angle);
1746 TGeoRotation *rot12 = new TGeoRotation();
1747 rot12->RotateZ(-90.0+i*20.);
1748 v9->AddNode(tpcihpl,i+1,new TGeoCombiTrans(x, y, 0., rot12));
1750 if(i==11){//resistor rod inner
1751 rotrod.RotateZ(-90.+angle);
1752 rotrod1[0]= new TGeoRotation();
1753 rotpos[0]= new TGeoRotation();
1755 rotrod1[0]->RotateZ(-90.+angle);
1756 *rotpos[0] = refl*rotrod; //rotation+reflection
1757 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1758 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
1761 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1762 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
1766 x=r * TMath::Cos(angle);
1767 y=r * TMath::Sin(angle);
1770 // outer rod holder + outer left plug
1772 TGeoRotation *rot33 = new TGeoRotation();
1773 rot33->RotateZ(-90+i*20.);
1775 v9->AddNode(tpcohpl,i+1,new TGeoCombiTrans(x, y, 0., rot33));
1777 Double_t xxx = 256.297*TMath::Cos((i*20.+10.)*TMath::DegToRad());
1778 Double_t yyy = 256.297*TMath::Sin((i*20.+10.)*TMath::DegToRad());
1780 TGeoRotation rot101("rot101");
1781 rot101.RotateZ(90.+i*20.+10.);
1782 TGeoRotation *rot103 = new TGeoRotation("rot103");
1783 *rot103 = rot101*rot102;
1785 TGeoCombiTrans *trh100 = new TGeoCombiTrans(xxx,yyy,0.,rot103);
1788 //main membrane holder
1789 v9->AddNode(tpcmmh,1,trh100);
1792 // "normal" membrane holder
1793 v9->AddNode(tpcomh,i+1,trh100);
1797 if(i==3){//resistor rod outer
1798 rotrod.RotateZ(90.+angle);
1799 rotrod1[1]= new TGeoRotation();
1800 rotpos[1]= new TGeoRotation();
1801 rotrod1[1]->RotateZ(90.+angle);
1802 *rotpos[1] = refl*rotrod;//rotation+reflection
1803 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1804 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
1807 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1808 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
1811 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
1815 } //end of rods positioning
1818 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1819 alice->AddNode(v1,1);
1821 } // end of function
1823 //_____________________________________________________________________________
1824 void AliTPCv4::AddAlignableVolumes() const
1827 // Create entries for alignable volumes associating the symbolic volume
1828 // name with the corresponding volume path. Needs to be syncronized with
1829 // eventual changes in the geometry.
1831 SetInnerChambersAlignable();
1832 SetOuterChambersAlignable();
1835 //_____________________________________________________________________________
1836 void AliTPCv4::SetInnerChambersAlignable() const
1840 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1841 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1842 TString vpappend = "/TPC_IROC_1";
1843 TString snstr1="TPC/EndcapA/Sector";
1844 TString snstr2="TPC/EndcapC/Sector";
1845 TString snappend="/InnerChamber";
1846 TString volpath, symname;
1848 for(Int_t cnt=1; cnt<=18; cnt++){
1851 volpath += vpappend;
1854 symname += snappend;
1855 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1856 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1858 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1859 const char *path = alignableEntry->GetTitle();
1860 if (!gGeoManager->cd(path))
1861 AliFatal(Form("Volume path %s not valid!",path));
1862 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1863 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1864 alignableEntry->SetMatrix(matTtoL);
1868 for(Int_t cnt=1; cnt<=18; cnt++){
1871 volpath += vpappend;
1874 symname += snappend;
1875 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1876 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1877 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1878 const char *path = alignableEntry->GetTitle();
1879 if (!gGeoManager->cd(path))
1880 AliFatal(Form("Volume path %s not valid!",path));
1881 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1882 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1883 alignableEntry->SetMatrix(matTtoL);
1888 //_____________________________________________________________________________
1889 void AliTPCv4::SetOuterChambersAlignable() const
1893 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1894 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1895 TString vpappend = "/TPC_OROC_1";
1896 TString snstr1="TPC/EndcapA/Sector";
1897 TString snstr2="TPC/EndcapC/Sector";
1898 TString snappend="/OuterChamber";
1899 TString volpath, symname;
1901 for(Int_t cnt=1; cnt<=18; cnt++){
1904 volpath += vpappend;
1907 symname += snappend;
1908 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1909 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1910 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1911 const char *path = alignableEntry->GetTitle();
1912 if (!gGeoManager->cd(path))
1913 AliFatal(Form("Volume path %s not valid!",path));
1914 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1915 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1916 alignableEntry->SetMatrix(matTtoL);
1920 for(Int_t cnt=1; cnt<=18; cnt++){
1923 volpath += vpappend;
1926 symname += snappend;
1927 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1928 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1929 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1930 const char *path = alignableEntry->GetTitle();
1931 if (!gGeoManager->cd(path))
1932 AliFatal(Form("Volume path %s not valid!",path));
1933 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1934 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1935 alignableEntry->SetMatrix(matTtoL);
1941 //_____________________________________________________________________________
1942 void AliTPCv4::CreateMaterials()
1945 // Define materials for version 2 of the Time Projection Chamber
1948 AliTPC::CreateMaterials();
1951 //_____________________________________________________________________________
1952 void AliTPCv4::Init()
1955 // Initialises version 2 of the TPC after that it has been built
1958 //Int_t *idtmed = fIdtmed->GetArray();
1963 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
1965 fIDrift=gMC->VolId("TPC_Drift");
1966 fSecOld=-100; // fake number
1968 gMC->SetMaxNStep(-30000); // max. number of steps increased
1970 // specific energy loss set in galice.cuts
1972 AliInfo("*** TPC version 4 initialized ***");
1973 AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1979 //_____________________________________________________________________________
1980 void AliTPCv4::StepManager()
1983 // Called for every step in the Time Projection Chamber
1987 // parameters used for the energy loss calculations
1989 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1990 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1991 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1994 const Float_t kbig = 1.e10;
2001 vol[1]=0; // preset row number to 0
2003 gMC->SetMaxStep(kbig);
2007 Float_t charge = gMC->TrackCharge();
2009 if(TMath::Abs(charge)<=0.) return; // take only charged particles
2011 // check the sensitive volume
2013 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
2014 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
2016 gMC->TrackPosition(p);
2017 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2021 Double_t angle = TMath::ACos(p[0]/r);
2022 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
2024 // angular segment, it is not a real sector number...
2026 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
2027 fTPCParam->GetInnerAngle());
2028 // rotate to segment "0"
2030 fTPCParam->AdjustCosSin(sector,cos,sin);
2031 Float_t x1=p[0]*cos + p[1]*sin;
2032 // check if within sector's limits
2033 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
2034 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
2035 // calculate real sector number...
2036 if (x1>fTPCParam->GetOuterRadiusLow()){
2037 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
2038 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
2039 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
2042 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
2044 // here I have a sector number
2048 // check if change of sector
2049 if(sector != fSecOld){
2051 // add track reference
2052 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
2054 // track is in the sensitive strip
2056 // track is entering the strip
2057 if (gMC->IsTrackEntering()){
2058 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
2059 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
2060 // row numbers are autonomous for lower and upper sectors
2061 if(vol[0] > fTPCParam->GetNInnerSector()) {
2062 vol[1] -= fTPCParam->GetNRowLow();
2065 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
2067 // lower sector, row 0, because Jouri wants to have this
2069 gMC->TrackMomentum(p);
2073 hits[3]=0.; // this hit has no energy loss
2074 // Get also the track time for pileup simulation
2075 hits[4]=gMC->TrackTime();
2077 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2081 gMC->TrackPosition(p);
2085 hits[3]=0.; // this hit has no energy loss
2086 // Get also the track time for pileup simulation
2087 hits[4]=gMC->TrackTime();
2089 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2094 //-----------------------------------------------------------------
2095 // charged particle is in the sensitive drift volume
2096 //-----------------------------------------------------------------
2098 if(gMC->TrackStep() > 0){
2100 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
2101 nel=TMath::Min(nel,30); // 30 electrons corresponds to 1 keV
2103 gMC->TrackPosition(p);
2107 hits[3]=(Float_t)nel;
2113 gMC->TrackMomentum(p);
2114 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2115 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2116 fTrackHits->SetHitPrecision(precision);
2119 // Get also the track time for pileup simulation
2120 hits[4]=gMC->TrackTime();
2122 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2125 } //within sector's limits
2126 // Stemax calculation for the next step
2127 if(!gMC->IsTrackAlive()) return; // particle has disappeared
2130 gMC->TrackMomentum(mom);
2131 Float_t ptot=mom.Rho();
2132 Float_t betaGamma = ptot/gMC->TrackMass();
2134 Int_t pid=gMC->TrackPid();
2135 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2137 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
2142 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
2143 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
2145 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2148 Double_t rnd = gMC->GetRandom()->Rndm();
2150 gMC->SetMaxStep(-TMath::Log(rnd)/pp);