]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Sim/AliTPCv2.cxx
Parameterization of the gas properties - Usage in the MC
[u/mrichter/AliRoot.git] / TPC / Sim / 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"
b40afa5e 38#include "AliMathBase.h"
e6add757 39#include "AliTrackReference.h"
73042f01 40#include "AliTPCParam.h"
4ed5dced 41#include "AliTPCTrackHitsV2.h"
116cbefd 42#include "AliTPCv2.h"
cdf69b9a 43#include "AliGeomManager.h"
c1637e41 44#include "TGeoVolume.h"
45#include "TGeoPcon.h"
46#include "TGeoTube.h"
c5d5037c 47#include "TGeoCone.h"
c1637e41 48#include "TGeoPgon.h"
49#include "TGeoTrd1.h"
50#include "TGeoCompositeShape.h"
51#include "TGeoPara.h"
1ac29fc4 52#include "TGeoPhysicalNode.h"
0f788f87 53#include "TGeoHalfSpace.h"
0f2ff24c 54#include "TTreeStream.h"
6c0ba48f 55#include "TGeoArb8.h"
1ac29fc4 56
a11596ad 57using std::ifstream;
58using std::ios_base;
566637aa 59
60extern "C"{
61 Gas gaspar_;
62};
c1637e41 63ClassImp(AliTPCv2)
64
65//_____________________________________________________________________________
66AliTPCv2::AliTPCv2(const char *name, const char *title) :
e046d791 67 AliTPC(name, title),
68 fIdSens(0),
69 fIDrift(0),
70 fSecOld(0)
c1637e41 71{
72 //
73 // Standard constructor for Time Projection Chamber version 2
74 //
6a905708 75
37831078 76
c1637e41 77 SetBufferSize(128000);
566637aa 78 if(!fTPCParam) {AliFatal("TPC parameters not set");
79 return;
80 }
81 gaspar_.fpot=fTPCParam->GetFpot();
82 gaspar_.eend=fTPCParam->GetEend();
83 gaspar_.eexpo=fTPCParam->GetExp();
84
79575d04 85
79575d04 86
c1637e41 87}
88
89//_____________________________________________________________________________
90void AliTPCv2::CreateGeometry()
91{
92 //
93 // Create the geometry of Time Projection Chamber version 2
94 //
95 //Begin_Html
96 /*
97 <img src="picts/AliTPC.gif">
98 */
99 //End_Html
100 //Begin_Html
101 /*
102 <img src="picts/AliTPCv2Tree.gif">
103 */
104 //End_Html
37831078 105
106 //----------------------------------------------------------
c1637e41 107 // This geometry is written using TGeo class
108 // Firstly the shapes are defined, and only then the volumes
109 // What is recognized by the MC are volumes
37831078 110 //----------------------------------------------------------
c1637e41 111 //
112 // tpc - this will be the mother volume
113 //
37831078 114
c1637e41 115 //
116 // here I define a volume TPC
117 // retrive the medium name with "TPC_" as a leading string
118 //
24c46a8e 119 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
c1637e41 120 //
24c46a8e 121 tpc->DefineSection(0,-289.6,77.,278.);
122 tpc->DefineSection(1,-262.1,77.,278.);
c1637e41 123 //
24c46a8e 124 tpc->DefineSection(2,-262.1,83.1,278.);
125 tpc->DefineSection(3,-260.,83.1,278.);
c1637e41 126 //
24c46a8e 127 tpc->DefineSection(4,-260.,70.,278.);
128 tpc->DefineSection(5,-259.6,70.,278.);
c1637e41 129 //
24c46a8e 130 tpc->DefineSection(6,-259.6,68.1,278.);
131 tpc->DefineSection(7,-253.6,68.1,278.);
c1637e41 132 //
c5d5037c 133 tpc->DefineSection(8,-253.6,67.88,278.);//hs
134 tpc->DefineSection(9,-74.0,60.68,278.);// hs
c1637e41 135 //
24c46a8e 136 tpc->DefineSection(10,-74.0,60.1,278.);
137 tpc->DefineSection(11,-73.3,60.1,278.);
c1637e41 138 //
24c46a8e 139 tpc->DefineSection(12,-73.3,56.9,278.);
140 tpc->DefineSection(13,-68.5,56.9,278.);
c1637e41 141 //
24c46a8e 142 tpc->DefineSection(14,-68.5,60.,278.);
143 tpc->DefineSection(15,-64.7,60.,278.);
78134e48 144 //
24c46a8e 145 tpc->DefineSection(16,-64.7,56.9,278.);
146 tpc->DefineSection(17,73.3,56.9,278.);
78134e48 147 //
24c46a8e 148 tpc->DefineSection(18,73.3,60.1,278.);
149 tpc->DefineSection(19,74.0,60.1,278.);
efe14311 150 //
c5d5037c 151 tpc->DefineSection(20,74.0,60.68,278.);// hs
152 tpc->DefineSection(21,253.6,65.38,278.);// hs
efe14311 153 //
24c46a8e 154 tpc->DefineSection(22,253.6,65.6,278.);
155 tpc->DefineSection(23,259.6,65.6,278.);
4fb9bd37 156 //
24c46a8e 157 tpc->DefineSection(24,259.6,70.0,278.);
158 tpc->DefineSection(25,260.,70.0,278.);
4fb9bd37 159 //
24c46a8e 160 tpc->DefineSection(26,260.,83.1,278.);
161 tpc->DefineSection(27,262.1,83.1,278.);
162 //
163 tpc->DefineSection(28,262.1,77.,278);
164 tpc->DefineSection(29,289.6,77.,278.);
c1637e41 165 //
166 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
167 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
168 //
169 // drift volume - sensitive volume, extended beyond the
170 // endcaps, because of the alignment
171 //
172 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
173 dvol->DefineSection(0,-260.,74.5,264.4);
174 dvol->DefineSection(1,-253.6,74.5,264.4);
175 //
176 dvol->DefineSection(2,-253.6,76.6774,258.);
177 dvol->DefineSection(3,253.6,76.6774,258.);
178 //
179 dvol->DefineSection(4,253.6,74.5,264.4);
180 dvol->DefineSection(5,260.,74.5,264.4);
181 //
a964d561 182 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_DriftGas2");
c1637e41 183 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
184 //
185 v1->AddNode(v9,1);
186 //
187 // outer insulator
188 //
189 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
190 //
191 tpco->DefineSection(0,-256.6,264.8,278.);
192 tpco->DefineSection(1,-253.6,264.8,278.);
193 //
194 tpco->DefineSection(2,-253.6,258.,278.);
195 tpco->DefineSection(3,250.6,258.,278.);
196 //
197 tpco->DefineSection(4,250.6,258.,275.5);
198 tpco->DefineSection(5,253.6,258.,275.5);
199 //
200 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
201 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
202 //
c449e944 203 TGeoRotation *segrot;//segment rotations
204 //
c1637e41 205 // outer containment vessel
206 //
207 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
208 //
209 tocv->DefineSection(0,-256.6,264.8,278.);
210 tocv->DefineSection(1,-253.6,264.8,278.);
211 //
212 tocv->DefineSection(2,-253.6,274.8124,278.);
213 tocv->DefineSection(3,247.6,274.8124,278.);
214 //
215 tocv->DefineSection(4,247.6,270.4,278.);
216 tocv->DefineSection(5,250.6,270.4,278.);
217 //
218 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
219 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
220 //
c449e944 221 TGeoTubeSeg *to1 = new TGeoTubeSeg(274.8174,277.995,252.1,0.,59.9); //epoxy
222 TGeoTubeSeg *to2 = new TGeoTubeSeg(274.8274,277.985,252.1,0.,59.9); //tedlar
223 TGeoTubeSeg *to3 = new TGeoTubeSeg(274.8312,277.9812,252.1,0.,59.9);//prepreg2
224 TGeoTubeSeg *to4 = new TGeoTubeSeg(274.9062,277.9062,252.1,0.,59.9);//nomex
225 TGeoTubeSeg *tog5 = new TGeoTubeSeg(274.8174,277.995,252.1,59.9,60.);//epoxy
c1637e41 226 //
227 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
228 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
229 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
230 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
231 //
6c0ba48f 232 TGeoMedium *smep = gGeoManager->GetMedium("TPC_Epoxy1");
233 //
c1637e41 234 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
235 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
236 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
237 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
c449e944 238 TGeoVolume *togv5 = new TGeoVolume("TPC_OCVG5",tog5,sm1);
c5d5037c 239 //
240 TGeoMedium *mhs = gGeoManager->GetMedium("TPC_Steel");
241 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
c449e944 242 //-------------------------------------------------------
c1637e41 243 // Tpc Outer Field Cage
244 // daughters - composite (sandwich)
245 //-------------------------------------------------------
37831078 246
c1637e41 247 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
248 //
249 tofc->DefineSection(0,-253.6,258.,269.6);
250 tofc->DefineSection(1,-250.6,258.,269.6);
251 //
252 tofc->DefineSection(2,-250.6,258.,260.0676);
253 tofc->DefineSection(3,250.6,258.,260.0676);
254 //
255 tofc->DefineSection(4,250.6,258.,275.5);
256 tofc->DefineSection(5,253.6,258.,275.5);
257 //
258 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
259 //sandwich
c449e944 260 TGeoTubeSeg *tf1 = new TGeoTubeSeg(258.0,260.0676,252.1,0.,59.9); //tedlar
261 TGeoTubeSeg *tf2 = new TGeoTubeSeg(258.0038,260.0638,252.1,0.,59.9); //prepreg3
262 TGeoTubeSeg *tf3 = new TGeoTubeSeg(258.0338,260.0338,252.1,0.,59.9);//nomex
263 TGeoTubeSeg *tfg4 = new TGeoTubeSeg(258.0,260.0676,252.1,59.9,60.); //epoxy glue
c1637e41 264 //
265 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
266 //
267 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
268 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
269 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
6c0ba48f 270 TGeoVolume *tfg4v = new TGeoVolume("TPC_OFCG4",tfg4,smep);
c1637e41 271 //
272 // outer part - positioning
273 //
c449e944 274 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);//ocv
275 //
276 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);//ofc
c1637e41 277 //
c449e944 278 TGeoVolumeAssembly *t200 = new TGeoVolumeAssembly("TPC_OCVSEG");
279 TGeoVolumeAssembly *t300 = new TGeoVolumeAssembly("TPC_OFCSEG");
c1637e41 280 //
c449e944 281 // assembly OCV and OFC
282 //
283 // 1st - no rotation
284 t200->AddNode(tov1,1); t200->AddNode(togv5,1);
285 t300->AddNode(tf1v,1); t300->AddNode(tfg4v,1);
286 // 2nd - rotation 60 deg
287 segrot = new TGeoRotation();
288 segrot->RotateZ(60.);
289 t200->AddNode(tov1,2,segrot); t200->AddNode(togv5,2,segrot);
290 t300->AddNode(tf1v,2,segrot); t300->AddNode(tfg4v,2,segrot);
291 // 3rd rotation 120 deg
292 segrot = new TGeoRotation();
293 segrot->RotateZ(120.);
294 t200->AddNode(tov1,3,segrot); t200->AddNode(togv5,3,segrot);
295 t300->AddNode(tf1v,3,segrot); t300->AddNode(tfg4v,3,segrot);
296 //4th rotation 180 deg
297 segrot = new TGeoRotation();
298 segrot->RotateZ(180.);
299 t200->AddNode(tov1,4,segrot); t200->AddNode(togv5,4,segrot);
300 t300->AddNode(tf1v,4,segrot); t300->AddNode(tfg4v,4,segrot);
301 //5th rotation 240 deg
302 segrot = new TGeoRotation();
303 segrot->RotateZ(240.);
304 t200->AddNode(tov1,5,segrot); t200->AddNode(togv5,5,segrot);
305 t300->AddNode(tf1v,5,segrot); t300->AddNode(tfg4v,5,segrot);
306 //6th rotation 300 deg
307 segrot = new TGeoRotation();
308 segrot->RotateZ(300.);
309 t200->AddNode(tov1,6,segrot); t200->AddNode(togv5,6,segrot);
310 t300->AddNode(tf1v,6,segrot); t300->AddNode(tfg4v,6,segrot);
311 //
312 v3->AddNode(t200,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(t300,1);
c1637e41 313 //
314 v2->AddNode(v3,1); v2->AddNode(v4,1);
315 //
316 v1->AddNode(v2,1);
317 //--------------------------------------------------------------------
318 // Tpc Inner INsulator (CO2)
319 // the cones, the central drum and the inner f.c. sandwich with a piece
320 // of the flane will be placed in the TPC
321 //--------------------------------------------------------------------
322 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
323 //
324 tpci->DefineSection(0,-253.6,68.4,76.6774);
325 tpci->DefineSection(1,-74.0,61.2,76.6774);
326 //
327 tpci->DefineSection(2,74.0,61.2,76.6774);
328 //
329 tpci->DefineSection(3,253.6,65.9,76.6774);
330 //
331 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
332 //
333 // now the inner field cage - only part of flanges (2 copies)
334 //
335 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
336 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
337 //
338 //---------------------------------------------------------
339 // Tpc Inner Containment vessel - Muon side
340 //---------------------------------------------------------
341 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
342 //
343 tcms->DefineSection(0,-259.1,68.1,74.2);
344 tcms->DefineSection(1,-253.6,68.1,74.2);
345 //
346 tcms->DefineSection(2,-253.6,68.1,68.4);
347 tcms->DefineSection(3,-74.0,60.9,61.2);
348 //
349 tcms->DefineSection(4,-74.0,60.1,61.2);
350 tcms->DefineSection(5,-73.3,60.1,61.2);
351 //
352 tcms->DefineSection(6,-73.3,56.9,61.2);
353 tcms->DefineSection(7,-73.0,56.9,61.2);
354 //
355 tcms->DefineSection(8,-73.0,56.9,58.8);
356 tcms->DefineSection(9,-71.3,56.9,58.8);
357 //
358 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
c5d5037c 359 //------------------------------------------------
360 // Heat screen muon side
361 //------------------------------------------------
362
363 TGeoCone *thsm = new TGeoCone(89.8,67.88,68.1,60.68,60.9);
364 TGeoCone *thsmw = new TGeoCone(89.8,67.94,68.04,60.74,60.84);
365 TGeoVolume *hvsm = new TGeoVolume("TPC_HSM",thsm,mhs); //steel
366 TGeoVolume *hvsmw = new TGeoVolume("TPC_HSMW",thsmw,m12); //water
367 // assembly heat screen muon
368 hvsm->AddNode(hvsmw,1);
c1637e41 369 //-----------------------------------------------
370 // inner containment vessel - shaft side
371 //-----------------------------------------------
372 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
373 //
374 tcss->DefineSection(0,71.3,56.9,58.8);
375 tcss->DefineSection(1,73.0,56.9,58.8);
376 //
377 tcss->DefineSection(2,73.0,56.9,61.2);
378 tcss->DefineSection(3,73.3,56.9,61.2);
379 //
380 tcss->DefineSection(4,73.3,60.1,61.2);
381 tcss->DefineSection(5,74.0,60.1,61.2);
382 //
383 tcss->DefineSection(6,74.0,60.9,61.2);
384 tcss->DefineSection(7,253.6,65.6,65.9);
385 //
386 tcss->DefineSection(8,253.6,65.6,74.2);
387 tcss->DefineSection(9,258.1,65.6,74.2);
388 //
389 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
c5d5037c 390 //-------------------------------------------------
391 // Heat screen shaft side
392 //--------------------------------------------------
393 TGeoCone *thss = new TGeoCone(89.8,60.68,60.9,65.38,65.6);
394 TGeoCone *thssw = new TGeoCone(89.8,60.74,60.84,65.44,65.54);
395 TGeoVolume *hvss = new TGeoVolume("TPC_HSS",thss,mhs); //steel
396 TGeoVolume *hvssw = new TGeoVolume("TPC_HSSW",thssw,m12); //water
397 //assembly heat screen shaft
398 hvss->AddNode(hvssw,1);
c1637e41 399 //-----------------------------------------------
400 // Inner field cage
401 // define 4 parts and make an assembly
402 //-----------------------------------------------
403 // part1 - Al - 2 copies
404 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
405 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
406 // sandwich - outermost parts - 2 copies
c1637e41 407 //
878dd3f2 408 // segment outermost
409 //
d56d7df1 410 TGeoTubeSeg *t2 = new TGeoTubeSeg(76.6774,78.845,74.175,350.,109.4); // tedlar 38 microns
411 TGeoTubeSeg *t3 = new TGeoTubeSeg(76.6812,78.8412,74.175,350.,109.4); // prepreg2 500 microns
412 TGeoTubeSeg *t4 = new TGeoTubeSeg(76.7312,78.7912,74.175,350.,109.4); // prepreg3 300 microns
413 TGeoTubeSeg *t5 = new TGeoTubeSeg(76.7612,78.7612,74.175,350.,109.4); // nomex 2 cm
414 TGeoTubeSeg *tepox1 = new TGeoTubeSeg(76.6774,78.845,74.175,109.4,110.);//epoxy
e079adac 415 TGeoTubeSeg *tpr1 = new TGeoTubeSeg(78.845,78.885,74.175,109.,111.);
878dd3f2 416
417 // volumes for the outer part
c1637e41 418 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
419 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
420 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
421 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
6c0ba48f 422 TGeoVolume *tvep1 = new TGeoVolume("TPC_IFEPOX1",tepox1,smep);
878dd3f2 423 TGeoVolume *tvpr1 = new TGeoVolume("TPC_PRSTR1",tpr1,sm2);
c1637e41 424 //
425 // middle parts - 2 copies
c1637e41 426 //
878dd3f2 427 // segment middle
428 //
d56d7df1 429 TGeoTubeSeg *t6 = new TGeoTubeSeg(76.6774,78.795,5.,350.,109.4); // tedlar 38 microns
430 TGeoTubeSeg *t7 = new TGeoTubeSeg(76.6812,78.7912,5.,350.,109.4); // prepreg2 250 microns
431 TGeoTubeSeg *t8 = new TGeoTubeSeg(76.7062,78.7662,5.,350.,109.4); // prepreg3 300 microns
432 TGeoTubeSeg *t9 = new TGeoTubeSeg(76.7362,78.7362,5.,350.,109.4); // nomex 2 cm
433 TGeoTubeSeg *tepox2 = new TGeoTubeSeg(76.6774,78.795,5.,109.4,110.);//epoxy
e079adac 434 TGeoTubeSeg *tpr2 = new TGeoTubeSeg(78.795,78.835,5.,109.,111.);
878dd3f2 435 // volumes for the middle part
c1637e41 436 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
437 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
438 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
439 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
6c0ba48f 440 TGeoVolume *tvep2 = new TGeoVolume("TPC_IFEPOX2",tepox2,smep);
878dd3f2 441 TGeoVolume *tvpr2 = new TGeoVolume("TPC_PRSTR2",tpr2,sm2);
c1637e41 442 // central part - 1 copy
878dd3f2 443 //
444 // segment central part
445 //
d56d7df1 446 TGeoTubeSeg *t10 = new TGeoTubeSeg(76.6774,78.785,93.75,350.,109.4); // tedlar 38 microns
447 TGeoTubeSeg *t11 = new TGeoTubeSeg(76.6812,78.7812,93.75,350.,109.4); // prepreg3 500 microns
448 TGeoTubeSeg *t12 = new TGeoTubeSeg(76.7312,78.7312,93.75,350.,109.4); // nomex 2 cm
449 TGeoTubeSeg *tepox3 = new TGeoTubeSeg(76.6774,78.785,93.75,109.4,110.);//epoxy
e079adac 450 TGeoTubeSeg *tpr3 = new TGeoTubeSeg(78.785,78.825,93.75,109.,111.);
878dd3f2 451 // volumes for the central part
c1637e41 452 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
453 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
454 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
6c0ba48f 455 TGeoVolume *tvep3 = new TGeoVolume("TPC_IFEPOX3",tepox3,smep);
878dd3f2 456 TGeoVolume *tvpr3 = new TGeoVolume("TPC_PRSTR3",tpr3,sm2);
c1637e41 457 //
878dd3f2 458 // creating a sandwich for the outer par,t tv2 is the mother
c1637e41 459 //
c1637e41 460 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
461 //
878dd3f2 462 // creating a sandwich for the middle part, tv6 is the mother
463 //
c1637e41 464 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
465 //
878dd3f2 466 // creating a sandwich for the central part, tv10 is the mother
467 //
c1637e41 468 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
469 //
878dd3f2 470 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC"); // ifc itself - 3 segments
878dd3f2 471
c1637e41 472 //
878dd3f2 473 // first segment - no rotation
474 //
475 // central
476 tv100->AddNode(tv10,1); //sandwich
477 tv100->AddNode(tvep3,1);//epoxy
478 tv100->AddNode(tvpr3,1);//prepreg strip
479 // middle
480 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75)); //sandwich1
481 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75)); // sandwich2
482 tv100->AddNode(tvep2,1,new TGeoTranslation(0.,0.,-98.75)); //epoxy
483 tv100->AddNode(tvep2,2,new TGeoTranslation(0.,0.,98.75)); //epoxy
484 tv100->AddNode(tvpr2,1,new TGeoTranslation(0.,0.,-98.75));//prepreg strip
485 tv100->AddNode(tvpr2,2,new TGeoTranslation(0.,0.,98.75));
486 // outer
487 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925)); //sandwich
c1637e41 488 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
878dd3f2 489 tv100->AddNode(tvep1,1,new TGeoTranslation(0.,0.,-177.925)); //epoxy
490 tv100->AddNode(tvep1,2,new TGeoTranslation(0.,0.,177.925));
491 tv100->AddNode(tvpr1,1,new TGeoTranslation(0.,0.,-177.925));//prepreg strip
492 tv100->AddNode(tvpr1,2,new TGeoTranslation(0.,0.,-177.925));
493 //
494 // second segment - rotation 120 deg.
495 //
496 segrot = new TGeoRotation();
497 segrot->RotateZ(120.);
498 //
499 // central
500 tv100->AddNode(tv10,2,segrot); //sandwich
501 tv100->AddNode(tvep3,2,segrot);//epoxy
502 tv100->AddNode(tvpr3,2,segrot);//prepreg strip
503 // middle
504 tv100->AddNode(tv6,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
505 tv100->AddNode(tv6,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
506 tv100->AddNode(tvep2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
507 tv100->AddNode(tvep2,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
508 tv100->AddNode(tvpr2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
509 tv100->AddNode(tvpr2,4,new TGeoCombiTrans(0.,0.,98.75,segrot));
510 //outer
511 tv100->AddNode(tv2,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
512 tv100->AddNode(tv2,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
513 tv100->AddNode(tvep1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
514 tv100->AddNode(tvep1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
515 tv100->AddNode(tvpr1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
516 tv100->AddNode(tvpr1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
517 //
518 // third segment - rotation 240 deg.
519 //
520 segrot = new TGeoRotation();
521 segrot->RotateZ(240.);
522 //
523 // central
524 tv100->AddNode(tv10,3,segrot); //sandwich
525 tv100->AddNode(tvep3,3,segrot);//epoxy
526 tv100->AddNode(tvpr3,3,segrot);//prepreg strip
527 // middle
528 tv100->AddNode(tv6,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
529 tv100->AddNode(tv6,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
530 tv100->AddNode(tvep2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
531 tv100->AddNode(tvep2,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
532 tv100->AddNode(tvpr2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
533 tv100->AddNode(tvpr2,6,new TGeoCombiTrans(0.,0.,98.75,segrot));
534 //outer
535 tv100->AddNode(tv2,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
536 tv100->AddNode(tv2,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
537 tv100->AddNode(tvep1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
538 tv100->AddNode(tvep1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
539 tv100->AddNode(tvpr1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
540 tv100->AddNode(tvpr1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
541 // Al parts - rings
c1637e41 542 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
543 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
544 //
545 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
546 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
547 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
c5d5037c 548 v1->AddNode(hvsm,1,new TGeoTranslation(0.,0.,-163.8));
549 v1->AddNode(hvss,1,new TGeoTranslation(0.,0.,163.8));
c1637e41 550 v9->AddNode(tv100,1);
551 //
552 // central drum
553 //
554 // flange + sandwich
555 //
556 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
557 cfl->DefineSection(0,-71.1,59.7,61.2);
558 cfl->DefineSection(1,-68.6,59.7,61.2);
559 //
efbf94c5 560 cfl->DefineSection(2,-68.6,60.6124,61.2);
561 cfl->DefineSection(3,68.6,60.6124,61.2);
c1637e41 562 //
563 cfl->DefineSection(4,68.6,59.7,61.2);
564 cfl->DefineSection(5,71.1,59.7,61.2);
565 //
566 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
567 // sandwich
cc8d387d 568 TGeoTubeSeg *cd1 = new TGeoTubeSeg(60.6224,61.19,71.1,0.2,119.2);
569 TGeoTubeSeg *cd2 = new TGeoTubeSeg(60.6262,61.1862,71.1,0.2,119.2);
570 TGeoTubeSeg *cd3 = new TGeoTubeSeg(60.6462,61.1662,71.1,0.2,119.2);
571 TGeoTubeSeg *cd4 = new TGeoTubeSeg(60.6562,61.1562,71.1,0.2,119.2);
572 TGeoTubeSeg *tepox4 = new TGeoTubeSeg(60.6224,61.19,71.1,359.8,0.8);
c1637e41 573 //
574 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
efbf94c5 575 TGeoMedium *sm8 = gGeoManager->GetMedium("TPC_Epoxyfm");
c1637e41 576 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
577 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
efbf94c5 578 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm8); //epoxy film
579 TGeoVolume *cd4v = new TGeoVolume("TPC_CDR4",cd4,sm4); //nomex
6c0ba48f 580 TGeoVolume *tvep4 = new TGeoVolume("TPC_IFEPOX4",tepox4,smep);
efbf94c5 581
c1637e41 582 //
583 // seals for central drum 2 copies
584 //
585 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
586 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
587 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
3378c058 588 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
589 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
c1637e41 590 //
591 // seal collars
592 TGeoPcon *se = new TGeoPcon(0.,360.,6);
593 se->DefineSection(0,-72.8,59.7,61.2);
594 se->DefineSection(1,-72.3,59.7,61.2);
595 //
596 se->DefineSection(2,-72.3,58.85,61.2);
597 se->DefineSection(3,-71.6,58.85,61.2);
598 //
599 se->DefineSection(4,-71.6,59.7,61.2);
600 se->DefineSection(5,-71.3,59.7,61.2);
601 //
602 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
603 //
604 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
605 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
606 //
607 // define reflection matrix
608 //
4fa47888 609 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
c1637e41 610 //
d56d7df1 611 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cd3v->AddNode(cd4v,1); //sandwich
612 // first segment
613 cflv->AddNode(cd1v,1); cflv->AddNode(tvep4,1);
614 // second segment
615 segrot = new TGeoRotation();
616 segrot->RotateZ(120.);
617 cflv->AddNode(cd1v,2,segrot); cflv->AddNode(tvep4,2,segrot);
618 // third segment
619 segrot = new TGeoRotation();
620 segrot->RotateZ(240.);
621 cflv->AddNode(cd1v,3,segrot); cflv->AddNode(tvep4,3,segrot);
c1637e41 622 //
a1ec4d07 623 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
624 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
c1637e41 625 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
626 //
627 // central membrane - 2 rings and a mylar membrane - assembly
628 //
cf84f9b1 629 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
630 TGeoTube *oh = new TGeoTube(250.,256.,0.5);
4236db1b 631 TGeoTube *mem = new TGeoTube(84.05,250.,0.00115);
c449e944 632
633 //
634 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
635 //
c1637e41 636 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
637 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
c449e944 638
c1637e41 639 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
640 //
641 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
642 cm->AddNode(ihv,1);
643 cm->AddNode(ohv,1);
644 cm->AddNode(memv,1);
c449e944 645
c1637e41 646 v9->AddNode(cm,1);
647 //
648 // end caps - they are make as an assembly of single segments
649 // containing both readout chambers
650 //
d899e254 651 Double_t openingAngle = 10.*TMath::DegToRad();
c1637e41 652 Double_t thick=1.5; // rib
d899e254 653 Double_t shift = thick/TMath::Sin(openingAngle);
c1637e41 654 //
d899e254 655 Double_t lowEdge = 86.3; // hole in the wheel
656 Double_t upEdge = 240.4; // hole in the wheel
c1637e41 657 //
658 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
659 //
660 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
661 //
d899e254 662 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
663 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
c1637e41 664 //
d899e254 665 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
666 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
c1637e41 667 //
d899e254 668 Double_t ys = shift*TMath::Sin(openingAngle);
669 Double_t xs = shift*TMath::Cos(openingAngle);
c1637e41 670 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
671 tr->RegisterYourself();
672 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
673 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
674 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
675 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
676 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
677 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
678 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
679 //
680 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
681 //
682 // readout chambers
683 //
684 // IROC first
685 //
686 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
687 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
688 // empty space
689 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
690 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
691 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
692 //bars
693 Double_t tga = (19.8328-12.3742)/39.3;
694 Double_t xmin,xmax;
695 xmin = 9.55*tga+12.3742;
696 xmax = 9.95*tga+12.3742;
697 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
698 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
699 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
700 xmin=19.4*tga+12.3742;
701 xmax=19.9*tga+12.3742;
702 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
703 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
704 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
705 xmin=29.35*tga+12.3742;
706 xmax=29.75*tga+12.3742;
707 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
708 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
709 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
710 //
711 // holes for connectors
712 //
713 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
714 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
d9e80aca 715 TString fileName(gSystem->Getenv("ALICE_ROOT"));
716 fileName += "/TPC/conn_iroc.dat";
c1637e41 717 ifstream in;
d9e80aca 718 in.open(fileName.Data(), ios_base::in); // asci file
2d1d58a6 719 TGeoRotation *rrr[86];
c1637e41 720 for(Int_t i =0;i<86;i++){
456cb019 721 Double_t y = 3.99;
c1637e41 722 Double_t x,z,ang;
723 in>>x>>z>>ang;
456cb019 724 z-=26.5;
2d1d58a6 725 rrr[i]= new TGeoRotation();
726 rrr[i]->RotateY(ang);
727 ibdv->AddNode(connv,i+1,new TGeoCombiTrans(x,y,z,rrr[i]));
c1637e41 728 }
729 in.close();
730 // "cap"
731 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
732 // "hole"
733 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
734 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
735 tr1->RegisterYourself();
736 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
737 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
738 //
739 // pad plane and wire fixations
740 //
741 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
c1637e41 742 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
743 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
744 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
745 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
746 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
747 //
748 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
749 //
750 iroc->AddNode(ibdv,1);
751 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
752 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
753 tga =(23.3521-14.5974)/49.65;
754 Double_t xx = 24.825*tga+14.5974-0.6;
755 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
756 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
757 //
758 // OROC
759 //
760 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
761 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
762 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
763 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
764 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
765 //horizontal bars
766 tga=(38.5084-20.2938)/99.3;
767 xmin=tga*10.2+20.2938;
768 xmax=tga*10.6+20.2938;
769 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
770 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
771 //
772 xmin=22.55*tga+20.2938;
773 xmax=24.15*tga+20.2938;
774 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
775 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
776 //
777 xmin=36.1*tga+20.2938;
778 xmax=36.5*tga+20.2938;
779 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
780 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
781 //
782 xmin=49.0*tga+20.2938;
783 xmax=50.6*tga+20.2938;
784 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
785 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
786 //
787 xmin=63.6*tga+20.2938;
788 xmax=64.0*tga+20.2938;
789 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
790 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
791 //
792 xmin=75.5*tga+20.2938;
793 xmax=77.15*tga+20.2938;
794 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
795 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
796 //
797 xmin=88.7*tga+20.2938;
798 xmax=89.1*tga+20.2938;
799 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
800 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
801 //
802 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
803 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
804 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
805 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
806 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
807 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
808 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
809 // vertical bars
810 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
811 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
812 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
813 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
814 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
815 //
816 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
817 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
818 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
819 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
820 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
821 //
822 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
823 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
824 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
825 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
826 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
827 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
828 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
829 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
830 //
831 // holes for connectors
832 //
d9e80aca 833 fileName = gSystem->Getenv("ALICE_ROOT");
834 fileName += "/TPC/conn_oroc.dat";
835 in.open(fileName.Data(), ios_base::in); // asci file
2d1d58a6 836 TGeoRotation *rr[78];
c1637e41 837 for(Int_t i =0;i<78;i++){
838 Double_t y =3.89;
839 Double_t x,z,ang;
840 Double_t x1,z1,x2,z2;
841 in>>x>>z>>ang;
842 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
843 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
844 //
845 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
846 //
2d1d58a6 847 rr[i]= new TGeoRotation();
848 rr[i]->RotateY(ang);
c1637e41 849 z1-=54.95;
850 z2-=54.95;
5f174279 851 //
2d1d58a6 852 obdv->AddNode(connv,i+1,new TGeoCombiTrans(x1,y,z1,rr[i]));
853 obdv->AddNode(connv,i+79,new TGeoCombiTrans(x2,y,z2,rr[i]));
c1637e41 854 }
855 in.close();
856 // cap
857 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
858 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
859 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
860 tr5->RegisterYourself();
861 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
862 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
863 //
864 // pad plane and wire fixations
865 //
866 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
867 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
868 //
869 tga=(43.5239-23.3874)/114.2;
870 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
871 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
872 xx = 57.1*tga+23.3874-0.7;
873 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
874 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
875 //
876 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
877 //
878 oroc->AddNode(obdv,1);
879 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
880 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
881 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
882 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
883 //
884 // now iroc and oroc are placed into a sector...
885 //
a1ec4d07 886 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
887 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
c1637e41 888 TGeoRotation rot1("rot1",90.,90.,0.);
889 TGeoRotation rot2("rot2");
890 rot2.RotateY(10.);
891 TGeoRotation *rot = new TGeoRotation("rot");
892 *rot=rot1*rot2;
893 //
894 Double_t x0,y0;
d899e254 895 x0=110.2*TMath::Cos(openingAngle);
896 y0=110.2*TMath::Sin(openingAngle);
1bae4c82 897 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
898 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
d899e254 899 x0=188.45*TMath::Cos(openingAngle);
900 y0=188.45*TMath::Sin(openingAngle);
1bae4c82 901 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
902 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
c1637e41 903 //
c1637e41 904 //
a1ec4d07 905 // A-side
c1637e41 906 //
a1ec4d07 907 secta->AddNode(ch,1);
908 secta->AddNode(iroc,1,combi1a);
909 secta->AddNode(oroc,1,combi2a);
910 //
911 // C-side
912 //
913 sectc->AddNode(ch,1);
914 sectc->AddNode(iroc,1,combi1c);
915 sectc->AddNode(oroc,1,combi2c);
916 //
917 // now I try to make wheels...
918 //
919 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
920 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
c1637e41 921 //
5f174279 922 TGeoRotation *rwh[18];
c1637e41 923 for(Int_t i =0;i<18;i++){
924 Double_t phi = (20.*i);
5f174279 925 rwh[i]=new TGeoRotation();
926 rwh[i]->RotateZ(phi);
927 wheela->AddNode(secta,i+1,rwh[i]);
928 wheelc->AddNode(sectc,i+1,rwh[i]);
79575d04 929
c1637e41 930 }
4fa47888 931 // wheels in the drift volume!
a1ec4d07 932
c1637e41 933 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
a1ec4d07 934 v9->AddNode(wheela,1,combi3);
935 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
c1637e41 936 //_____________________________________________________________
937 // service support wheel
938 //_____________________________________________________________
939 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
940 sw->DefineSection(0,-4.,80.5,251.75);
941 sw->DefineSection(1,4.,80.5,251.75);
942 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
943 //
944 thick=1.;
d899e254 945 shift = thick/TMath::Sin(openingAngle);
c1637e41 946 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
947 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
948 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
949 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
950 //
74518339 951 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
952 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
953 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
954 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
955 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
956 //
957 shv->AddNode(elv,1);
958 //
959 //
d899e254 960 ys = shift*TMath::Sin(openingAngle);
961 xs = shift*TMath::Cos(openingAngle);
c1637e41 962 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
963 // cover
964 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
965 co->DefineSection(0,-0.5,77.,255.25);
966 co->DefineSection(1,0.5,77.,255.25);
967 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
968 // hole in a cover
969 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
d899e254 970 shift=4./TMath::Sin(openingAngle);
c1637e41 971 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
972 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
973 //
974 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
975 //
d899e254 976 ys = shift*TMath::Sin(openingAngle);
977 xs = shift*TMath::Cos(openingAngle);
c1637e41 978 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
979 //
980 // Sector as an Assembly
981 //
982 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
983 swhs->AddNode(swv,1);
984 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
985 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
986 //
987 // SSW as an Assembly of sectors
988 //
5f174279 989 TGeoRotation *rsw[18];
990 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
c1637e41 991 for(Int_t i =0;i<18;i++){
992 Double_t phi = (20.*i);
5f174279 993 rsw[i] = new TGeoRotation();
994 rsw[i]->RotateZ(phi);
995 swheel->AddNode(swhs,i+1,rsw[i]);
c1637e41 996 }
997 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
998 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
999
1000 // sensitive strips - strip "0" is always set
1001 // conditional
1002 Int_t totrows;
1003 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
1004 Double_t *upar;
1005 upar=NULL;
1006 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
1007 upar=new Double_t [10];
1008 upar[0]=0.;
1009 upar[1]=360.;
1010 upar[2]=18.;
1011 upar[3]=2.;
1012 //
1013 upar[4]=-124.8;
1014 upar[7]=124.8;
1015
1016 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
1017
1018 upar[5]=rlow;
1019 upar[6]=rlow+.01;
1020 upar[8]=upar[5];
1021 upar[9]=upar[6];
1022 //
1023 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1024 gGeoManager->Node("TPC_Strip",totrows+1,
1025 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1026 //
1027 // now, strips optionally
1028 //
1029 if(fSens){
1030 //lower sectors
1031 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
1032 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
1033 upar[5]=rlow;
1034 upar[6]=rlow+.01;
1035 upar[8]=upar[5];
1036 upar[9]=upar[6];
1037 gGeoManager->Node("TPC_Strip",i,
1038 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1039 gGeoManager->Node("TPC_Strip",totrows+i,
1040 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1041 }
1042 //upper sectors
1043 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
1044 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
1045 upar[5]=rlow;
1046 upar[6]=rlow+.01;
1047 upar[8]=upar[5];
1048 upar[9]=upar[6];
1049 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
1050 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1051 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
1052 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1053 }
1054 }//strips
37831078 1055 //----------------------------------------------------------
0f788f87 1056 // TPC Support Rods - MAKROLON
37831078 1057 //----------------------------------------------------------
c1637e41 1058 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
1059 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
78134e48 1060 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
c5d5037c 1061 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");;
0f788f87 1062 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
eea68010 1063 TGeoMedium *m14 = gGeoManager->GetMedium("TPC_Alumina1");
0f788f87 1064 //
1065 // tpc rod is an assembly of 10 long parts and 2 short parts
1066 // connected with alu rings and plagged on both sides.
79575d04 1067 //
c1637e41 1068 //
cc8d387d 1069 // tpc rod long
1070 //
0f788f87 1071 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
1072 rod->DefineSection(0,-10.43,1.92,2.08);
1073 rod->DefineSection(1,-9.75,1.92,2.08);
1074
1075 rod->DefineSection(2,-9.75,1.8,2.2);
1076 rod->DefineSection(3,9.75,1.8,2.2);
1077
1078 rod->DefineSection(4,9.75,1.92,2.08);
1079 rod->DefineSection(5,10.43,1.92,2.08);
1080 //
1081 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
1082 //
1083 // tpc rod short
1084 //
1085 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
1086 rod1->DefineSection(0,-8.93,1.92,2.08);
1087 rod1->DefineSection(1,-8.25,1.92,2.08);
1088
1089 rod1->DefineSection(2,-8.25,1.8,2.2);
1090 rod1->DefineSection(3,8.25,1.8,2.2);
1091
1092 rod1->DefineSection(4,8.25,1.92,2.08);
1093 rod1->DefineSection(5,8.93,1.92,2.08);
1094 //
1095 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
1096 //
1097 // below is for the resistor rod
1098 //
1099 // hole for the brass connectors
1100 //
1101
1102 new TGeoTube("hhole",0.,0.3,0.3);
1103 //
1104 //transformations for holes - initialy they
1105 // are placed at x=0 and negative y
1106 //
1107 TGeoRotation *rhole = new TGeoRotation();
1108 rhole->RotateX(90.);
1109 TGeoCombiTrans *transf[13];
1110 Char_t name[30];
1111 for(Int_t i=0;i<13;i++){
94e6c6f4 1112 //sprintf(name,"transf%d",i);
1113 snprintf(name,30,"transf%d",i);
0f788f87 1114 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
1115 transf[i]->RegisterYourself();
1116 }
1117 // union expression for holes
1118 TString operl("hhole:transf0");
1119 for (Int_t i=1;i<13;i++){
94e6c6f4 1120 //sprintf(name,"+hhole:transf%d",i);
1121 snprintf(name,30,"+hhole:transf%d",i);
0f788f87 1122 operl.Append(name);
1123 }
78134e48 1124 //
0f788f87 1125 TString opers("hhole:transf1");
1126 for (Int_t i=2;i<12;i++){
94e6c6f4 1127 //sprintf(name,"+hhole:transf%d",i);
1128 snprintf(name,30,"+hhole:transf%d",i);
0f788f87 1129 opers.Append(name);
1130 }
1131 //union of holes
1132 new TGeoCompositeShape("hlv",operl.Data());
1133 new TGeoCompositeShape("hsv",opers.Data());
1134 //
1135 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
1136 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
1137 //rods - volumes - makrolon rods with holes
1138 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
1139 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
1140 //brass connectors
1141 //connectors
1142 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
1143 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
1144 //
1145 // hooks holding strips
1146 //
1147 new TGeoBBox("hk1",0.625,0.015,0.75);
1148 new TGeoBBox("hk2",0.625,0.015,0.15);
1149 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
1150 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
1151 tr21->RegisterYourself();
1152 tr12->RegisterYourself();
1153
1154 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
1155 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
1156 //
1157 // assembly of the short rod with connectors and hooks
1158 //
1159 //
1160 // short rod
1161 //
1162 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1163 //
1164 spart->AddNode( rodsv,1);
1165 for(Int_t i=1;i<12;i++){
1166 spart->AddNode(bconv,i,transf[i]);
1167 }
1168 for(Int_t i =0;i<11;i++){
ceb660a9 1169 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
0f788f87 1170 }
1171 //
1172 // long rod
1173 //
1174 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1175 //
1176 lpart->AddNode( rodlv,1);
1177 for(Int_t i=0;i<13;i++){
ceb660a9 1178 lpart->AddNode(bconv,i+12,transf[i]);
0f788f87 1179 }
1180 for(Int_t i =0;i<13;i++){
ceb660a9 1181 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
0f788f87 1182 }
1183 //
1184 // alu ring
1185 //
1186 new TGeoTube("ring1",2.1075,2.235,0.53);
1187 new TGeoTube("ring2",1.7925,1.89,0.43);
1188 new TGeoTube("ring3",1.89,2.1075,0.05);
1189 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1190 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1191 //
1192 // rod assembly
1193 //
ceb660a9 1194 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
0f788f87 1195 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1196 //long pieces
1197 for(Int_t i=0;i<11;i++){
ceb660a9 1198 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
0f788f87 1199 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1200 }
1201 for(Int_t i=0;i<10;i++){
6c0ba48f 1202 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//resistor rod
1203 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));//makrolon rod
0f788f87 1204 }
78134e48 1205 //
6c0ba48f 1206 // right plug - identical for all rods
1207 //
1208 TGeoPcon *tpcrp = new TGeoPcon(0.,360.,6);
1209 //
1210 tpcrp->DefineSection(0,123.05,1.89,2.1075);
1211 tpcrp->DefineSection(1,123.59,1.89,2.1075);
1212 //
1213 tpcrp->DefineSection(2,123.59,1.8,2.2);
1214 tpcrp->DefineSection(3,127.,1.8,2.2);
1215 //
1216 tpcrp->DefineSection(4,127.,0.,2.2);
1217 tpcrp->DefineSection(5,127.5,0.,2.2);
1218 //
1219 TGeoVolume *tpcrpv = new TGeoVolume("TPC_RP",tpcrp,m6);
1220 //
1221 // adding short pieces and right plug
78134e48 1222 //
ceb660a9 1223 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1224 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1225 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1226 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
6c0ba48f 1227 tpcrrod->AddNode(tpcrpv,1);
78134e48 1228 //
0f788f87 1229 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1230 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1231 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1232 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
6c0ba48f 1233 tpcmrod->AddNode(tpcrpv,2);
78134e48 1234 //
6c0ba48f 1235 // from the ringv position to the CM is 3.0 cm!
1236 //----------------------------------------
78134e48 1237 //
78134e48 1238 //
6c0ba48f 1239 //HV rods - makrolon + 0.58cm (diameter) Cu ->check the length
1240 TGeoTube *hvr = new TGeoTube(0.,1.465,123.);
1241 TGeoTube *hvc = new TGeoTube(0.,0.29,123.);
0f788f87 1242 //
1243 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1244 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1245 hvrv->AddNode(hvcv,1);
78134e48 1246 //
0f788f87 1247 //resistor rod
1248 //
6c0ba48f 1249 TGeoTube *cr = new TGeoTube(0.,0.45,123.);
1250 TGeoTube *cw = new TGeoTube(0.,0.15,123.);
0f788f87 1251 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
ceb660a9 1252 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
0f788f87 1253 //
1254 // ceramic rod with water
1255 //
1256 crv->AddNode(cwv,1);
1257 //
1258 //peek rod
1259 //
6c0ba48f 1260 TGeoTube *pr =new TGeoTube(0.2,0.35,123.);
ceb660a9 1261 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
0f788f87 1262 //
1263 // copper plates with connectors
1264 //
1265 new TGeoTube("tub",0.,1.7,0.025);
1266 //
1267 // half space - points on the plane and a normal vector
1268 //
1269 Double_t n[3],p[3];
1270 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1271 Double_t intp = 1.245;
1272 //
1273 Double_t b = slope*slope+1.;
1274 p[0]=intp*slope/b;
1275 p[1]=-intp/b;
1276 p[2]=0.;
1277 //
1278 n[0]=-p[0];
1279 n[1]=-p[1];
1280 n[2]=0.;
1281 Double_t norm;
1282 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1283 n[0] /= norm;
1284 n[1] /=norm;
1285 //
1286 new TGeoHalfSpace("sp1",p,n);
1287 //
1288 slope = -slope;
1289 //
1290 p[0]=intp*slope/b;
1291 p[1]=-intp/b;
1292 //
1293 n[0]=-p[0];
1294 n[1]=-p[1];
1295 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1296 n[0] /= norm;
1297 n[1] /=norm;
1298 //
1299 new TGeoHalfSpace("sp2",p,n);
1300 // holes for rods
1301 //holes
1302 new TGeoTube("h1",0.,0.5,0.025);
1303 new TGeoTube("h2",0.,0.35,0.025);
1304 //translations:
1305 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1306 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1307 ttr11->RegisterYourself();
1308 ttr22->RegisterYourself();
1309 // elastic connector
1310 new TGeoBBox("elcon",0.72,0.005,0.3);
1311 TGeoRotation *crr1 = new TGeoRotation();
1312 crr1->RotateZ(-22.);
1313TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1314ctr1->RegisterYourself();
1315 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1316"(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1317 //
1318 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1319 //
1320 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1321 // and resistors
1322 //
ceb660a9 1323 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
0f788f87 1324 // rods
1325 rrod->AddNode(crv,1,ttr11);
1326 rrod->AddNode(crv,2,ttr22);
1327 rrod->AddNode(prv,1);
1328 //Cu plates
1329 for(Int_t i=0;i<165;i++){
1330 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1331 }
1332 //resistors
1333 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
cc8d387d 1334 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m14);
0f788f87 1335 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1336 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1337 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1338 //
1339 TGeoRotation *crr2 = new TGeoRotation();
1340 crr2->RotateY(30.);
1341 TGeoRotation *crr3 = new TGeoRotation();
1342 crr3->RotateY(-30.);
1343 //
1344 for(Int_t i=0;i<164;i+=2){
1345 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1346 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1347 }
ceb660a9 1348
d00b3fc6 1349 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
6c0ba48f 1350 //
1351 // rod left head with holders - inner
1352 //
1353 // first element - support for inner holder TPC_IHS
1354 Double_t shift1[3] = {0.0,-0.175,0.0};
1355
1356new TGeoBBox("tpcihs1", 4.7, 0.66, 2.35);
1357new TGeoBBox("tpcihs2", 4.7, 0.485, 1.0, shift1);
1358new TGeoBBox("tpcihs3", 1.5, 0.485, 2.35, shift1);
1359new TGeoTube("tpcihs4", 0.0, 2.38, 0.1);
1360//
1361Double_t pointstrap[16];
1362pointstrap[0]= 0.0;
1363pointstrap[1]= 0.0;
1364pointstrap[2]= 0.0;
1365pointstrap[3]= 1.08;
1366pointstrap[4]= 2.3;
1367pointstrap[5]= 1.08;
1368pointstrap[6]= 3.38;
1369pointstrap[7]= 0.0;
1370pointstrap[8]= 0.0;
1371pointstrap[9]= 0.0;
1372pointstrap[10]= 0.0;
1373pointstrap[11]= 1.08;
1374pointstrap[12]= 2.3;
1375pointstrap[13]= 1.08;
1376pointstrap[14]= 3.38;
1377pointstrap[15]= 0.0;
1378//
1379TGeoArb8 *tpcihs5 = new TGeoArb8("tpcihs5", 0.6, pointstrap);
1380//
1381// half space - cutting "legs"
1382//
1383 p[0]=0.0;
1384 p[1]=0.105;
1385 p[2]=0.0;
1386 //
1387n[0] = 0.0;
1388n[1] = 1.0;
1389n[2] = 0.0;
1390
1391new TGeoHalfSpace("cutil1", p, n);
1392
1393//
1394// transformations
1395//
1396TGeoTranslation *trans2 = new TGeoTranslation("trans2", 0.0, 2.84, 2.25);
1397trans2->RegisterYourself();
1398TGeoTranslation*trans3= new TGeoTranslation("trans3", 0.0, 2.84, -2.25);
1399trans3->RegisterYourself();
1400//support - composite volume
1401//
1402TGeoCompositeShape *tpcihs6 = new TGeoCompositeShape("tpcihs6", "tpcihs1-(tpcihs2+tpcihs3)-(tpcihs4:trans2)-(tpcihs4:trans3)-cutil1");
1403//
1404// volumes - all makrolon
1405//
1406 TGeoVolume *tpcihss = new TGeoVolume("TPC_IHSS", tpcihs6, m6); //support
1407 TGeoVolume *tpcihst = new TGeoVolume("TPC_IHSTR",tpcihs5 , m6); //trapesoid
1408 //now assembly
1409TGeoRotation *rot111 = new TGeoRotation();
1410rot111->RotateY(180.0);
1411//
1412TGeoVolumeAssembly *tpcihs = new TGeoVolumeAssembly("TPC_IHS"); // assembly of the support
1413tpcihs->AddNode(tpcihss, 1);
1414tpcihs->AddNode(tpcihst, 1, new TGeoTranslation(-4.7, 0.66, 0.0));
1415tpcihs->AddNode(tpcihst, 2, new TGeoCombiTrans(4.7, 0.66, 0.0, rot111));
1416//
1417// two rod holders (TPC_IRH) assembled with the support
1418//
1419new TGeoBBox("tpcirh1", 4.7, 1.33, 0.5);
1420 shift1[0]=-3.65;
1421 shift1[1]=0.53;
1422 shift1[2]=0.;
1423new TGeoBBox("tpcirh2", 1.05, 0.8, 0.5, shift1);
1424 shift1[0]=3.65;
1425 shift1[1]=0.53;
1426 shift1[2]=0.;
1427new TGeoBBox("tpcirh3", 1.05, 0.8, 0.5, shift1);
1428 shift1[0]=0.0;
1429 shift1[1]=1.08;
1430 shift1[2]=0.;
1431new TGeoBBox("tpcirh4", 1.9, 0.25, 0.5, shift1);
1432new TGeoTube("tpcirh5", 0, 1.9, 5);
1433//
1434TGeoTranslation *trans4 = new TGeoTranslation("trans4", 0, 0.83, 0.0);
1435trans4->RegisterYourself();
1436//
1437TGeoCompositeShape *tpcirh6 = new TGeoCompositeShape("tpcirh6", "tpcirh1-tpcirh2-tpcirh3-(tpcirh5:trans4)-tpcirh4");
1438//
1439// now volume
1440//
1441TGeoVolume *tpcirh = new TGeoVolume("TPC_IRH", tpcirh6, m6);
1442//
1443// and all together...
1444//
1445TGeoVolume *tpciclamp = new TGeoVolumeAssembly("TPC_ICLP");
1446tpciclamp->AddNode(tpcihs, 1);
1447tpciclamp->AddNode(tpcirh, 1, new TGeoTranslation(0, 1.99, 1.1));
1448tpciclamp->AddNode(tpcirh, 2, new TGeoTranslation(0, 1.99, -1.1));
1449//
1450// and now left inner "head"
1451//
1452TGeoPcon *inplug = new TGeoPcon("inplug", 0.0, 360.0, 14);
1453
1454inplug->DefineSection(0, 0.3, 0.0, 2.2);
1455inplug->DefineSection(1, 0.6, 0.0, 2.2);
1456
1457inplug->DefineSection(2, 0.6, 0.0, 1.75);
1458inplug->DefineSection(3, 0.7, 0.0, 1.75);
1459
1460inplug->DefineSection(4, 0.7, 1.55, 1.75);
1461inplug->DefineSection(5, 1.6, 1.55, 1.75);
1462
1463inplug->DefineSection(6, 1.6, 1.55, 2.2);
1464inplug->DefineSection(7, 1.875, 1.55, 2.2);
1465
1466inplug->DefineSection(8, 1.875, 1.55, 2.2);
1467inplug->DefineSection(9, 2.47, 1.75, 2.2);
1468
1469inplug->DefineSection(10, 2.47, 1.75, 2.08);
1470inplug->DefineSection(11, 2.57, 1.8, 2.08);
1471
1472inplug->DefineSection(12, 2.57, 1.92, 2.08);
1473inplug->DefineSection(13, 2.95, 1.92, 2.08);
1474//
1475 shift1[0]=0.0;
1476 shift1[1]=-2.09;
1477 shift1[2]=1.075;
1478 //
1479new TGeoBBox("pcuti", 1.5, 0.11, 1.075, shift1);
1480//
1481TGeoCompositeShape *inplleft = new TGeoCompositeShape("inplleft", "inplug-pcuti");
1482TGeoVolume *tpcinlplug = new TGeoVolume("TPC_INPLL", inplleft, m6);
1483//
1484// holder + plugs
1485//
1486 TGeoVolume *tpcihpl = new TGeoVolumeAssembly("TPC_IHPL"); //holder+2 plugs (reflected)
1487 tpcihpl->AddNode(tpcinlplug, 1);
1488 tpcihpl->AddNode(tpcinlplug, 2,ref);
1489 tpcihpl->AddNode(tpciclamp,1,new TGeoTranslation(0.0, -2.765, 0.0));
1490 //
1491 // outer holders and clamps
1492 //
1493
1494 // outer membrane holder (between rods)
1495pointstrap[0]= 0.0;
1496pointstrap[1]= 0.0;
1497pointstrap[2]= 0.0;
1498pointstrap[3]= 2.8;
1499pointstrap[4]= 3.1;
1500pointstrap[5]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1501pointstrap[6]= 3.1;
1502pointstrap[7]= 0.0;
1503pointstrap[8]= 0.0;
1504pointstrap[9]= 0.0;
1505pointstrap[10]= 0.0;
1506pointstrap[11]= 2.8;
1507pointstrap[12]= 3.1;
1508pointstrap[13]= 2.8-3.1*TMath::Tan(15.*TMath::DegToRad());
1509pointstrap[14]= 3.1;
1510pointstrap[15]= 0.0;
1511//
1512TGeoArb8 *tpcomh1 = new TGeoArb8("tpcomh1", 1.05, pointstrap);
1513TGeoBBox *tpcomh2 = new TGeoBBox("tpcomh2", 0.8, 1.4, 6);
1514//
1515TGeoVolume *tpcomh1v = new TGeoVolume("TPC_OMH1", tpcomh1, m7);
1516TGeoVolume *tpcomh2v = new TGeoVolume("TPC_OMH2", tpcomh2, m7);
1517//
1518TGeoVolume *tpcomh3v = new TGeoVolumeAssembly("TPC_OMH3"); // assembly1
1519tpcomh3v->AddNode(tpcomh1v, 1, new TGeoTranslation(0.8, -1.4, 4.95));
1520 tpcomh3v->AddNode(tpcomh1v, 2, new TGeoTranslation(0.8, -1.4, -4.95));
1521tpcomh3v->AddNode(tpcomh2v, 1);
1522//
1523shift1[0] = 0.9;
1524shift1[1] = -1.85;
1525shift1[2] = 0.0;
1526//
1527new TGeoBBox("tpcomh3", 1.65, 1.15, 3.4);
1528TGeoBBox *tpcomh4 = new TGeoBBox("tpcomh4", 0.75, 0.7, 3.4, shift1);
1529//
1530// halfspace 1
1531//
1532p[0] = 0.0;
1533p[1] = -1.05;
1534p[2] = -3.4;
1535//
1536n[0] = 0.0;
1537n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1538n[2] = 1.0;
1539//
1540new TGeoHalfSpace("cutomh1", p, n);
1541//
1542// halfspace 2
1543//
1544p[0] = 0.0;
1545p[1] = -1.05;
1546p[2] = 3.4;
1547//
1548n[0] = 0.0;
1549n[1] = -1.0*TMath::Tan(30.*TMath::DegToRad());
1550n[2] = -1.0;
1551//
1552new TGeoHalfSpace("cutomh2", p, n);
1553//
1554// halfspace 3
1555//
1556p[0] = -1.65;
1557p[1] = 0.0;
1558p[2] = -0.9;
1559//
1560n[0] = 1.0*TMath::Tan(75.*TMath::DegToRad());
1561n[1] = 0.0;
1562n[2] = 1.0;
1563//
1564new TGeoHalfSpace("cutomh3", p, n);
1565//
1566// halfspace 4
1567//
1568p[0] = -1.65;
1569p[1] = 0.0;
1570p[2] = 0.9;
1571//
1572n[0] = 1.0*TMath::Tan(75*TMath::DegToRad());
1573n[1] = 0.0;
1574n[2] = -1.0;
1575//
1576new TGeoHalfSpace("cutomh4", p, n);
1577//
1578// halsfspace 5
1579//
1580p[0] = 1.65;
1581p[1] = -1.05;
1582p[2] = 0.0;
1583//
1584n[0] = -1.0;
1585n[1] = -1.0*TMath::Tan(20.*TMath::DegToRad());
1586n[2] = 0.0;
1587//
1588new TGeoHalfSpace("cutomh5", p, n);
1589//
1590TGeoCompositeShape *tpcomh5 = new TGeoCompositeShape("tpcomh5", "tpcomh3-cutomh1-cutomh2-cutomh3-cutomh4-cutomh5");
1591//
1592 TGeoVolume *tpcomh5v = new TGeoVolume("TPC_OMH5",tpcomh5,m6);
1593 TGeoVolume *tpcomh4v = new TGeoVolume("TPC_OMH6",tpcomh4,m6);
1594 //
1595 TGeoVolumeAssembly *tpcomh7v = new TGeoVolumeAssembly("TPC_OMH7");
1596 tpcomh7v->AddNode(tpcomh5v,1);
1597 tpcomh7v->AddNode(tpcomh4v,1);
1598 //
1599 // full membrane holder - tpcomh3v + tpcomh7v
1600 //
1601 TGeoVolumeAssembly *tpcomh = new TGeoVolumeAssembly("TPC_OMH");
1602 tpcomh->AddNode(tpcomh3v,1,new TGeoTranslation(1.5,0.,0.));
1603 tpcomh->AddNode(tpcomh3v,2,new TGeoCombiTrans(-1.5,0.,0.,rot111));
1604 tpcomh->AddNode(tpcomh7v,1,new TGeoTranslation(0.65+1.5, 2.55, 0.0));
1605 tpcomh->AddNode(tpcomh7v,2,new TGeoCombiTrans(-0.65-1.5, 2.55, 0.0,rot111));
1606 //
1607 // outer rod holder support
1608 //
1609new TGeoBBox("tpcohs1", 3.8, 0.675, 2.35);
1610//
1611shift1[0] = 0.0;
1612shift1[1] = 0.175;
1613shift1[2] = 0.0;
1614//
1615new TGeoBBox("tpcohs2", 1.5, 0.5, 2.35, shift1);
1616new TGeoBBox("tpcohs3", 3.8, 0.5, 0.85, shift1);
1617//
1618shift1[0] = 0.0;
1619shift1[1] = -1.175;
1620shift1[2] = 0.0;
1621//
1622TGeoBBox *tpcohs4 = new TGeoBBox("tpsohs4", 3.1, 0.5, 0.7, shift1);
1623//
1624TGeoVolume *tpcohs4v = new TGeoVolume("TPC_OHS4", tpcohs4, m6);
1625//
1626p[0] = 0.0;
1627p[1] = -0.186;
1628p[2] = 0.0;
1629//
1630n[0] = 0.0;
1631n[1] = -1.0;
1632n[2] = 0.0;
1633//
1634new TGeoHalfSpace("cutohs1", p, n);
1635//
1636TGeoCompositeShape *tpcohs5 = new TGeoCompositeShape("tpcohs5", "tpcohs1-tpcohs2-tpcohs3-cutohs1");
1637TGeoVolume *tpcohs5v = new TGeoVolume("TPC_OHS5", tpcohs5, m6);
1638//
1639TGeoVolumeAssembly *tpcohs = new TGeoVolumeAssembly("TPC_OHS");
1640tpcohs->AddNode(tpcohs5v, 1);
1641tpcohs->AddNode(tpcohs4v, 1);
1642//
1643// outer rod holder itself
1644//
1645shift1[0] = 0.0;
1646shift1[1] = 1.325;
1647shift1[2] = 0.0;
1648 new TGeoBBox("tpcorh1", 3.1, 1.825, 0.55); //from this box we cut pieces...
1649 //
1650shift1[0] = -3.1;
1651shift1[1] = -0.5;
1652shift1[2] = 0.0;
1653//
1654new TGeoBBox("tpcorh2", 0.5, 2.75, 1.1, shift1);
1655//
1656shift1[0] = 3.1;
1657shift1[1] = -0.5;
1658shift1[2] = 0.0;
1659//
1660new TGeoBBox("tpcorh3", 0.5, 2.75, 1.1, shift1);
1661//
1662shift1[0] = 0.0;
1663shift1[1] = -0.5;
1664shift1[2] = -0.95;
1665//
1666new TGeoBBox("tpcorh4", 3.9, 2.75, 0.5, shift1);
1667//
1668shift1[0] = 0.0;
1669shift1[1] = -0.5;
1670shift1[2] = 0.0;
1671//
1672new TGeoBBox("tpcorh5", 1.95, 0.5, 1.1, shift1);
1673//
1674shift1[0] = 0.0;
1675shift1[1] = -0.5;
1676shift1[2] = 0.55;
1677//
1678new TGeoBBox("tpcorh6", 2.4, 0.5, 0.6, shift1);
1679//
1680new TGeoTube("tpcorh7", 0, 1.95, 0.85);
1681new TGeoTube("tpcorh8", 0, 2.4, 0.6);
1682//
1683TGeoTranslation *trans33 = new TGeoTranslation("trans33", 0.0, 0.0, 0.55);
1684trans33->RegisterYourself();
1685//
1686TGeoCompositeShape *tpcorh9 = new TGeoCompositeShape("tpcorh9", "tpcorh1-tpcorh2-tpcorh3-tpcorh4-tpcorh5-tpcorh6-(tpcorh8:trans33)-tpcorh7");
1687//
1688 TGeoVolume *tpcorh9v = new TGeoVolume("TPC_ORH",tpcorh9,m6); //outer rod holder
1689 //
1690 // now 2 holders together
1691 //
1692 TGeoVolumeAssembly *tpcorh = new TGeoVolumeAssembly("TPC_ORH2");
1693 //
1694 tpcorh->AddNode(tpcorh9v,1,new TGeoTranslation(0.0, 0.0, 1.25));
1695 tpcorh->AddNode(tpcorh9v,2,new TGeoCombiTrans(0.0, 0.0, -1.25,rot111));
1696//
1697// outer rod plug left
1698//
1699TGeoPcon *outplug = new TGeoPcon("outplug", 0.0, 360.0, 14);
1700
1701outplug->DefineSection(0, 0.5, 0.0, 2.2);
1702outplug->DefineSection(1, 0.7, 0.0, 2.2);
1703
1704outplug->DefineSection(2, 0.7, 1.55, 2.2);
1705outplug->DefineSection(3, 0.8, 1.55, 2.2);
1706
1707outplug->DefineSection(4, 0.8, 1.55, 1.75);
1708outplug->DefineSection(5, 1.2, 1.55, 1.75);
1709
1710outplug->DefineSection(6, 1.2, 1.55, 2.2);
1711outplug->DefineSection(7, 1.875, 1.55, 2.2);
1712
1713outplug->DefineSection(8, 1.875, 1.55, 2.2);
1714outplug->DefineSection(9, 2.47, 1.75, 2.2);
1715
1716outplug->DefineSection(10, 2.47, 1.75, 2.08);
1717outplug->DefineSection(11, 2.57, 1.8, 2.08);
1718
1719outplug->DefineSection(12, 2.57, 1.92, 2.08);
1720outplug->DefineSection(13, 2.95, 1.92, 2.08);
1721//
1722shift1[0] = 0.0;
1723shift1[1] = 2.09;
1724shift1[2] = 1.01;
1725
1726new TGeoBBox("cutout", 2.5, 0.11, 1.01, shift1);
1727//
1728
1729TGeoCompositeShape *outplleft = new TGeoCompositeShape("outplleft", "outplug-cutout");
1730TGeoVolume *outplleftv = new TGeoVolume("TPC_OPLL", outplleft, m6);
1731//
1732// support + holder + plug
1733//
1734
1735
1736 TGeoVolumeAssembly *tpcohpl = new TGeoVolumeAssembly("TPC_OHPL");
1737 //
1738 tpcohpl->AddNode(outplleftv,1); //plug
1739 tpcohpl->AddNode(outplleftv,2,ref); //plug reflected
1740 tpcohpl->AddNode(tpcorh,1); //rod holder
1741 tpcohpl->AddNode(tpcohs,1,new TGeoTranslation(0.0, 3.925, 0)); // support
1742 //
1743
1744 //
1745 // main membrane holder
1746 //
1747pointstrap[0]= 0.0;
1748pointstrap[1]= 0.0;
1749pointstrap[2]= 0.0;
1750pointstrap[3]= 2.8;
1751pointstrap[4]= 3.1;
1752pointstrap[5]= 1.96;
1753pointstrap[6]= 3.1;
1754pointstrap[7]= 0.0;
1755pointstrap[8]= 0.0;
1756pointstrap[9]= 0.0;
1757pointstrap[10]= 0.0;
1758pointstrap[11]= 2.8;
1759pointstrap[12]= 3.1;
1760pointstrap[13]= 1.96;
1761pointstrap[14]= 3.1;
1762pointstrap[15]= 0.0;
1763//
1764TGeoArb8 *tpcmmh1 = new TGeoArb8("tpcmmh1", 1.75, pointstrap);
1765TGeoBBox *tpcmmh2 = new TGeoBBox("tpcmmh2", 0.8, 1.4, 12.5);
1766//
1767TGeoVolume *tpcmmh1v = new TGeoVolume("TPC_MMH1", tpcmmh1, m6);
1768TGeoVolume *tpcmmh2v = new TGeoVolume("TPC_MMH2", tpcmmh2, m6);
1769//
1770 TGeoVolumeAssembly *tpcmmhs = new TGeoVolumeAssembly("TPC_MMHS");
1771 tpcmmhs->AddNode(tpcmmh1v,1,new TGeoTranslation(0.8, -1.4, 10.75));
1772 tpcmmhs->AddNode(tpcmmh1v,2,new TGeoTranslation(0.8, -1.4, -10.75));
1773 tpcmmhs->AddNode(tpcmmh2v,1);
1774 //
1775 // main membrahe holder clamp
1776 //
1777shift1[0] = -0.75;
1778shift1[1] = -1.15;
1779shift1[2] = 0.0;
1780//
1781new TGeoBBox("tpcmmhc1", 1.65, 1.85, 8.9);
1782new TGeoBBox("tpcmmhc2", 0.9, 0.7, 8.9, shift1);
1783//
1784// half spaces - cuts
1785//
1786p[0] = -1.65;
1787p[1] = 0.0;
1788p[2] = -0.9;
1789//
1790n[0] = 8.0;
1791n[1] = 0.0;
1792n[2] = 8.0*TMath::Tan(13.*TMath::DegToRad());
1793//
1794new TGeoHalfSpace("cutmmh1", p, n);
1795//
1796p[0] = -1.65;
1797p[1] = 0.0;
1798p[2] = 0.9;
1799//
1800n[0] = 8.0;
1801n[1] = 0.0;
1802n[2] = -8.0*TMath::Tan(13.*TMath::DegToRad());
1803//
1804new TGeoHalfSpace("cutmmh2", p, n);
1805//
1806p[0] = 0.0;
1807p[1] = 1.85;
1808p[2] = -2.8;
1809//
1810n[0] = 0.0;
1811n[1] = -6.1;
1812n[2] = 6.1*TMath::Tan(20.*TMath::DegToRad());
1813//
1814new TGeoHalfSpace("cutmmh3", p, n);
1815//
1816p[0] = 0.0;
1817p[1] = 1.85;
1818p[2] = 2.8;
1819//
1820n[0] = 0.0;
1821n[1] = -6.1;
1822n[2] = -6.1*TMath::Tan(20*TMath::DegToRad());
1823//
1824new TGeoHalfSpace("cutmmh4", p, n);
1825//
1826p[0] = 0.75;
1827p[1] = 0.0;
1828p[2] = -8.9;
1829//
1830n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1831n[1] = 0.0;
1832n[2] = 2.4;
1833//
1834 new TGeoHalfSpace("cutmmh5", p, n);
1835//
1836p[0] = 0.75;
1837p[1] = 0.0;
1838p[2] = 8.9;
1839//
1840n[0] = 2.4*TMath::Tan(30*TMath::DegToRad());
1841n[1] = 0.0;
1842n[2] = -2.4;
1843//
1844new TGeoHalfSpace("cutmmh6", p, n);
1845
1846TGeoCompositeShape *tpcmmhc = new TGeoCompositeShape("TPC_MMHC", "tpcmmhc1-tpcmmhc2-cutmmh1-cutmmh2-cutmmh3-cutmmh4-cutmmh5-cutmmh6");
1847
1848 TGeoVolume *tpcmmhcv = new TGeoVolume("TPC_MMHC",tpcmmhc,m6);
1849 //
1850TGeoVolume *tpcmmh = new TGeoVolumeAssembly("TPC_MMH");
1851//
1852 tpcmmh->AddNode(tpcmmhcv,1,new TGeoTranslation(0.65+1.5, 1.85, 0.0));
1853 tpcmmh->AddNode(tpcmmhcv,2,new TGeoCombiTrans(-0.65-1.5, 1.85, 0.0,rot111));
1854 tpcmmh->AddNode(tpcmmhs,1,new TGeoTranslation(1.5, 0.0, 0.0));
1855 tpcmmh->AddNode(tpcmmhs,2,new TGeoCombiTrans(-1.5, 0.0, 0.0,rot111));
1856 //
1857
1858 //
1859
1860//--------------------------------------------
7f96259a 1861 //
1862 // guard ring resistor chain
1863 //
232c5b28 1864
1865 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
7f96259a 1866 //
cc8d387d 1867 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m14);
232c5b28 1868
7f96259a 1869 //
1870 Double_t xrc,yrc;
1871 //
7f96259a 1872 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1873 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1874 //
232c5b28 1875 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1876 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1877 //
e079adac 1878 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1879 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
232c5b28 1880 //
1881 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1882 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
0f788f87 1883 //------------------------------------------------------------------
1884 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1885 TGeoRotation rotrod("rotrod");
0f788f87 1886 //
2d1d58a6 1887 TGeoRotation *rotpos[2];
1888 //
1889 TGeoRotation *rotrod1[2];
6c0ba48f 1890
0f788f87 1891
1892 //v9 - drift gas
1893
6c0ba48f 1894 TGeoRotation rot102("rot102");
1895 rot102.RotateY(-90.);
1896
7281dc07 1897 for(Int_t i=0;i<18;i++){
c1637e41 1898 Double_t angle,x,y;
1899 Double_t z,r;
1900 angle=TMath::DegToRad()*20.*(Double_t)i;
0f788f87 1901 //inner rods
c1637e41 1902 r=81.5;
1903 x=r * TMath::Cos(angle);
1904 y=r * TMath::Sin(angle);
6c0ba48f 1905 z = 126.;
1906 TGeoRotation *rot12 = new TGeoRotation();
1907 rot12->RotateZ(-90.0+i*20.);
1908 v9->AddNode(tpcihpl,i+1,new TGeoCombiTrans(x, y, 0., rot12));
c449e944 1909 //
0f788f87 1910 if(i==11){//resistor rod inner
1911 rotrod.RotateZ(-90.+angle);
2d1d58a6 1912 rotrod1[0]= new TGeoRotation();
1913 rotpos[0]= new TGeoRotation();
1914 //
1915 rotrod1[0]->RotateZ(-90.+angle);
1916 *rotpos[0] = refl*rotrod; //rotation+reflection
ceb660a9 1917 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1918 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
78134e48 1919 }
1920 else {
0f788f87 1921 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1922 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
c1637e41 1923 }
0f788f87 1924 // outer rods
c1637e41 1925 r=254.25;
1926 x=r * TMath::Cos(angle);
1927 y=r * TMath::Sin(angle);
6c0ba48f 1928 z=126.;
1929 //
1930 // outer rod holder + outer left plug
1931 //
1932 TGeoRotation *rot33 = new TGeoRotation();
1933 rot33->RotateZ(-90+i*20.);
1934 //
1935 v9->AddNode(tpcohpl,i+1,new TGeoCombiTrans(x, y, 0., rot33));
1936 //
1937 Double_t xxx = 256.297*TMath::Cos((i*20.+10.)*TMath::DegToRad());
1938 Double_t yyy = 256.297*TMath::Sin((i*20.+10.)*TMath::DegToRad());
1939 //
1940 TGeoRotation rot101("rot101");
1941 rot101.RotateZ(90.+i*20.+10.);
1942 TGeoRotation *rot103 = new TGeoRotation("rot103");
1943 *rot103 = rot101*rot102;
1944 //
1945 TGeoCombiTrans *trh100 = new TGeoCombiTrans(xxx,yyy,0.,rot103);
1946 //
1947 if(i==2) {
1948 //main membrane holder
1949 v9->AddNode(tpcmmh,1,trh100);
1950 }
1951 else{
1952 // "normal" membrane holder
1953 v9->AddNode(tpcomh,i+1,trh100);
1954 }
1955
78134e48 1956 //
0f788f87 1957 if(i==3){//resistor rod outer
1958 rotrod.RotateZ(90.+angle);
2d1d58a6 1959 rotrod1[1]= new TGeoRotation();
1960 rotpos[1]= new TGeoRotation();
1961 rotrod1[1]->RotateZ(90.+angle);
1962 *rotpos[1] = refl*rotrod;//rotation+reflection
ceb660a9 1963 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1964 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
78134e48 1965 }
0f788f87 1966 else {
1967 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1968 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
78134e48 1969 }
0f788f87 1970 if(i==15){
cf84f9b1 1971 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
6c0ba48f 1972
1973
78134e48 1974 }
0f788f87 1975 } //end of rods positioning
69776907 1976
bde68ab0 1977 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1978 alice->AddNode(v1,1);
c1637e41 1979
37831078 1980} // end of function
1981
ac81c411 1982//_____________________________________________________________________________
1983void AliTPCv2::AddAlignableVolumes() const
1984{
1985 //
1986 // Create entries for alignable volumes associating the symbolic volume
1987 // name with the corresponding volume path. Needs to be syncronized with
1988 // eventual changes in the geometry.
1989 //
1990 SetInnerChambersAlignable();
1991 SetOuterChambersAlignable();
1992}
1993
1994//_____________________________________________________________________________
1995void AliTPCv2::SetInnerChambersAlignable() const
1996{
1997 //
cdf69b9a 1998 AliGeomManager::ELayerID idTPC1 = AliGeomManager::kTPC1;
1999 Int_t modUID, modnum = 0;
d899e254 2000 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
2001 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
2002 TString vpappend = "/TPC_IROC_1";
2003 TString snstr1="TPC/EndcapA/Sector";
2004 TString snstr2="TPC/EndcapC/Sector";
2005 TString snappend="/InnerChamber";
ac81c411 2006 TString volpath, symname;
2007
1ac29fc4 2008 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 2009 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
1ac29fc4 2010 volpath = vpstr1;
2011 volpath += cnt;
2012 volpath += vpappend;
2013 symname = snstr1;
2014 symname += cnt;
2015 symname += snappend;
cdf69b9a 2016 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 2017 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 2018 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
2019 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 2020 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
2021 alignableEntry->SetMatrix(matTtoL);
1ac29fc4 2022 }
65293f49 2023
ac81c411 2024 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 2025 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
d899e254 2026 volpath = vpstr2;
ac81c411 2027 volpath += cnt;
d899e254 2028 volpath += vpappend;
2029 symname = snstr2;
ac81c411 2030 symname += cnt;
d899e254 2031 symname += snappend;
cdf69b9a 2032 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 2033 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 2034 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
2035 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 2036 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
2037 alignableEntry->SetMatrix(matTtoL);
ac81c411 2038 }
2039}
2040
ac81c411 2041//_____________________________________________________________________________
2042void AliTPCv2::SetOuterChambersAlignable() const
2043{
2044 //
cdf69b9a 2045 AliGeomManager::ELayerID idTPC2 = AliGeomManager::kTPC2;
2046 Int_t modUID, modnum = 0;
d899e254 2047 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
2048 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
2049 TString vpappend = "/TPC_OROC_1";
2050 TString snstr1="TPC/EndcapA/Sector";
2051 TString snstr2="TPC/EndcapC/Sector";
2052 TString snappend="/OuterChamber";
ac81c411 2053 TString volpath, symname;
2054
2055 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 2056 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
d899e254 2057 volpath = vpstr1;
ac81c411 2058 volpath += cnt;
d899e254 2059 volpath += vpappend;
2060 symname = snstr1;
ac81c411 2061 symname += cnt;
d899e254 2062 symname += snappend;
cdf69b9a 2063 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 2064 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 2065 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
2066 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 2067 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
2068 alignableEntry->SetMatrix(matTtoL);
ac81c411 2069 }
84cbbd90 2070
ac81c411 2071 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 2072 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
d899e254 2073 volpath = vpstr2;
ac81c411 2074 volpath += cnt;
d899e254 2075 volpath += vpappend;
2076 symname = snstr2;
ac81c411 2077 symname += cnt;
d899e254 2078 symname += snappend;
cdf69b9a 2079 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 2080 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 2081 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
2082 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 2083 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
2084 alignableEntry->SetMatrix(matTtoL);
ac81c411 2085 }
2086}
2087
37831078 2088
2089//_____________________________________________________________________________
2090void AliTPCv2::CreateMaterials()
2091{
2092 //
2093 // Define materials for version 2 of the Time Projection Chamber
2094 //
2095
2096 AliTPC::CreateMaterials();
2097}
2098
2099//_____________________________________________________________________________
2100void AliTPCv2::Init()
2101{
2102 //
2103 // Initialises version 2 of the TPC after that it has been built
2104 //
2105
2106 Int_t *idtmed = fIdtmed->GetArray();
2107
2108 AliTPC::Init();
d4c354b9 2109
c1637e41 2110
2111 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
d4c354b9 2112
c1637e41 2113 fIDrift=gMC->VolId("TPC_Drift");
2114 fSecOld=-100; // fake number
37831078 2115
566637aa 2116 gMC->SetMaxNStep(-120000); // max. number of steps increased
37831078 2117
4481461d 2118 if (fPrimaryIonisation) {
098dfc1a 2119 // for FLUKA
4481461d 2120 gMC->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential
2121
2122 gMC->Gstpar(idtmed[2],"PRIMIO_N", 14.35);
2123 gMC->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss
8143dfb2 2124 gMC->Gstpar(idtmed[2],"STRA",4);
098dfc1a 2125 }
2126 // specific energy loss for geant3 is now defined in galice.cuts
4481461d 2127
37831078 2128
a9d15241 2129 AliDebug(1,"*** TPC version 2 initialized ***");
2130 AliDebug(1,Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
37831078 2131
2132 //
fe4da5cc 2133
2134}
2135
2136//_____________________________________________________________________________
2137void AliTPCv2::StepManager()
2138{
2139 //
2140 // Called for every step in the Time Projection Chamber
2141 //
2142
2143 //
2144 // parameters used for the energy loss calculations
2145 //
566637aa 2146 //const Float_t kprim = 14.35; // number of primary collisions per 1 cm
2147 //const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
2148 //const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
ec6ac410 2149 const Int_t kMaxDistRef =15; // maximal difference between 2 stored references
566637aa 2150
2151 Float_t prim = fTPCParam->GetNprim();
2152 Float_t poti = fTPCParam->GetFpot();
2153 Float_t wIon = fTPCParam->GetWmean();
fe4da5cc 2154
73042f01 2155 const Float_t kbig = 1.e10;
fe4da5cc 2156
2157 Int_t id,copy;
e61fd20d 2158 Float_t hits[5];
fe4da5cc 2159 Int_t vol[2];
37831078 2160 TLorentzVector p;
fe4da5cc 2161
37831078 2162 vol[1]=0; // preset row number to 0
fe4da5cc 2163 //
f6a67d69 2164 if (!fPrimaryIonisation) gMC->SetMaxStep(kbig);
fe4da5cc 2165
0a6d8768 2166 if(!gMC->IsTrackAlive()) return; // particle has disappeared
fe4da5cc 2167
cfce8870 2168 Float_t charge = gMC->TrackCharge();
fe4da5cc 2169
2170 if(TMath::Abs(charge)<=0.) return; // take only charged particles
2171
37831078 2172 // check the sensitive volume
2173
c1637e41 2174 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
2175 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
da33556f 2176
2ddbb964 2177 if ( fPrimaryIonisation && id == fIDrift ) {
2178 Double_t rnd = gMC->GetRandom()->Rndm();
2179 gMC->SetMaxStep(0.2+(2.*rnd-1.)*0.05); // 2 mm +- rndm*0.5mm step
2180 }
2181
2182 //if ( fPrimaryIonisation && id == fIDrift && gMC->IsTrackEntering()) {
2183 // gMC->SetMaxStep(0.2); // 2 mm
2184 //}
2185
c1637e41 2186 gMC->TrackPosition(p);
2187 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2188 //
2189
2190 //
2191 Double_t angle = TMath::ACos(p[0]/r);
2192 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
2193 //
2194 // angular segment, it is not a real sector number...
2195 //
2196 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
2197 fTPCParam->GetInnerAngle());
2198 // rotate to segment "0"
2199 Float_t cos,sin;
2200 fTPCParam->AdjustCosSin(sector,cos,sin);
2201 Float_t x1=p[0]*cos + p[1]*sin;
2202 // check if within sector's limits
5bd5dbc4 2203 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
2204 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
c1637e41 2205 // calculate real sector number...
2206 if (x1>fTPCParam->GetOuterRadiusLow()){
2207 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
2208 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
2209 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
37831078 2210 }
c1637e41 2211 else
2212 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
2213 //
2214 // here I have a sector number
2215 //
37831078 2216
c1637e41 2217 vol[0]=sector;
ec6ac410 2218
2219 static Double_t lastReferenceR=0;
2220 if (TMath::Abs(lastReferenceR-r)>kMaxDistRef){
2221 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
2222 lastReferenceR = r;
2223 }
2224
c1637e41 2225 // check if change of sector
2226 if(sector != fSecOld){
2227 fSecOld=sector;
2228 // add track reference
e6add757 2229 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
c1637e41 2230 }
2231 // track is in the sensitive strip
2232 if(id == fIdSens){
2233 // track is entering the strip
2234 if (gMC->IsTrackEntering()){
2235 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
2236 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
2237 // row numbers are autonomous for lower and upper sectors
2238 if(vol[0] > fTPCParam->GetNInnerSector()) {
2239 vol[1] -= fTPCParam->GetNRowLow();
2240 }
2241 //
2242 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
37831078 2243
c1637e41 2244 // lower sector, row 0, because Jouri wants to have this
37831078 2245
c1637e41 2246 gMC->TrackMomentum(p);
2247 hits[0]=p[0];
2248 hits[1]=p[1];
2249 hits[2]=p[2];
2250 hits[3]=0.; // this hit has no energy loss
2251 // Get also the track time for pileup simulation
2252 hits[4]=gMC->TrackTime();
6a905708 2253
c1637e41 2254 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
2255 }
2256 //
e61fd20d 2257
c1637e41 2258 gMC->TrackPosition(p);
2259 hits[0]=p[0];
2260 hits[1]=p[1];
2261 hits[2]=p[2];
2262 hits[3]=0.; // this hit has no energy loss
2263 // Get also the track time for pileup simulation
2264 hits[4]=gMC->TrackTime();
930ee558 2265
c1637e41 2266 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
37831078 2267
c1637e41 2268 }
2269 else return;
2270 }
37831078 2271 //-----------------------------------------------------------------
c1637e41 2272 // charged particle is in the sensitive drift volume
37831078 2273 //-----------------------------------------------------------------
cfce8870 2274 if(gMC->TrackStep() > 0) {
b97617a6 2275 Int_t nel=0;
2276 if (!fPrimaryIonisation) {
566637aa 2277 nel = (Int_t)(((gMC->Edep())-poti)/wIon) + 1;
b97617a6 2278 }
2279 else {
63414189 2280 static Double_t deForNextStep = 0.;
2281 // Geant4 (the meaning of Edep as in Geant3) - wrong
566637aa 2282 //nel = (Int_t)(((gMC->Edep())-poti)/wIon) + 1;
63414189 2283
2284 // Geant4 (the meaning of Edep as in Geant3) - NEW
2285 Double_t eAvailable = gMC->Edep() + deForNextStep;
566637aa 2286 nel = (Int_t)(eAvailable/wIon);
2287 deForNextStep = eAvailable - nel*wIon;
b97617a6 2288 }
fe4da5cc 2289 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
c1637e41 2290 //
37831078 2291 gMC->TrackPosition(p);
2292 hits[0]=p[0];
2293 hits[1]=p[1];
2294 hits[2]=p[2];
fe4da5cc 2295 hits[3]=(Float_t)nel;
c1637e41 2296
fe4da5cc 2297 // Add this hit
c1637e41 2298
97d77e7a 2299 // if (fHitType&&2){
2300 if(fHitType){
6a905708 2301 gMC->TrackMomentum(p);
2302 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2303 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2304 fTrackHits->SetHitPrecision(precision);
2305 }
e61fd20d 2306
2307 // Get also the track time for pileup simulation
2308 hits[4]=gMC->TrackTime();
c1637e41 2309
2310 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
0f2ff24c 2311 if (fDebugStreamer){
2312 // You can dump here what you need
2313 // function CreateDebugStremer() to be called in the Config.C macro
2314 // if you want to enable it
2315 // By default debug streaemer is OFF
2316 Float_t edep = gMC->Edep();
2317 Float_t tstep = gMC->TrackStep();
2318 Int_t pid=gMC->TrackPid();
2319 (*fDebugStreamer)<<"hit"<<
2320 "x="<<hits[0]<< // hit position
2321 "y="<<hits[1]<<
2322 "z="<<hits[2]<<
2323 "nel="<<hits[3]<< // number of electorns
2324 "tof="<<hits[4]<< // hit TOF
2325 "edep="<<edep<< // energy deposit
2326 "pid="<<pid<< // pid
2327 "step="<<tstep<<
2328 "p.="<<&p<<
2329 "\n";
2330 }
2331
c1637e41 2332 } // step>0
2333 } //within sector's limits
fe4da5cc 2334 // Stemax calculation for the next step
2335
2336 Float_t pp;
0a6d8768 2337 TLorentzVector mom;
b97617a6 2338 // below is valid only for Geant3 (fPromaryIonisation not set)
2339 if(!fPrimaryIonisation){
2340 gMC->TrackMomentum(mom);
2341 Float_t ptot=mom.Rho();
2342 Float_t betaGamma = ptot/gMC->TrackMass();
595bf2c3 2343
b97617a6 2344 Int_t pid=gMC->TrackPid();
2345 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2346 {
566637aa 2347 pp = prim*1.58; // electrons above 20 MeV/c are on the plateau!
b97617a6 2348 }
2349 else
2350 {
2351
2352 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
566637aa 2353 TVectorD *bbpar = fTPCParam->GetBetheBloch(); //get parametrization from OCDB
2354 pp=prim*AliMathBase::BetheBlochAleph(betaGamma,(*bbpar)(0),(*bbpar)(1),(*bbpar)(2),(*bbpar)(3),(*bbpar)(4));
2355
595bf2c3 2356
fe4da5cc 2357 }
2358
b97617a6 2359 Double_t rnd = gMC->GetRandom()->Rndm();
fe4da5cc 2360
b97617a6 2361 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
2362 }
c1637e41 2363
fe4da5cc 2364}
2365
73042f01 2366