]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCv2.cxx
AliTPCclusterInof is added to the cluster only as option
[u/mrichter/AliRoot.git] / TPC / AliTPCv2.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
88cb7938 16/* $Id$ */
4c039060 17
73042f01 18//
fe4da5cc 19///////////////////////////////////////////////////////////////////////////////
20// //
21// Time Projection Chamber version 2 -- detailed TPC and slow simulation //
22// //
23//Begin_Html
24/*
1439f98e 25<img src="picts/AliTPCv2Class.gif">
fe4da5cc 26*/
27//End_Html
28// //
29// //
30///////////////////////////////////////////////////////////////////////////////
116cbefd 31
d899e254 32//#include <stdlib.h>
fe4da5cc 33
88cb7938 34#include <TLorentzVector.h>
116cbefd 35#include <TPDGCode.h>
d9e80aca 36#include <TString.h>
f77f13c8 37#include "AliLog.h"
e6add757 38#include "AliTrackReference.h"
73042f01 39#include "AliTPCParam.h"
4ed5dced 40#include "AliTPCTrackHitsV2.h"
116cbefd 41#include "AliTPCv2.h"
c1637e41 42#include "TGeoVolume.h"
43#include "TGeoPcon.h"
44#include "TGeoTube.h"
45#include "TGeoPgon.h"
46#include "TGeoTrd1.h"
47#include "TGeoCompositeShape.h"
48#include "TGeoPara.h"
1ac29fc4 49#include "TGeoPhysicalNode.h"
50
c1637e41 51ClassImp(AliTPCv2)
52
53//_____________________________________________________________________________
54AliTPCv2::AliTPCv2(const char *name, const char *title) :
e046d791 55 AliTPC(name, title),
56 fIdSens(0),
57 fIDrift(0),
58 fSecOld(0)
c1637e41 59{
60 //
61 // Standard constructor for Time Projection Chamber version 2
62 //
6a905708 63
37831078 64
c1637e41 65 SetBufferSize(128000);
79575d04 66
79575d04 67
c1637e41 68 if (fTPCParam)
69 fTPCParam->Write(fTPCParam->GetTitle());
70}
71
72//_____________________________________________________________________________
73void AliTPCv2::CreateGeometry()
74{
75 //
76 // Create the geometry of Time Projection Chamber version 2
77 //
78 //Begin_Html
79 /*
80 <img src="picts/AliTPC.gif">
81 */
82 //End_Html
83 //Begin_Html
84 /*
85 <img src="picts/AliTPCv2Tree.gif">
86 */
87 //End_Html
37831078 88
89 //----------------------------------------------------------
c1637e41 90 // This geometry is written using TGeo class
91 // Firstly the shapes are defined, and only then the volumes
92 // What is recognized by the MC are volumes
37831078 93 //----------------------------------------------------------
c1637e41 94 //
95 // tpc - this will be the mother volume
96 //
37831078 97
c1637e41 98 //
99 // here I define a volume TPC
100 // retrive the medium name with "TPC_" as a leading string
101 //
102 TGeoPcon *tpc = new TGeoPcon(0.,360.,18); //18 sections
103 tpc->DefineSection(0,-290.,77.,278.);
456cb019 104 tpc->DefineSection(1,-259.6,70.,278.);
c1637e41 105 //
106 tpc->DefineSection(2,-259.6,68.1,278.);
107 tpc->DefineSection(3,-253.6,68.1,278.);
108 //
109 tpc->DefineSection(4,-253.6,68.,278.);
110 tpc->DefineSection(5,-74.0,60.8,278.);
111 //
112 tpc->DefineSection(6,-74.0,60.1,278.);
113 tpc->DefineSection(7,-73.3,60.1,278.);
114 //
115 tpc->DefineSection(8,-73.3,56.9,278.);
116 tpc->DefineSection(9,73.3,56.9,278.);
117 //
118 tpc->DefineSection(10,73.3,60.1,278.);
119 tpc->DefineSection(11,74.0,60.1,278.);
120 //
121 tpc->DefineSection(12,74.0,60.8,278.);
122 tpc->DefineSection(13,253.6,65.5,278.);
123 //
124 tpc->DefineSection(14,253.6,65.6,278.);
125 tpc->DefineSection(15,259.6,65.6,278.);
126 //
456cb019 127 tpc->DefineSection(16,259.6,70.0,278.);
c1637e41 128 tpc->DefineSection(17,290.,77.,278.);
129 //
130 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
131 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
132 //
133 // drift volume - sensitive volume, extended beyond the
134 // endcaps, because of the alignment
135 //
136 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
137 dvol->DefineSection(0,-260.,74.5,264.4);
138 dvol->DefineSection(1,-253.6,74.5,264.4);
139 //
140 dvol->DefineSection(2,-253.6,76.6774,258.);
141 dvol->DefineSection(3,253.6,76.6774,258.);
142 //
143 dvol->DefineSection(4,253.6,74.5,264.4);
144 dvol->DefineSection(5,260.,74.5,264.4);
145 //
146 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_Ne-CO2-N-2");
147 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
148 //
149 v1->AddNode(v9,1);
150 //
151 // outer insulator
152 //
153 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
154 //
155 tpco->DefineSection(0,-256.6,264.8,278.);
156 tpco->DefineSection(1,-253.6,264.8,278.);
157 //
158 tpco->DefineSection(2,-253.6,258.,278.);
159 tpco->DefineSection(3,250.6,258.,278.);
160 //
161 tpco->DefineSection(4,250.6,258.,275.5);
162 tpco->DefineSection(5,253.6,258.,275.5);
163 //
164 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
165 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
166 //
167 // outer containment vessel
168 //
169 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
170 //
171 tocv->DefineSection(0,-256.6,264.8,278.);
172 tocv->DefineSection(1,-253.6,264.8,278.);
173 //
174 tocv->DefineSection(2,-253.6,274.8124,278.);
175 tocv->DefineSection(3,247.6,274.8124,278.);
176 //
177 tocv->DefineSection(4,247.6,270.4,278.);
178 tocv->DefineSection(5,250.6,270.4,278.);
179 //
180 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
181 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
182 //
183 TGeoTube *to1 = new TGeoTube(274.8174,277.995,252.1); //epoxy
184 TGeoTube *to2 = new TGeoTube(274.8274,277.985,252.1); //tedlar
185 TGeoTube *to3 = new TGeoTube(274.8312,277.9812,252.1);//prepreg2
186 TGeoTube *to4 = new TGeoTube(274.9062,277.9062,252.1);//nomex
187 //
188 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
189 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
190 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
191 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
192 //
193 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
194 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
195 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
196 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
197 //-------------------------------------------------------
198 // Tpc Outer Field Cage
199 // daughters - composite (sandwich)
200 //-------------------------------------------------------
37831078 201
c1637e41 202 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
203 //
204 tofc->DefineSection(0,-253.6,258.,269.6);
205 tofc->DefineSection(1,-250.6,258.,269.6);
206 //
207 tofc->DefineSection(2,-250.6,258.,260.0676);
208 tofc->DefineSection(3,250.6,258.,260.0676);
209 //
210 tofc->DefineSection(4,250.6,258.,275.5);
211 tofc->DefineSection(5,253.6,258.,275.5);
212 //
213 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
214 //sandwich
215 TGeoTube *tf1 = new TGeoTube(258.0,260.0676,252.1); //tedlar
216 TGeoTube *tf2 = new TGeoTube(258.0038,260.0638,252.1); //prepreg3
217 TGeoTube *tf3 = new TGeoTube(258.0338,260.0338,252.1);//nomex
218 //
219 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
220 //
221 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
222 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
223 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
224 //
225 // outer part - positioning
226 //
227 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);
228 //
229 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);
230 //
456cb019 231 v3->AddNode(tov1,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(tf1v,1);
c1637e41 232 //
233 v2->AddNode(v3,1); v2->AddNode(v4,1);
234 //
235 v1->AddNode(v2,1);
236 //--------------------------------------------------------------------
237 // Tpc Inner INsulator (CO2)
238 // the cones, the central drum and the inner f.c. sandwich with a piece
239 // of the flane will be placed in the TPC
240 //--------------------------------------------------------------------
241 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
242 //
243 tpci->DefineSection(0,-253.6,68.4,76.6774);
244 tpci->DefineSection(1,-74.0,61.2,76.6774);
245 //
246 tpci->DefineSection(2,74.0,61.2,76.6774);
247 //
248 tpci->DefineSection(3,253.6,65.9,76.6774);
249 //
250 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
251 //
252 // now the inner field cage - only part of flanges (2 copies)
253 //
254 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
255 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
256 //
257 //---------------------------------------------------------
258 // Tpc Inner Containment vessel - Muon side
259 //---------------------------------------------------------
260 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
261 //
262 tcms->DefineSection(0,-259.1,68.1,74.2);
263 tcms->DefineSection(1,-253.6,68.1,74.2);
264 //
265 tcms->DefineSection(2,-253.6,68.1,68.4);
266 tcms->DefineSection(3,-74.0,60.9,61.2);
267 //
268 tcms->DefineSection(4,-74.0,60.1,61.2);
269 tcms->DefineSection(5,-73.3,60.1,61.2);
270 //
271 tcms->DefineSection(6,-73.3,56.9,61.2);
272 tcms->DefineSection(7,-73.0,56.9,61.2);
273 //
274 tcms->DefineSection(8,-73.0,56.9,58.8);
275 tcms->DefineSection(9,-71.3,56.9,58.8);
276 //
277 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
278 //-----------------------------------------------
279 // inner containment vessel - shaft side
280 //-----------------------------------------------
281 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
282 //
283 tcss->DefineSection(0,71.3,56.9,58.8);
284 tcss->DefineSection(1,73.0,56.9,58.8);
285 //
286 tcss->DefineSection(2,73.0,56.9,61.2);
287 tcss->DefineSection(3,73.3,56.9,61.2);
288 //
289 tcss->DefineSection(4,73.3,60.1,61.2);
290 tcss->DefineSection(5,74.0,60.1,61.2);
291 //
292 tcss->DefineSection(6,74.0,60.9,61.2);
293 tcss->DefineSection(7,253.6,65.6,65.9);
294 //
295 tcss->DefineSection(8,253.6,65.6,74.2);
296 tcss->DefineSection(9,258.1,65.6,74.2);
297 //
298 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
299 //-----------------------------------------------
300 // Inner field cage
301 // define 4 parts and make an assembly
302 //-----------------------------------------------
303 // part1 - Al - 2 copies
304 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
305 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
306 // sandwich - outermost parts - 2 copies
307 TGeoTube *t2 = new TGeoTube(76.6774,78.845,74.175); // tedlar 38 microns
308 TGeoTube *t3 = new TGeoTube(76.6812,78.8412,74.175); // prepreg2 500 microns
309 TGeoTube *t4 = new TGeoTube(76.7312,78.7912,74.175); // prepreg3 300 microns
310 TGeoTube *t5 = new TGeoTube(76.7612,78.7612,74.175); // nomex 2 cm
311 //
312 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
313 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
314 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
315 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
316 //
317 // middle parts - 2 copies
318 TGeoTube *t6 = new TGeoTube(76.6774,78.795,5.); // tedlar 38 microns
319 TGeoTube *t7 = new TGeoTube(76.6812,78.7912,5.); // prepreg2 250 microns
320 TGeoTube *t8 = new TGeoTube(76.7062,78.7662,5.); // prepreg3 300 microns
321 TGeoTube *t9 = new TGeoTube(76.7362,78.7362,5.); // nomex 2 cm
322 //
323 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
324 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
325 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
326 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
327 // central part - 1 copy
328 TGeoTube *t10 = new TGeoTube(76.6774,78.745,93.75); // tedlar 38 microns
329 TGeoTube *t11 = new TGeoTube(76.6812,78.7412,93.75); // prepreg3 300 microns
330 TGeoTube *t12 = new TGeoTube(76.7112,78.7112,93.75); // nomex 2 cm
331 //
332 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
333 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
334 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
335 //
336 // inner part - positioning
337 //
338 // creating a sandwich
339 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
340 //
341 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
342 //
343 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
344 //
345 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC");
346 //
347 tv100->AddNode(tv10,1);
348 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75));
349 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75));
350 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925));
351 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
352 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
353 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
354 //
355 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
356 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
357 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
358 v9->AddNode(tv100,1);
359 //
360 // central drum
361 //
362 // flange + sandwich
363 //
364 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
365 cfl->DefineSection(0,-71.1,59.7,61.2);
366 cfl->DefineSection(1,-68.6,59.7,61.2);
367 //
368 cfl->DefineSection(2,-68.6,60.6324,61.2);
369 cfl->DefineSection(3,68.6,60.6324,61.2);
370 //
371 cfl->DefineSection(4,68.6,59.7,61.2);
372 cfl->DefineSection(5,71.1,59.7,61.2);
373 //
374 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
375 // sandwich
376 TGeoTube *cd1 = new TGeoTube(60.6424,61.19,71.1);
377 TGeoTube *cd2 = new TGeoTube(60.6462,61.1862,71.1);
378 TGeoTube *cd3 = new TGeoTube(60.6662,61.1662,71.1);
379 //
380 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
381 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
382 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
383 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm4); //nomex
384 //
385 // seals for central drum 2 copies
386 //
387 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
388 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
389 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
390 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.));
391 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.));
392 //
393 // seal collars
394 TGeoPcon *se = new TGeoPcon(0.,360.,6);
395 se->DefineSection(0,-72.8,59.7,61.2);
396 se->DefineSection(1,-72.3,59.7,61.2);
397 //
398 se->DefineSection(2,-72.3,58.85,61.2);
399 se->DefineSection(3,-71.6,58.85,61.2);
400 //
401 se->DefineSection(4,-71.6,59.7,61.2);
402 se->DefineSection(5,-71.3,59.7,61.2);
403 //
404 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
405 //
406 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
407 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
408 //
409 // define reflection matrix
410 //
4fa47888 411 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
c1637e41 412 //
413 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
414 //
a1ec4d07 415 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
416 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
c1637e41 417 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
418 //
419 // central membrane - 2 rings and a mylar membrane - assembly
420 //
421 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
422 TGeoTube *oh = new TGeoTube(250.,256.,.5);
423 TGeoTube *mem = new TGeoTube(84.05,250,0.01);
424 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
425 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
426 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
427 //
428 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
429 cm->AddNode(ihv,1);
430 cm->AddNode(ohv,1);
431 cm->AddNode(memv,1);
432 v9->AddNode(cm,1);
433 //
434 // end caps - they are make as an assembly of single segments
435 // containing both readout chambers
436 //
d899e254 437 Double_t openingAngle = 10.*TMath::DegToRad();
c1637e41 438 Double_t thick=1.5; // rib
d899e254 439 Double_t shift = thick/TMath::Sin(openingAngle);
c1637e41 440 //
d899e254 441 Double_t lowEdge = 86.3; // hole in the wheel
442 Double_t upEdge = 240.4; // hole in the wheel
c1637e41 443 //
444 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
445 //
446 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
447 //
d899e254 448 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
449 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
c1637e41 450 //
d899e254 451 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
452 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
c1637e41 453 //
d899e254 454 Double_t ys = shift*TMath::Sin(openingAngle);
455 Double_t xs = shift*TMath::Cos(openingAngle);
c1637e41 456 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
457 tr->RegisterYourself();
458 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
459 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
460 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
461 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
462 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
463 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
464 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
465 //
466 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
467 //
468 // readout chambers
469 //
470 // IROC first
471 //
472 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
473 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
474 // empty space
475 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
476 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
477 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
478 //bars
479 Double_t tga = (19.8328-12.3742)/39.3;
480 Double_t xmin,xmax;
481 xmin = 9.55*tga+12.3742;
482 xmax = 9.95*tga+12.3742;
483 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
484 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
485 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
486 xmin=19.4*tga+12.3742;
487 xmax=19.9*tga+12.3742;
488 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
489 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
490 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
491 xmin=29.35*tga+12.3742;
492 xmax=29.75*tga+12.3742;
493 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
494 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
495 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
496 //
497 // holes for connectors
498 //
499 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
500 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
d9e80aca 501 TString fileName(gSystem->Getenv("ALICE_ROOT"));
502 fileName += "/TPC/conn_iroc.dat";
c1637e41 503 ifstream in;
d9e80aca 504 in.open(fileName.Data(), ios_base::in); // asci file
c1637e41 505 for(Int_t i =0;i<86;i++){
456cb019 506 Double_t y = 3.99;
c1637e41 507 Double_t x,z,ang;
508 in>>x>>z>>ang;
456cb019 509 z-=26.5;
c1637e41 510 TGeoRotation *rrr = new TGeoRotation();
511 rrr->RotateY(ang);
512 TGeoCombiTrans *trans = new TGeoCombiTrans("trans",x,y,z,rrr);
513 ibdv->AddNode(connv,i+1,trans);
514 }
515 in.close();
516 // "cap"
517 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
518 // "hole"
519 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
520 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
521 tr1->RegisterYourself();
522 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
523 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
524 //
525 // pad plane and wire fixations
526 //
527 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
528 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
529 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
530 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
531 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
532 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
533 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
534 //
535 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
536 //
537 iroc->AddNode(ibdv,1);
538 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
539 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
540 tga =(23.3521-14.5974)/49.65;
541 Double_t xx = 24.825*tga+14.5974-0.6;
542 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
543 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
544 //
545 // OROC
546 //
547 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
548 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
549 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
550 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
551 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
552 //horizontal bars
553 tga=(38.5084-20.2938)/99.3;
554 xmin=tga*10.2+20.2938;
555 xmax=tga*10.6+20.2938;
556 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
557 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
558 //
559 xmin=22.55*tga+20.2938;
560 xmax=24.15*tga+20.2938;
561 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
562 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
563 //
564 xmin=36.1*tga+20.2938;
565 xmax=36.5*tga+20.2938;
566 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
567 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
568 //
569 xmin=49.0*tga+20.2938;
570 xmax=50.6*tga+20.2938;
571 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
572 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
573 //
574 xmin=63.6*tga+20.2938;
575 xmax=64.0*tga+20.2938;
576 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
577 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
578 //
579 xmin=75.5*tga+20.2938;
580 xmax=77.15*tga+20.2938;
581 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
582 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
583 //
584 xmin=88.7*tga+20.2938;
585 xmax=89.1*tga+20.2938;
586 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
587 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
588 //
589 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
590 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
591 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
592 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
593 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
594 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
595 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
596 // vertical bars
597 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
598 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
599 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
600 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
601 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
602 //
603 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
604 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
605 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
606 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
607 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
608 //
609 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
610 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
611 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
612 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
613 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
614 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
615 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
616 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
617 //
618 // holes for connectors
619 //
d9e80aca 620 fileName = gSystem->Getenv("ALICE_ROOT");
621 fileName += "/TPC/conn_oroc.dat";
622 in.open(fileName.Data(), ios_base::in); // asci file
c1637e41 623 for(Int_t i =0;i<78;i++){
624 Double_t y =3.89;
625 Double_t x,z,ang;
626 Double_t x1,z1,x2,z2;
627 in>>x>>z>>ang;
628 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
629 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
630 //
631 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
632 //
633 TGeoRotation *rr = new TGeoRotation();
634 rr->RotateY(ang);
635 z1-=54.95;
636 z2-=54.95;
637 TGeoCombiTrans *trans1 = new TGeoCombiTrans("trans1",x1,y,z1,rr);
638 TGeoCombiTrans *trans2 = new TGeoCombiTrans("trans2",x2,y,z2,rr);
639 obdv->AddNode(connv,i+1,trans1);
640 obdv->AddNode(connv,i+79,trans2);
641 }
642 in.close();
643 // cap
644 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
645 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
646 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
647 tr5->RegisterYourself();
648 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
649 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
650 //
651 // pad plane and wire fixations
652 //
653 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
654 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
655 //
656 tga=(43.5239-23.3874)/114.2;
657 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
658 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
659 xx = 57.1*tga+23.3874-0.7;
660 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
661 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
662 //
663 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
664 //
665 oroc->AddNode(obdv,1);
666 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
667 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
668 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
669 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
670 //
671 // now iroc and oroc are placed into a sector...
672 //
a1ec4d07 673 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
674 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
c1637e41 675 TGeoRotation rot1("rot1",90.,90.,0.);
676 TGeoRotation rot2("rot2");
677 rot2.RotateY(10.);
678 TGeoRotation *rot = new TGeoRotation("rot");
679 *rot=rot1*rot2;
680 //
681 Double_t x0,y0;
d899e254 682 x0=110.2*TMath::Cos(openingAngle);
683 y0=110.2*TMath::Sin(openingAngle);
a1ec4d07 684 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //a-side
685 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //c-side
d899e254 686 x0=188.45*TMath::Cos(openingAngle);
687 y0=188.45*TMath::Sin(openingAngle);
a1ec4d07 688 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //a-side
689 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //c-side
c1637e41 690 //
c1637e41 691 //
a1ec4d07 692 // A-side
c1637e41 693 //
a1ec4d07 694 secta->AddNode(ch,1);
695 secta->AddNode(iroc,1,combi1a);
696 secta->AddNode(oroc,1,combi2a);
697 //
698 // C-side
699 //
700 sectc->AddNode(ch,1);
701 sectc->AddNode(iroc,1,combi1c);
702 sectc->AddNode(oroc,1,combi2c);
703 //
704 // now I try to make wheels...
705 //
706 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
707 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
c1637e41 708 //
709 for(Int_t i =0;i<18;i++){
710 Double_t phi = (20.*i);
711 TGeoRotation *r = new TGeoRotation();
712 r->RotateZ(phi);
a1ec4d07 713 wheela->AddNode(secta,i+1,r);
714 wheelc->AddNode(sectc,i+1,r);
79575d04 715
c1637e41 716 }
4fa47888 717 // wheels in the drift volume!
a1ec4d07 718
c1637e41 719 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
a1ec4d07 720 v9->AddNode(wheela,1,combi3);
721 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
c1637e41 722 //_____________________________________________________________
723 // service support wheel
724 //_____________________________________________________________
725 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
726 sw->DefineSection(0,-4.,80.5,251.75);
727 sw->DefineSection(1,4.,80.5,251.75);
728 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
729 //
730 thick=1.;
d899e254 731 shift = thick/TMath::Sin(openingAngle);
c1637e41 732 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
733 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
734 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
735 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
736 //
74518339 737 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
738 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
739 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
740 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
741 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
742 //
743 shv->AddNode(elv,1);
744 //
745 //
d899e254 746 ys = shift*TMath::Sin(openingAngle);
747 xs = shift*TMath::Cos(openingAngle);
c1637e41 748 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
749 // cover
750 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
751 co->DefineSection(0,-0.5,77.,255.25);
752 co->DefineSection(1,0.5,77.,255.25);
753 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
754 // hole in a cover
755 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
d899e254 756 shift=4./TMath::Sin(openingAngle);
c1637e41 757 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
758 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
759 //
760 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
761 //
d899e254 762 ys = shift*TMath::Sin(openingAngle);
763 xs = shift*TMath::Cos(openingAngle);
c1637e41 764 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
765 //
766 // Sector as an Assembly
767 //
768 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
769 swhs->AddNode(swv,1);
770 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
771 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
772 //
773 // SSW as an Assembly of sectors
774 //
775 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
776 for(Int_t i =0;i<18;i++){
777 Double_t phi = (20.*i);
778 TGeoRotation *r = new TGeoRotation();
779 r->RotateZ(phi);
780 swheel->AddNode(swhs,i+1,r);
781 }
782 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
783 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
784
785 // sensitive strips - strip "0" is always set
786 // conditional
787 Int_t totrows;
788 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
789 Double_t *upar;
790 upar=NULL;
791 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
792 upar=new Double_t [10];
793 upar[0]=0.;
794 upar[1]=360.;
795 upar[2]=18.;
796 upar[3]=2.;
797 //
798 upar[4]=-124.8;
799 upar[7]=124.8;
800
801 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
802
803 upar[5]=rlow;
804 upar[6]=rlow+.01;
805 upar[8]=upar[5];
806 upar[9]=upar[6];
807 //
808 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
809 gGeoManager->Node("TPC_Strip",totrows+1,
810 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
811 //
812 // now, strips optionally
813 //
814 if(fSens){
815 //lower sectors
816 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
817 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
818 upar[5]=rlow;
819 upar[6]=rlow+.01;
820 upar[8]=upar[5];
821 upar[9]=upar[6];
822 gGeoManager->Node("TPC_Strip",i,
823 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
824 gGeoManager->Node("TPC_Strip",totrows+i,
825 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
826 }
827 //upper sectors
828 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
829 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
830 upar[5]=rlow;
831 upar[6]=rlow+.01;
832 upar[8]=upar[5];
833 upar[9]=upar[6];
834 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
835 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
836 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
837 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
838 }
839 }//strips
37831078 840 //----------------------------------------------------------
c1637e41 841 // TPc Support Rods - MAKROLON
37831078 842 //----------------------------------------------------------
c1637e41 843 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
844 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
845 // upper and lower rods differ in length!
846 delete [] upar;
847 upar=NULL;
848 gGeoManager->Volume("TPC_Rod","TUBE",m6->GetId(),upar);
849 upar=new Double_t [3];
850 upar[0]=1.8;
851 upar[1]=2.2;
852
79575d04 853 //
c1637e41 854 //HV rods - makrolon + 0.58cm (diameter) Cu
ae4806ca 855 TGeoTube *hvr = new TGeoTube(0.,2.2,126.64);
c1637e41 856 TGeoTube *hvc = new TGeoTube(0.,0.29,126.64);
857 //
858 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
859 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
860 hvrv->AddNode(hvcv,1);
861
7281dc07 862 for(Int_t i=0;i<18;i++){
c1637e41 863 Double_t angle,x,y;
864 Double_t z,r;
865 angle=TMath::DegToRad()*20.*(Double_t)i;
866 r=81.5;
867 x=r * TMath::Cos(angle);
868 y=r * TMath::Sin(angle);
869 upar[2]=126.64; //lower
870 z= 126.96;
871 if(i==15){
872 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z));
873 v9->AddNode(hvrv,2,new TGeoTranslation(x,y,-z));
874 }
875 else{
876 gGeoManager->Node("TPC_Rod",i+1,"TPC_Drift",x,y,z,0,kTRUE,upar,3);//shaft
0079eac0 877 gGeoManager->Node("TPC_Rod",i+19,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon
c1637e41 878 }
879 r=254.25;
880 x=r * TMath::Cos(angle);
881 y=r * TMath::Sin(angle);
882 upar[2]=126.54; //upper
883 z=127.06;
0079eac0 884 gGeoManager->Node("TPC_Rod",i+37,"TPC_Drift",x,y,z,0,kTRUE,upar,3);
885 gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
c1637e41 886 }
79575d04 887
69776907 888 delete [] upar;
889
bde68ab0 890 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
891 alice->AddNode(v1,1);
c1637e41 892
37831078 893} // end of function
894
ac81c411 895//_____________________________________________________________________________
896void AliTPCv2::AddAlignableVolumes() const
897{
898 //
899 // Create entries for alignable volumes associating the symbolic volume
900 // name with the corresponding volume path. Needs to be syncronized with
901 // eventual changes in the geometry.
902 //
903 SetInnerChambersAlignable();
904 SetOuterChambersAlignable();
905}
906
907//_____________________________________________________________________________
908void AliTPCv2::SetInnerChambersAlignable() const
909{
910 //
911 Int_t modnum = 0;
d899e254 912 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
913 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
914 TString vpappend = "/TPC_IROC_1";
915 TString snstr1="TPC/EndcapA/Sector";
916 TString snstr2="TPC/EndcapC/Sector";
917 TString snappend="/InnerChamber";
ac81c411 918 TString volpath, symname;
919
1ac29fc4 920 for(Int_t cnt=1; cnt<=18; cnt++){
921 volpath = vpstr1;
922 volpath += cnt;
923 volpath += vpappend;
924 symname = snstr1;
925 symname += cnt;
926 symname += snappend;
84cbbd90 927 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
928 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1ac29fc4 929 //
930 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
931 const char *path = alignableEntry->GetTitle();
932 if (!gGeoManager->cd(path))
933 AliFatal(Form("Volume path %s not valid!",path));
934 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
935 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
936 alignableEntry->SetMatrix(matTtoL);
937 modnum++;
938 }
65293f49 939
ac81c411 940 for(Int_t cnt=1; cnt<=18; cnt++){
d899e254 941 volpath = vpstr2;
ac81c411 942 volpath += cnt;
d899e254 943 volpath += vpappend;
944 symname = snstr2;
ac81c411 945 symname += cnt;
d899e254 946 symname += snappend;
84cbbd90 947 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
948 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1ac29fc4 949 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
950 const char *path = alignableEntry->GetTitle();
951 if (!gGeoManager->cd(path))
952 AliFatal(Form("Volume path %s not valid!",path));
953 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
954 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
955 alignableEntry->SetMatrix(matTtoL);
ac81c411 956 modnum++;
957 }
958}
959
ac81c411 960//_____________________________________________________________________________
961void AliTPCv2::SetOuterChambersAlignable() const
962{
963 //
964 Int_t modnum = 0;
d899e254 965 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
966 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
967 TString vpappend = "/TPC_OROC_1";
968 TString snstr1="TPC/EndcapA/Sector";
969 TString snstr2="TPC/EndcapC/Sector";
970 TString snappend="/OuterChamber";
ac81c411 971 TString volpath, symname;
972
973 for(Int_t cnt=1; cnt<=18; cnt++){
d899e254 974 volpath = vpstr1;
ac81c411 975 volpath += cnt;
d899e254 976 volpath += vpappend;
977 symname = snstr1;
ac81c411 978 symname += cnt;
d899e254 979 symname += snappend;
84cbbd90 980 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
981 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1ac29fc4 982 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
983 const char *path = alignableEntry->GetTitle();
984 if (!gGeoManager->cd(path))
985 AliFatal(Form("Volume path %s not valid!",path));
986 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
987 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
988 alignableEntry->SetMatrix(matTtoL);
ac81c411 989 modnum++;
990 }
84cbbd90 991
ac81c411 992 for(Int_t cnt=1; cnt<=18; cnt++){
d899e254 993 volpath = vpstr2;
ac81c411 994 volpath += cnt;
d899e254 995 volpath += vpappend;
996 symname = snstr2;
ac81c411 997 symname += cnt;
d899e254 998 symname += snappend;
84cbbd90 999 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1000 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
1ac29fc4 1001 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
1002 const char *path = alignableEntry->GetTitle();
1003 if (!gGeoManager->cd(path))
1004 AliFatal(Form("Volume path %s not valid!",path));
1005 TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
1006 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1007 alignableEntry->SetMatrix(matTtoL);
ac81c411 1008 modnum++;
1009 }
1010}
1011
37831078 1012//_____________________________________________________________________________
d899e254 1013void AliTPCv2::DrawDetector() const
37831078 1014{
1015 //
1016 // Draw a shaded view of the Time Projection Chamber version 1
1017 //
1018
1019 // Set everything unseen
1020 gMC->Gsatt("*", "seen", -1);
1021 //
1022 // Set ALIC mother transparent
1023 gMC->Gsatt("ALIC","SEEN",0);
1024 //
1025 // Set the volumes visible
1026 //
1027
1028 gMC->Gsatt("TPC ","SEEN",0);
1029 gMC->Gsatt("TOIN","SEEN",1);
1030 gMC->Gsatt("TOIN","COLO",7);
37831078 1031 gMC->Gsatt("TOCV","SEEN",1);
1032 gMC->Gsatt("TOCV","COLO",4);
1033 gMC->Gsatt("TSA1","SEEN",0);
1034 gMC->Gsatt("TSA2","SEEN",0);
1035 gMC->Gsatt("TSA3","SEEN",0);
79575d04 1036 gMC->Gsatt("TSA4","SEEN",0);
1037 gMC->Gsatt("TSA5","SEEN",0);
37831078 1038 gMC->Gsatt("TOFC","SEEN",1);
1039 gMC->Gsatt("TOFC","COLO",4);
37831078 1040 gMC->Gsatt("TSA6","SEEN",0);
1041 gMC->Gsatt("TSA7","SEEN",0);
79575d04 1042 gMC->Gsatt("TSA8","SEEN",0);
37831078 1043 gMC->Gsatt("TIIN","SEEN",1);
79575d04 1044 gMC->Gsatt("TIIN","COLO",7);
1045 gMC->Gsatt("TII1","SEEN",0);
1046 gMC->Gsatt("TIFC","SEEN",1);
1047 gMC->Gsatt("TIFC","COLO",4);
1048 gMC->Gsatt("TSA9","SEEN",0);
37831078 1049 gMC->Gsatt("TS10","SEEN",0);
1050 gMC->Gsatt("TS11","SEEN",0);
1051 gMC->Gsatt("TS12","SEEN",0);
37831078 1052 gMC->Gsatt("TS13","SEEN",0);
1053 gMC->Gsatt("TS14","SEEN",0);
79575d04 1054 gMC->Gsatt("TICC","SEEN",0);
1055 gMC->Gsatt("TICM","SEEN",0);
37831078 1056 gMC->Gsatt("TS15","SEEN",0);
1057 gMC->Gsatt("TS16","SEEN",0);
37831078 1058 gMC->Gsatt("TS17","SEEN",0);
79575d04 1059 gMC->Gsatt("TS18","SEEN",0);
1060 gMC->Gsatt("TS19","SEEN",0);
1061 gMC->Gsatt("TPJ1","SEEN",0);
1062 gMC->Gsatt("TPJ2","SEEN",0);
1063 gMC->Gsatt("TICS","SEEN",0);
1064 gMC->Gsatt("TDGN","SEEN",0);
37831078 1065 gMC->Gsatt("TIRC","SEEN",0);
1066 gMC->Gsatt("TIC1","SEEN",1);
1067 gMC->Gsatt("TIPP","SEEN",0);
1068 gMC->Gsatt("TIC3","SEEN",0);
1069 gMC->Gsatt("TRCE","SEEN",0);
1070 gMC->Gsatt("TPSC","SEEN",0);
79575d04 1071 gMC->Gsatt("TPCC","SEEN",0);
37831078 1072 gMC->Gsatt("TORC","SEEN",0);
1073 gMC->Gsatt("TOPP","SEEN",0);
1074 gMC->Gsatt("TOC3","SEEN",0);
1075 gMC->Gsatt("TOC1","SEEN",1);
1076 gMC->Gsatt("TSSW","SEEN",1);
1077 gMC->Gsatt("TSWC","SEEN",1);
37831078 1078 gMC->Gsatt("TSSW","COLO",3);
1079 gMC->Gsatt("TSWC","COLO",3);
1080 gMC->Gsatt("TSCE","COLO",6);
79575d04 1081 gMC->Gsatt("TSCE","SEEN",1);
37831078 1082 gMC->Gsatt("TWES","SEEN",0);
1083 gMC->Gsatt("TSWB","SEEN",0);
1084 gMC->Gsatt("TPEL","SEEN",0);
1085 gMC->Gsatt("TPMW","SEEN",1);
37831078 1086 gMC->Gsatt("TESR","SEEN",1);
1087 gMC->Gsatt("TPMW","COLO",12);
37831078 1088 gMC->Gsatt("TIC1","COLO",5);
79575d04 1089 gMC->Gsatt("TOC1","COLO",5);
37831078 1090 gMC->Gsatt("TESB","SEEN",0);
37831078 1091 gMC->Gsatt("THVM","SEEN",1);
1092 gMC->Gsatt("THVM","COLO",11);
79575d04 1093 gMC->Gsatt("THVH","SEEN",0);
1094 gMC->Gsatt("TPSR","SEEN",0);
37831078 1095 gMC->Gsatt("THVL","SEEN",0);
79575d04 1096 gMC->Gsatt("THVC","SEEN",0);
37831078 1097 gMC->Gsatt("THVE","SEEN",0);
1098 gMC->Gsatt("THVR","SEEN",0);
79575d04 1099 gMC->Gsatt("TPSS","SEEN",0);
1100 gMC->Gsatt("TPUS","SEEN",0);
1101 gMC->Gsatt("TPLS","SEEN",0);
37831078 1102
1103 //
1104 gMC->Gdopt("hide", "on");
1105 gMC->Gdopt("shad", "on");
1106 gMC->Gsatt("*", "fill", 7);
1107 gMC->SetClipBox(".");
1108 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1109 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1110 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1111 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1112 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1113 gMC->DefaultRange();
1114 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1115 gMC->Gdhead(1111, "Time Projection Chamber");
1116 gMC->Gdman(18, 4, "MAN");
1117 gMC->Gdopt("hide","off");
1118}
1119
1120//_____________________________________________________________________________
1121void AliTPCv2::CreateMaterials()
1122{
1123 //
1124 // Define materials for version 2 of the Time Projection Chamber
1125 //
1126
1127 AliTPC::CreateMaterials();
1128}
1129
1130//_____________________________________________________________________________
1131void AliTPCv2::Init()
1132{
1133 //
1134 // Initialises version 2 of the TPC after that it has been built
1135 //
1136
1137 Int_t *idtmed = fIdtmed->GetArray();
1138
1139 AliTPC::Init();
d4c354b9 1140
c1637e41 1141
1142 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
d4c354b9 1143
c1637e41 1144 fIDrift=gMC->VolId("TPC_Drift");
1145 fSecOld=-100; // fake number
37831078 1146
1147 gMC->SetMaxNStep(30000); // max. number of steps increased
1148
1149 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
1150
f77f13c8 1151 AliInfo("*** TPC version 2 initialized ***");
1152 AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
37831078 1153
1154 //
fe4da5cc 1155
1156}
1157
1158//_____________________________________________________________________________
1159void AliTPCv2::StepManager()
1160{
1161 //
1162 // Called for every step in the Time Projection Chamber
1163 //
1164
1165 //
1166 // parameters used for the energy loss calculations
1167 //
73042f01 1168 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1169 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1170 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
fe4da5cc 1171
1172
73042f01 1173 const Float_t kbig = 1.e10;
fe4da5cc 1174
1175 Int_t id,copy;
e61fd20d 1176 Float_t hits[5];
fe4da5cc 1177 Int_t vol[2];
37831078 1178 TLorentzVector p;
fe4da5cc 1179
37831078 1180 vol[1]=0; // preset row number to 0
fe4da5cc 1181 //
73042f01 1182 gMC->SetMaxStep(kbig);
fe4da5cc 1183
0a6d8768 1184 if(!gMC->IsTrackAlive()) return; // particle has disappeared
fe4da5cc 1185
cfce8870 1186 Float_t charge = gMC->TrackCharge();
fe4da5cc 1187
1188 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1189
37831078 1190 // check the sensitive volume
1191
c1637e41 1192 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
1193 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
da33556f 1194
c1637e41 1195 gMC->TrackPosition(p);
1196 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1197 //
1198
1199 //
1200 Double_t angle = TMath::ACos(p[0]/r);
1201 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1202 //
1203 // angular segment, it is not a real sector number...
1204 //
1205 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1206 fTPCParam->GetInnerAngle());
1207 // rotate to segment "0"
1208 Float_t cos,sin;
1209 fTPCParam->AdjustCosSin(sector,cos,sin);
1210 Float_t x1=p[0]*cos + p[1]*sin;
1211 // check if within sector's limits
1212 if(x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp()
1213 ||x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp()){
1214 // calculate real sector number...
1215 if (x1>fTPCParam->GetOuterRadiusLow()){
1216 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1217 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1218 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
37831078 1219 }
c1637e41 1220 else
1221 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1222 //
1223 // here I have a sector number
1224 //
37831078 1225
c1637e41 1226 vol[0]=sector;
1227 // check if change of sector
1228 if(sector != fSecOld){
1229 fSecOld=sector;
1230 // add track reference
e6add757 1231 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
c1637e41 1232 }
1233 // track is in the sensitive strip
1234 if(id == fIdSens){
1235 // track is entering the strip
1236 if (gMC->IsTrackEntering()){
1237 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1238 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1239 // row numbers are autonomous for lower and upper sectors
1240 if(vol[0] > fTPCParam->GetNInnerSector()) {
1241 vol[1] -= fTPCParam->GetNRowLow();
1242 }
1243 //
1244 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
37831078 1245
c1637e41 1246 // lower sector, row 0, because Jouri wants to have this
37831078 1247
c1637e41 1248 gMC->TrackMomentum(p);
1249 hits[0]=p[0];
1250 hits[1]=p[1];
1251 hits[2]=p[2];
1252 hits[3]=0.; // this hit has no energy loss
1253 // Get also the track time for pileup simulation
1254 hits[4]=gMC->TrackTime();
6a905708 1255
c1637e41 1256 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1257 }
1258 //
e61fd20d 1259
c1637e41 1260 gMC->TrackPosition(p);
1261 hits[0]=p[0];
1262 hits[1]=p[1];
1263 hits[2]=p[2];
1264 hits[3]=0.; // this hit has no energy loss
1265 // Get also the track time for pileup simulation
1266 hits[4]=gMC->TrackTime();
930ee558 1267
c1637e41 1268 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
37831078 1269
c1637e41 1270 }
1271 else return;
1272 }
37831078 1273 //-----------------------------------------------------------------
c1637e41 1274 // charged particle is in the sensitive drift volume
37831078 1275 //-----------------------------------------------------------------
cfce8870 1276 if(gMC->TrackStep() > 0) {
c1637e41 1277
73042f01 1278 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
fe4da5cc 1279 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
c1637e41 1280 //
37831078 1281 gMC->TrackPosition(p);
1282 hits[0]=p[0];
1283 hits[1]=p[1];
1284 hits[2]=p[2];
fe4da5cc 1285 hits[3]=(Float_t)nel;
c1637e41 1286
fe4da5cc 1287 // Add this hit
c1637e41 1288
6a905708 1289 if (fHitType&&2){
1290 gMC->TrackMomentum(p);
1291 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1292 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1293 fTrackHits->SetHitPrecision(precision);
1294 }
e61fd20d 1295
1296 // Get also the track time for pileup simulation
1297 hits[4]=gMC->TrackTime();
c1637e41 1298
1299 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
e61fd20d 1300
c1637e41 1301 } // step>0
1302 } //within sector's limits
fe4da5cc 1303 // Stemax calculation for the next step
1304
1305 Float_t pp;
0a6d8768 1306 TLorentzVector mom;
1307 gMC->TrackMomentum(mom);
1308 Float_t ptot=mom.Rho();
73042f01 1309 Float_t betaGamma = ptot/gMC->TrackMass();
fe4da5cc 1310
69e40cce 1311 Int_t pid=gMC->TrackPid();
cc80f89e 1312 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
fe4da5cc 1313 {
73042f01 1314 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
fe4da5cc 1315 }
1316 else
1317 {
595bf2c3 1318
07521998 1319 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
595bf2c3 1320 pp=kprim*BetheBloch(betaGamma);
1321
fe4da5cc 1322 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1323 }
1324
b9d0a01d 1325 Double_t rnd = gMC->GetRandom()->Rndm();
fe4da5cc 1326
cfce8870 1327 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
fe4da5cc 1328
c1637e41 1329
fe4da5cc 1330}
1331
1332//_____________________________________________________________________________
1333Float_t AliTPCv2::BetheBloch(Float_t bg)
1334{
1335 //
1336 // Bethe-Bloch energy loss formula
1337 //
73042f01 1338 const Double_t kp1=0.76176e-1;
1339 const Double_t kp2=10.632;
1340 const Double_t kp3=0.13279e-4;
1341 const Double_t kp4=1.8631;
1342 const Double_t kp5=1.9479;
fe4da5cc 1343
1344 Double_t dbg = (Double_t) bg;
1345
1346 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1347
73042f01 1348 Double_t aa = TMath::Power(beta,kp4);
1349 Double_t bb = TMath::Power(1./dbg,kp5);
fe4da5cc 1350
73042f01 1351 bb=TMath::Log(kp3+bb);
fe4da5cc 1352
73042f01 1353 return ((Float_t)((kp2-aa-bb)*kp1/aa));
fe4da5cc 1354}
73042f01 1355
1356