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");
902 TGeoMedium *m14 = gGeoManager->GetMedium("TPC_Alumina1");
904 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
906 // tpc rod is an assembly of 10 long parts and 2 short parts
907 // connected with alu rings and plagged on both sides.
912 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
913 rod->DefineSection(0,-10.43,1.92,2.08);
914 rod->DefineSection(1,-9.75,1.92,2.08);
916 rod->DefineSection(2,-9.75,1.8,2.2);
917 rod->DefineSection(3,9.75,1.8,2.2);
919 rod->DefineSection(4,9.75,1.92,2.08);
920 rod->DefineSection(5,10.43,1.92,2.08);
922 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
926 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
927 rod1->DefineSection(0,-8.93,1.92,2.08);
928 rod1->DefineSection(1,-8.25,1.92,2.08);
930 rod1->DefineSection(2,-8.25,1.8,2.2);
931 rod1->DefineSection(3,8.25,1.8,2.2);
933 rod1->DefineSection(4,8.25,1.92,2.08);
934 rod1->DefineSection(5,8.93,1.92,2.08);
936 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
938 // below is for the resistor rod
940 // hole for the brass connectors
943 new TGeoTube("hhole",0.,0.3,0.3);
945 //transformations for holes - initialy they
946 // are placed at x=0 and negative y
948 TGeoRotation *rhole = new TGeoRotation();
950 TGeoCombiTrans *transf[13];
952 for(Int_t i=0;i<13;i++){
953 //sprintf(name,"transf%d",i);
954 snprintf(name,30,"transf%d",i);
955 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
956 transf[i]->RegisterYourself();
958 // union expression for holes
959 TString operl("hhole:transf0");
960 for (Int_t i=1;i<13;i++){
961 //sprintf(name,"+hhole:transf%d",i);
962 snprintf(name,30,"+hhole:transf%d",i);
966 TString opers("hhole:transf1");
967 for (Int_t i=2;i<12;i++){
968 //sprintf(name,"+hhole:transf%d",i);
969 snprintf(name,30,"+hhole:transf%d",i);
973 new TGeoCompositeShape("hlv",operl.Data());
974 new TGeoCompositeShape("hsv",opers.Data());
976 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
977 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
978 //rods - volumes - makrolon rods with holes
979 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
980 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
983 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
984 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
986 // hooks holding strips
988 new TGeoBBox("hk1",0.625,0.015,0.75);
989 new TGeoBBox("hk2",0.625,0.015,0.15);
990 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
991 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
992 tr21->RegisterYourself();
993 tr12->RegisterYourself();
995 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
996 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
998 // assembly of the short rod with connectors and hooks
1003 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1005 spart->AddNode( rodsv,1);
1006 for(Int_t i=1;i<12;i++){
1007 spart->AddNode(bconv,i,transf[i]);
1009 for(Int_t i =0;i<11;i++){
1010 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
1015 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1017 lpart->AddNode( rodlv,1);
1018 for(Int_t i=0;i<13;i++){
1019 lpart->AddNode(bconv,i+12,transf[i]);
1021 for(Int_t i =0;i<13;i++){
1022 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
1027 new TGeoTube("ring1",2.1075,2.235,0.53);
1028 new TGeoTube("ring2",1.7925,1.89,0.43);
1029 new TGeoTube("ring3",1.89,2.1075,0.05);
1030 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1031 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1035 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
1036 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1038 for(Int_t i=0;i<11;i++){
1039 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
1040 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1042 for(Int_t i=0;i<10;i++){
1043 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//resistor rod
1044 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//makrolon rod
1047 // right plug - identical for all rods
1049 TGeoPcon *tpcrp = new TGeoPcon(0.,360.,6);
1051 tpcrp->DefineSection(0,123.05,1.89,2.1075);
1052 tpcrp->DefineSection(1,123.59,1.89,2.1075);
1054 tpcrp->DefineSection(2,123.59,1.8,2.2);
1055 tpcrp->DefineSection(3,127.,1.8,2.2);
1057 tpcrp->DefineSection(4,127.,0.,2.2);
1058 tpcrp->DefineSection(5,127.5,0.,2.2);
1060 TGeoVolume *tpcrpv = new TGeoVolume("TPC_RP",tpcrp,m6);
1062 // adding short pieces and right plug
1064 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1065 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1066 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1067 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
1068 tpcrrod->AddNode(tpcrpv,1);
1070 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1071 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1072 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1073 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1074 tpcmrod->AddNode(tpcrpv,2);
1076 // from the ringv position to the CM is 3.0 cm!
1077 //----------------------------------------
1080 //HV rods - makrolon + 0.58cm (diameter) Cu ->check the length
1081 TGeoTube *hvr = new TGeoTube(0.,1.465,123.);
1082 TGeoTube *hvc = new TGeoTube(0.,0.29,123.);
1084 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1085 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1086 hvrv->AddNode(hvcv,1);
1090 TGeoTube *cr = new TGeoTube(0.,0.45,123.);
1091 TGeoTube *cw = new TGeoTube(0.,0.15,123.);
1092 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
1093 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
1095 // ceramic rod with water
1097 crv->AddNode(cwv,1);
1101 TGeoTube *pr =new TGeoTube(0.2,0.35,123.);
1102 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
1104 // copper plates with connectors
1106 new TGeoTube("tub",0.,1.7,0.025);
1108 // half space - points on the plane and a normal vector
1111 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1112 Double_t intp = 1.245;
1114 Double_t b = slope*slope+1.;
1123 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1127 new TGeoHalfSpace("sp1",p,n);
1136 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1140 new TGeoHalfSpace("sp2",p,n);
1143 new TGeoTube("h1",0.,0.5,0.025);
1144 new TGeoTube("h2",0.,0.35,0.025);
1146 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1147 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1148 ttr11->RegisterYourself();
1149 ttr22->RegisterYourself();
1150 // elastic connector
1151 new TGeoBBox("elcon",0.72,0.005,0.3);
1152 TGeoRotation *crr1 = new TGeoRotation();
1153 crr1->RotateZ(-22.);
1154 TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1155 ctr1->RegisterYourself();
1156 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1157 "(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1159 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1161 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1164 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
1166 rrod->AddNode(crv,1,ttr11);
1167 rrod->AddNode(crv,2,ttr22);
1168 rrod->AddNode(prv,1);
1170 for(Int_t i=0;i<165;i++){
1171 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1174 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1175 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m14);
1176 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1177 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1178 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1180 TGeoRotation *crr2 = new TGeoRotation();
1182 TGeoRotation *crr3 = new TGeoRotation();
1183 crr3->RotateY(-30.);
1185 for(Int_t i=0;i<164;i+=2){
1186 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1187 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1190 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
1192 // rod left head with holders - inner
1194 // first element - support for inner holder TPC_IHS
1195 Double_t shift1[3] = {0.0,-0.175,0.0};
1197 new TGeoBBox("tpcihs1", 4.7, 0.66, 2.35);
1198 new TGeoBBox("tpcihs2", 4.7, 0.485, 1.0, shift1);
1199 new TGeoBBox("tpcihs3", 1.5, 0.485, 2.35, shift1);
1200 new TGeoTube("tpcihs4", 0.0, 2.38, 0.1);
1202 Double_t pointstrap[16];
1206 pointstrap[3]= 1.08;
1208 pointstrap[5]= 1.08;
1209 pointstrap[6]= 3.38;
1213 pointstrap[10]= 0.0;
1214 pointstrap[11]= 1.08;
1215 pointstrap[12]= 2.3;
1216 pointstrap[13]= 1.08;
1217 pointstrap[14]= 3.38;
1218 pointstrap[15]= 0.0;
1220 TGeoArb8 *tpcihs5 = new TGeoArb8("tpcihs5", 0.6, pointstrap);
1222 // half space - cutting "legs"
1232 new TGeoHalfSpace("cutil1", p, n);
1237 TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0.0, 2.84, 2.25);
1238 trans2->RegisterYourself();
1239 TGeoTranslation*trans3= new TGeoTranslation("trans3", 0.0, 2.84, -2.25);
1240 trans3->RegisterYourself();
1241 //support - composite volume
1243 TGeoCompositeShape *tpcihs6 = new TGeoCompositeShape("tpcihs6", "tpcihs1-(tpcihs2+tpcihs3)-(tpcihs4:trans2)-(tpcihs4:trans3)-cutil1");
1245 // volumes - all makrolon
1247 TGeoVolume *tpcihss = new TGeoVolume("TPC_IHSS", tpcihs6, m6); //support
1248 TGeoVolume *tpcihst = new TGeoVolume("TPC_IHSTR",tpcihs5 , m6); //trapesoid
1250 TGeoRotation *rot111 = new TGeoRotation();
1251 rot111->RotateY(180.0);
1253 TGeoVolumeAssembly *tpcihs = new TGeoVolumeAssembly("TPC_IHS"); // assembly of the support
1254 tpcihs->AddNode(tpcihss, 1);
1255 tpcihs->AddNode(tpcihst, 1, new TGeoTranslation(-4.7, 0.66, 0.0));
1256 tpcihs->AddNode(tpcihst, 2, new TGeoCombiTrans(4.7, 0.66, 0.0, rot111));
1258 // two rod holders (TPC_IRH) assembled with the support
1260 new TGeoBBox("tpcirh1", 4.7, 1.33, 0.5);
1264 new TGeoBBox("tpcirh2", 1.05, 0.8, 0.5, shift1);
1268 new TGeoBBox("tpcirh3", 1.05, 0.8, 0.5, shift1);
1272 new TGeoBBox("tpcirh4", 1.9, 0.25, 0.5, shift1);
1273 new TGeoTube("tpcirh5", 0, 1.9, 5);
1275 TGeoTranslation *trans4 = new TGeoTranslation("trans4", 0, 0.83, 0.0);
1276 trans4->RegisterYourself();
1278 TGeoCompositeShape *tpcirh6 = new TGeoCompositeShape("tpcirh6", "tpcirh1-tpcirh2-tpcirh3-(tpcirh5:trans4)-tpcirh4");
1282 TGeoVolume *tpcirh = new TGeoVolume("TPC_IRH", tpcirh6, m6);
1284 // and all together...
1286 TGeoVolume *tpciclamp = new TGeoVolumeAssembly("TPC_ICLP");
1287 tpciclamp->AddNode(tpcihs, 1);
1288 tpciclamp->AddNode(tpcirh, 1, new TGeoTranslation(0, 1.99, 1.1));
1289 tpciclamp->AddNode(tpcirh, 2, new TGeoTranslation(0, 1.99, -1.1));
1291 // and now left inner "head"
1293 TGeoPcon *inplug = new TGeoPcon("inplug", 0.0, 360.0, 14);
1295 inplug->DefineSection(0, 0.3, 0.0, 2.2);
1296 inplug->DefineSection(1, 0.6, 0.0, 2.2);
1298 inplug->DefineSection(2, 0.6, 0.0, 1.75);
1299 inplug->DefineSection(3, 0.7, 0.0, 1.75);
1301 inplug->DefineSection(4, 0.7, 1.55, 1.75);
1302 inplug->DefineSection(5, 1.6, 1.55, 1.75);
1304 inplug->DefineSection(6, 1.6, 1.55, 2.2);
1305 inplug->DefineSection(7, 1.875, 1.55, 2.2);
1307 inplug->DefineSection(8, 1.875, 1.55, 2.2);
1308 inplug->DefineSection(9, 2.47, 1.75, 2.2);
1310 inplug->DefineSection(10, 2.47, 1.75, 2.08);
1311 inplug->DefineSection(11, 2.57, 1.8, 2.08);
1313 inplug->DefineSection(12, 2.57, 1.92, 2.08);
1314 inplug->DefineSection(13, 2.95, 1.92, 2.08);
1320 new TGeoBBox("pcuti", 1.5, 0.11, 1.075, shift1);
1322 TGeoCompositeShape *inplleft = new TGeoCompositeShape("inplleft", "inplug-pcuti");
1323 TGeoVolume *tpcinlplug = new TGeoVolume("TPC_INPLL", inplleft, m6);
1327 TGeoVolume *tpcihpl = new TGeoVolumeAssembly("TPC_IHPL"); //holder+2 plugs (reflected)
1328 tpcihpl->AddNode(tpcinlplug, 1);
1329 tpcihpl->AddNode(tpcinlplug, 2,ref);
1330 tpcihpl->AddNode(tpciclamp,1,new TGeoTranslation(0.0, -2.765, 0.0));
1332 // outer holders and clamps
1335 // outer membrane holder (between rods)
1341 pointstrap[5]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1346 pointstrap[10]= 0.0;
1347 pointstrap[11]= 2.8;
1348 pointstrap[12]= 3.1;
1349 pointstrap[13]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1350 pointstrap[14]= 3.1;
1351 pointstrap[15]= 0.0;
1353 TGeoArb8 *tpcomh1 = new TGeoArb8("tpcomh1", 1.05, pointstrap);
1354 TGeoBBox *tpcomh2 = new TGeoBBox("tpcomh2", 0.8, 1.4, 6);
1356 TGeoVolume *tpcomh1v = new TGeoVolume("TPC_OMH1", tpcomh1, m7);
1357 TGeoVolume *tpcomh2v = new TGeoVolume("TPC_OMH2", tpcomh2, m7);
1359 TGeoVolume *tpcomh3v = new TGeoVolumeAssembly("TPC_OMH3"); // assembly1
1360 tpcomh3v->AddNode(tpcomh1v, 1, new TGeoTranslation(0.8, -1.4, 4.95));
1361 tpcomh3v->AddNode(tpcomh1v, 2, new TGeoTranslation(0.8, -1.4, -4.95));
1362 tpcomh3v->AddNode(tpcomh2v, 1);
1368 new TGeoBBox("tpcomh3", 1.65, 1.15, 3.4);
1369 TGeoBBox *tpcomh4 = new TGeoBBox("tpcomh4", 0.75, 0.7, 3.4, shift1);
1378 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1381 new TGeoHalfSpace("cutomh1", p, n);
1390 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1393 new TGeoHalfSpace("cutomh2", p, n);
1401 n[0] = 1.0*TMath::Tan(75.*TMath::DegToRad());
1405 new TGeoHalfSpace("cutomh3", p, n);
1413 n[0] = 1.0*TMath::Tan(75*TMath::DegToRad());
1417 new TGeoHalfSpace("cutomh4", p, n);
1426 n[1] = -1.0*TMath::Tan(20.*TMath::DegToRad());
1429 new TGeoHalfSpace("cutomh5", p, n);
1431 TGeoCompositeShape *tpcomh5 = new TGeoCompositeShape("tpcomh5", "tpcomh3-cutomh1-cutomh2-cutomh3-cutomh4-cutomh5");
1433 TGeoVolume *tpcomh5v = new TGeoVolume("TPC_OMH5",tpcomh5,m6);
1434 TGeoVolume *tpcomh4v = new TGeoVolume("TPC_OMH6",tpcomh4,m6);
1436 TGeoVolumeAssembly *tpcomh7v = new TGeoVolumeAssembly("TPC_OMH7");
1437 tpcomh7v->AddNode(tpcomh5v,1);
1438 tpcomh7v->AddNode(tpcomh4v,1);
1440 // full membrane holder - tpcomh3v + tpcomh7v
1442 TGeoVolumeAssembly *tpcomh = new TGeoVolumeAssembly("TPC_OMH");
1443 tpcomh->AddNode(tpcomh3v,1,new TGeoTranslation(1.5,0.,0.));
1444 tpcomh->AddNode(tpcomh3v,2,new TGeoCombiTrans(-1.5,0.,0.,rot111));
1445 tpcomh->AddNode(tpcomh7v,1,new TGeoTranslation(0.65+1.5, 2.55, 0.0));
1446 tpcomh->AddNode(tpcomh7v,2,new TGeoCombiTrans(-0.65-1.5, 2.55, 0.0,rot111));
1448 // outer rod holder support
1450 new TGeoBBox("tpcohs1", 3.8, 0.675, 2.35);
1456 new TGeoBBox("tpcohs2", 1.5, 0.5, 2.35, shift1);
1457 new TGeoBBox("tpcohs3", 3.8, 0.5, 0.85, shift1);
1463 TGeoBBox *tpcohs4 = new TGeoBBox("tpsohs4", 3.1, 0.5, 0.7, shift1);
1465 TGeoVolume *tpcohs4v = new TGeoVolume("TPC_OHS4", tpcohs4, m6);
1475 new TGeoHalfSpace("cutohs1", p, n);
1477 TGeoCompositeShape *tpcohs5 = new TGeoCompositeShape("tpcohs5", "tpcohs1-tpcohs2-tpcohs3-cutohs1");
1478 TGeoVolume *tpcohs5v = new TGeoVolume("TPC_OHS5", tpcohs5, m6);
1480 TGeoVolumeAssembly *tpcohs = new TGeoVolumeAssembly("TPC_OHS");
1481 tpcohs->AddNode(tpcohs5v, 1);
1482 tpcohs->AddNode(tpcohs4v, 1);
1484 // outer rod holder itself
1489 new TGeoBBox("tpcorh1", 3.1, 1.825, 0.55); //from this box we cut pieces...
1495 new TGeoBBox("tpcorh2", 0.5, 2.75, 1.1, shift1);
1501 new TGeoBBox("tpcorh3", 0.5, 2.75, 1.1, shift1);
1507 new TGeoBBox("tpcorh4", 3.9, 2.75, 0.5, shift1);
1513 new TGeoBBox("tpcorh5", 1.95, 0.5, 1.1, shift1);
1519 new TGeoBBox("tpcorh6", 2.4, 0.5, 0.6, shift1);
1521 new TGeoTube("tpcorh7", 0, 1.95, 0.85);
1522 new TGeoTube("tpcorh8", 0, 2.4, 0.6);
1524 TGeoTranslation *trans33 = new TGeoTranslation("trans33", 0.0, 0.0, 0.55);
1525 trans33->RegisterYourself();
1527 TGeoCompositeShape *tpcorh9 = new TGeoCompositeShape("tpcorh9", "tpcorh1-tpcorh2-tpcorh3-tpcorh4-tpcorh5-tpcorh6-(tpcorh8:trans33)-tpcorh7");
1529 TGeoVolume *tpcorh9v = new TGeoVolume("TPC_ORH",tpcorh9,m6); //outer rod holder
1531 // now 2 holders together
1533 TGeoVolumeAssembly *tpcorh = new TGeoVolumeAssembly("TPC_ORH2");
1535 tpcorh->AddNode(tpcorh9v,1,new TGeoTranslation(0.0, 0.0, 1.25));
1536 tpcorh->AddNode(tpcorh9v,2,new TGeoCombiTrans(0.0, 0.0, -1.25,rot111));
1538 // outer rod plug left
1540 TGeoPcon *outplug = new TGeoPcon("outplug", 0.0, 360.0, 14);
1542 outplug->DefineSection(0, 0.5, 0.0, 2.2);
1543 outplug->DefineSection(1, 0.7, 0.0, 2.2);
1545 outplug->DefineSection(2, 0.7, 1.55, 2.2);
1546 outplug->DefineSection(3, 0.8, 1.55, 2.2);
1548 outplug->DefineSection(4, 0.8, 1.55, 1.75);
1549 outplug->DefineSection(5, 1.2, 1.55, 1.75);
1551 outplug->DefineSection(6, 1.2, 1.55, 2.2);
1552 outplug->DefineSection(7, 1.875, 1.55, 2.2);
1554 outplug->DefineSection(8, 1.875, 1.55, 2.2);
1555 outplug->DefineSection(9, 2.47, 1.75, 2.2);
1557 outplug->DefineSection(10, 2.47, 1.75, 2.08);
1558 outplug->DefineSection(11, 2.57, 1.8, 2.08);
1560 outplug->DefineSection(12, 2.57, 1.92, 2.08);
1561 outplug->DefineSection(13, 2.95, 1.92, 2.08);
1567 new TGeoBBox("cutout", 2.5, 0.11, 1.01, shift1);
1570 TGeoCompositeShape *outplleft = new TGeoCompositeShape("outplleft", "outplug-cutout");
1571 TGeoVolume *outplleftv = new TGeoVolume("TPC_OPLL", outplleft, m6);
1573 // support + holder + plug
1577 TGeoVolumeAssembly *tpcohpl = new TGeoVolumeAssembly("TPC_OHPL");
1579 tpcohpl->AddNode(outplleftv,1); //plug
1580 tpcohpl->AddNode(outplleftv,2,ref); //plug reflected
1581 tpcohpl->AddNode(tpcorh,1); //rod holder
1582 tpcohpl->AddNode(tpcohs,1,new TGeoTranslation(0.0, 3.925, 0)); // support
1586 // main membrane holder
1593 pointstrap[5]= 1.96;
1598 pointstrap[10]= 0.0;
1599 pointstrap[11]= 2.8;
1600 pointstrap[12]= 3.1;
1601 pointstrap[13]= 1.96;
1602 pointstrap[14]= 3.1;
1603 pointstrap[15]= 0.0;
1605 TGeoArb8 *tpcmmh1 = new TGeoArb8("tpcmmh1", 1.75, pointstrap);
1606 TGeoBBox *tpcmmh2 = new TGeoBBox("tpcmmh2", 0.8, 1.4, 12.5);
1608 TGeoVolume *tpcmmh1v = new TGeoVolume("TPC_MMH1", tpcmmh1, m6);
1609 TGeoVolume *tpcmmh2v = new TGeoVolume("TPC_MMH2", tpcmmh2, m6);
1611 TGeoVolumeAssembly *tpcmmhs = new TGeoVolumeAssembly("TPC_MMHS");
1612 tpcmmhs->AddNode(tpcmmh1v,1,new TGeoTranslation(0.8, -1.4, 10.75));
1613 tpcmmhs->AddNode(tpcmmh1v,2,new TGeoTranslation(0.8, -1.4, -10.75));
1614 tpcmmhs->AddNode(tpcmmh2v,1);
1616 // main membrahe holder clamp
1622 new TGeoBBox("tpcmmhc1", 1.65, 1.85, 8.9);
1623 new TGeoBBox("tpcmmhc2", 0.9, 0.7, 8.9, shift1);
1625 // half spaces - cuts
1633 n[2] = 8.0*TMath::Tan(13.*TMath::DegToRad());
1635 new TGeoHalfSpace("cutmmh1", p, n);
1643 n[2] = -8.0*TMath::Tan(13.*TMath::DegToRad());
1645 new TGeoHalfSpace("cutmmh2", p, n);
1653 n[2] = 6.1*TMath::Tan(20.*TMath::DegToRad());
1655 new TGeoHalfSpace("cutmmh3", p, n);
1663 n[2] = -6.1*TMath::Tan(20*TMath::DegToRad());
1665 new TGeoHalfSpace("cutmmh4", p, n);
1671 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1675 new TGeoHalfSpace("cutmmh5", p, n);
1681 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1685 new TGeoHalfSpace("cutmmh6", p, n);
1687 TGeoCompositeShape *tpcmmhc = new TGeoCompositeShape("TPC_MMHC", "tpcmmhc1-tpcmmhc2-cutmmh1-cutmmh2-cutmmh3-cutmmh4-cutmmh5-cutmmh6");
1689 TGeoVolume *tpcmmhcv = new TGeoVolume("TPC_MMHC",tpcmmhc,m6);
1691 TGeoVolume *tpcmmh = new TGeoVolumeAssembly("TPC_MMH");
1693 tpcmmh->AddNode(tpcmmhcv,1,new TGeoTranslation(0.65+1.5, 1.85, 0.0));
1694 tpcmmh->AddNode(tpcmmhcv,2,new TGeoCombiTrans(-0.65-1.5, 1.85, 0.0,rot111));
1695 tpcmmh->AddNode(tpcmmhs,1,new TGeoTranslation(1.5, 0.0, 0.0));
1696 tpcmmh->AddNode(tpcmmhs,2,new TGeoCombiTrans(-1.5, 0.0, 0.0,rot111));
1701 //--------------------------------------------
1703 // guard ring resistor chain
1706 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
1708 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m14);
1713 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1714 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1716 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1717 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1719 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1720 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
1722 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1723 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
1724 //------------------------------------------------------------------
1725 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1726 TGeoRotation rotrod("rotrod");
1728 TGeoRotation *rotpos[2];
1730 TGeoRotation *rotrod1[2];
1735 TGeoRotation rot102("rot102");
1736 rot102.RotateY(-90.);
1738 for(Int_t i=0;i<18;i++){
1741 angle=TMath::DegToRad()*20.*(Double_t)i;
1744 x=r * TMath::Cos(angle);
1745 y=r * TMath::Sin(angle);
1747 TGeoRotation *rot12 = new TGeoRotation();
1748 rot12->RotateZ(-90.0+i*20.);
1749 v9->AddNode(tpcihpl,i+1,new TGeoCombiTrans(x, y, 0., rot12));
1751 if(i==11){//resistor rod inner
1752 rotrod.RotateZ(-90.+angle);
1753 rotrod1[0]= new TGeoRotation();
1754 rotpos[0]= new TGeoRotation();
1756 rotrod1[0]->RotateZ(-90.+angle);
1757 *rotpos[0] = refl*rotrod; //rotation+reflection
1758 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1759 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
1762 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1763 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
1767 x=r * TMath::Cos(angle);
1768 y=r * TMath::Sin(angle);
1771 // outer rod holder + outer left plug
1773 TGeoRotation *rot33 = new TGeoRotation();
1774 rot33->RotateZ(-90+i*20.);
1776 v9->AddNode(tpcohpl,i+1,new TGeoCombiTrans(x, y, 0., rot33));
1778 Double_t xxx = 256.297*TMath::Cos((i*20.+10.)*TMath::DegToRad());
1779 Double_t yyy = 256.297*TMath::Sin((i*20.+10.)*TMath::DegToRad());
1781 TGeoRotation rot101("rot101");
1782 rot101.RotateZ(90.+i*20.+10.);
1783 TGeoRotation *rot103 = new TGeoRotation("rot103");
1784 *rot103 = rot101*rot102;
1786 TGeoCombiTrans *trh100 = new TGeoCombiTrans(xxx,yyy,0.,rot103);
1789 //main membrane holder
1790 v9->AddNode(tpcmmh,1,trh100);
1793 // "normal" membrane holder
1794 v9->AddNode(tpcomh,i+1,trh100);
1798 if(i==3){//resistor rod outer
1799 rotrod.RotateZ(90.+angle);
1800 rotrod1[1]= new TGeoRotation();
1801 rotpos[1]= new TGeoRotation();
1802 rotrod1[1]->RotateZ(90.+angle);
1803 *rotpos[1] = refl*rotrod;//rotation+reflection
1804 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1805 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
1808 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1809 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
1812 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
1816 } //end of rods positioning
1819 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1820 alice->AddNode(v1,1);
1822 } // end of function
1824 //_____________________________________________________________________________
1825 void AliTPCv4::AddAlignableVolumes() const
1828 // Create entries for alignable volumes associating the symbolic volume
1829 // name with the corresponding volume path. Needs to be syncronized with
1830 // eventual changes in the geometry.
1832 SetInnerChambersAlignable();
1833 SetOuterChambersAlignable();
1836 //_____________________________________________________________________________
1837 void AliTPCv4::SetInnerChambersAlignable() const
1841 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1842 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1843 TString vpappend = "/TPC_IROC_1";
1844 TString snstr1="TPC/EndcapA/Sector";
1845 TString snstr2="TPC/EndcapC/Sector";
1846 TString snappend="/InnerChamber";
1847 TString volpath, symname;
1849 for(Int_t cnt=1; cnt<=18; cnt++){
1852 volpath += vpappend;
1855 symname += snappend;
1856 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1857 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1859 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1860 const char *path = alignableEntry->GetTitle();
1861 if (!gGeoManager->cd(path))
1862 AliFatal(Form("Volume path %s not valid!",path));
1863 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1864 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1865 alignableEntry->SetMatrix(matTtoL);
1869 for(Int_t cnt=1; cnt<=18; cnt++){
1872 volpath += vpappend;
1875 symname += snappend;
1876 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1877 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1878 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1879 const char *path = alignableEntry->GetTitle();
1880 if (!gGeoManager->cd(path))
1881 AliFatal(Form("Volume path %s not valid!",path));
1882 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1883 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1884 alignableEntry->SetMatrix(matTtoL);
1889 //_____________________________________________________________________________
1890 void AliTPCv4::SetOuterChambersAlignable() const
1894 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1895 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1896 TString vpappend = "/TPC_OROC_1";
1897 TString snstr1="TPC/EndcapA/Sector";
1898 TString snstr2="TPC/EndcapC/Sector";
1899 TString snappend="/OuterChamber";
1900 TString volpath, symname;
1902 for(Int_t cnt=1; cnt<=18; cnt++){
1905 volpath += vpappend;
1908 symname += snappend;
1909 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1910 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1911 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1912 const char *path = alignableEntry->GetTitle();
1913 if (!gGeoManager->cd(path))
1914 AliFatal(Form("Volume path %s not valid!",path));
1915 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1916 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1917 alignableEntry->SetMatrix(matTtoL);
1921 for(Int_t cnt=1; cnt<=18; cnt++){
1924 volpath += vpappend;
1927 symname += snappend;
1928 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1929 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1930 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1931 const char *path = alignableEntry->GetTitle();
1932 if (!gGeoManager->cd(path))
1933 AliFatal(Form("Volume path %s not valid!",path));
1934 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1935 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1936 alignableEntry->SetMatrix(matTtoL);
1942 //_____________________________________________________________________________
1943 void AliTPCv4::CreateMaterials()
1946 // Define materials for version 2 of the Time Projection Chamber
1949 AliTPC::CreateMaterials();
1952 //_____________________________________________________________________________
1953 void AliTPCv4::Init()
1956 // Initialises version 2 of the TPC after that it has been built
1959 //Int_t *idtmed = fIdtmed->GetArray();
1964 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
1966 fIDrift=gMC->VolId("TPC_Drift");
1967 fSecOld=-100; // fake number
1969 gMC->SetMaxNStep(-30000); // max. number of steps increased
1971 // specific energy loss set in galice.cuts
1973 AliInfo("*** TPC version 4 initialized ***");
1974 AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1980 //_____________________________________________________________________________
1981 void AliTPCv4::StepManager()
1984 // Called for every step in the Time Projection Chamber
1988 // parameters used for the energy loss calculations
1990 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1991 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1992 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1995 const Float_t kbig = 1.e10;
2002 vol[1]=0; // preset row number to 0
2004 gMC->SetMaxStep(kbig);
2008 Float_t charge = gMC->TrackCharge();
2010 if(TMath::Abs(charge)<=0.) return; // take only charged particles
2012 // check the sensitive volume
2014 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
2015 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
2017 gMC->TrackPosition(p);
2018 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2022 Double_t angle = TMath::ACos(p[0]/r);
2023 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
2025 // angular segment, it is not a real sector number...
2027 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
2028 fTPCParam->GetInnerAngle());
2029 // rotate to segment "0"
2031 fTPCParam->AdjustCosSin(sector,cos,sin);
2032 Float_t x1=p[0]*cos + p[1]*sin;
2033 // check if within sector's limits
2034 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
2035 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
2036 // calculate real sector number...
2037 if (x1>fTPCParam->GetOuterRadiusLow()){
2038 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
2039 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
2040 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
2043 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
2045 // here I have a sector number
2049 // check if change of sector
2050 if(sector != fSecOld){
2052 // add track reference
2053 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
2055 // track is in the sensitive strip
2057 // track is entering the strip
2058 if (gMC->IsTrackEntering()){
2059 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
2060 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
2061 // row numbers are autonomous for lower and upper sectors
2062 if(vol[0] > fTPCParam->GetNInnerSector()) {
2063 vol[1] -= fTPCParam->GetNRowLow();
2066 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
2068 // lower sector, row 0, because Jouri wants to have this
2070 gMC->TrackMomentum(p);
2074 hits[3]=0.; // this hit has no energy loss
2075 // Get also the track time for pileup simulation
2076 hits[4]=gMC->TrackTime();
2078 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2082 gMC->TrackPosition(p);
2086 hits[3]=0.; // this hit has no energy loss
2087 // Get also the track time for pileup simulation
2088 hits[4]=gMC->TrackTime();
2090 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2095 //-----------------------------------------------------------------
2096 // charged particle is in the sensitive drift volume
2097 //-----------------------------------------------------------------
2099 if(gMC->TrackStep() > 0){
2101 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
2102 nel=TMath::Min(nel,30); // 30 electrons corresponds to 1 keV
2104 gMC->TrackPosition(p);
2108 hits[3]=(Float_t)nel;
2114 gMC->TrackMomentum(p);
2115 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2116 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2117 fTrackHits->SetHitPrecision(precision);
2120 // Get also the track time for pileup simulation
2121 hits[4]=gMC->TrackTime();
2123 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2126 } //within sector's limits
2127 // Stemax calculation for the next step
2128 if(!gMC->IsTrackAlive()) return; // particle has disappeared
2131 gMC->TrackMomentum(mom);
2132 Float_t ptot=mom.Rho();
2133 Float_t betaGamma = ptot/gMC->TrackMass();
2135 Int_t pid=gMC->TrackPid();
2136 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2138 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
2143 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
2144 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
2146 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2149 Double_t rnd = gMC->GetRandom()->Rndm();
2151 gMC->SetMaxStep(-TMath::Log(rnd)/pp);