1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 ///////////////////////////////////////////////////////////////////////////////
21 // Time Projection Chamber version 1 -- detailed TPC and fast simulation //
25 <img src="picts/AliTPCv1Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
32 #include <Riostream.h>
34 #include <TInterpreter.h>
36 #include <TVirtualMC.h>
42 #include "AliTPCDigitsArray.h"
43 #include "AliTPCParam.h"
44 #include "AliTPCParamSR.h"
46 #include "TLorentzVector.h"
49 #include "TGeoManager.h"
50 #include "TGeoVolume.h"
55 #include "TGeoCompositeShape.h"
57 #include "TGeoPhysicalNode.h"
58 #include "TGeoHalfSpace.h"
59 #include "TTreeStream.h"
66 //_____________________________________________________________________________
68 AliTPCv1::AliTPCv1():AliTPC(),fIdSens(0)
75 //_____________________________________________________________________________
76 AliTPCv1::AliTPCv1(const char *name, const char *title)
77 :AliTPC(name, title),fIdSens(0)
80 // Standard constructor for Time Projection Chamber
85 fTPCParam->Write(fTPCParam->GetTitle());
90 //_____________________________________________________________________________
91 void AliTPCv1::CreateGeometry()
93 //-------------------------------------------------------------
94 // Creates geometry for Time Projection Chamber version 1
95 // Detailed geometry -- Fast simulation - space points
96 // at the pad-rows centers
97 // Origin M.Kowalski, INP Cracow, Marek.Kowalski@ifj.edu.pl
98 //-----------------------------------------------------------
102 <img src="picts/AliTPC.gif">
107 <img src="picts/AliTPCv1Tree.gif">
110 //----------------------------------------------------------
111 // This geometry is written using TGeo class
112 // Firstly the shapes are defined, and only then the volumes
113 // What is recognized by the MC are volumes
114 //----------------------------------------------------------
116 // tpc - this will be the mother volume
120 // here I define a volume TPC
121 // retrive the medium name with "TPC_" as a leading string
123 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
125 tpc->DefineSection(0,-289.6,77.,278.);
126 tpc->DefineSection(1,-262.1,77.,278.);
128 tpc->DefineSection(2,-262.1,83.1,278.);
129 tpc->DefineSection(3,-260.,83.1,278.);
131 tpc->DefineSection(4,-260.,70.,278.);
132 tpc->DefineSection(5,-259.6,70.,278.);
134 tpc->DefineSection(6,-259.6,68.1,278.);
135 tpc->DefineSection(7,-253.6,68.1,278.);
137 tpc->DefineSection(8,-253.6,67.88,278.);//hs
138 tpc->DefineSection(9,-74.0,60.68,278.);// hs
140 tpc->DefineSection(10,-74.0,60.1,278.);
141 tpc->DefineSection(11,-73.3,60.1,278.);
143 tpc->DefineSection(12,-73.3,56.9,278.);
144 tpc->DefineSection(13,-68.5,56.9,278.);
146 tpc->DefineSection(14,-68.5,60.,278.);
147 tpc->DefineSection(15,-64.7,60.,278.);
149 tpc->DefineSection(16,-64.7,56.9,278.);
150 tpc->DefineSection(17,73.3,56.9,278.);
152 tpc->DefineSection(18,73.3,60.1,278.);
153 tpc->DefineSection(19,74.0,60.1,278.);
155 tpc->DefineSection(20,74.0,60.68,278.);// hs
156 tpc->DefineSection(21,253.6,65.38,278.);// hs
158 tpc->DefineSection(22,253.6,65.6,278.);
159 tpc->DefineSection(23,259.6,65.6,278.);
161 tpc->DefineSection(24,259.6,70.0,278.);
162 tpc->DefineSection(25,260.,70.0,278.);
164 tpc->DefineSection(26,260.,83.1,278.);
165 tpc->DefineSection(27,262.1,83.1,278.);
167 tpc->DefineSection(28,262.1,77.,278);
168 tpc->DefineSection(29,289.6,77.,278.);
172 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
173 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
175 // drift volume - sensitive volume, extended beyond the
176 // endcaps, because of the alignment
178 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
179 dvol->DefineSection(0,-260.,74.5,264.4);
180 dvol->DefineSection(1,-253.6,74.5,264.4);
182 dvol->DefineSection(2,-253.6,76.6774,258.);
183 dvol->DefineSection(3,253.6,76.6774,258.);
185 dvol->DefineSection(4,253.6,74.5,264.4);
186 dvol->DefineSection(5,260.,74.5,264.4);
188 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-1");
189 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
196 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
198 tpco->DefineSection(0,-256.6,264.8,278.);
199 tpco->DefineSection(1,-253.6,264.8,278.);
201 tpco->DefineSection(2,-253.6,258.,278.);
202 tpco->DefineSection(3,250.6,258.,278.);
204 tpco->DefineSection(4,250.6,258.,275.5);
205 tpco->DefineSection(5,253.6,258.,275.5);
207 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
208 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
210 // outer containment vessel
212 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
214 tocv->DefineSection(0,-256.6,264.8,278.);
215 tocv->DefineSection(1,-253.6,264.8,278.);
217 tocv->DefineSection(2,-253.6,274.8124,278.);
218 tocv->DefineSection(3,247.6,274.8124,278.);
220 tocv->DefineSection(4,247.6,270.4,278.);
221 tocv->DefineSection(5,250.6,270.4,278.);
223 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
224 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
226 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
227 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
228 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
229 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
231 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
232 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
233 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
234 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
236 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
237 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
238 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
239 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
240 TGeoMedium *mhs = gGeoManager->GetMedium("TPC_Steel");
241 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
242 //-------------------------------------------------------
243 // Tpc Outer Field Cage
244 // daughters - composite (sandwich)
245 //-------------------------------------------------------
247 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
249 tofc->DefineSection(0,-253.6,258.,269.6);
250 tofc->DefineSection(1,-250.6,258.,269.6);
252 tofc->DefineSection(2,-250.6,258.,260.0676);
253 tofc->DefineSection(3,250.6,258.,260.0676);
255 tofc->DefineSection(4,250.6,258.,275.5);
256 tofc->DefineSection(5,253.6,258.,275.5);
258 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
260 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
261 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
262 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
264 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
266 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
267 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
268 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
270 // outer part - positioning
272 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
274 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
276 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
278 v2->AddNode(v3,1); v2->AddNode(v4,1);
281 //--------------------------------------------------------------------
282 // Tpc Inner INsulator (CO2)
283 // the cones, the central drum and the inner f.c. sandwich with a piece
284 // of the flane will be placed in the TPC
285 //--------------------------------------------------------------------
286 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
288 tpci->DefineSection(0,-253.6,68.4,76.6774);
289 tpci->DefineSection(1,-74.0,61.2,76.6774);
291 tpci->DefineSection(2,74.0,61.2,76.6774);
293 tpci->DefineSection(3,253.6,65.9,76.6774);
295 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
297 // now the inner field cage - only part of flanges (2 copies)
299 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
300 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
302 //---------------------------------------------------------
303 // Tpc Inner Containment vessel - Muon side
304 //---------------------------------------------------------
305 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
307 tcms->DefineSection(0,-259.1,68.1,74.2);
308 tcms->DefineSection(1,-253.6,68.1,74.2);
310 tcms->DefineSection(2,-253.6,68.1,68.4);
311 tcms->DefineSection(3,-74.0,60.9,61.2);
313 tcms->DefineSection(4,-74.0,60.1,61.2);
314 tcms->DefineSection(5,-73.3,60.1,61.2);
316 tcms->DefineSection(6,-73.3,56.9,61.2);
317 tcms->DefineSection(7,-73.0,56.9,61.2);
319 tcms->DefineSection(8,-73.0,56.9,58.8);
320 tcms->DefineSection(9,-71.3,56.9,58.8);
322 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
323 //------------------------------------------------
324 // Heat screen muon side
325 //------------------------------------------------
327 TGeoCone *thsm = new TGeoCone(89.8,67.88,68.1,60.68,60.9);
328 TGeoCone *thsmw = new TGeoCone(89.8,67.94,68.04,60.74,60.84);
329 TGeoVolume *hvsm = new TGeoVolume("TPC_HSM",thsm,mhs); //steel
330 TGeoVolume *hvsmw = new TGeoVolume("TPC_HSMW",thsmw,m12); //water
331 // assembly heat screen muon
332 hvsm->AddNode(hvsmw,1);
333 //-----------------------------------------------
334 // inner containment vessel - shaft side
335 //-----------------------------------------------
336 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
338 tcss->DefineSection(0,71.3,56.9,58.8);
339 tcss->DefineSection(1,73.0,56.9,58.8);
341 tcss->DefineSection(2,73.0,56.9,61.2);
342 tcss->DefineSection(3,73.3,56.9,61.2);
344 tcss->DefineSection(4,73.3,60.1,61.2);
345 tcss->DefineSection(5,74.0,60.1,61.2);
347 tcss->DefineSection(6,74.0,60.9,61.2);
348 tcss->DefineSection(7,253.6,65.6,65.9);
350 tcss->DefineSection(8,253.6,65.6,74.2);
351 tcss->DefineSection(9,258.1,65.6,74.2);
353 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
354 //-------------------------------------------------
355 // Heat screen shaft side
356 //--------------------------------------------------
357 TGeoCone *thss = new TGeoCone(89.8,60.68,60.9,65.38,65.6);
358 TGeoCone *thssw = new TGeoCone(89.8,60.74,60.84,65.44,65.54);
359 TGeoVolume *hvss = new TGeoVolume("TPC_HSS",thss,mhs); //steel
360 TGeoVolume *hvssw = new TGeoVolume("TPC_HSSW",thssw,m12); //water
361 //assembly heat screen shaft
362 hvss->AddNode(hvssw,1);
363 //-----------------------------------------------
365 // define 4 parts and make an assembly
366 //-----------------------------------------------
367 // part1 - Al - 2 copies
368 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
369 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
370 // sandwich - outermost parts - 2 copies
371 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
372 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
373 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
374 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
376 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
377 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
378 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
379 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
381 // middle parts - 2 copies
382 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
383 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
384 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
385 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
387 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
388 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
389 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
390 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
391 // central part - 1 copy
392 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
393 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
394 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
396 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
397 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
398 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
400 // inner part - positioning
402 // creating a sandwich
403 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
405 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
407 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
409 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
411 tv100->AddNode(tv10,1);
412 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
413 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
414 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
415 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
416 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
417 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
419 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
420 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
421 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
422 v1->AddNode(hvsm,1,new TGeoTranslation(0.,0.,-163.8));
423 v1->AddNode(hvss,1,new TGeoTranslation(0.,0.,163.8));
424 v9->AddNode(tv100,1);
430 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
431 cfl->DefineSection(0,-71.1,59.7,61.2);
432 cfl->DefineSection(1,-68.6,59.7,61.2);
434 cfl->DefineSection(2,-68.6,60.6324,61.2);
435 cfl->DefineSection(3,68.6,60.6324,61.2);
437 cfl->DefineSection(4,68.6,59.7,61.2);
438 cfl->DefineSection(5,71.1,59.7,61.2);
440 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
442 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
443 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
444 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
446 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
447 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
448 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
449 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
451 // seals for central drum 2 copies
453 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
454 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
455 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
456 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
457 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
460 TGeoPcon *se = new TGeoPcon(0.,360.,6);
461 se->DefineSection(0,-72.8,59.7,61.2);
462 se->DefineSection(1,-72.3,59.7,61.2);
464 se->DefineSection(2,-72.3,58.85,61.2);
465 se->DefineSection(3,-71.6,58.85,61.2);
467 se->DefineSection(4,-71.6,59.7,61.2);
468 se->DefineSection(5,-71.3,59.7,61.2);
470 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
472 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
473 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
475 // define reflection matrix
477 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
479 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
481 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
482 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
483 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
485 // central membrane - 2 rings and a mylar membrane - assembly
487 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
488 TGeoTube *oh = new TGeoTube(250.,256.,.5);
489 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
490 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
491 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
492 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
494 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
500 // end caps - they are make as an assembly of single segments
501 // containing both readout chambers
503 Double_t openingAngle = 10.*TMath::DegToRad();
504 Double_t thick=1.5; // rib
505 Double_t shift = thick/TMath::Sin(openingAngle);
507 Double_t lowEdge = 86.3; // hole in the wheel
508 Double_t upEdge = 240.4; // hole in the wheel
510 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
512 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
514 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
515 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
517 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
518 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
520 Double_t ys = shift*TMath::Sin(openingAngle);
521 Double_t xs = shift*TMath::Cos(openingAngle);
522 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
523 tr->RegisterYourself();
524 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
525 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
526 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
527 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
528 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
529 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
530 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
532 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
538 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
539 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
541 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
542 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
543 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
545 Double_t tga = (19.8328-12.3742)/39.3;
547 xmin = 9.55*tga+12.3742;
548 xmax = 9.95*tga+12.3742;
549 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
550 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
551 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
552 xmin=19.4*tga+12.3742;
553 xmax=19.9*tga+12.3742;
554 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
555 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
556 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
557 xmin=29.35*tga+12.3742;
558 xmax=29.75*tga+12.3742;
559 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
560 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
561 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
563 // holes for connectors
565 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
566 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
567 TString fileName(gSystem->Getenv("ALICE_ROOT"));
568 fileName += "/TPC/conn_iroc.dat";
570 in.open(fileName.Data(), ios_base::in); // asci file
571 for(Int_t i =0;i<86;i++){
576 TGeoRotation *rrr = new TGeoRotation();
578 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
579 ibdv->AddNode(connv,i+1,trans);
583 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
585 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
586 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
587 tr1->RegisterYourself();
588 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
589 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
591 // pad plane and wire fixations
593 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
594 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
595 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
596 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
597 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
598 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
599 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
601 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
603 iroc->AddNode(ibdv,1);
604 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
605 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
606 tga =(23.3521-14.5974)/49.65;
607 Double_t xx = 24.825*tga+14.5974-0.6;
608 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
609 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
613 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
614 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
615 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
616 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
617 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
619 tga=(38.5084-20.2938)/99.3;
620 xmin=tga*10.2+20.2938;
621 xmax=tga*10.6+20.2938;
622 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
623 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
625 xmin=22.55*tga+20.2938;
626 xmax=24.15*tga+20.2938;
627 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
628 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
630 xmin=36.1*tga+20.2938;
631 xmax=36.5*tga+20.2938;
632 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
633 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
635 xmin=49.0*tga+20.2938;
636 xmax=50.6*tga+20.2938;
637 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
638 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
640 xmin=63.6*tga+20.2938;
641 xmax=64.0*tga+20.2938;
642 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
643 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
645 xmin=75.5*tga+20.2938;
646 xmax=77.15*tga+20.2938;
647 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
648 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
650 xmin=88.7*tga+20.2938;
651 xmax=89.1*tga+20.2938;
652 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
653 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
655 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
656 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
657 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
658 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
659 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
660 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
661 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
663 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
664 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
665 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
666 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
667 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
669 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
670 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
671 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
672 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
673 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
675 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
676 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
677 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
678 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
679 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
680 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
681 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
682 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
684 // holes for connectors
686 fileName = gSystem->Getenv("ALICE_ROOT");
687 fileName += "/TPC/conn_oroc.dat";
688 in.open(fileName.Data(), ios_base::in); // asci file
689 for(Int_t i =0;i<78;i++){
692 Double_t x1,z1,x2,z2;
694 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
695 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
697 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
699 TGeoRotation *rr = new TGeoRotation();
703 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
704 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
705 obdv->AddNode(connv,i+1,trans1);
706 obdv->AddNode(connv,i+79,trans2);
710 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
711 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
712 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
713 tr5->RegisterYourself();
714 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
715 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
717 // pad plane and wire fixations
719 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
720 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
722 tga=(43.5239-23.3874)/114.2;
723 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
724 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
725 xx = 57.1*tga+23.3874-0.7;
726 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
727 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
729 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
731 oroc->AddNode(obdv,1);
732 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
733 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
734 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
735 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
737 // now iroc and oroc are placed into a sector...
739 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
740 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
741 TGeoRotation rot1("rot1",90.,90.,0.);
742 TGeoRotation rot2("rot2");
744 TGeoRotation *rot = new TGeoRotation("rot");
748 x0=110.2*TMath::Cos(openingAngle);
749 y0=110.2*TMath::Sin(openingAngle);
750 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
751 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
752 x0=188.45*TMath::Cos(openingAngle);
753 y0=188.45*TMath::Sin(openingAngle);
754 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
755 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
759 secta->AddNode(ch,1);
760 secta->AddNode(iroc,1,combi1a);
761 secta->AddNode(oroc,1,combi2a);
765 sectc->AddNode(ch,1);
766 sectc->AddNode(iroc,1,combi1c);
767 sectc->AddNode(oroc,1,combi2c);
769 // now I try to make wheels...
771 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
772 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
774 for(Int_t i =0;i<18;i++){
775 Double_t phi = (20.*i);
776 TGeoRotation *r = new TGeoRotation();
778 wheela->AddNode(secta,i+1,r);
779 wheelc->AddNode(sectc,i+1,r);
782 // wheels in the drift volume!
783 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
784 v9->AddNode(wheela,1,combi3);
785 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
787 //_____________________________________________________________
788 // service support wheel
789 //_____________________________________________________________
790 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
791 sw->DefineSection(0,-4.,80.5,251.75);
792 sw->DefineSection(1,4.,80.5,251.75);
793 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
796 shift = thick/TMath::Sin(openingAngle);
797 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
798 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
799 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
800 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
802 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
803 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
804 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
805 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
806 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
811 ys = shift*TMath::Sin(openingAngle);
812 xs = shift*TMath::Cos(openingAngle);
813 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
815 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
816 co->DefineSection(0,-0.5,77.,255.25);
817 co->DefineSection(1,0.5,77.,255.25);
818 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
820 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
821 shift=4./TMath::Sin(openingAngle);
822 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
823 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
825 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
827 ys = shift*TMath::Sin(openingAngle);
828 xs = shift*TMath::Cos(openingAngle);
829 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
831 // Sector as an Assembly
833 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
834 swhs->AddNode(swv,1);
835 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
836 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
838 // SSW as an Assembly of sectors
840 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
841 for(Int_t i =0;i<18;i++){
842 Double_t phi = (20.*i);
843 TGeoRotation *r = new TGeoRotation();
845 swheel->AddNode(swhs,i+1,r);
847 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
848 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
851 TGeoMedium *m8 = gGeoManager->GetMedium("TPC_Ne-CO2-2");
853 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
856 gGeoManager->Volume("TPC_Strip","PGON",m8->GetId(),upar);
857 upar=new Double_t [10];
866 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
873 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
874 gGeoManager->Node("TPC_Strip",totrows+1,
875 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
880 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
881 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
886 gGeoManager->Node("TPC_Strip",i,
887 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
888 gGeoManager->Node("TPC_Strip",totrows+i,
889 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
892 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
893 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
898 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
899 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
900 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
901 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
904 //----------------------------------------------------------
905 // TPc Support Rods - MAKROLON
906 //----------------------------------------------------------
907 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
908 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
909 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
910 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
911 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
913 // tpc rod is an assembly of 10 long parts and 2 short parts
914 // connected with alu rings and plagged on both sides.
919 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
920 rod->DefineSection(0,-10.43,1.92,2.08);
921 rod->DefineSection(1,-9.75,1.92,2.08);
923 rod->DefineSection(2,-9.75,1.8,2.2);
924 rod->DefineSection(3,9.75,1.8,2.2);
926 rod->DefineSection(4,9.75,1.92,2.08);
927 rod->DefineSection(5,10.43,1.92,2.08);
929 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
933 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
934 rod1->DefineSection(0,-8.93,1.92,2.08);
935 rod1->DefineSection(1,-8.25,1.92,2.08);
937 rod1->DefineSection(2,-8.25,1.8,2.2);
938 rod1->DefineSection(3,8.25,1.8,2.2);
940 rod1->DefineSection(4,8.25,1.92,2.08);
941 rod1->DefineSection(5,8.93,1.92,2.08);
943 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
945 // below is for the resistor rod
947 // hole for the brass connectors
950 new TGeoTube("hhole",0.,0.3,0.3);
952 //transformations for holes - initialy they
953 // are placed at x=0 and negative y
955 TGeoRotation *rhole = new TGeoRotation();
957 TGeoCombiTrans *transf[13];
959 for(Int_t i=0;i<13;i++){
960 //sprintf(name,"transf%d",i);
961 snprintf(name,30,"transf%d",i);
962 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
963 transf[i]->RegisterYourself();
965 // union expression for holes
966 TString operl("hhole:transf0");
967 for (Int_t i=1;i<13;i++){
968 //sprintf(name,"+hhole:transf%d",i);
969 snprintf(name,30,"+hhole:transf%d",i);
973 TString opers("hhole:transf1");
974 for (Int_t i=2;i<12;i++){
975 //sprintf(name,"+hhole:transf%d",i);
976 snprintf(name,30,"+hhole:transf%d",i);
980 new TGeoCompositeShape("hlv",operl.Data());
981 new TGeoCompositeShape("hsv",opers.Data());
983 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
984 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
985 //rods - volumes - makrolon rods with holes
986 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
987 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
990 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
991 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
993 // hooks holding strips
995 new TGeoBBox("hk1",0.625,0.015,0.75);
996 new TGeoBBox("hk2",0.625,0.015,0.15);
997 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
998 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
999 tr21->RegisterYourself();
1000 tr12->RegisterYourself();
1002 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
1003 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
1005 // assembly of the short rod with connectors and hooks
1010 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1012 spart->AddNode( rodsv,1);
1013 for(Int_t i=1;i<12;i++){
1014 spart->AddNode(bconv,i,transf[i]);
1016 for(Int_t i =0;i<11;i++){
1017 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
1022 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1024 lpart->AddNode( rodlv,1);
1025 for(Int_t i=0;i<13;i++){
1026 lpart->AddNode(bconv,i+12,transf[i]);
1028 for(Int_t i =0;i<13;i++){
1029 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
1034 new TGeoTube("ring1",2.1075,2.235,0.53);
1035 new TGeoTube("ring2",1.7925,1.89,0.43);
1036 new TGeoTube("ring3",1.89,2.1075,0.05);
1037 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1038 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1042 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
1043 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1045 for(Int_t i=0;i<11;i++){
1046 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
1047 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1049 for(Int_t i=0;i<10;i++){
1050 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//resistor rod
1051 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//makrolon rod
1054 // right plug - identical for all rods
1056 TGeoPcon *tpcrp = new TGeoPcon(0.,360.,6);
1058 tpcrp->DefineSection(0,123.05,1.89,2.1075);
1059 tpcrp->DefineSection(1,123.59,1.89,2.1075);
1061 tpcrp->DefineSection(2,123.59,1.8,2.2);
1062 tpcrp->DefineSection(3,127.,1.8,2.2);
1064 tpcrp->DefineSection(4,127.,0.,2.2);
1065 tpcrp->DefineSection(5,127.5,0.,2.2);
1067 TGeoVolume *tpcrpv = new TGeoVolume("TPC_RP",tpcrp,m6);
1069 // adding short pieces and right plug
1071 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1072 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1073 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1074 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
1075 tpcrrod->AddNode(tpcrpv,1);
1077 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1078 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1079 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1080 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1081 tpcmrod->AddNode(tpcrpv,2);
1083 // from the ringv position to the CM is 3.0 cm!
1084 //----------------------------------------
1087 //HV rods - makrolon + 0.58cm (diameter) Cu ->check the length
1088 TGeoTube *hvr = new TGeoTube(0.,1.465,123.);
1089 TGeoTube *hvc = new TGeoTube(0.,0.29,123.);
1091 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1092 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1093 hvrv->AddNode(hvcv,1);
1097 TGeoTube *cr = new TGeoTube(0.,0.45,123.);
1098 TGeoTube *cw = new TGeoTube(0.,0.15,123.);
1099 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
1100 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
1102 // ceramic rod with water
1104 crv->AddNode(cwv,1);
1108 TGeoTube *pr =new TGeoTube(0.2,0.35,123.);
1109 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
1111 // copper plates with connectors
1113 new TGeoTube("tub",0.,1.7,0.025);
1115 // half space - points on the plane and a normal vector
1118 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1119 Double_t intp = 1.245;
1121 Double_t b = slope*slope+1.;
1130 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1134 new TGeoHalfSpace("sp1",p,n);
1143 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1147 new TGeoHalfSpace("sp2",p,n);
1150 new TGeoTube("h1",0.,0.5,0.025);
1151 new TGeoTube("h2",0.,0.35,0.025);
1153 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1154 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1155 ttr11->RegisterYourself();
1156 ttr22->RegisterYourself();
1157 // elastic connector
1158 new TGeoBBox("elcon",0.72,0.005,0.3);
1159 TGeoRotation *crr1 = new TGeoRotation();
1160 crr1->RotateZ(-22.);
1161 TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1162 ctr1->RegisterYourself();
1163 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1164 "(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1166 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1168 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1171 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
1173 rrod->AddNode(crv,1,ttr11);
1174 rrod->AddNode(crv,2,ttr22);
1175 rrod->AddNode(prv,1);
1177 for(Int_t i=0;i<165;i++){
1178 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1181 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1182 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m10);
1183 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1184 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1185 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1187 TGeoRotation *crr2 = new TGeoRotation();
1189 TGeoRotation *crr3 = new TGeoRotation();
1190 crr3->RotateY(-30.);
1192 for(Int_t i=0;i<164;i+=2){
1193 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1194 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1197 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
1199 // rod left head with holders - inner
1201 // first element - support for inner holder TPC_IHS
1202 Double_t shift1[3] = {0.0,-0.175,0.0};
1204 new TGeoBBox("tpcihs1", 4.7, 0.66, 2.35);
1205 new TGeoBBox("tpcihs2", 4.7, 0.485, 1.0, shift1);
1206 new TGeoBBox("tpcihs3", 1.5, 0.485, 2.35, shift1);
1207 new TGeoTube("tpcihs4", 0.0, 2.38, 0.1);
1209 Double_t pointstrap[16];
1213 pointstrap[3]= 1.08;
1215 pointstrap[5]= 1.08;
1216 pointstrap[6]= 3.38;
1220 pointstrap[10]= 0.0;
1221 pointstrap[11]= 1.08;
1222 pointstrap[12]= 2.3;
1223 pointstrap[13]= 1.08;
1224 pointstrap[14]= 3.38;
1225 pointstrap[15]= 0.0;
1227 TGeoArb8 *tpcihs5 = new TGeoArb8("tpcihs5", 0.6, pointstrap);
1229 // half space - cutting "legs"
1239 new TGeoHalfSpace("cutil1", p, n);
1244 TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0.0, 2.84, 2.25);
1245 trans2->RegisterYourself();
1246 TGeoTranslation*trans3= new TGeoTranslation("trans3", 0.0, 2.84, -2.25);
1247 trans3->RegisterYourself();
1248 //support - composite volume
1250 TGeoCompositeShape *tpcihs6 = new TGeoCompositeShape("tpcihs6", "tpcihs1-(tpcihs2+tpcihs3)-(tpcihs4:trans2)-(tpcihs4:trans3)-cutil1");
1252 // volumes - all makrolon
1254 TGeoVolume *tpcihss = new TGeoVolume("TPC_IHSS", tpcihs6, m6); //support
1255 TGeoVolume *tpcihst = new TGeoVolume("TPC_IHSTR",tpcihs5 , m6); //trapesoid
1257 TGeoRotation *rot111 = new TGeoRotation();
1258 rot111->RotateY(180.0);
1260 TGeoVolumeAssembly *tpcihs = new TGeoVolumeAssembly("TPC_IHS"); // assembly of the support
1261 tpcihs->AddNode(tpcihss, 1);
1262 tpcihs->AddNode(tpcihst, 1, new TGeoTranslation(-4.7, 0.66, 0.0));
1263 tpcihs->AddNode(tpcihst, 2, new TGeoCombiTrans(4.7, 0.66, 0.0, rot111));
1265 // two rod holders (TPC_IRH) assembled with the support
1267 new TGeoBBox("tpcirh1", 4.7, 1.33, 0.5);
1271 new TGeoBBox("tpcirh2", 1.05, 0.8, 0.5, shift1);
1275 new TGeoBBox("tpcirh3", 1.05, 0.8, 0.5, shift1);
1279 new TGeoBBox("tpcirh4", 1.9, 0.25, 0.5, shift1);
1280 new TGeoTube("tpcirh5", 0, 1.9, 5);
1282 TGeoTranslation *trans4 = new TGeoTranslation("trans4", 0, 0.83, 0.0);
1283 trans4->RegisterYourself();
1285 TGeoCompositeShape *tpcirh6 = new TGeoCompositeShape("tpcirh6", "tpcirh1-tpcirh2-tpcirh3-(tpcirh5:trans4)-tpcirh4");
1289 TGeoVolume *tpcirh = new TGeoVolume("TPC_IRH", tpcirh6, m6);
1291 // and all together...
1293 TGeoVolume *tpciclamp = new TGeoVolumeAssembly("TPC_ICLP");
1294 tpciclamp->AddNode(tpcihs, 1);
1295 tpciclamp->AddNode(tpcirh, 1, new TGeoTranslation(0, 1.99, 1.1));
1296 tpciclamp->AddNode(tpcirh, 2, new TGeoTranslation(0, 1.99, -1.1));
1298 // and now left inner "head"
1300 TGeoPcon *inplug = new TGeoPcon("inplug", 0.0, 360.0, 14);
1302 inplug->DefineSection(0, 0.3, 0.0, 2.2);
1303 inplug->DefineSection(1, 0.6, 0.0, 2.2);
1305 inplug->DefineSection(2, 0.6, 0.0, 1.75);
1306 inplug->DefineSection(3, 0.7, 0.0, 1.75);
1308 inplug->DefineSection(4, 0.7, 1.55, 1.75);
1309 inplug->DefineSection(5, 1.6, 1.55, 1.75);
1311 inplug->DefineSection(6, 1.6, 1.55, 2.2);
1312 inplug->DefineSection(7, 1.875, 1.55, 2.2);
1314 inplug->DefineSection(8, 1.875, 1.55, 2.2);
1315 inplug->DefineSection(9, 2.47, 1.75, 2.2);
1317 inplug->DefineSection(10, 2.47, 1.75, 2.08);
1318 inplug->DefineSection(11, 2.57, 1.8, 2.08);
1320 inplug->DefineSection(12, 2.57, 1.92, 2.08);
1321 inplug->DefineSection(13, 2.95, 1.92, 2.08);
1327 new TGeoBBox("pcuti", 1.5, 0.11, 1.075, shift1);
1329 TGeoCompositeShape *inplleft = new TGeoCompositeShape("inplleft", "inplug-pcuti");
1330 TGeoVolume *tpcinlplug = new TGeoVolume("TPC_INPLL", inplleft, m6);
1334 TGeoVolume *tpcihpl = new TGeoVolumeAssembly("TPC_IHPL"); //holder+2 plugs (reflected)
1335 tpcihpl->AddNode(tpcinlplug, 1);
1336 tpcihpl->AddNode(tpcinlplug, 2,ref);
1337 tpcihpl->AddNode(tpciclamp,1,new TGeoTranslation(0.0, -2.765, 0.0));
1339 // outer holders and clamps
1342 // outer membrane holder (between rods)
1348 pointstrap[5]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1353 pointstrap[10]= 0.0;
1354 pointstrap[11]= 2.8;
1355 pointstrap[12]= 3.1;
1356 pointstrap[13]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1357 pointstrap[14]= 3.1;
1358 pointstrap[15]= 0.0;
1360 TGeoArb8 *tpcomh1 = new TGeoArb8("tpcomh1", 1.05, pointstrap);
1361 TGeoBBox *tpcomh2 = new TGeoBBox("tpcomh2", 0.8, 1.4, 6);
1363 TGeoVolume *tpcomh1v = new TGeoVolume("TPC_OMH1", tpcomh1, m7);
1364 TGeoVolume *tpcomh2v = new TGeoVolume("TPC_OMH2", tpcomh2, m7);
1366 TGeoVolume *tpcomh3v = new TGeoVolumeAssembly("TPC_OMH3"); // assembly1
1367 tpcomh3v->AddNode(tpcomh1v, 1, new TGeoTranslation(0.8, -1.4, 4.95));
1368 tpcomh3v->AddNode(tpcomh1v, 2, new TGeoTranslation(0.8, -1.4, -4.95));
1369 tpcomh3v->AddNode(tpcomh2v, 1);
1375 new TGeoBBox("tpcomh3", 1.65, 1.15, 3.4);
1376 TGeoBBox *tpcomh4 = new TGeoBBox("tpcomh4", 0.75, 0.7, 3.4, shift1);
1385 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1388 new TGeoHalfSpace("cutomh1", p, n);
1397 n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1400 new TGeoHalfSpace("cutomh2", p, n);
1408 n[0] = 1.0*TMath::Tan(75.*TMath::DegToRad());
1412 new TGeoHalfSpace("cutomh3", p, n);
1420 n[0] = 1.0*TMath::Tan(75*TMath::DegToRad());
1424 new TGeoHalfSpace("cutomh4", p, n);
1433 n[1] = -1.0*TMath::Tan(20.*TMath::DegToRad());
1436 new TGeoHalfSpace("cutomh5", p, n);
1438 TGeoCompositeShape *tpcomh5 = new TGeoCompositeShape("tpcomh5", "tpcomh3-cutomh1-cutomh2-cutomh3-cutomh4-cutomh5");
1440 TGeoVolume *tpcomh5v = new TGeoVolume("TPC_OMH5",tpcomh5,m6);
1441 TGeoVolume *tpcomh4v = new TGeoVolume("TPC_OMH6",tpcomh4,m6);
1443 TGeoVolumeAssembly *tpcomh7v = new TGeoVolumeAssembly("TPC_OMH7");
1444 tpcomh7v->AddNode(tpcomh5v,1);
1445 tpcomh7v->AddNode(tpcomh4v,1);
1447 // full membrane holder - tpcomh3v + tpcomh7v
1449 TGeoVolumeAssembly *tpcomh = new TGeoVolumeAssembly("TPC_OMH");
1450 tpcomh->AddNode(tpcomh3v,1,new TGeoTranslation(1.5,0.,0.));
1451 tpcomh->AddNode(tpcomh3v,2,new TGeoCombiTrans(-1.5,0.,0.,rot111));
1452 tpcomh->AddNode(tpcomh7v,1,new TGeoTranslation(0.65+1.5, 2.55, 0.0));
1453 tpcomh->AddNode(tpcomh7v,2,new TGeoCombiTrans(-0.65-1.5, 2.55, 0.0,rot111));
1455 // outer rod holder support
1457 new TGeoBBox("tpcohs1", 3.8, 0.675, 2.35);
1463 new TGeoBBox("tpcohs2", 1.5, 0.5, 2.35, shift1);
1464 new TGeoBBox("tpcohs3", 3.8, 0.5, 0.85, shift1);
1470 TGeoBBox *tpcohs4 = new TGeoBBox("tpsohs4", 3.1, 0.5, 0.7, shift1);
1472 TGeoVolume *tpcohs4v = new TGeoVolume("TPC_OHS4", tpcohs4, m6);
1482 new TGeoHalfSpace("cutohs1", p, n);
1484 TGeoCompositeShape *tpcohs5 = new TGeoCompositeShape("tpcohs5", "tpcohs1-tpcohs2-tpcohs3-cutohs1");
1485 TGeoVolume *tpcohs5v = new TGeoVolume("TPC_OHS5", tpcohs5, m6);
1487 TGeoVolumeAssembly *tpcohs = new TGeoVolumeAssembly("TPC_OHS");
1488 tpcohs->AddNode(tpcohs5v, 1);
1489 tpcohs->AddNode(tpcohs4v, 1);
1491 // outer rod holder itself
1496 new TGeoBBox("tpcorh1", 3.1, 1.825, 0.55); //from this box we cut pieces...
1502 new TGeoBBox("tpcorh2", 0.5, 2.75, 1.1, shift1);
1508 new TGeoBBox("tpcorh3", 0.5, 2.75, 1.1, shift1);
1514 new TGeoBBox("tpcorh4", 3.9, 2.75, 0.5, shift1);
1520 new TGeoBBox("tpcorh5", 1.95, 0.5, 1.1, shift1);
1526 new TGeoBBox("tpcorh6", 2.4, 0.5, 0.6, shift1);
1528 new TGeoTube("tpcorh7", 0, 1.95, 0.85);
1529 new TGeoTube("tpcorh8", 0, 2.4, 0.6);
1531 TGeoTranslation *trans33 = new TGeoTranslation("trans33", 0.0, 0.0, 0.55);
1532 trans33->RegisterYourself();
1534 TGeoCompositeShape *tpcorh9 = new TGeoCompositeShape("tpcorh9", "tpcorh1-tpcorh2-tpcorh3-tpcorh4-tpcorh5-tpcorh6-(tpcorh8:trans33)-tpcorh7");
1536 TGeoVolume *tpcorh9v = new TGeoVolume("TPC_ORH",tpcorh9,m6); //outer rod holder
1538 // now 2 holders together
1540 TGeoVolumeAssembly *tpcorh = new TGeoVolumeAssembly("TPC_ORH2");
1542 tpcorh->AddNode(tpcorh9v,1,new TGeoTranslation(0.0, 0.0, 1.25));
1543 tpcorh->AddNode(tpcorh9v,2,new TGeoCombiTrans(0.0, 0.0, -1.25,rot111));
1545 // outer rod plug left
1547 TGeoPcon *outplug = new TGeoPcon("outplug", 0.0, 360.0, 14);
1549 outplug->DefineSection(0, 0.5, 0.0, 2.2);
1550 outplug->DefineSection(1, 0.7, 0.0, 2.2);
1552 outplug->DefineSection(2, 0.7, 1.55, 2.2);
1553 outplug->DefineSection(3, 0.8, 1.55, 2.2);
1555 outplug->DefineSection(4, 0.8, 1.55, 1.75);
1556 outplug->DefineSection(5, 1.2, 1.55, 1.75);
1558 outplug->DefineSection(6, 1.2, 1.55, 2.2);
1559 outplug->DefineSection(7, 1.875, 1.55, 2.2);
1561 outplug->DefineSection(8, 1.875, 1.55, 2.2);
1562 outplug->DefineSection(9, 2.47, 1.75, 2.2);
1564 outplug->DefineSection(10, 2.47, 1.75, 2.08);
1565 outplug->DefineSection(11, 2.57, 1.8, 2.08);
1567 outplug->DefineSection(12, 2.57, 1.92, 2.08);
1568 outplug->DefineSection(13, 2.95, 1.92, 2.08);
1574 new TGeoBBox("cutout", 2.5, 0.11, 1.01, shift1);
1577 TGeoCompositeShape *outplleft = new TGeoCompositeShape("outplleft", "outplug-cutout");
1578 TGeoVolume *outplleftv = new TGeoVolume("TPC_OPLL", outplleft, m6);
1580 // support + holder + plug
1584 TGeoVolumeAssembly *tpcohpl = new TGeoVolumeAssembly("TPC_OHPL");
1586 tpcohpl->AddNode(outplleftv,1); //plug
1587 tpcohpl->AddNode(outplleftv,2,ref); //plug reflected
1588 tpcohpl->AddNode(tpcorh,1); //rod holder
1589 tpcohpl->AddNode(tpcohs,1,new TGeoTranslation(0.0, 3.925, 0)); // support
1593 // main membrane holder
1600 pointstrap[5]= 1.96;
1605 pointstrap[10]= 0.0;
1606 pointstrap[11]= 2.8;
1607 pointstrap[12]= 3.1;
1608 pointstrap[13]= 1.96;
1609 pointstrap[14]= 3.1;
1610 pointstrap[15]= 0.0;
1612 TGeoArb8 *tpcmmh1 = new TGeoArb8("tpcmmh1", 1.75, pointstrap);
1613 TGeoBBox *tpcmmh2 = new TGeoBBox("tpcmmh2", 0.8, 1.4, 12.5);
1615 TGeoVolume *tpcmmh1v = new TGeoVolume("TPC_MMH1", tpcmmh1, m6);
1616 TGeoVolume *tpcmmh2v = new TGeoVolume("TPC_MMH2", tpcmmh2, m6);
1618 TGeoVolumeAssembly *tpcmmhs = new TGeoVolumeAssembly("TPC_MMHS");
1619 tpcmmhs->AddNode(tpcmmh1v,1,new TGeoTranslation(0.8, -1.4, 10.75));
1620 tpcmmhs->AddNode(tpcmmh1v,2,new TGeoTranslation(0.8, -1.4, -10.75));
1621 tpcmmhs->AddNode(tpcmmh2v,1);
1623 // main membrahe holder clamp
1629 new TGeoBBox("tpcmmhc1", 1.65, 1.85, 8.9);
1630 new TGeoBBox("tpcmmhc2", 0.9, 0.7, 8.9, shift1);
1632 // half spaces - cuts
1640 n[2] = 8.0*TMath::Tan(13.*TMath::DegToRad());
1642 new TGeoHalfSpace("cutmmh1", p, n);
1650 n[2] = -8.0*TMath::Tan(13.*TMath::DegToRad());
1652 new TGeoHalfSpace("cutmmh2", p, n);
1660 n[2] = 6.1*TMath::Tan(20.*TMath::DegToRad());
1662 new TGeoHalfSpace("cutmmh3", p, n);
1670 n[2] = -6.1*TMath::Tan(20*TMath::DegToRad());
1672 new TGeoHalfSpace("cutmmh4", p, n);
1678 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1682 new TGeoHalfSpace("cutmmh5", p, n);
1688 n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1692 new TGeoHalfSpace("cutmmh6", p, n);
1694 TGeoCompositeShape *tpcmmhc = new TGeoCompositeShape("TPC_MMHC", "tpcmmhc1-tpcmmhc2-cutmmh1-cutmmh2-cutmmh3-cutmmh4-cutmmh5-cutmmh6");
1696 TGeoVolume *tpcmmhcv = new TGeoVolume("TPC_MMHC",tpcmmhc,m6);
1698 TGeoVolume *tpcmmh = new TGeoVolumeAssembly("TPC_MMH");
1700 tpcmmh->AddNode(tpcmmhcv,1,new TGeoTranslation(0.65+1.5, 1.85, 0.0));
1701 tpcmmh->AddNode(tpcmmhcv,2,new TGeoCombiTrans(-0.65-1.5, 1.85, 0.0,rot111));
1702 tpcmmh->AddNode(tpcmmhs,1,new TGeoTranslation(1.5, 0.0, 0.0));
1703 tpcmmh->AddNode(tpcmmhs,2,new TGeoCombiTrans(-1.5, 0.0, 0.0,rot111));
1708 //--------------------------------------------
1710 // guard ring resistor chain
1713 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
1715 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m10);
1720 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1721 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1723 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1724 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1726 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1727 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
1729 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1730 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
1731 //------------------------------------------------------------------
1732 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1733 TGeoRotation rotrod("rotrod");
1735 TGeoRotation *rotpos[2];
1737 TGeoRotation *rotrod1[2];
1742 TGeoRotation rot102("rot102");
1743 rot102.RotateY(-90.);
1745 for(Int_t i=0;i<18;i++){
1748 angle=TMath::DegToRad()*20.*(Double_t)i;
1751 x=r * TMath::Cos(angle);
1752 y=r * TMath::Sin(angle);
1754 TGeoRotation *rot12 = new TGeoRotation();
1755 rot12->RotateZ(-90.0+i*20.);
1756 v9->AddNode(tpcihpl,i+1,new TGeoCombiTrans(x, y, 0., rot12));
1758 if(i==11){//resistor rod inner
1759 rotrod.RotateZ(-90.+angle);
1760 rotrod1[0]= new TGeoRotation();
1761 rotpos[0]= new TGeoRotation();
1763 rotrod1[0]->RotateZ(-90.+angle);
1764 *rotpos[0] = refl*rotrod; //rotation+reflection
1765 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1766 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
1769 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1770 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
1774 x=r * TMath::Cos(angle);
1775 y=r * TMath::Sin(angle);
1778 // outer rod holder + outer left plug
1780 TGeoRotation *rot33 = new TGeoRotation();
1781 rot33->RotateZ(-90+i*20.);
1783 v9->AddNode(tpcohpl,i+1,new TGeoCombiTrans(x, y, 0., rot33));
1785 Double_t xxx = 256.297*TMath::Cos((i*20.+10.)*TMath::DegToRad());
1786 Double_t yyy = 256.297*TMath::Sin((i*20.+10.)*TMath::DegToRad());
1788 TGeoRotation rot101("rot101");
1789 rot101.RotateZ(90.+i*20.+10.);
1790 TGeoRotation *rot103 = new TGeoRotation("rot103");
1791 *rot103 = rot101*rot102;
1793 TGeoCombiTrans *trh100 = new TGeoCombiTrans(xxx,yyy,0.,rot103);
1796 //main membrane holder
1797 v9->AddNode(tpcmmh,1,trh100);
1800 // "normal" membrane holder
1801 v9->AddNode(tpcomh,i+1,trh100);
1805 if(i==3){//resistor rod outer
1806 rotrod.RotateZ(90.+angle);
1807 rotrod1[1]= new TGeoRotation();
1808 rotpos[1]= new TGeoRotation();
1809 rotrod1[1]->RotateZ(90.+angle);
1810 *rotpos[1] = refl*rotrod;//rotation+reflection
1811 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1812 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
1815 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1816 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
1819 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
1823 } //end of rods positioning
1826 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1827 alice->AddNode(v1,1);
1829 } // end of function
1832 //_____________________________________________________________________________
1833 void AliTPCv1::CreateMaterials()
1836 // Define materials for Time Projection Chamber
1838 AliTPC::CreateMaterials();
1841 //_____________________________________________________________________________
1842 void AliTPCv1::Init()
1845 // Initialises TPC detector after it has been created
1848 fIdSens=gMC->VolId("TPC_Strip"); // sensitive strip
1850 printf("%s: *** TPC version 1 initialized***\n",ClassName());
1852 // printf("TPC version 1 initialized\n");
1855 //_____________________________________________________________________________
1856 void AliTPCv1::StepManager()
1859 // Called at every step in the Time Projection Chamber
1867 id = gMC->CurrentVolID(copy);
1868 if(id!=fIdSens) return;
1869 if(gMC->TrackCharge() && gMC->IsTrackEntering()) {
1872 // Only charged tracks entering the sensitive volume
1875 gMC->TrackPosition(p);
1876 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1880 Double_t angle = TMath::ACos(p[0]/r);
1881 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1883 // angular segment, it is not a real sector number...
1885 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1886 fTPCParam->GetInnerAngle());
1887 // rotate to segment "0"
1889 fTPCParam->AdjustCosSin(sector,cos,sin);
1890 Float_t x1 = p[0]*cos + p[1]*sin;
1891 Float_t y1 = TMath::Abs(-p[0]*sin + p[1]*cos);
1892 // calculate real sector number...
1893 if (x1>fTPCParam->GetOuterRadiusLow()){
1894 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1895 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1896 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
1899 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1901 // here I have a sector number
1905 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1906 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1907 // row numbers are autonomous for lower and upper sectors
1908 if(vol[0] > fTPCParam->GetNInnerSector()) {
1909 vol[1] -= fTPCParam->GetNRowLow();
1911 Double_t range = (sector<36) ? fTPCParam->GetYInner(vol[1]) :
1912 fTPCParam->GetYOuter(vol[1]);
1913 if(y1>range) return;
1916 // because Jouri wants to have this
1918 gMC->TrackMomentum(p);
1922 hits[3]=0.; // this hit has no energy loss
1923 // Get also the track time for pileup simulation
1924 hits[4]=gMC->TrackTime();
1926 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
1928 gMC->TrackPosition(p);
1929 for(i=0;i<3;++i) hits[i]=p[i];
1930 hits[3]=1; //I'd like to have something positive here (I.Belikov)
1931 // Get also the track time for pileup simulation
1932 hits[4]=gMC->TrackTime();
1934 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
1936 }// track entering sensitive strip
1939 //_____________________________________________________________________________