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