1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 ///////////////////////////////////////////////////////////////////////////////
21 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
25 <img src="picts/AliTPCv2Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
34 #include <TLorentzVector.h>
38 #include "AliMathBase.h"
39 #include "AliTrackReference.h"
40 #include "AliTPCParam.h"
41 #include "AliTPCTrackHitsV2.h"
43 #include "AliGeomManager.h"
44 #include "TGeoVolume.h"
49 #include "TGeoCompositeShape.h"
51 #include "TGeoPhysicalNode.h"
52 #include "TGeoHalfSpace.h"
53 #include "TTreeStream.h"
57 //_____________________________________________________________________________
58 AliTPCv2::AliTPCv2(const char *name, const char *title) :
65 // Standard constructor for Time Projection Chamber version 2
69 SetBufferSize(128000);
73 // fTPCParam->Write(fTPCParam->GetTitle());
76 //_____________________________________________________________________________
77 void AliTPCv2::CreateGeometry()
80 // Create the geometry of Time Projection Chamber version 2
84 <img src="picts/AliTPC.gif">
89 <img src="picts/AliTPCv2Tree.gif">
93 //----------------------------------------------------------
94 // This geometry is written using TGeo class
95 // Firstly the shapes are defined, and only then the volumes
96 // What is recognized by the MC are volumes
97 //----------------------------------------------------------
99 // tpc - this will be the mother volume
103 // here I define a volume TPC
104 // retrive the medium name with "TPC_" as a leading string
106 TGeoPcon *tpc = new TGeoPcon(0.,360.,20); //20 sections
108 tpc->DefineSection(0,-291.,77.,278.);
109 tpc->DefineSection(1,-270,77.,278.);
111 tpc->DefineSection(2,-270.,77.,278.);
112 tpc->DefineSection(3,-259.6,70.,278.);
114 tpc->DefineSection(4,-259.6,68.1,278.);
115 tpc->DefineSection(5,-253.6,68.1,278.);
117 tpc->DefineSection(6,-253.6,68.,278.);
118 tpc->DefineSection(7,-74.0,60.8,278.);
120 tpc->DefineSection(8,-74.0,60.1,278.);
121 tpc->DefineSection(9,-73.3,60.1,278.);
123 tpc->DefineSection(10,-73.3,56.9,278.);
124 tpc->DefineSection(11,73.3,56.9,278.);
126 tpc->DefineSection(12,73.3,60.1,278.);
127 tpc->DefineSection(13,74.0,60.1,278.);
129 tpc->DefineSection(14,74.0,60.8,278.);
130 tpc->DefineSection(15,253.6,65.5,278.);
132 tpc->DefineSection(16,253.6,65.6,278.);
133 tpc->DefineSection(17,259.6,65.6,278.);
135 tpc->DefineSection(18,259.6,70.0,278.);
136 tpc->DefineSection(19,291.,77.,278.);
138 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
139 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
141 // drift volume - sensitive volume, extended beyond the
142 // endcaps, because of the alignment
144 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
145 dvol->DefineSection(0,-260.,74.5,264.4);
146 dvol->DefineSection(1,-253.6,74.5,264.4);
148 dvol->DefineSection(2,-253.6,76.6774,258.);
149 dvol->DefineSection(3,253.6,76.6774,258.);
151 dvol->DefineSection(4,253.6,74.5,264.4);
152 dvol->DefineSection(5,260.,74.5,264.4);
154 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-N-2");
155 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
161 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
163 tpco->DefineSection(0,-256.6,264.8,278.);
164 tpco->DefineSection(1,-253.6,264.8,278.);
166 tpco->DefineSection(2,-253.6,258.,278.);
167 tpco->DefineSection(3,250.6,258.,278.);
169 tpco->DefineSection(4,250.6,258.,275.5);
170 tpco->DefineSection(5,253.6,258.,275.5);
172 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
173 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
175 TGeoRotation *segrot;//segment rotations
177 // outer containment vessel
179 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
181 tocv->DefineSection(0,-256.6,264.8,278.);
182 tocv->DefineSection(1,-253.6,264.8,278.);
184 tocv->DefineSection(2,-253.6,274.8124,278.);
185 tocv->DefineSection(3,247.6,274.8124,278.);
187 tocv->DefineSection(4,247.6,270.4,278.);
188 tocv->DefineSection(5,250.6,270.4,278.);
190 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
191 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
193 TGeoTubeSeg *to1 = new TGeoTubeSeg(274.8174,277.995,252.1,0.,59.9); //epoxy
194 TGeoTubeSeg *to2 = new TGeoTubeSeg(274.8274,277.985,252.1,0.,59.9); //tedlar
195 TGeoTubeSeg *to3 = new TGeoTubeSeg(274.8312,277.9812,252.1,0.,59.9);//prepreg2
196 TGeoTubeSeg *to4 = new TGeoTubeSeg(274.9062,277.9062,252.1,0.,59.9);//nomex
197 TGeoTubeSeg *tog5 = new TGeoTubeSeg(274.8174,277.995,252.1,59.9,60.);//epoxy
199 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
200 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
201 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
202 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
204 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
205 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
206 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
207 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
208 TGeoVolume *togv5 = new TGeoVolume("TPC_OCVG5",tog5,sm1);
209 //-------------------------------------------------------
210 // Tpc Outer Field Cage
211 // daughters - composite (sandwich)
212 //-------------------------------------------------------
214 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
216 tofc->DefineSection(0,-253.6,258.,269.6);
217 tofc->DefineSection(1,-250.6,258.,269.6);
219 tofc->DefineSection(2,-250.6,258.,260.0676);
220 tofc->DefineSection(3,250.6,258.,260.0676);
222 tofc->DefineSection(4,250.6,258.,275.5);
223 tofc->DefineSection(5,253.6,258.,275.5);
225 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
227 TGeoTubeSeg *tf1 = new TGeoTubeSeg(258.0,260.0676,252.1,0.,59.9); //tedlar
228 TGeoTubeSeg *tf2 = new TGeoTubeSeg(258.0038,260.0638,252.1,0.,59.9); //prepreg3
229 TGeoTubeSeg *tf3 = new TGeoTubeSeg(258.0338,260.0338,252.1,0.,59.9);//nomex
230 TGeoTubeSeg *tfg4 = new TGeoTubeSeg(258.0,260.0676,252.1,59.9,60.); //epoxy glue
232 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
234 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
235 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
236 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
237 TGeoVolume *tfg4v = new TGeoVolume("TPC_OFCG4",tfg4,sm1);
239 // outer part - positioning
241 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);//ocv
243 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);//ofc
245 TGeoVolumeAssembly *t200 = new TGeoVolumeAssembly("TPC_OCVSEG");
246 TGeoVolumeAssembly *t300 = new TGeoVolumeAssembly("TPC_OFCSEG");
248 // assembly OCV and OFC
251 t200->AddNode(tov1,1); t200->AddNode(togv5,1);
252 t300->AddNode(tf1v,1); t300->AddNode(tfg4v,1);
253 // 2nd - rotation 60 deg
254 segrot = new TGeoRotation();
255 segrot->RotateZ(60.);
256 t200->AddNode(tov1,2,segrot); t200->AddNode(togv5,2,segrot);
257 t300->AddNode(tf1v,2,segrot); t300->AddNode(tfg4v,2,segrot);
258 // 3rd rotation 120 deg
259 segrot = new TGeoRotation();
260 segrot->RotateZ(120.);
261 t200->AddNode(tov1,3,segrot); t200->AddNode(togv5,3,segrot);
262 t300->AddNode(tf1v,3,segrot); t300->AddNode(tfg4v,3,segrot);
263 //4th rotation 180 deg
264 segrot = new TGeoRotation();
265 segrot->RotateZ(180.);
266 t200->AddNode(tov1,4,segrot); t200->AddNode(togv5,4,segrot);
267 t300->AddNode(tf1v,4,segrot); t300->AddNode(tfg4v,4,segrot);
268 //5th rotation 240 deg
269 segrot = new TGeoRotation();
270 segrot->RotateZ(240.);
271 t200->AddNode(tov1,5,segrot); t200->AddNode(togv5,5,segrot);
272 t300->AddNode(tf1v,5,segrot); t300->AddNode(tfg4v,5,segrot);
273 //6th rotation 300 deg
274 segrot = new TGeoRotation();
275 segrot->RotateZ(300.);
276 t200->AddNode(tov1,6,segrot); t200->AddNode(togv5,6,segrot);
277 t300->AddNode(tf1v,6,segrot); t300->AddNode(tfg4v,6,segrot);
279 v3->AddNode(t200,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(t300,1);
281 v2->AddNode(v3,1); v2->AddNode(v4,1);
284 //--------------------------------------------------------------------
285 // Tpc Inner INsulator (CO2)
286 // the cones, the central drum and the inner f.c. sandwich with a piece
287 // of the flane will be placed in the TPC
288 //--------------------------------------------------------------------
289 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
291 tpci->DefineSection(0,-253.6,68.4,76.6774);
292 tpci->DefineSection(1,-74.0,61.2,76.6774);
294 tpci->DefineSection(2,74.0,61.2,76.6774);
296 tpci->DefineSection(3,253.6,65.9,76.6774);
298 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
300 // now the inner field cage - only part of flanges (2 copies)
302 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
303 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
305 //---------------------------------------------------------
306 // Tpc Inner Containment vessel - Muon side
307 //---------------------------------------------------------
308 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
310 tcms->DefineSection(0,-259.1,68.1,74.2);
311 tcms->DefineSection(1,-253.6,68.1,74.2);
313 tcms->DefineSection(2,-253.6,68.1,68.4);
314 tcms->DefineSection(3,-74.0,60.9,61.2);
316 tcms->DefineSection(4,-74.0,60.1,61.2);
317 tcms->DefineSection(5,-73.3,60.1,61.2);
319 tcms->DefineSection(6,-73.3,56.9,61.2);
320 tcms->DefineSection(7,-73.0,56.9,61.2);
322 tcms->DefineSection(8,-73.0,56.9,58.8);
323 tcms->DefineSection(9,-71.3,56.9,58.8);
325 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
326 //-----------------------------------------------
327 // inner containment vessel - shaft side
328 //-----------------------------------------------
329 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
331 tcss->DefineSection(0,71.3,56.9,58.8);
332 tcss->DefineSection(1,73.0,56.9,58.8);
334 tcss->DefineSection(2,73.0,56.9,61.2);
335 tcss->DefineSection(3,73.3,56.9,61.2);
337 tcss->DefineSection(4,73.3,60.1,61.2);
338 tcss->DefineSection(5,74.0,60.1,61.2);
340 tcss->DefineSection(6,74.0,60.9,61.2);
341 tcss->DefineSection(7,253.6,65.6,65.9);
343 tcss->DefineSection(8,253.6,65.6,74.2);
344 tcss->DefineSection(9,258.1,65.6,74.2);
346 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
347 //-----------------------------------------------
349 // define 4 parts and make an assembly
350 //-----------------------------------------------
351 // part1 - Al - 2 copies
352 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
353 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
354 // sandwich - outermost parts - 2 copies
358 TGeoTubeSeg *t2 = new TGeoTubeSeg(76.6774,78.845,74.175,350.,109.4); // tedlar 38 microns
359 TGeoTubeSeg *t3 = new TGeoTubeSeg(76.6812,78.8412,74.175,350.,109.4); // prepreg2 500 microns
360 TGeoTubeSeg *t4 = new TGeoTubeSeg(76.7312,78.7912,74.175,350.,109.4); // prepreg3 300 microns
361 TGeoTubeSeg *t5 = new TGeoTubeSeg(76.7612,78.7612,74.175,350.,109.4); // nomex 2 cm
362 TGeoTubeSeg *tepox1 = new TGeoTubeSeg(76.6774,78.845,74.175,109.4,110.);//epoxy
363 TGeoTubeSeg *tpr1 = new TGeoTubeSeg(78.845,78.885,74.175,109.,111.);
365 // volumes for the outer part
366 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
367 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
368 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
369 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
370 TGeoVolume *tvep1 = new TGeoVolume("TPC_IFEPOX1",tepox1,sm1);
371 TGeoVolume *tvpr1 = new TGeoVolume("TPC_PRSTR1",tpr1,sm2);
373 // middle parts - 2 copies
377 TGeoTubeSeg *t6 = new TGeoTubeSeg(76.6774,78.795,5.,350.,109.4); // tedlar 38 microns
378 TGeoTubeSeg *t7 = new TGeoTubeSeg(76.6812,78.7912,5.,350.,109.4); // prepreg2 250 microns
379 TGeoTubeSeg *t8 = new TGeoTubeSeg(76.7062,78.7662,5.,350.,109.4); // prepreg3 300 microns
380 TGeoTubeSeg *t9 = new TGeoTubeSeg(76.7362,78.7362,5.,350.,109.4); // nomex 2 cm
381 TGeoTubeSeg *tepox2 = new TGeoTubeSeg(76.6774,78.795,5.,109.4,110.);//epoxy
382 TGeoTubeSeg *tpr2 = new TGeoTubeSeg(78.795,78.835,5.,109.,111.);
383 // volumes for the middle part
384 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
385 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
386 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
387 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
388 TGeoVolume *tvep2 = new TGeoVolume("TPC_IFEPOX2",tepox2,sm1);
389 TGeoVolume *tvpr2 = new TGeoVolume("TPC_PRSTR2",tpr2,sm2);
390 // central part - 1 copy
392 // segment central part
394 TGeoTubeSeg *t10 = new TGeoTubeSeg(76.6774,78.785,93.75,350.,109.4); // tedlar 38 microns
395 TGeoTubeSeg *t11 = new TGeoTubeSeg(76.6812,78.7812,93.75,350.,109.4); // prepreg3 500 microns
396 TGeoTubeSeg *t12 = new TGeoTubeSeg(76.7312,78.7312,93.75,350.,109.4); // nomex 2 cm
397 TGeoTubeSeg *tepox3 = new TGeoTubeSeg(76.6774,78.785,93.75,109.4,110.);//epoxy
398 TGeoTubeSeg *tpr3 = new TGeoTubeSeg(78.785,78.825,93.75,109.,111.);
399 // volumes for the central part
400 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
401 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
402 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
403 TGeoVolume *tvep3 = new TGeoVolume("TPC_IFEPOX3",tepox3,sm1);
404 TGeoVolume *tvpr3 = new TGeoVolume("TPC_PRSTR3",tpr3,sm2);
406 // creating a sandwich for the outer par,t tv2 is the mother
408 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
410 // creating a sandwich for the middle part, tv6 is the mother
412 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
414 // creating a sandwich for the central part, tv10 is the mother
416 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
418 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC"); // ifc itself - 3 segments
421 // first segment - no rotation
424 tv100->AddNode(tv10,1); //sandwich
425 tv100->AddNode(tvep3,1);//epoxy
426 tv100->AddNode(tvpr3,1);//prepreg strip
428 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75)); //sandwich1
429 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75)); // sandwich2
430 tv100->AddNode(tvep2,1,new TGeoTranslation(0.,0.,-98.75)); //epoxy
431 tv100->AddNode(tvep2,2,new TGeoTranslation(0.,0.,98.75)); //epoxy
432 tv100->AddNode(tvpr2,1,new TGeoTranslation(0.,0.,-98.75));//prepreg strip
433 tv100->AddNode(tvpr2,2,new TGeoTranslation(0.,0.,98.75));
435 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925)); //sandwich
436 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
437 tv100->AddNode(tvep1,1,new TGeoTranslation(0.,0.,-177.925)); //epoxy
438 tv100->AddNode(tvep1,2,new TGeoTranslation(0.,0.,177.925));
439 tv100->AddNode(tvpr1,1,new TGeoTranslation(0.,0.,-177.925));//prepreg strip
440 tv100->AddNode(tvpr1,2,new TGeoTranslation(0.,0.,-177.925));
442 // second segment - rotation 120 deg.
444 segrot = new TGeoRotation();
445 segrot->RotateZ(120.);
448 tv100->AddNode(tv10,2,segrot); //sandwich
449 tv100->AddNode(tvep3,2,segrot);//epoxy
450 tv100->AddNode(tvpr3,2,segrot);//prepreg strip
452 tv100->AddNode(tv6,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
453 tv100->AddNode(tv6,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
454 tv100->AddNode(tvep2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
455 tv100->AddNode(tvep2,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
456 tv100->AddNode(tvpr2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
457 tv100->AddNode(tvpr2,4,new TGeoCombiTrans(0.,0.,98.75,segrot));
459 tv100->AddNode(tv2,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
460 tv100->AddNode(tv2,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
461 tv100->AddNode(tvep1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
462 tv100->AddNode(tvep1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
463 tv100->AddNode(tvpr1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
464 tv100->AddNode(tvpr1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
466 // third segment - rotation 240 deg.
468 segrot = new TGeoRotation();
469 segrot->RotateZ(240.);
472 tv100->AddNode(tv10,3,segrot); //sandwich
473 tv100->AddNode(tvep3,3,segrot);//epoxy
474 tv100->AddNode(tvpr3,3,segrot);//prepreg strip
476 tv100->AddNode(tv6,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
477 tv100->AddNode(tv6,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
478 tv100->AddNode(tvep2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
479 tv100->AddNode(tvep2,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
480 tv100->AddNode(tvpr2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
481 tv100->AddNode(tvpr2,6,new TGeoCombiTrans(0.,0.,98.75,segrot));
483 tv100->AddNode(tv2,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
484 tv100->AddNode(tv2,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
485 tv100->AddNode(tvep1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
486 tv100->AddNode(tvep1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
487 tv100->AddNode(tvpr1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
488 tv100->AddNode(tvpr1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
490 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
491 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
493 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
494 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
495 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
496 v9->AddNode(tv100,1);
502 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
503 cfl->DefineSection(0,-71.1,59.7,61.2);
504 cfl->DefineSection(1,-68.6,59.7,61.2);
506 cfl->DefineSection(2,-68.6,60.6124,61.2);
507 cfl->DefineSection(3,68.6,60.6124,61.2);
509 cfl->DefineSection(4,68.6,59.7,61.2);
510 cfl->DefineSection(5,71.1,59.7,61.2);
512 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
514 TGeoTubeSeg *cd1 = new TGeoTubeSeg(60.6224,61.19,71.1,0.1,119.9);
515 TGeoTubeSeg *cd2 = new TGeoTubeSeg(60.6262,61.1862,71.1,0.1,119.9);
516 TGeoTubeSeg *cd3 = new TGeoTubeSeg(60.6462,61.1662,71.1,0.1,119.9);
517 TGeoTubeSeg *cd4 = new TGeoTubeSeg(60.6562,61.1562,71.1,0.1,119.9);
518 TGeoTubeSeg *tepox4 = new TGeoTubeSeg(60.6224,61.19,71.1,359.9,0.1);
519 // TGeoTube *cd1 = new TGeoTube(60.6224,61.19,71.1);
520 // TGeoTube *cd2 = new TGeoTube(60.6262,61.1862,71.1);
521 // TGeoTube *cd3 = new TGeoTube(60.6462,61.1662,71.1);
522 // TGeoTube *cd4 = new TGeoTube(60.6562,61.1562,71.1);
524 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
525 TGeoMedium *sm8 = gGeoManager->GetMedium("TPC_Epoxyfm");
526 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
527 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
528 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm8); //epoxy film
529 TGeoVolume *cd4v = new TGeoVolume("TPC_CDR4",cd4,sm4); //nomex
530 TGeoVolume *tvep4 = new TGeoVolume("TPC_IFEPOX4",tepox4,sm1);
533 // seals for central drum 2 copies
535 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
536 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
537 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
538 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
539 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
542 TGeoPcon *se = new TGeoPcon(0.,360.,6);
543 se->DefineSection(0,-72.8,59.7,61.2);
544 se->DefineSection(1,-72.3,59.7,61.2);
546 se->DefineSection(2,-72.3,58.85,61.2);
547 se->DefineSection(3,-71.6,58.85,61.2);
549 se->DefineSection(4,-71.6,59.7,61.2);
550 se->DefineSection(5,-71.3,59.7,61.2);
552 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
554 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
555 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
557 // define reflection matrix
559 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
561 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cd3v->AddNode(cd4v,1); //sandwich
563 cflv->AddNode(cd1v,1); cflv->AddNode(tvep4,1);
565 segrot = new TGeoRotation();
566 segrot->RotateZ(120.);
567 cflv->AddNode(cd1v,2,segrot); cflv->AddNode(tvep4,2,segrot);
569 segrot = new TGeoRotation();
570 segrot->RotateZ(240.);
571 cflv->AddNode(cd1v,3,segrot); cflv->AddNode(tvep4,3,segrot);
573 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
574 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
575 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
577 // central membrane - 2 rings and a mylar membrane - assembly
579 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
580 TGeoTube *oh = new TGeoTube(250.,256.,0.5);
581 TGeoTube *mem = new TGeoTube(84.05,250.,0.00115);
584 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
586 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
587 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
589 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
591 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
598 // end caps - they are make as an assembly of single segments
599 // containing both readout chambers
601 Double_t openingAngle = 10.*TMath::DegToRad();
602 Double_t thick=1.5; // rib
603 Double_t shift = thick/TMath::Sin(openingAngle);
605 Double_t lowEdge = 86.3; // hole in the wheel
606 Double_t upEdge = 240.4; // hole in the wheel
608 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
610 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
612 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
613 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
615 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
616 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
618 Double_t ys = shift*TMath::Sin(openingAngle);
619 Double_t xs = shift*TMath::Cos(openingAngle);
620 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
621 tr->RegisterYourself();
622 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
623 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
624 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
625 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
626 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
627 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
628 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
630 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
636 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
637 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
639 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
640 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
641 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
643 Double_t tga = (19.8328-12.3742)/39.3;
645 xmin = 9.55*tga+12.3742;
646 xmax = 9.95*tga+12.3742;
647 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
648 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
649 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
650 xmin=19.4*tga+12.3742;
651 xmax=19.9*tga+12.3742;
652 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
653 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
654 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
655 xmin=29.35*tga+12.3742;
656 xmax=29.75*tga+12.3742;
657 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
658 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
659 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
661 // holes for connectors
663 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
664 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
665 TString fileName(gSystem->Getenv("ALICE_ROOT"));
666 fileName += "/TPC/conn_iroc.dat";
668 in.open(fileName.Data(), ios_base::in); // asci file
669 TGeoRotation *rrr[86];
670 for(Int_t i =0;i<86;i++){
675 rrr[i]= new TGeoRotation();
676 rrr[i]->RotateY(ang);
677 ibdv->AddNode(connv,i+1,new TGeoCombiTrans(x,y,z,rrr[i]));
681 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
683 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
684 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
685 tr1->RegisterYourself();
686 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
687 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
689 // pad plane and wire fixations
691 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
692 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
693 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
694 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
695 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
696 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
698 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
700 iroc->AddNode(ibdv,1);
701 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
702 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
703 tga =(23.3521-14.5974)/49.65;
704 Double_t xx = 24.825*tga+14.5974-0.6;
705 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
706 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
710 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
711 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
712 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
713 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
714 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
716 tga=(38.5084-20.2938)/99.3;
717 xmin=tga*10.2+20.2938;
718 xmax=tga*10.6+20.2938;
719 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
720 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
722 xmin=22.55*tga+20.2938;
723 xmax=24.15*tga+20.2938;
724 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
725 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
727 xmin=36.1*tga+20.2938;
728 xmax=36.5*tga+20.2938;
729 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
730 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
732 xmin=49.0*tga+20.2938;
733 xmax=50.6*tga+20.2938;
734 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
735 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
737 xmin=63.6*tga+20.2938;
738 xmax=64.0*tga+20.2938;
739 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
740 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
742 xmin=75.5*tga+20.2938;
743 xmax=77.15*tga+20.2938;
744 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
745 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
747 xmin=88.7*tga+20.2938;
748 xmax=89.1*tga+20.2938;
749 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
750 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
752 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
753 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
754 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
755 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
756 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
757 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
758 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
760 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
761 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
762 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
763 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
764 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
766 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
767 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
768 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
769 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
770 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
772 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
773 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
774 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
775 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
776 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
777 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
778 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
779 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
781 // holes for connectors
783 fileName = gSystem->Getenv("ALICE_ROOT");
784 fileName += "/TPC/conn_oroc.dat";
785 in.open(fileName.Data(), ios_base::in); // asci file
786 TGeoRotation *rr[78];
787 for(Int_t i =0;i<78;i++){
790 Double_t x1,z1,x2,z2;
792 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
793 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
795 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
797 rr[i]= new TGeoRotation();
802 obdv->AddNode(connv,i+1,new TGeoCombiTrans(x1,y,z1,rr[i]));
803 obdv->AddNode(connv,i+79,new TGeoCombiTrans(x2,y,z2,rr[i]));
807 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
808 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
809 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
810 tr5->RegisterYourself();
811 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
812 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
814 // pad plane and wire fixations
816 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
817 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
819 tga=(43.5239-23.3874)/114.2;
820 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
821 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
822 xx = 57.1*tga+23.3874-0.7;
823 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
824 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
826 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
828 oroc->AddNode(obdv,1);
829 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
830 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
831 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
832 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
834 // now iroc and oroc are placed into a sector...
836 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
837 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
838 TGeoRotation rot1("rot1",90.,90.,0.);
839 TGeoRotation rot2("rot2");
841 TGeoRotation *rot = new TGeoRotation("rot");
845 x0=110.2*TMath::Cos(openingAngle);
846 y0=110.2*TMath::Sin(openingAngle);
847 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
848 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
849 x0=188.45*TMath::Cos(openingAngle);
850 y0=188.45*TMath::Sin(openingAngle);
851 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
852 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
857 secta->AddNode(ch,1);
858 secta->AddNode(iroc,1,combi1a);
859 secta->AddNode(oroc,1,combi2a);
863 sectc->AddNode(ch,1);
864 sectc->AddNode(iroc,1,combi1c);
865 sectc->AddNode(oroc,1,combi2c);
867 // now I try to make wheels...
869 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
870 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
872 TGeoRotation *rwh[18];
873 for(Int_t i =0;i<18;i++){
874 Double_t phi = (20.*i);
875 rwh[i]=new TGeoRotation();
876 rwh[i]->RotateZ(phi);
877 wheela->AddNode(secta,i+1,rwh[i]);
878 wheelc->AddNode(sectc,i+1,rwh[i]);
881 // wheels in the drift volume!
883 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
884 v9->AddNode(wheela,1,combi3);
885 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
886 //_____________________________________________________________
887 // service support wheel
888 //_____________________________________________________________
889 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
890 sw->DefineSection(0,-4.,80.5,251.75);
891 sw->DefineSection(1,4.,80.5,251.75);
892 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
895 shift = thick/TMath::Sin(openingAngle);
896 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
897 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
898 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
899 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
901 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
902 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
903 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
904 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
905 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
910 ys = shift*TMath::Sin(openingAngle);
911 xs = shift*TMath::Cos(openingAngle);
912 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
914 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
915 co->DefineSection(0,-0.5,77.,255.25);
916 co->DefineSection(1,0.5,77.,255.25);
917 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
919 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
920 shift=4./TMath::Sin(openingAngle);
921 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
922 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
924 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
926 ys = shift*TMath::Sin(openingAngle);
927 xs = shift*TMath::Cos(openingAngle);
928 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
930 // Sector as an Assembly
932 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
933 swhs->AddNode(swv,1);
934 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
935 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
937 // SSW as an Assembly of sectors
939 TGeoRotation *rsw[18];
940 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
941 for(Int_t i =0;i<18;i++){
942 Double_t phi = (20.*i);
943 rsw[i] = new TGeoRotation();
944 rsw[i]->RotateZ(phi);
945 swheel->AddNode(swhs,i+1,rsw[i]);
947 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
948 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
950 // sensitive strips - strip "0" is always set
953 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
956 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
957 upar=new Double_t [10];
966 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
973 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
974 gGeoManager->Node("TPC_Strip",totrows+1,
975 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
977 // now, strips optionally
981 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
982 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
987 gGeoManager->Node("TPC_Strip",i,
988 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
989 gGeoManager->Node("TPC_Strip",totrows+i,
990 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
993 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
994 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
999 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
1000 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1001 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
1002 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1005 //----------------------------------------------------------
1006 // TPC Support Rods - MAKROLON
1007 //----------------------------------------------------------
1008 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
1009 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
1010 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
1011 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");
1012 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
1013 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
1015 // tpc rod is an assembly of 10 long parts and 2 short parts
1016 // connected with alu rings and plagged on both sides.
1021 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
1022 rod->DefineSection(0,-10.43,1.92,2.08);
1023 rod->DefineSection(1,-9.75,1.92,2.08);
1025 rod->DefineSection(2,-9.75,1.8,2.2);
1026 rod->DefineSection(3,9.75,1.8,2.2);
1028 rod->DefineSection(4,9.75,1.92,2.08);
1029 rod->DefineSection(5,10.43,1.92,2.08);
1031 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
1035 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
1036 rod1->DefineSection(0,-8.93,1.92,2.08);
1037 rod1->DefineSection(1,-8.25,1.92,2.08);
1039 rod1->DefineSection(2,-8.25,1.8,2.2);
1040 rod1->DefineSection(3,8.25,1.8,2.2);
1042 rod1->DefineSection(4,8.25,1.92,2.08);
1043 rod1->DefineSection(5,8.93,1.92,2.08);
1045 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
1047 // below is for the resistor rod
1049 // hole for the brass connectors
1052 new TGeoTube("hhole",0.,0.3,0.3);
1054 //transformations for holes - initialy they
1055 // are placed at x=0 and negative y
1057 TGeoRotation *rhole = new TGeoRotation();
1058 rhole->RotateX(90.);
1059 TGeoCombiTrans *transf[13];
1061 for(Int_t i=0;i<13;i++){
1062 sprintf(name,"transf%d",i);
1063 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
1064 transf[i]->RegisterYourself();
1066 // union expression for holes
1067 TString operl("hhole:transf0");
1068 for (Int_t i=1;i<13;i++){
1069 sprintf(name,"+hhole:transf%d",i);
1073 TString opers("hhole:transf1");
1074 for (Int_t i=2;i<12;i++){
1075 sprintf(name,"+hhole:transf%d",i);
1079 new TGeoCompositeShape("hlv",operl.Data());
1080 new TGeoCompositeShape("hsv",opers.Data());
1082 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
1083 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
1084 //rods - volumes - makrolon rods with holes
1085 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
1086 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
1089 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
1090 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
1092 // hooks holding strips
1094 new TGeoBBox("hk1",0.625,0.015,0.75);
1095 new TGeoBBox("hk2",0.625,0.015,0.15);
1096 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
1097 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
1098 tr21->RegisterYourself();
1099 tr12->RegisterYourself();
1101 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
1102 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
1104 // assembly of the short rod with connectors and hooks
1109 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1111 spart->AddNode( rodsv,1);
1112 for(Int_t i=1;i<12;i++){
1113 spart->AddNode(bconv,i,transf[i]);
1115 for(Int_t i =0;i<11;i++){
1116 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
1121 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1123 lpart->AddNode( rodlv,1);
1124 for(Int_t i=0;i<13;i++){
1125 lpart->AddNode(bconv,i+12,transf[i]);
1127 for(Int_t i =0;i<13;i++){
1128 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
1133 new TGeoTube("ring1",2.1075,2.235,0.53);
1134 new TGeoTube("ring2",1.7925,1.89,0.43);
1135 new TGeoTube("ring3",1.89,2.1075,0.05);
1136 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1137 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1141 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
1142 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1144 for(Int_t i=0;i<11;i++){
1145 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
1146 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1148 for(Int_t i=0;i<10;i++){
1149 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));
1150 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));
1155 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1156 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1157 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1158 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
1160 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1161 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1162 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1163 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1167 TGeoPcon *lp = new TGeoPcon(0.,360.,4);
1169 lp->DefineSection(0,-125.8,1.92,2.235);
1170 lp->DefineSection(1,-124.8,1.92,2.235);
1172 lp->DefineSection(2,-124.8,1.92,2.08);
1173 lp->DefineSection(3,-123.1,1.92,2.08);
1175 TGeoVolume *lpv1 = new TGeoVolume("TPC_lpv1",lp,m6);
1176 TGeoVolume *lpv2 = new TGeoVolume("TPC_lpv2",lp,m6);
1178 TGeoTube *lr = new TGeoTube(2.1075,2.235,0.5);
1179 TGeoVolume *lrv = new TGeoVolume("TPC_lrv",lr,m3);
1181 lpv2->AddNode(lrv,1,new TGeoTranslation(0.,0.,-125.3));
1183 tpcrrod->AddNode(lpv2,1);
1184 tpcmrod->AddNode(lpv1,1);
1188 TGeoTube *rp = new TGeoTube(1.92,2.08,2.025);
1189 TGeoVolume *rpv = new TGeoVolume("TPC_rpv",rp,m6);
1190 tpcrrod->AddNode(rpv,1, new TGeoTranslation(0.,0.,125.125));
1191 tpcmrod->AddNode(rpv,2,new TGeoTranslation(0.,0.,125.125));
1194 //HV rods - makrolon + 0.58cm (diameter) Cu
1195 TGeoTube *hvr = new TGeoTube(0.,1.465,126.5);
1196 TGeoTube *hvc = new TGeoTube(0.,0.29,126.5);
1198 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1199 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1200 hvrv->AddNode(hvcv,1);
1204 TGeoTube *cr = new TGeoTube(0.,0.45,126.2);
1205 TGeoTube *cw = new TGeoTube(0.,0.15,126.2);
1206 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
1207 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
1209 // ceramic rod with water
1211 crv->AddNode(cwv,1);
1215 TGeoTube *pr =new TGeoTube(0.2,0.35,126.2);
1216 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
1218 // copper plates with connectors
1220 new TGeoTube("tub",0.,1.7,0.025);
1222 // half space - points on the plane and a normal vector
1225 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1226 Double_t intp = 1.245;
1228 Double_t b = slope*slope+1.;
1237 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1241 new TGeoHalfSpace("sp1",p,n);
1250 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1254 new TGeoHalfSpace("sp2",p,n);
1257 new TGeoTube("h1",0.,0.5,0.025);
1258 new TGeoTube("h2",0.,0.35,0.025);
1260 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1261 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1262 ttr11->RegisterYourself();
1263 ttr22->RegisterYourself();
1264 // elastic connector
1265 new TGeoBBox("elcon",0.72,0.005,0.3);
1266 TGeoRotation *crr1 = new TGeoRotation();
1267 crr1->RotateZ(-22.);
1268 TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1269 ctr1->RegisterYourself();
1270 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1271 "(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1273 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1275 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1278 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
1280 rrod->AddNode(crv,1,ttr11);
1281 rrod->AddNode(crv,2,ttr22);
1282 rrod->AddNode(prv,1);
1284 for(Int_t i=0;i<165;i++){
1285 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1288 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1289 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m10);
1290 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1291 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1292 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1294 TGeoRotation *crr2 = new TGeoRotation();
1296 TGeoRotation *crr3 = new TGeoRotation();
1297 crr3->RotateY(-30.);
1299 for(Int_t i=0;i<164;i+=2){
1300 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1301 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1304 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
1306 // guard ring resistor chain
1309 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
1311 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m10);
1316 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1317 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1319 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1320 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1322 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1323 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
1325 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1326 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
1327 //------------------------------------------------------------------
1328 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1329 TGeoRotation rotrod("rotrod");
1331 TGeoRotation *rotpos[2];
1333 TGeoRotation *rotrod1[2];
1334 TGeoTubeSeg *irh = new TGeoTubeSeg(78.825,79.25,1.5,358.5,1.5);
1335 TGeoTubeSeg *orh = new TGeoTubeSeg(256.5,257.95,1.5,359.5,0.5);
1336 TGeoTubeSeg *ohh = new TGeoTubeSeg(256.5,257.95,1.5,9.5,10.5);
1337 TGeoVolume *irhv = new TGeoVolume("TPC_IRHH",irh,m4);
1338 TGeoVolume *orhv = new TGeoVolume("TPC_ORHH",orh,m4);
1339 TGeoVolume *ohhv = new TGeoVolume("TPC_OHVHH",ohh,m4);
1343 for(Int_t i=0;i<18;i++){
1346 angle=TMath::DegToRad()*20.*(Double_t)i;
1347 TGeoRotation *roth = new TGeoRotation(); //rotation for rod holders
1348 roth->RotateZ(angle);
1351 x=r * TMath::Cos(angle);
1352 y=r * TMath::Sin(angle);
1355 v9->AddNode(irhv,i+1,roth);
1356 v9->AddNode(orhv,i+1,roth);
1357 v9->AddNode(ohhv,i+1,roth);
1359 if(i==11){//resistor rod inner
1360 rotrod.RotateZ(-90.+angle);
1361 rotrod1[0]= new TGeoRotation();
1362 rotpos[0]= new TGeoRotation();
1364 rotrod1[0]->RotateZ(-90.+angle);
1365 *rotpos[0] = refl*rotrod; //rotation+reflection
1366 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1367 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
1370 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1371 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
1375 x=r * TMath::Cos(angle);
1376 y=r * TMath::Sin(angle);
1379 if(i==3){//resistor rod outer
1380 rotrod.RotateZ(90.+angle);
1381 rotrod1[1]= new TGeoRotation();
1382 rotpos[1]= new TGeoRotation();
1383 rotrod1[1]->RotateZ(90.+angle);
1384 *rotpos[1] = refl*rotrod;//rotation+reflection
1385 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1386 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
1389 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1390 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
1393 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
1395 } //end of rods positioning
1397 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1398 alice->AddNode(v1,1);
1400 } // end of function
1402 //_____________________________________________________________________________
1403 void AliTPCv2::AddAlignableVolumes() const
1406 // Create entries for alignable volumes associating the symbolic volume
1407 // name with the corresponding volume path. Needs to be syncronized with
1408 // eventual changes in the geometry.
1410 SetInnerChambersAlignable();
1411 SetOuterChambersAlignable();
1414 //_____________________________________________________________________________
1415 void AliTPCv2::SetInnerChambersAlignable() const
1418 AliGeomManager::ELayerID idTPC1 = AliGeomManager::kTPC1;
1419 Int_t modUID, modnum = 0;
1420 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1421 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1422 TString vpappend = "/TPC_IROC_1";
1423 TString snstr1="TPC/EndcapA/Sector";
1424 TString snstr2="TPC/EndcapC/Sector";
1425 TString snappend="/InnerChamber";
1426 TString volpath, symname;
1428 for(Int_t cnt=1; cnt<=18; cnt++){
1429 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
1432 volpath += vpappend;
1435 symname += snappend;
1436 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1437 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1438 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1439 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1440 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1441 alignableEntry->SetMatrix(matTtoL);
1444 for(Int_t cnt=1; cnt<=18; cnt++){
1445 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
1448 volpath += vpappend;
1451 symname += snappend;
1452 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1453 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1454 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1455 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1456 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1457 alignableEntry->SetMatrix(matTtoL);
1461 //_____________________________________________________________________________
1462 void AliTPCv2::SetOuterChambersAlignable() const
1465 AliGeomManager::ELayerID idTPC2 = AliGeomManager::kTPC2;
1466 Int_t modUID, modnum = 0;
1467 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1468 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1469 TString vpappend = "/TPC_OROC_1";
1470 TString snstr1="TPC/EndcapA/Sector";
1471 TString snstr2="TPC/EndcapC/Sector";
1472 TString snappend="/OuterChamber";
1473 TString volpath, symname;
1475 for(Int_t cnt=1; cnt<=18; cnt++){
1476 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
1479 volpath += vpappend;
1482 symname += snappend;
1483 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1484 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1485 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1486 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1487 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1488 alignableEntry->SetMatrix(matTtoL);
1491 for(Int_t cnt=1; cnt<=18; cnt++){
1492 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
1495 volpath += vpappend;
1498 symname += snappend;
1499 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
1500 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1501 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1502 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1503 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1504 alignableEntry->SetMatrix(matTtoL);
1508 //_____________________________________________________________________________
1509 void AliTPCv2::DrawDetector() const
1512 // Draw a shaded view of the Time Projection Chamber version 1
1515 // Set everything unseen
1516 gMC->Gsatt("*", "seen", -1);
1518 // Set ALIC mother transparent
1519 gMC->Gsatt("ALIC","SEEN",0);
1521 // Set the volumes visible
1524 gMC->Gsatt("TPC ","SEEN",0);
1525 gMC->Gsatt("TOIN","SEEN",1);
1526 gMC->Gsatt("TOIN","COLO",7);
1527 gMC->Gsatt("TOCV","SEEN",1);
1528 gMC->Gsatt("TOCV","COLO",4);
1529 gMC->Gsatt("TSA1","SEEN",0);
1530 gMC->Gsatt("TSA2","SEEN",0);
1531 gMC->Gsatt("TSA3","SEEN",0);
1532 gMC->Gsatt("TSA4","SEEN",0);
1533 gMC->Gsatt("TSA5","SEEN",0);
1534 gMC->Gsatt("TOFC","SEEN",1);
1535 gMC->Gsatt("TOFC","COLO",4);
1536 gMC->Gsatt("TSA6","SEEN",0);
1537 gMC->Gsatt("TSA7","SEEN",0);
1538 gMC->Gsatt("TSA8","SEEN",0);
1539 gMC->Gsatt("TIIN","SEEN",1);
1540 gMC->Gsatt("TIIN","COLO",7);
1541 gMC->Gsatt("TII1","SEEN",0);
1542 gMC->Gsatt("TIFC","SEEN",1);
1543 gMC->Gsatt("TIFC","COLO",4);
1544 gMC->Gsatt("TSA9","SEEN",0);
1545 gMC->Gsatt("TS10","SEEN",0);
1546 gMC->Gsatt("TS11","SEEN",0);
1547 gMC->Gsatt("TS12","SEEN",0);
1548 gMC->Gsatt("TS13","SEEN",0);
1549 gMC->Gsatt("TS14","SEEN",0);
1550 gMC->Gsatt("TICC","SEEN",0);
1551 gMC->Gsatt("TICM","SEEN",0);
1552 gMC->Gsatt("TS15","SEEN",0);
1553 gMC->Gsatt("TS16","SEEN",0);
1554 gMC->Gsatt("TS17","SEEN",0);
1555 gMC->Gsatt("TS18","SEEN",0);
1556 gMC->Gsatt("TS19","SEEN",0);
1557 gMC->Gsatt("TPJ1","SEEN",0);
1558 gMC->Gsatt("TPJ2","SEEN",0);
1559 gMC->Gsatt("TICS","SEEN",0);
1560 gMC->Gsatt("TDGN","SEEN",0);
1561 gMC->Gsatt("TIRC","SEEN",0);
1562 gMC->Gsatt("TIC1","SEEN",1);
1563 gMC->Gsatt("TIPP","SEEN",0);
1564 gMC->Gsatt("TIC3","SEEN",0);
1565 gMC->Gsatt("TRCE","SEEN",0);
1566 gMC->Gsatt("TPSC","SEEN",0);
1567 gMC->Gsatt("TPCC","SEEN",0);
1568 gMC->Gsatt("TORC","SEEN",0);
1569 gMC->Gsatt("TOPP","SEEN",0);
1570 gMC->Gsatt("TOC3","SEEN",0);
1571 gMC->Gsatt("TOC1","SEEN",1);
1572 gMC->Gsatt("TSSW","SEEN",1);
1573 gMC->Gsatt("TSWC","SEEN",1);
1574 gMC->Gsatt("TSSW","COLO",3);
1575 gMC->Gsatt("TSWC","COLO",3);
1576 gMC->Gsatt("TSCE","COLO",6);
1577 gMC->Gsatt("TSCE","SEEN",1);
1578 gMC->Gsatt("TWES","SEEN",0);
1579 gMC->Gsatt("TSWB","SEEN",0);
1580 gMC->Gsatt("TPEL","SEEN",0);
1581 gMC->Gsatt("TPMW","SEEN",1);
1582 gMC->Gsatt("TESR","SEEN",1);
1583 gMC->Gsatt("TPMW","COLO",12);
1584 gMC->Gsatt("TIC1","COLO",5);
1585 gMC->Gsatt("TOC1","COLO",5);
1586 gMC->Gsatt("TESB","SEEN",0);
1587 gMC->Gsatt("THVM","SEEN",1);
1588 gMC->Gsatt("THVM","COLO",11);
1589 gMC->Gsatt("THVH","SEEN",0);
1590 gMC->Gsatt("TPSR","SEEN",0);
1591 gMC->Gsatt("THVL","SEEN",0);
1592 gMC->Gsatt("THVC","SEEN",0);
1593 gMC->Gsatt("THVE","SEEN",0);
1594 gMC->Gsatt("THVR","SEEN",0);
1595 gMC->Gsatt("TPSS","SEEN",0);
1596 gMC->Gsatt("TPUS","SEEN",0);
1597 gMC->Gsatt("TPLS","SEEN",0);
1600 gMC->Gdopt("hide", "on");
1601 gMC->Gdopt("shad", "on");
1602 gMC->Gsatt("*", "fill", 7);
1603 gMC->SetClipBox(".");
1604 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1605 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1606 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1607 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1608 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1609 gMC->DefaultRange();
1610 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1611 gMC->Gdhead(1111, "Time Projection Chamber");
1612 gMC->Gdman(18, 4, "MAN");
1613 gMC->Gdopt("hide","off");
1616 //_____________________________________________________________________________
1617 void AliTPCv2::CreateMaterials()
1620 // Define materials for version 2 of the Time Projection Chamber
1623 AliTPC::CreateMaterials();
1626 //_____________________________________________________________________________
1627 void AliTPCv2::Init()
1630 // Initialises version 2 of the TPC after that it has been built
1633 Int_t *idtmed = fIdtmed->GetArray();
1638 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
1640 fIDrift=gMC->VolId("TPC_Drift");
1641 fSecOld=-100; // fake number
1643 gMC->SetMaxNStep(-30000); // max. number of steps increased
1645 if (fPrimaryIonisation) {
1647 gMC->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential
1649 gMC->Gstpar(idtmed[2],"PRIMIO_N", 14.35);
1650 gMC->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss
1651 gMC->Gstpar(idtmed[2],"STRA",4);
1653 // specific energy loss for geant3 is now defined in galice.cuts
1656 AliDebug(1,"*** TPC version 2 initialized ***");
1657 AliDebug(1,Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1663 //_____________________________________________________________________________
1664 void AliTPCv2::StepManager()
1667 // Called for every step in the Time Projection Chamber
1671 // parameters used for the energy loss calculations
1673 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1674 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1675 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1676 const Int_t kMaxDistRef =15; // maximal difference between 2 stored references
1678 const Float_t kbig = 1.e10;
1685 vol[1]=0; // preset row number to 0
1687 if (!fPrimaryIonisation) gMC->SetMaxStep(kbig);
1689 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1691 Float_t charge = gMC->TrackCharge();
1693 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1695 // check the sensitive volume
1697 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
1698 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
1700 gMC->TrackPosition(p);
1701 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1705 Double_t angle = TMath::ACos(p[0]/r);
1706 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1708 // angular segment, it is not a real sector number...
1710 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1711 fTPCParam->GetInnerAngle());
1712 // rotate to segment "0"
1714 fTPCParam->AdjustCosSin(sector,cos,sin);
1715 Float_t x1=p[0]*cos + p[1]*sin;
1716 // check if within sector's limits
1717 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
1718 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
1719 // calculate real sector number...
1720 if (x1>fTPCParam->GetOuterRadiusLow()){
1721 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1722 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1723 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
1726 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1728 // here I have a sector number
1733 static Double_t lastReferenceR=0;
1734 if (TMath::Abs(lastReferenceR-r)>kMaxDistRef){
1735 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
1739 // check if change of sector
1740 if(sector != fSecOld){
1742 // add track reference
1743 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
1745 // track is in the sensitive strip
1747 // track is entering the strip
1748 if (gMC->IsTrackEntering()){
1749 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1750 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1751 // row numbers are autonomous for lower and upper sectors
1752 if(vol[0] > fTPCParam->GetNInnerSector()) {
1753 vol[1] -= fTPCParam->GetNRowLow();
1756 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
1758 // lower sector, row 0, because Jouri wants to have this
1760 gMC->TrackMomentum(p);
1764 hits[3]=0.; // this hit has no energy loss
1765 // Get also the track time for pileup simulation
1766 hits[4]=gMC->TrackTime();
1768 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1772 gMC->TrackPosition(p);
1776 hits[3]=0.; // this hit has no energy loss
1777 // Get also the track time for pileup simulation
1778 hits[4]=gMC->TrackTime();
1780 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1785 //-----------------------------------------------------------------
1786 // charged particle is in the sensitive drift volume
1787 //-----------------------------------------------------------------
1788 if(gMC->TrackStep() > 0) {
1790 if (!fPrimaryIonisation) {
1791 nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1794 Float_t edep = gMC->Edep();
1795 if (edep > 0.) nel = (Int_t)((gMC->Edep()*1.5)/kwIon) + 1;
1797 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1799 gMC->TrackPosition(p);
1803 hits[3]=(Float_t)nel;
1808 gMC->TrackMomentum(p);
1809 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1810 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1811 fTrackHits->SetHitPrecision(precision);
1814 // Get also the track time for pileup simulation
1815 hits[4]=gMC->TrackTime();
1817 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1818 if (fDebugStreamer){
1819 // You can dump here what you need
1820 // function CreateDebugStremer() to be called in the Config.C macro
1821 // if you want to enable it
1822 // By default debug streaemer is OFF
1823 Float_t edep = gMC->Edep();
1824 Float_t tstep = gMC->TrackStep();
1825 Int_t pid=gMC->TrackPid();
1826 (*fDebugStreamer)<<"hit"<<
1827 "x="<<hits[0]<< // hit position
1830 "nel="<<hits[3]<< // number of electorns
1831 "tof="<<hits[4]<< // hit TOF
1832 "edep="<<edep<< // energy deposit
1833 "pid="<<pid<< // pid
1840 } //within sector's limits
1841 // Stemax calculation for the next step
1845 // below is valid only for Geant3 (fPromaryIonisation not set)
1846 if(!fPrimaryIonisation){
1847 gMC->TrackMomentum(mom);
1848 Float_t ptot=mom.Rho();
1849 Float_t betaGamma = ptot/gMC->TrackMass();
1851 Int_t pid=gMC->TrackPid();
1852 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1854 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1859 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
1860 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
1864 Double_t rnd = gMC->GetRandom()->Rndm();
1866 gMC->SetMaxStep(-TMath::Log(rnd)/pp);