Drift gas selection via title in the AliTPC constructor
[u/mrichter/AliRoot.git] / TPC / AliTPCv2.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
88cb7938 16/* $Id$ */
4c039060 17
73042f01 18//
fe4da5cc 19///////////////////////////////////////////////////////////////////////////////
20// //
21// Time Projection Chamber version 2 -- detailed TPC and slow simulation //
22// //
23//Begin_Html
24/*
1439f98e 25<img src="picts/AliTPCv2Class.gif">
fe4da5cc 26*/
27//End_Html
28// //
29// //
30///////////////////////////////////////////////////////////////////////////////
116cbefd 31
d899e254 32//#include <stdlib.h>
fe4da5cc 33
88cb7938 34#include <TLorentzVector.h>
116cbefd 35#include <TPDGCode.h>
d9e80aca 36#include <TString.h>
f77f13c8 37#include "AliLog.h"
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"
1ac29fc4 55
a11596ad 56using std::ifstream;
57using std::ios_base;
fe4da5cc 58ClassImp(AliTPCv2)
59
60//_____________________________________________________________________________
61AliTPCv2::AliTPCv2(const char *name, const char *title) :
e046d791 62 AliTPC(name, title),
63 fIdSens(0),
64 fIDrift(0),
65 fSecOld(0)
fe4da5cc 66{
67 //
68 // Standard constructor for Time Projection Chamber version 2
69 //
37831078 70
73042f01 71
c1637e41 72 SetBufferSize(128000);
73042f01 73
73042f01 74
db2fdcfb 75// if (fTPCParam)
76// fTPCParam->Write(fTPCParam->GetTitle());
fe4da5cc 77}
78
79//_____________________________________________________________________________
80void AliTPCv2::CreateGeometry()
81{
82 //
83 // Create the geometry of Time Projection Chamber version 2
84 //
85 //Begin_Html
86 /*
37831078 87 <img src="picts/AliTPC.gif">
fe4da5cc 88 */
89 //End_Html
90 //Begin_Html
91 /*
1439f98e 92 <img src="picts/AliTPCv2Tree.gif">
fe4da5cc 93 */
94 //End_Html
95
c1637e41 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 //----------------------------------------------------------
37831078 101 //
c1637e41 102 // tpc - this will be the mother volume
37831078 103 //
79575d04 104
37831078 105 //
c1637e41 106 // here I define a volume TPC
107 // retrive the medium name with "TPC_" as a leading string
37831078 108 //
24c46a8e 109 TGeoPcon *tpc = new TGeoPcon(0.,360.,30); //30 sections
37831078 110 //
24c46a8e 111 tpc->DefineSection(0,-289.6,77.,278.);
112 tpc->DefineSection(1,-262.1,77.,278.);
37831078 113 //
24c46a8e 114 tpc->DefineSection(2,-262.1,83.1,278.);
115 tpc->DefineSection(3,-260.,83.1,278.);
37831078 116 //
24c46a8e 117 tpc->DefineSection(4,-260.,70.,278.);
118 tpc->DefineSection(5,-259.6,70.,278.);
37831078 119 //
24c46a8e 120 tpc->DefineSection(6,-259.6,68.1,278.);
121 tpc->DefineSection(7,-253.6,68.1,278.);
37831078 122 //
c5d5037c 123 tpc->DefineSection(8,-253.6,67.88,278.);//hs
124 tpc->DefineSection(9,-74.0,60.68,278.);// hs
37831078 125 //
24c46a8e 126 tpc->DefineSection(10,-74.0,60.1,278.);
127 tpc->DefineSection(11,-73.3,60.1,278.);
37831078 128 //
24c46a8e 129 tpc->DefineSection(12,-73.3,56.9,278.);
130 tpc->DefineSection(13,-68.5,56.9,278.);
37831078 131 //
24c46a8e 132 tpc->DefineSection(14,-68.5,60.,278.);
133 tpc->DefineSection(15,-64.7,60.,278.);
78134e48 134 //
24c46a8e 135 tpc->DefineSection(16,-64.7,56.9,278.);
136 tpc->DefineSection(17,73.3,56.9,278.);
78134e48 137 //
24c46a8e 138 tpc->DefineSection(18,73.3,60.1,278.);
139 tpc->DefineSection(19,74.0,60.1,278.);
efe14311 140 //
c5d5037c 141 tpc->DefineSection(20,74.0,60.68,278.);// hs
142 tpc->DefineSection(21,253.6,65.38,278.);// hs
efe14311 143 //
24c46a8e 144 tpc->DefineSection(22,253.6,65.6,278.);
145 tpc->DefineSection(23,259.6,65.6,278.);
4fb9bd37 146 //
24c46a8e 147 tpc->DefineSection(24,259.6,70.0,278.);
148 tpc->DefineSection(25,260.,70.0,278.);
4fb9bd37 149 //
24c46a8e 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.);
37831078 155 //
c1637e41 156 TGeoMedium *m1 = gGeoManager->GetMedium("TPC_Air");
157 TGeoVolume *v1 = new TGeoVolume("TPC_M",tpc,m1);
79575d04 158 //
c1637e41 159 // drift volume - sensitive volume, extended beyond the
160 // endcaps, because of the alignment
37831078 161 //
c1637e41 162 TGeoPcon *dvol = new TGeoPcon(0.,360.,6);
163 dvol->DefineSection(0,-260.,74.5,264.4);
164 dvol->DefineSection(1,-253.6,74.5,264.4);
37831078 165 //
c1637e41 166 dvol->DefineSection(2,-253.6,76.6774,258.);
167 dvol->DefineSection(3,253.6,76.6774,258.);
37831078 168 //
c1637e41 169 dvol->DefineSection(4,253.6,74.5,264.4);
170 dvol->DefineSection(5,260.,74.5,264.4);
37831078 171 //
a964d561 172 TGeoMedium *m5 = gGeoManager->GetMedium("TPC_DriftGas2");
c1637e41 173 TGeoVolume *v9 = new TGeoVolume("TPC_Drift",dvol,m5);
37831078 174 //
c1637e41 175 v1->AddNode(v9,1);
37831078 176 //
c1637e41 177 // outer insulator
720b23b8 178 //
c1637e41 179 TGeoPcon *tpco = new TGeoPcon(0.,360.,6); //insulator
79575d04 180 //
c1637e41 181 tpco->DefineSection(0,-256.6,264.8,278.);
182 tpco->DefineSection(1,-253.6,264.8,278.);
183 //
184 tpco->DefineSection(2,-253.6,258.,278.);
185 tpco->DefineSection(3,250.6,258.,278.);
186 //
187 tpco->DefineSection(4,250.6,258.,275.5);
188 tpco->DefineSection(5,253.6,258.,275.5);
189 //
190 TGeoMedium *m2 = gGeoManager->GetMedium("TPC_CO2");
191 TGeoVolume *v2 = new TGeoVolume("TPC_OI",tpco,m2);
192 //
c449e944 193 TGeoRotation *segrot;//segment rotations
194 //
c1637e41 195 // outer containment vessel
196 //
197 TGeoPcon *tocv = new TGeoPcon(0.,360.,6); // containment vessel
198 //
199 tocv->DefineSection(0,-256.6,264.8,278.);
200 tocv->DefineSection(1,-253.6,264.8,278.);
201 //
202 tocv->DefineSection(2,-253.6,274.8124,278.);
203 tocv->DefineSection(3,247.6,274.8124,278.);
204 //
205 tocv->DefineSection(4,247.6,270.4,278.);
206 tocv->DefineSection(5,250.6,270.4,278.);
207 //
208 TGeoMedium *m3 = gGeoManager->GetMedium("TPC_Al");
209 TGeoVolume *v3 = new TGeoVolume("TPC_OCV",tocv,m3);
210 //
c449e944 211 TGeoTubeSeg *to1 = new TGeoTubeSeg(274.8174,277.995,252.1,0.,59.9); //epoxy
212 TGeoTubeSeg *to2 = new TGeoTubeSeg(274.8274,277.985,252.1,0.,59.9); //tedlar
213 TGeoTubeSeg *to3 = new TGeoTubeSeg(274.8312,277.9812,252.1,0.,59.9);//prepreg2
214 TGeoTubeSeg *to4 = new TGeoTubeSeg(274.9062,277.9062,252.1,0.,59.9);//nomex
215 TGeoTubeSeg *tog5 = new TGeoTubeSeg(274.8174,277.995,252.1,59.9,60.);//epoxy
c1637e41 216 //
217 TGeoMedium *sm1 = gGeoManager->GetMedium("TPC_Epoxy");
218 TGeoMedium *sm2 = gGeoManager->GetMedium("TPC_Tedlar");
219 TGeoMedium *sm3 = gGeoManager->GetMedium("TPC_Prepreg2");
220 TGeoMedium *sm4 = gGeoManager->GetMedium("TPC_Nomex");
221 //
222 TGeoVolume *tov1 = new TGeoVolume("TPC_OCV1",to1,sm1);
223 TGeoVolume *tov2 = new TGeoVolume("TPC_OCV2",to2,sm2);
224 TGeoVolume *tov3 = new TGeoVolume("TPC_OCV3",to3,sm3);
225 TGeoVolume *tov4 = new TGeoVolume("TPC_OCV4",to4,sm4);
c449e944 226 TGeoVolume *togv5 = new TGeoVolume("TPC_OCVG5",tog5,sm1);
c5d5037c 227 //
228 TGeoMedium *mhs = gGeoManager->GetMedium("TPC_Steel");
229 TGeoMedium *m12 = gGeoManager->GetMedium("TPC_Water");
c449e944 230 //-------------------------------------------------------
37831078 231 // Tpc Outer Field Cage
c1637e41 232 // daughters - composite (sandwich)
37831078 233 //-------------------------------------------------------
1283eee5 234
c1637e41 235 TGeoPcon *tofc = new TGeoPcon(0.,360.,6);
79575d04 236 //
c1637e41 237 tofc->DefineSection(0,-253.6,258.,269.6);
238 tofc->DefineSection(1,-250.6,258.,269.6);
37831078 239 //
c1637e41 240 tofc->DefineSection(2,-250.6,258.,260.0676);
241 tofc->DefineSection(3,250.6,258.,260.0676);
37831078 242 //
c1637e41 243 tofc->DefineSection(4,250.6,258.,275.5);
244 tofc->DefineSection(5,253.6,258.,275.5);
37831078 245 //
c1637e41 246 TGeoVolume *v4 = new TGeoVolume("TPC_TOFC",tofc,m3);
247 //sandwich
c449e944 248 TGeoTubeSeg *tf1 = new TGeoTubeSeg(258.0,260.0676,252.1,0.,59.9); //tedlar
249 TGeoTubeSeg *tf2 = new TGeoTubeSeg(258.0038,260.0638,252.1,0.,59.9); //prepreg3
250 TGeoTubeSeg *tf3 = new TGeoTubeSeg(258.0338,260.0338,252.1,0.,59.9);//nomex
251 TGeoTubeSeg *tfg4 = new TGeoTubeSeg(258.0,260.0676,252.1,59.9,60.); //epoxy glue
37831078 252 //
c1637e41 253 TGeoMedium *sm5 = gGeoManager->GetMedium("TPC_Prepreg3");
37831078 254 //
c1637e41 255 TGeoVolume *tf1v = new TGeoVolume("TPC_OFC1",tf1,sm2);
256 TGeoVolume *tf2v = new TGeoVolume("TPC_OFC2",tf2,sm5);
257 TGeoVolume *tf3v = new TGeoVolume("TPC_OFC3",tf3,sm4);
c449e944 258 TGeoVolume *tfg4v = new TGeoVolume("TPC_OFCG4",tfg4,sm1);
37831078 259 //
c1637e41 260 // outer part - positioning
37831078 261 //
c449e944 262 tov1->AddNode(tov2,1); tov2->AddNode(tov3,1); tov3->AddNode(tov4,1);//ocv
263 //
264 tf1v->AddNode(tf2v,1); tf2v->AddNode(tf3v,1);//ofc
37831078 265 //
c449e944 266 TGeoVolumeAssembly *t200 = new TGeoVolumeAssembly("TPC_OCVSEG");
267 TGeoVolumeAssembly *t300 = new TGeoVolumeAssembly("TPC_OFCSEG");
37831078 268 //
c449e944 269 // assembly OCV and OFC
270 //
271 // 1st - no rotation
272 t200->AddNode(tov1,1); t200->AddNode(togv5,1);
273 t300->AddNode(tf1v,1); t300->AddNode(tfg4v,1);
274 // 2nd - rotation 60 deg
275 segrot = new TGeoRotation();
276 segrot->RotateZ(60.);
277 t200->AddNode(tov1,2,segrot); t200->AddNode(togv5,2,segrot);
278 t300->AddNode(tf1v,2,segrot); t300->AddNode(tfg4v,2,segrot);
279 // 3rd rotation 120 deg
280 segrot = new TGeoRotation();
281 segrot->RotateZ(120.);
282 t200->AddNode(tov1,3,segrot); t200->AddNode(togv5,3,segrot);
283 t300->AddNode(tf1v,3,segrot); t300->AddNode(tfg4v,3,segrot);
284 //4th rotation 180 deg
285 segrot = new TGeoRotation();
286 segrot->RotateZ(180.);
287 t200->AddNode(tov1,4,segrot); t200->AddNode(togv5,4,segrot);
288 t300->AddNode(tf1v,4,segrot); t300->AddNode(tfg4v,4,segrot);
289 //5th rotation 240 deg
290 segrot = new TGeoRotation();
291 segrot->RotateZ(240.);
292 t200->AddNode(tov1,5,segrot); t200->AddNode(togv5,5,segrot);
293 t300->AddNode(tf1v,5,segrot); t300->AddNode(tfg4v,5,segrot);
294 //6th rotation 300 deg
295 segrot = new TGeoRotation();
296 segrot->RotateZ(300.);
297 t200->AddNode(tov1,6,segrot); t200->AddNode(togv5,6,segrot);
298 t300->AddNode(tf1v,6,segrot); t300->AddNode(tfg4v,6,segrot);
299 //
300 v3->AddNode(t200,1,new TGeoTranslation(0.,0.,-1.5)); v4->AddNode(t300,1);
37831078 301 //
c1637e41 302 v2->AddNode(v3,1); v2->AddNode(v4,1);
37831078 303 //
c1637e41 304 v1->AddNode(v2,1);
305 //--------------------------------------------------------------------
306 // Tpc Inner INsulator (CO2)
307 // the cones, the central drum and the inner f.c. sandwich with a piece
308 // of the flane will be placed in the TPC
309 //--------------------------------------------------------------------
310 TGeoPcon *tpci = new TGeoPcon(0.,360.,4);
37831078 311 //
c1637e41 312 tpci->DefineSection(0,-253.6,68.4,76.6774);
313 tpci->DefineSection(1,-74.0,61.2,76.6774);
37831078 314 //
c1637e41 315 tpci->DefineSection(2,74.0,61.2,76.6774);
37831078 316 //
c1637e41 317 tpci->DefineSection(3,253.6,65.9,76.6774);
37831078 318 //
c1637e41 319 TGeoVolume *v5 = new TGeoVolume("TPC_INI",tpci,m2);
37831078 320 //
c1637e41 321 // now the inner field cage - only part of flanges (2 copies)
37831078 322 //
c1637e41 323 TGeoTube *tif1 = new TGeoTube(69.9,76.6774,1.5);
324 TGeoVolume *v6 = new TGeoVolume("TPC_IFC1",tif1,m3);
37831078 325 //
c1637e41 326 //---------------------------------------------------------
327 // Tpc Inner Containment vessel - Muon side
79575d04 328 //---------------------------------------------------------
c1637e41 329 TGeoPcon *tcms = new TGeoPcon(0.,360.,10);
37831078 330 //
c1637e41 331 tcms->DefineSection(0,-259.1,68.1,74.2);
332 tcms->DefineSection(1,-253.6,68.1,74.2);
37831078 333 //
c1637e41 334 tcms->DefineSection(2,-253.6,68.1,68.4);
335 tcms->DefineSection(3,-74.0,60.9,61.2);
37831078 336 //
c1637e41 337 tcms->DefineSection(4,-74.0,60.1,61.2);
338 tcms->DefineSection(5,-73.3,60.1,61.2);
37831078 339 //
c1637e41 340 tcms->DefineSection(6,-73.3,56.9,61.2);
341 tcms->DefineSection(7,-73.0,56.9,61.2);
37831078 342 //
c1637e41 343 tcms->DefineSection(8,-73.0,56.9,58.8);
344 tcms->DefineSection(9,-71.3,56.9,58.8);
37831078 345 //
c1637e41 346 TGeoVolume *v7 = new TGeoVolume("TPC_ICVM",tcms,m3);
c5d5037c 347 //------------------------------------------------
348 // Heat screen muon side
349 //------------------------------------------------
350
351 TGeoCone *thsm = new TGeoCone(89.8,67.88,68.1,60.68,60.9);
352 TGeoCone *thsmw = new TGeoCone(89.8,67.94,68.04,60.74,60.84);
353 TGeoVolume *hvsm = new TGeoVolume("TPC_HSM",thsm,mhs); //steel
354 TGeoVolume *hvsmw = new TGeoVolume("TPC_HSMW",thsmw,m12); //water
355 // assembly heat screen muon
356 hvsm->AddNode(hvsmw,1);
c1637e41 357 //-----------------------------------------------
358 // inner containment vessel - shaft side
359 //-----------------------------------------------
360 TGeoPcon *tcss = new TGeoPcon(0.,360.,10);
37831078 361 //
c1637e41 362 tcss->DefineSection(0,71.3,56.9,58.8);
363 tcss->DefineSection(1,73.0,56.9,58.8);
1283eee5 364 //
c1637e41 365 tcss->DefineSection(2,73.0,56.9,61.2);
366 tcss->DefineSection(3,73.3,56.9,61.2);
367 //
368 tcss->DefineSection(4,73.3,60.1,61.2);
369 tcss->DefineSection(5,74.0,60.1,61.2);
1283eee5 370 //
c1637e41 371 tcss->DefineSection(6,74.0,60.9,61.2);
372 tcss->DefineSection(7,253.6,65.6,65.9);
37831078 373 //
c1637e41 374 tcss->DefineSection(8,253.6,65.6,74.2);
375 tcss->DefineSection(9,258.1,65.6,74.2);
1283eee5 376 //
c1637e41 377 TGeoVolume *v8 = new TGeoVolume("TPC_ICVS",tcss,m3);
c5d5037c 378 //-------------------------------------------------
379 // Heat screen shaft side
380 //--------------------------------------------------
381 TGeoCone *thss = new TGeoCone(89.8,60.68,60.9,65.38,65.6);
382 TGeoCone *thssw = new TGeoCone(89.8,60.74,60.84,65.44,65.54);
383 TGeoVolume *hvss = new TGeoVolume("TPC_HSS",thss,mhs); //steel
384 TGeoVolume *hvssw = new TGeoVolume("TPC_HSSW",thssw,m12); //water
385 //assembly heat screen shaft
386 hvss->AddNode(hvssw,1);
c1637e41 387 //-----------------------------------------------
388 // Inner field cage
389 // define 4 parts and make an assembly
390 //-----------------------------------------------
391 // part1 - Al - 2 copies
392 TGeoTube *t1 = new TGeoTube(76.6774,78.845,0.75);
393 TGeoVolume *tv1 = new TGeoVolume("TPC_IFC2",t1,m3);
394 // sandwich - outermost parts - 2 copies
1283eee5 395 //
878dd3f2 396 // segment outermost
397 //
d56d7df1 398 TGeoTubeSeg *t2 = new TGeoTubeSeg(76.6774,78.845,74.175,350.,109.4); // tedlar 38 microns
399 TGeoTubeSeg *t3 = new TGeoTubeSeg(76.6812,78.8412,74.175,350.,109.4); // prepreg2 500 microns
400 TGeoTubeSeg *t4 = new TGeoTubeSeg(76.7312,78.7912,74.175,350.,109.4); // prepreg3 300 microns
401 TGeoTubeSeg *t5 = new TGeoTubeSeg(76.7612,78.7612,74.175,350.,109.4); // nomex 2 cm
402 TGeoTubeSeg *tepox1 = new TGeoTubeSeg(76.6774,78.845,74.175,109.4,110.);//epoxy
e079adac 403 TGeoTubeSeg *tpr1 = new TGeoTubeSeg(78.845,78.885,74.175,109.,111.);
878dd3f2 404
405 // volumes for the outer part
c1637e41 406 TGeoVolume *tv2 = new TGeoVolume("TPC_IFC3",t2,sm2);
407 TGeoVolume *tv3 = new TGeoVolume("TPC_IFC4",t3,sm3);
408 TGeoVolume *tv4 = new TGeoVolume("TPC_IFC5",t4,sm5);
409 TGeoVolume *tv5 = new TGeoVolume("TPC_IFC6",t5,sm4);
878dd3f2 410 TGeoVolume *tvep1 = new TGeoVolume("TPC_IFEPOX1",tepox1,sm1);
411 TGeoVolume *tvpr1 = new TGeoVolume("TPC_PRSTR1",tpr1,sm2);
37831078 412 //
c1637e41 413 // middle parts - 2 copies
79575d04 414 //
878dd3f2 415 // segment middle
416 //
d56d7df1 417 TGeoTubeSeg *t6 = new TGeoTubeSeg(76.6774,78.795,5.,350.,109.4); // tedlar 38 microns
418 TGeoTubeSeg *t7 = new TGeoTubeSeg(76.6812,78.7912,5.,350.,109.4); // prepreg2 250 microns
419 TGeoTubeSeg *t8 = new TGeoTubeSeg(76.7062,78.7662,5.,350.,109.4); // prepreg3 300 microns
420 TGeoTubeSeg *t9 = new TGeoTubeSeg(76.7362,78.7362,5.,350.,109.4); // nomex 2 cm
421 TGeoTubeSeg *tepox2 = new TGeoTubeSeg(76.6774,78.795,5.,109.4,110.);//epoxy
e079adac 422 TGeoTubeSeg *tpr2 = new TGeoTubeSeg(78.795,78.835,5.,109.,111.);
878dd3f2 423 // volumes for the middle part
c1637e41 424 TGeoVolume *tv6 = new TGeoVolume("TPC_IFC7",t6,sm2);
425 TGeoVolume *tv7 = new TGeoVolume("TPC_IFC8",t7,sm3);
426 TGeoVolume *tv8 = new TGeoVolume("TPC_IFC9",t8,sm5);
427 TGeoVolume *tv9 = new TGeoVolume("TPC_IFC10",t9,sm4);
878dd3f2 428 TGeoVolume *tvep2 = new TGeoVolume("TPC_IFEPOX2",tepox2,sm1);
429 TGeoVolume *tvpr2 = new TGeoVolume("TPC_PRSTR2",tpr2,sm2);
c1637e41 430 // central part - 1 copy
878dd3f2 431 //
432 // segment central part
433 //
d56d7df1 434 TGeoTubeSeg *t10 = new TGeoTubeSeg(76.6774,78.785,93.75,350.,109.4); // tedlar 38 microns
435 TGeoTubeSeg *t11 = new TGeoTubeSeg(76.6812,78.7812,93.75,350.,109.4); // prepreg3 500 microns
436 TGeoTubeSeg *t12 = new TGeoTubeSeg(76.7312,78.7312,93.75,350.,109.4); // nomex 2 cm
437 TGeoTubeSeg *tepox3 = new TGeoTubeSeg(76.6774,78.785,93.75,109.4,110.);//epoxy
e079adac 438 TGeoTubeSeg *tpr3 = new TGeoTubeSeg(78.785,78.825,93.75,109.,111.);
878dd3f2 439 // volumes for the central part
c1637e41 440 TGeoVolume *tv10 = new TGeoVolume("TPC_IFC11",t10,sm2);
441 TGeoVolume *tv11 = new TGeoVolume("TPC_IFC12",t11,sm5);
442 TGeoVolume *tv12 = new TGeoVolume("TPC_IFC13",t12,sm4);
878dd3f2 443 TGeoVolume *tvep3 = new TGeoVolume("TPC_IFEPOX3",tepox3,sm1);
444 TGeoVolume *tvpr3 = new TGeoVolume("TPC_PRSTR3",tpr3,sm2);
79575d04 445 //
878dd3f2 446 // creating a sandwich for the outer par,t tv2 is the mother
79575d04 447 //
c1637e41 448 tv2->AddNode(tv3,1); tv3->AddNode(tv4,1); tv4->AddNode(tv5,1);
79575d04 449 //
878dd3f2 450 // creating a sandwich for the middle part, tv6 is the mother
451 //
c1637e41 452 tv6->AddNode(tv7,1); tv7->AddNode(tv8,1); tv8->AddNode(tv9,1);
79575d04 453 //
878dd3f2 454 // creating a sandwich for the central part, tv10 is the mother
455 //
c1637e41 456 tv10->AddNode(tv11,1); tv11->AddNode(tv12,1);
37831078 457 //
878dd3f2 458 TGeoVolumeAssembly *tv100 = new TGeoVolumeAssembly("TPC_IFC"); // ifc itself - 3 segments
878dd3f2 459
37831078 460 //
878dd3f2 461 // first segment - no rotation
462 //
463 // central
464 tv100->AddNode(tv10,1); //sandwich
465 tv100->AddNode(tvep3,1);//epoxy
466 tv100->AddNode(tvpr3,1);//prepreg strip
467 // middle
468 tv100->AddNode(tv6,1,new TGeoTranslation(0.,0.,-98.75)); //sandwich1
469 tv100->AddNode(tv6,2,new TGeoTranslation(0.,0.,98.75)); // sandwich2
470 tv100->AddNode(tvep2,1,new TGeoTranslation(0.,0.,-98.75)); //epoxy
471 tv100->AddNode(tvep2,2,new TGeoTranslation(0.,0.,98.75)); //epoxy
472 tv100->AddNode(tvpr2,1,new TGeoTranslation(0.,0.,-98.75));//prepreg strip
473 tv100->AddNode(tvpr2,2,new TGeoTranslation(0.,0.,98.75));
474 // outer
475 tv100->AddNode(tv2,1,new TGeoTranslation(0.,0.,-177.925)); //sandwich
c1637e41 476 tv100->AddNode(tv2,2,new TGeoTranslation(0.,0.,177.925));
878dd3f2 477 tv100->AddNode(tvep1,1,new TGeoTranslation(0.,0.,-177.925)); //epoxy
478 tv100->AddNode(tvep1,2,new TGeoTranslation(0.,0.,177.925));
479 tv100->AddNode(tvpr1,1,new TGeoTranslation(0.,0.,-177.925));//prepreg strip
480 tv100->AddNode(tvpr1,2,new TGeoTranslation(0.,0.,-177.925));
481 //
482 // second segment - rotation 120 deg.
483 //
484 segrot = new TGeoRotation();
485 segrot->RotateZ(120.);
486 //
487 // central
488 tv100->AddNode(tv10,2,segrot); //sandwich
489 tv100->AddNode(tvep3,2,segrot);//epoxy
490 tv100->AddNode(tvpr3,2,segrot);//prepreg strip
491 // middle
492 tv100->AddNode(tv6,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
493 tv100->AddNode(tv6,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
494 tv100->AddNode(tvep2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
495 tv100->AddNode(tvep2,4,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
496 tv100->AddNode(tvpr2,3,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
497 tv100->AddNode(tvpr2,4,new TGeoCombiTrans(0.,0.,98.75,segrot));
498 //outer
499 tv100->AddNode(tv2,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
500 tv100->AddNode(tv2,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
501 tv100->AddNode(tvep1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
502 tv100->AddNode(tvep1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
503 tv100->AddNode(tvpr1,3,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
504 tv100->AddNode(tvpr1,4,new TGeoCombiTrans(0.,0.,177.925,segrot));
505 //
506 // third segment - rotation 240 deg.
507 //
508 segrot = new TGeoRotation();
509 segrot->RotateZ(240.);
510 //
511 // central
512 tv100->AddNode(tv10,3,segrot); //sandwich
513 tv100->AddNode(tvep3,3,segrot);//epoxy
514 tv100->AddNode(tvpr3,3,segrot);//prepreg strip
515 // middle
516 tv100->AddNode(tv6,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //sandwich1
517 tv100->AddNode(tv6,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); // sandwich2
518 tv100->AddNode(tvep2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot)); //epoxy
519 tv100->AddNode(tvep2,6,new TGeoCombiTrans(0.,0.,98.75,segrot)); //epoxy
520 tv100->AddNode(tvpr2,5,new TGeoCombiTrans(0.,0.,-98.75,segrot));//prepreg strip
521 tv100->AddNode(tvpr2,6,new TGeoCombiTrans(0.,0.,98.75,segrot));
522 //outer
523 tv100->AddNode(tv2,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//sandwich
524 tv100->AddNode(tv2,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
525 tv100->AddNode(tvep1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//epoxy
526 tv100->AddNode(tvep1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
527 tv100->AddNode(tvpr1,5,new TGeoCombiTrans(0.,0.,-177.925,segrot));//prepreg strip
528 tv100->AddNode(tvpr1,6,new TGeoCombiTrans(0.,0.,177.925,segrot));
529 // Al parts - rings
c1637e41 530 tv100->AddNode(tv1,1,new TGeoTranslation(0.,0.,-252.85));
531 tv100->AddNode(tv1,2,new TGeoTranslation(0.,0.,252.85));
532 //
533 v5->AddNode(v6,1, new TGeoTranslation(0.,0.,-252.1));
534 v5->AddNode(v6,2, new TGeoTranslation(0.,0.,252.1));
535 v1->AddNode(v5,1); v1->AddNode(v7,1); v1->AddNode(v8,1);
c5d5037c 536 v1->AddNode(hvsm,1,new TGeoTranslation(0.,0.,-163.8));
537 v1->AddNode(hvss,1,new TGeoTranslation(0.,0.,163.8));
c1637e41 538 v9->AddNode(tv100,1);
539 //
540 // central drum
541 //
542 // flange + sandwich
543 //
544 TGeoPcon *cfl = new TGeoPcon(0.,360.,6);
545 cfl->DefineSection(0,-71.1,59.7,61.2);
546 cfl->DefineSection(1,-68.6,59.7,61.2);
547 //
efbf94c5 548 cfl->DefineSection(2,-68.6,60.6124,61.2);
549 cfl->DefineSection(3,68.6,60.6124,61.2);
c1637e41 550 //
551 cfl->DefineSection(4,68.6,59.7,61.2);
552 cfl->DefineSection(5,71.1,59.7,61.2);
553 //
554 TGeoVolume *cflv = new TGeoVolume("TPC_CDR",cfl,m3);
555 // sandwich
d56d7df1 556 TGeoTubeSeg *cd1 = new TGeoTubeSeg(60.6224,61.19,71.1,0.1,119.9);
557 TGeoTubeSeg *cd2 = new TGeoTubeSeg(60.6262,61.1862,71.1,0.1,119.9);
558 TGeoTubeSeg *cd3 = new TGeoTubeSeg(60.6462,61.1662,71.1,0.1,119.9);
559 TGeoTubeSeg *cd4 = new TGeoTubeSeg(60.6562,61.1562,71.1,0.1,119.9);
560 TGeoTubeSeg *tepox4 = new TGeoTubeSeg(60.6224,61.19,71.1,359.9,0.1);
561 // TGeoTube *cd1 = new TGeoTube(60.6224,61.19,71.1);
562 // TGeoTube *cd2 = new TGeoTube(60.6262,61.1862,71.1);
563 // TGeoTube *cd3 = new TGeoTube(60.6462,61.1662,71.1);
564 // TGeoTube *cd4 = new TGeoTube(60.6562,61.1562,71.1);
c1637e41 565 //
566 TGeoMedium *sm6 = gGeoManager->GetMedium("TPC_Prepreg1");
efbf94c5 567 TGeoMedium *sm8 = gGeoManager->GetMedium("TPC_Epoxyfm");
c1637e41 568 TGeoVolume *cd1v = new TGeoVolume("TPC_CDR1",cd1,sm2); //tedlar
569 TGeoVolume *cd2v = new TGeoVolume("TPC_CDR2",cd2,sm6);// prepreg1
efbf94c5 570 TGeoVolume *cd3v = new TGeoVolume("TPC_CDR3",cd3,sm8); //epoxy film
571 TGeoVolume *cd4v = new TGeoVolume("TPC_CDR4",cd4,sm4); //nomex
d56d7df1 572 TGeoVolume *tvep4 = new TGeoVolume("TPC_IFEPOX4",tepox4,sm1);
efbf94c5 573
c1637e41 574 //
575 // seals for central drum 2 copies
576 //
577 TGeoTube *cs = new TGeoTube(56.9,61.2,0.1);
578 TGeoMedium *sm7 = gGeoManager->GetMedium("TPC_Mylar");
579 TGeoVolume *csv = new TGeoVolume("TPC_CDRS",cs,sm7);
3378c058 580 v1->AddNode(csv,1,new TGeoTranslation(0.,0.,-71.2));
581 v1->AddNode(csv,2,new TGeoTranslation(0.,0.,71.2));
c1637e41 582 //
583 // seal collars
584 TGeoPcon *se = new TGeoPcon(0.,360.,6);
585 se->DefineSection(0,-72.8,59.7,61.2);
586 se->DefineSection(1,-72.3,59.7,61.2);
587 //
588 se->DefineSection(2,-72.3,58.85,61.2);
589 se->DefineSection(3,-71.6,58.85,61.2);
590 //
591 se->DefineSection(4,-71.6,59.7,61.2);
592 se->DefineSection(5,-71.3,59.7,61.2);
593 //
594 TGeoVolume *sev = new TGeoVolume("TPC_CDCE",se,m3);
595 //
596 TGeoTube *si = new TGeoTube(56.9,58.8,1.);
597 TGeoVolume *siv = new TGeoVolume("TPC_CDCI",si,m3);
598 //
599 // define reflection matrix
600 //
4fa47888 601 TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
c1637e41 602 //
d56d7df1 603 cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cd3v->AddNode(cd4v,1); //sandwich
604 // first segment
605 cflv->AddNode(cd1v,1); cflv->AddNode(tvep4,1);
606 // second segment
607 segrot = new TGeoRotation();
608 segrot->RotateZ(120.);
609 cflv->AddNode(cd1v,2,segrot); cflv->AddNode(tvep4,2,segrot);
610 // third segment
611 segrot = new TGeoRotation();
612 segrot->RotateZ(240.);
613 cflv->AddNode(cd1v,3,segrot); cflv->AddNode(tvep4,3,segrot);
c1637e41 614 //
a1ec4d07 615 v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
616 v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
c1637e41 617 v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
618 //
619 // central membrane - 2 rings and a mylar membrane - assembly
620 //
cf84f9b1 621 TGeoTube *ih = new TGeoTube(81.05,84.05,0.3);
622 TGeoTube *oh = new TGeoTube(250.,256.,0.5);
4236db1b 623 TGeoTube *mem = new TGeoTube(84.05,250.,0.00115);
c449e944 624
625 //
626 TGeoMedium *m4 = gGeoManager->GetMedium("TPC_G10");
627 //
c1637e41 628 TGeoVolume *ihv = new TGeoVolume("TPC_IHVH",ih,m3);
629 TGeoVolume *ohv = new TGeoVolume("TPC_OHVH",oh,m3);
c449e944 630
c1637e41 631 TGeoVolume *memv = new TGeoVolume("TPC_HV",mem,sm7);
632 //
633 TGeoVolumeAssembly *cm = new TGeoVolumeAssembly("TPC_HVMEM");
634 cm->AddNode(ihv,1);
635 cm->AddNode(ohv,1);
636 cm->AddNode(memv,1);
c449e944 637
c1637e41 638 v9->AddNode(cm,1);
639 //
640 // end caps - they are make as an assembly of single segments
641 // containing both readout chambers
642 //
d899e254 643 Double_t openingAngle = 10.*TMath::DegToRad();
c1637e41 644 Double_t thick=1.5; // rib
d899e254 645 Double_t shift = thick/TMath::Sin(openingAngle);
c1637e41 646 //
d899e254 647 Double_t lowEdge = 86.3; // hole in the wheel
648 Double_t upEdge = 240.4; // hole in the wheel
c1637e41 649 //
650 new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
651 //
652 TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
653 //
d899e254 654 hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
655 hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
c1637e41 656 //
d899e254 657 hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
658 hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
c1637e41 659 //
d899e254 660 Double_t ys = shift*TMath::Sin(openingAngle);
661 Double_t xs = shift*TMath::Cos(openingAngle);
c1637e41 662 TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
663 tr->RegisterYourself();
664 TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
665 TGeoVolume *sv = new TGeoVolume("TPC_WSEG",chamber,m3);
666 TGeoPgon *bar = new TGeoPgon("bar",0.,20.,1,2);
667 bar->DefineSection(0,-3.,131.5-shift,136.5-shift);
668 bar->DefineSection(1,1.5,131.5-shift,136.5-shift);
669 TGeoVolume *barv = new TGeoVolume("TPC_WBAR",bar,m3);
670 TGeoVolumeAssembly *ch = new TGeoVolumeAssembly("TPC_WCH");//empty segment
671 //
672 ch->AddNode(sv,1); ch->AddNode(barv,1,tr);
673 //
674 // readout chambers
675 //
676 // IROC first
677 //
678 TGeoTrd1 *ibody = new TGeoTrd1(13.8742,21.3328,4.29,21.15);
679 TGeoVolume *ibdv = new TGeoVolume("TPC_IROCB",ibody,m3);
37831078 680 // empty space
c1637e41 681 TGeoTrd1 *emp = new TGeoTrd1(12.3742,19.8328,3.99,19.65);
682 TGeoVolume *empv = new TGeoVolume("TPC_IROCE",emp,m1);
683 ibdv->AddNode(empv,1,new TGeoTranslation(0.,-0.3,0.));
684 //bars
685 Double_t tga = (19.8328-12.3742)/39.3;
686 Double_t xmin,xmax;
687 xmin = 9.55*tga+12.3742;
688 xmax = 9.95*tga+12.3742;
689 TGeoTrd1 *ib1 = new TGeoTrd1(xmin,xmax,3.29,0.2);
690 TGeoVolume *ib1v = new TGeoVolume("TPC_IRB1",ib1,m3);
691 empv->AddNode(ib1v,1,new TGeoTranslation("tt1",0.,0.7,-9.9));
692 xmin=19.4*tga+12.3742;
693 xmax=19.9*tga+12.3742;
694 TGeoTrd1 *ib2 = new TGeoTrd1(xmin,xmax,3.29,0.25);
695 TGeoVolume *ib2v = new TGeoVolume("TPC_TRB2",ib2,m3);
696 empv->AddNode(ib2v,1,new TGeoTranslation(0.,0.7,0.));
697 xmin=29.35*tga+12.3742;
698 xmax=29.75*tga+12.3742;
699 TGeoTrd1 *ib3 = new TGeoTrd1(xmin,xmax,3.29,0.2);
700 TGeoVolume *ib3v = new TGeoVolume("TPC_IRB3",ib3,m3);
701 empv->AddNode(ib3v,1,new TGeoTranslation(0.,0.7,9.9));
702 //
703 // holes for connectors
704 //
705 TGeoBBox *conn = new TGeoBBox(0.4,0.3,4.675); // identical for iroc and oroc
706 TGeoVolume *connv = new TGeoVolume("TPC_RCCON",conn,m1);
d9e80aca 707 TString fileName(gSystem->Getenv("ALICE_ROOT"));
708 fileName += "/TPC/conn_iroc.dat";
c1637e41 709 ifstream in;
d9e80aca 710 in.open(fileName.Data(), ios_base::in); // asci file
2d1d58a6 711 TGeoRotation *rrr[86];
c1637e41 712 for(Int_t i =0;i<86;i++){
456cb019 713 Double_t y = 3.99;
c1637e41 714 Double_t x,z,ang;
715 in>>x>>z>>ang;
456cb019 716 z-=26.5;
2d1d58a6 717 rrr[i]= new TGeoRotation();
718 rrr[i]->RotateY(ang);
719 ibdv->AddNode(connv,i+1,new TGeoCombiTrans(x,y,z,rrr[i]));
c1637e41 720 }
721 in.close();
722 // "cap"
723 new TGeoTrd1("icap",14.5974,23.3521,1.19,24.825);
724 // "hole"
725 new TGeoTrd1("ihole",13.8742,21.3328,1.2,21.15);
726 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0.,0.,1.725);
727 tr1->RegisterYourself();
728 TGeoCompositeShape *ic = new TGeoCompositeShape("icap-ihole:tr1");
729 TGeoVolume *icv = new TGeoVolume("TPC_IRCAP",ic,m3);
730 //
731 // pad plane and wire fixations
732 //
733 TGeoTrd1 *pp = new TGeoTrd1(14.5974,23.3521,0.3,24.825); //pad+iso
c1637e41 734 TGeoVolume *ppv = new TGeoVolume("TPC_IRPP",pp,m4);
735 TGeoPara *f1 = new TGeoPara(.6,.5,24.825,0.,-10.,0.);
736 TGeoVolume *f1v = new TGeoVolume("TPC_IRF1",f1,m4);
737 TGeoPara *f2 = new TGeoPara(.6,.5,24.825,0.,10.,0.);
738 TGeoVolume *f2v = new TGeoVolume("TPC_IRF2",f2,m4);
739 //
740 TGeoVolumeAssembly *iroc = new TGeoVolumeAssembly("TPC_IROC");
741 //
742 iroc->AddNode(ibdv,1);
743 iroc->AddNode(icv,1,new TGeoTranslation(0.,3.1,-1.725));
744 iroc->AddNode(ppv,1,new TGeoTranslation(0.,4.59,-1.725));
745 tga =(23.3521-14.5974)/49.65;
746 Double_t xx = 24.825*tga+14.5974-0.6;
747 iroc->AddNode(f1v,1,new TGeoTranslation(-xx,5.39,-1.725));
748 iroc->AddNode(f2v,1,new TGeoTranslation(xx,5.39,-1.725));
749 //
750 // OROC
751 //
752 TGeoTrd1 *obody = new TGeoTrd1(22.2938,40.5084,4.19,51.65);
753 TGeoVolume *obdv = new TGeoVolume("TPC_OROCB",obody,m3);
754 TGeoTrd1 *oemp = new TGeoTrd1(20.2938,38.5084,3.89,49.65);
755 TGeoVolume *oempv = new TGeoVolume("TPC_OROCE",oemp,m1);
756 obdv->AddNode(oempv,1,new TGeoTranslation(0.,-0.3,0.));
757 //horizontal bars
758 tga=(38.5084-20.2938)/99.3;
759 xmin=tga*10.2+20.2938;
760 xmax=tga*10.6+20.2938;
761 TGeoTrd1 *ob1 = new TGeoTrd1(xmin,xmax,2.915,0.2);
762 TGeoVolume *ob1v = new TGeoVolume("TPC_ORB1",ob1,m3);
763 //
764 xmin=22.55*tga+20.2938;
765 xmax=24.15*tga+20.2938;
766 TGeoTrd1 *ob2 = new TGeoTrd1(xmin,xmax,2.915,0.8);
767 TGeoVolume *ob2v = new TGeoVolume("TPC_ORB2",ob2,m3);
768 //
769 xmin=36.1*tga+20.2938;
770 xmax=36.5*tga+20.2938;
771 TGeoTrd1 *ob3 = new TGeoTrd1(xmin,xmax,2.915,0.2);
772 TGeoVolume *ob3v = new TGeoVolume("TPC_ORB3",ob3,m3);
773 //
774 xmin=49.0*tga+20.2938;
775 xmax=50.6*tga+20.2938;
776 TGeoTrd1 *ob4 = new TGeoTrd1(xmin,xmax,2.915,0.8);
777 TGeoVolume *ob4v = new TGeoVolume("TPC_ORB4",ob4,m3);
778 //
779 xmin=63.6*tga+20.2938;
780 xmax=64.0*tga+20.2938;
781 TGeoTrd1 *ob5 = new TGeoTrd1(xmin,xmax,2.915,0.2);
782 TGeoVolume *ob5v = new TGeoVolume("TPC_ORB5",ob5,m3);
783 //
784 xmin=75.5*tga+20.2938;
785 xmax=77.15*tga+20.2938;
786 TGeoTrd1 *ob6 = new TGeoTrd1(xmin,xmax,2.915,0.8);
787 TGeoVolume *ob6v = new TGeoVolume("TPC_ORB6",ob6,m3);
788 //
789 xmin=88.7*tga+20.2938;
790 xmax=89.1*tga+20.2938;
791 TGeoTrd1 *ob7 = new TGeoTrd1(xmin,xmax,2.915,0.2);
792 TGeoVolume *ob7v = new TGeoVolume("TPC_ORB7",ob7,m3);
793 //
794 oempv->AddNode(ob1v,1,new TGeoTranslation(0.,0.975,-39.25));
795 oempv->AddNode(ob2v,1,new TGeoTranslation(0.,0.975,-26.3));
796 oempv->AddNode(ob3v,1,new TGeoTranslation(0.,0.975,-13.35));
797 oempv->AddNode(ob4v,1,new TGeoTranslation(0.,0.975,0.15));
798 oempv->AddNode(ob5v,1,new TGeoTranslation(0.,0.975,14.15));
799 oempv->AddNode(ob6v,1,new TGeoTranslation(0.,0.975,26.7));
800 oempv->AddNode(ob7v,1,new TGeoTranslation(0.,0.975,39.25));
801 // vertical bars
802 TGeoBBox *ob8 = new TGeoBBox(0.8,2.915,5.1);
803 TGeoBBox *ob9 = new TGeoBBox(0.8,2.915,5.975);
804 TGeoBBox *ob10 = new TGeoBBox(0.8,2.915,5.775);
805 TGeoBBox *ob11 = new TGeoBBox(0.8,2.915,6.25);
806 TGeoBBox *ob12 = new TGeoBBox(0.8,2.915,6.5);
807 //
808 TGeoVolume *ob8v = new TGeoVolume("TPC_ORB8",ob8,m3);
809 TGeoVolume *ob9v = new TGeoVolume("TPC_ORB9",ob9,m3);
810 TGeoVolume *ob10v = new TGeoVolume("TPC_ORB10",ob10,m3);
811 TGeoVolume *ob11v = new TGeoVolume("TPC_ORB11",ob11,m3);
812 TGeoVolume *ob12v = new TGeoVolume("TPC_ORB12",ob12,m3);
813 //
814 oempv->AddNode(ob8v,1,new TGeoTranslation(0.,0.975,-44.55));
815 oempv->AddNode(ob8v,2,new TGeoTranslation(0.,0.975,44.55));
816 oempv->AddNode(ob9v,1,new TGeoTranslation(0.,0.975,-33.075));
817 oempv->AddNode(ob9v,2,new TGeoTranslation(0.,0.975,-19.525));
818 oempv->AddNode(ob10v,1,new TGeoTranslation(0.,0.975,20.125));
819 oempv->AddNode(ob10v,2,new TGeoTranslation(0.,0.975,33.275));
820 oempv->AddNode(ob11v,1,new TGeoTranslation(0.,0.975,-6.9));
821 oempv->AddNode(ob12v,1,new TGeoTranslation(0.,0.975,7.45));
822 //
823 // holes for connectors
824 //
d9e80aca 825 fileName = gSystem->Getenv("ALICE_ROOT");
826 fileName += "/TPC/conn_oroc.dat";
827 in.open(fileName.Data(), ios_base::in); // asci file
2d1d58a6 828 TGeoRotation *rr[78];
c1637e41 829 for(Int_t i =0;i<78;i++){
830 Double_t y =3.89;
831 Double_t x,z,ang;
832 Double_t x1,z1,x2,z2;
833 in>>x>>z>>ang;
834 Double_t xr = 4.7*TMath::Sin(ang*TMath::DegToRad());
835 Double_t zr = 4.7*TMath::Cos(ang*TMath::DegToRad());
836 //
837 x1=xr+x; x2=-xr+x; z1=zr+z; z2 = -zr+z;
838 //
2d1d58a6 839 rr[i]= new TGeoRotation();
840 rr[i]->RotateY(ang);
c1637e41 841 z1-=54.95;
842 z2-=54.95;
5f174279 843 //
2d1d58a6 844 obdv->AddNode(connv,i+1,new TGeoCombiTrans(x1,y,z1,rr[i]));
845 obdv->AddNode(connv,i+79,new TGeoCombiTrans(x2,y,z2,rr[i]));
c1637e41 846 }
847 in.close();
848 // cap
849 new TGeoTrd1("ocap",23.3874,43.5239,1.09,57.1);
850 new TGeoTrd1("ohole",22.2938,40.5084,1.09,51.65);
851 TGeoTranslation *tr5 = new TGeoTranslation("tr5",0.,0.,-2.15);
852 tr5->RegisterYourself();
853 TGeoCompositeShape *oc = new TGeoCompositeShape("ocap-ohole:tr5");
854 TGeoVolume *ocv = new TGeoVolume("TPC_ORCAP",oc,m3);
855 //
856 // pad plane and wire fixations
857 //
858 TGeoTrd1 *opp = new TGeoTrd1(23.3874,43.5239,0.3,57.1);
859 TGeoVolume *oppv = new TGeoVolume("TPC_ORPP",opp,m4);
860 //
861 tga=(43.5239-23.3874)/114.2;
862 TGeoPara *f3 = new TGeoPara(.7,.6,57.1,0.,-10.,0.);
863 TGeoPara *f4 = new TGeoPara(.7,.6,57.1,0.,10.,0.);
864 xx = 57.1*tga+23.3874-0.7;
865 TGeoVolume *f3v = new TGeoVolume("TPC_ORF1",f3,m4);
866 TGeoVolume *f4v = new TGeoVolume("TPC_ORF2",f4,m4);
867 //
868 TGeoVolumeAssembly *oroc = new TGeoVolumeAssembly("TPC_OROC");
869 //
870 oroc->AddNode(obdv,1);
871 oroc->AddNode(ocv,1,new TGeoTranslation(0.,3.1,2.15));
872 oroc->AddNode(oppv,1,new TGeoTranslation(0.,4.49,2.15));
873 oroc->AddNode(f3v,1,new TGeoTranslation(-xx,5.39,2.15));
874 oroc->AddNode(f4v,1,new TGeoTranslation(xx,5.39,2.15));
875 //
876 // now iroc and oroc are placed into a sector...
877 //
a1ec4d07 878 TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
879 TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
c1637e41 880 TGeoRotation rot1("rot1",90.,90.,0.);
881 TGeoRotation rot2("rot2");
882 rot2.RotateY(10.);
883 TGeoRotation *rot = new TGeoRotation("rot");
884 *rot=rot1*rot2;
885 //
886 Double_t x0,y0;
d899e254 887 x0=110.2*TMath::Cos(openingAngle);
888 y0=110.2*TMath::Sin(openingAngle);
1bae4c82 889 TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //a-side
890 TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //c-side
d899e254 891 x0=188.45*TMath::Cos(openingAngle);
892 y0=188.45*TMath::Sin(openingAngle);
1bae4c82 893 TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //a-side
894 TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //c-side
c1637e41 895 //
c1637e41 896 //
a1ec4d07 897 // A-side
c1637e41 898 //
a1ec4d07 899 secta->AddNode(ch,1);
900 secta->AddNode(iroc,1,combi1a);
901 secta->AddNode(oroc,1,combi2a);
902 //
903 // C-side
904 //
905 sectc->AddNode(ch,1);
906 sectc->AddNode(iroc,1,combi1c);
907 sectc->AddNode(oroc,1,combi2c);
908 //
909 // now I try to make wheels...
910 //
911 TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
912 TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
c1637e41 913 //
5f174279 914 TGeoRotation *rwh[18];
c1637e41 915 for(Int_t i =0;i<18;i++){
916 Double_t phi = (20.*i);
5f174279 917 rwh[i]=new TGeoRotation();
918 rwh[i]->RotateZ(phi);
919 wheela->AddNode(secta,i+1,rwh[i]);
920 wheelc->AddNode(sectc,i+1,rwh[i]);
c1637e41 921
922 }
4fa47888 923 // wheels in the drift volume!
a1ec4d07 924
c1637e41 925 TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
a1ec4d07 926 v9->AddNode(wheela,1,combi3);
927 v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
c1637e41 928 //_____________________________________________________________
929 // service support wheel
930 //_____________________________________________________________
931 TGeoPgon *sw = new TGeoPgon(0.,20.,1,2);
932 sw->DefineSection(0,-4.,80.5,251.75);
933 sw->DefineSection(1,4.,80.5,251.75);
934 TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
935 //
936 thick=1.;
d899e254 937 shift = thick/TMath::Sin(openingAngle);
c1637e41 938 TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
939 sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
940 sh->DefineSection(1,4.,81.5-shift,250.75-shift);
941 TGeoVolume *shv = new TGeoVolume("TPC_SWS1",sh,m1); //Air
942 //
74518339 943 TGeoMedium *m9 = gGeoManager->GetMedium("TPC_Si");
944 TGeoPgon *el = new TGeoPgon(0.,20.,1,2);
945 el->DefineSection(0,-1.872,81.5-shift,250.75-shift);
946 el->DefineSection(1,1.872,81.5-shift,250.75-shift);
947 TGeoVolume *elv = new TGeoVolume("TPC_ELEC",el,m9); //Si
948 //
949 shv->AddNode(elv,1);
950 //
951 //
d899e254 952 ys = shift*TMath::Sin(openingAngle);
953 xs = shift*TMath::Cos(openingAngle);
c1637e41 954 swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
955 // cover
956 TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
957 co->DefineSection(0,-0.5,77.,255.25);
958 co->DefineSection(1,0.5,77.,255.25);
959 TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
960 // hole in a cover
961 TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
d899e254 962 shift=4./TMath::Sin(openingAngle);
c1637e41 963 coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
964 coh->DefineSection(1,0.5,85.-shift,247.25-shift);
965 //
966 TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
967 //
d899e254 968 ys = shift*TMath::Sin(openingAngle);
969 xs = shift*TMath::Cos(openingAngle);
c1637e41 970 cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
971 //
972 // Sector as an Assembly
973 //
974 TGeoVolumeAssembly *swhs = new TGeoVolumeAssembly("TPC_SSWSEC");
975 swhs->AddNode(swv,1);
976 swhs->AddNode(cov,1,new TGeoTranslation(0.,0.,-4.5));
977 swhs->AddNode(cov,2,new TGeoTranslation(0.,0.,4.5));
978 //
979 // SSW as an Assembly of sectors
980 //
5f174279 981 TGeoRotation *rsw[18];
982 TGeoVolumeAssembly *swheel = new TGeoVolumeAssembly("TPC_SSWHEEL");
c1637e41 983 for(Int_t i =0;i<18;i++){
984 Double_t phi = (20.*i);
5f174279 985 rsw[i] = new TGeoRotation();
986 rsw[i]->RotateZ(phi);
987 swheel->AddNode(swhs,i+1,rsw[i]);
c1637e41 988 }
989 v1->AddNode(swheel,1,new TGeoTranslation(0.,0.,-284.6));
990 v1->AddNode(swheel,2,new TGeoTranslation(0.,0.,284.6));
991
992 // sensitive strips - strip "0" is always set
993 // conditional
994 Int_t totrows;
995 totrows = fTPCParam->GetNRowLow() + fTPCParam->GetNRowUp();
996 Double_t *upar;
997 upar=NULL;
998 gGeoManager->Volume("TPC_Strip","PGON",m5->GetId(),upar);
999 upar=new Double_t [10];
1000 upar[0]=0.;
1001 upar[1]=360.;
1002 upar[2]=18.;
1003 upar[3]=2.;
1004 //
1005 upar[4]=-124.8;
1006 upar[7]=124.8;
1007
1008 Double_t rlow=fTPCParam->GetPadRowRadiiLow(0);
1009
1010 upar[5]=rlow;
1011 upar[6]=rlow+.01;
1012 upar[8]=upar[5];
1013 upar[9]=upar[6];
1014 //
1015 gGeoManager->Node("TPC_Strip",1,"TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1016 gGeoManager->Node("TPC_Strip",totrows+1,
1017 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1018 //
1019 // now, strips optionally
1020 //
1021 if(fSens){
1022 //lower sectors
1023 for(Int_t i=2;i<fTPCParam->GetNRowLow()+1;i++){
1024 rlow=fTPCParam->GetPadRowRadiiLow(i-1);
1025 upar[5]=rlow;
1026 upar[6]=rlow+.01;
1027 upar[8]=upar[5];
1028 upar[9]=upar[6];
1029 gGeoManager->Node("TPC_Strip",i,
1030 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1031 gGeoManager->Node("TPC_Strip",totrows+i,
1032 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1033 }
1034 //upper sectors
1035 for(Int_t i=1;i<fTPCParam->GetNRowUp()+1;i++){
1036 rlow=fTPCParam->GetPadRowRadiiUp(i-1);
1037 upar[5]=rlow;
1038 upar[6]=rlow+.01;
1039 upar[8]=upar[5];
1040 upar[9]=upar[6];
1041 gGeoManager->Node("TPC_Strip",i+fTPCParam->GetNRowLow(),
1042 "TPC_Drift",0.,0.,124.82,0,kTRUE,upar,10);
1043 gGeoManager->Node("TPC_Strip",totrows+i+fTPCParam->GetNRowLow(),
1044 "TPC_Drift",0.,0.,-124.82,0,kTRUE,upar,10);
1045 }
1046 }//strips
37831078 1047 //----------------------------------------------------------
0f788f87 1048 // TPC Support Rods - MAKROLON
37831078 1049 //----------------------------------------------------------
c1637e41 1050 TGeoMedium *m6=gGeoManager->GetMedium("TPC_Makrolon");
1051 TGeoMedium *m7=gGeoManager->GetMedium("TPC_Cu");
78134e48 1052 TGeoMedium *m10 = gGeoManager->GetMedium("TPC_Alumina");
c5d5037c 1053 TGeoMedium *m11 = gGeoManager->GetMedium("TPC_Peek");;
0f788f87 1054 TGeoMedium *m13 = gGeoManager->GetMedium("TPC_Brass");
1055 //
1056 // tpc rod is an assembly of 10 long parts and 2 short parts
1057 // connected with alu rings and plagged on both sides.
c1637e41 1058 //
c1637e41 1059 //
0f788f87 1060// tpc rod long
1061//
1062 TGeoPcon *rod = new TGeoPcon("rod",0.,360.,6);
1063 rod->DefineSection(0,-10.43,1.92,2.08);
1064 rod->DefineSection(1,-9.75,1.92,2.08);
1065
1066 rod->DefineSection(2,-9.75,1.8,2.2);
1067 rod->DefineSection(3,9.75,1.8,2.2);
1068
1069 rod->DefineSection(4,9.75,1.92,2.08);
1070 rod->DefineSection(5,10.43,1.92,2.08);
1071 //
1072 TGeoVolume *mrodl = new TGeoVolume("TPC_mrodl",rod,m6);
1073 //
1074 // tpc rod short
1075 //
1076 TGeoPcon *rod1 = new TGeoPcon("rod1",0.,360.,6);
1077 rod1->DefineSection(0,-8.93,1.92,2.08);
1078 rod1->DefineSection(1,-8.25,1.92,2.08);
1079
1080 rod1->DefineSection(2,-8.25,1.8,2.2);
1081 rod1->DefineSection(3,8.25,1.8,2.2);
1082
1083 rod1->DefineSection(4,8.25,1.92,2.08);
1084 rod1->DefineSection(5,8.93,1.92,2.08);
1085 //
1086 TGeoVolume *mrods = new TGeoVolume("TPC_mrods",rod1,m6);
1087 //
1088 // below is for the resistor rod
1089 //
1090 // hole for the brass connectors
1091 //
1092
1093 new TGeoTube("hhole",0.,0.3,0.3);
1094 //
1095 //transformations for holes - initialy they
1096 // are placed at x=0 and negative y
1097 //
1098 TGeoRotation *rhole = new TGeoRotation();
1099 rhole->RotateX(90.);
1100 TGeoCombiTrans *transf[13];
1101 Char_t name[30];
1102 for(Int_t i=0;i<13;i++){
94e6c6f4 1103 //sprintf(name,"transf%d",i);
1104 snprintf(name,30,"transf%d",i);
0f788f87 1105 transf[i]= new TGeoCombiTrans(name,0.,-2.,-9.+i*1.5,rhole);
1106 transf[i]->RegisterYourself();
1107 }
1108 // union expression for holes
1109 TString operl("hhole:transf0");
1110 for (Int_t i=1;i<13;i++){
94e6c6f4 1111 //sprintf(name,"+hhole:transf%d",i);
1112 snprintf(name,30,"+hhole:transf%d",i);
0f788f87 1113 operl.Append(name);
1114 }
78134e48 1115 //
0f788f87 1116 TString opers("hhole:transf1");
1117 for (Int_t i=2;i<12;i++){
94e6c6f4 1118 //sprintf(name,"+hhole:transf%d",i);
1119 snprintf(name,30,"+hhole:transf%d",i);
0f788f87 1120 opers.Append(name);
1121 }
1122 //union of holes
1123 new TGeoCompositeShape("hlv",operl.Data());
1124 new TGeoCompositeShape("hsv",opers.Data());
1125 //
1126 TGeoCompositeShape *rodl = new TGeoCompositeShape("rodl","rod-hlv");
1127 TGeoCompositeShape *rods = new TGeoCompositeShape("rods","rod1-hsv");
1128 //rods - volumes - makrolon rods with holes
1129 TGeoVolume *rodlv = new TGeoVolume("TPC_rodl",rodl,m6);
1130 TGeoVolume *rodsv = new TGeoVolume("TPC_rods",rods,m6);
1131 //brass connectors
1132 //connectors
1133 TGeoTube *bcon = new TGeoTube(0.,0.3,0.3);//connectors
1134 TGeoVolume *bconv = new TGeoVolume("TPC_bcon",bcon,m13);
1135 //
1136 // hooks holding strips
1137 //
1138 new TGeoBBox("hk1",0.625,0.015,0.75);
1139 new TGeoBBox("hk2",0.625,0.015,0.15);
1140 TGeoTranslation *tr21 = new TGeoTranslation("tr21",0.,-0.03,-0.6);
1141 TGeoTranslation *tr12 = new TGeoTranslation("tr12",0.,-0.03,0.6);
1142 tr21->RegisterYourself();
1143 tr12->RegisterYourself();
1144
1145 TGeoCompositeShape *hook = new TGeoCompositeShape("hook","hk1+hk2:tr21+hk2:tr12");
1146 TGeoVolume *hookv = new TGeoVolume("TPC_hook",hook,m13);
1147 //
1148 // assembly of the short rod with connectors and hooks
1149 //
1150 //
1151 // short rod
1152 //
1153 TGeoVolumeAssembly *spart = new TGeoVolumeAssembly("TPC_spart");
1154 //
1155 spart->AddNode( rodsv,1);
1156 for(Int_t i=1;i<12;i++){
1157 spart->AddNode(bconv,i,transf[i]);
1158 }
1159 for(Int_t i =0;i<11;i++){
ceb660a9 1160 spart->AddNode(hookv,i+1,new TGeoTranslation(0.,-2.315,-7.5+i*1.5));
0f788f87 1161 }
1162 //
1163 // long rod
1164 //
1165 TGeoVolumeAssembly *lpart = new TGeoVolumeAssembly("TPC_lpart");
1166 //
1167 lpart->AddNode( rodlv,1);
1168 for(Int_t i=0;i<13;i++){
ceb660a9 1169 lpart->AddNode(bconv,i+12,transf[i]);
0f788f87 1170 }
1171 for(Int_t i =0;i<13;i++){
ceb660a9 1172 lpart->AddNode(hookv,i+12,new TGeoTranslation(0.,-2.315,-9.+i*1.5));
0f788f87 1173 }
1174 //
1175 // alu ring
1176 //
1177 new TGeoTube("ring1",2.1075,2.235,0.53);
1178 new TGeoTube("ring2",1.7925,1.89,0.43);
1179 new TGeoTube("ring3",1.89,2.1075,0.05);
1180 TGeoCompositeShape *ring = new TGeoCompositeShape("ring","ring1+ring2+ring3");
1181 TGeoVolume *ringv = new TGeoVolume("TPC_ring",ring,m3);
1182 //
1183 // rod assembly
1184 //
ceb660a9 1185 TGeoVolumeAssembly *tpcrrod = new TGeoVolumeAssembly("TPC_rrod");//rrod
0f788f87 1186 TGeoVolumeAssembly *tpcmrod = new TGeoVolumeAssembly("TPC_mrod");//makrolon rod
1187 //long pieces
1188 for(Int_t i=0;i<11;i++){
ceb660a9 1189 tpcrrod->AddNode(ringv,i+1,new TGeoTranslation(0.,0.,-105.+i*21));
0f788f87 1190 tpcmrod->AddNode(ringv,i+12,new TGeoTranslation(0.,0.,-105.+i*21));
1191 }
1192 for(Int_t i=0;i<10;i++){
ceb660a9 1193 tpcrrod->AddNode(lpart,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));
0f788f87 1194 tpcmrod->AddNode(mrodl,i+1,new TGeoTranslation(0.,0.,-94.5+i*21));
1195 }
78134e48 1196 //
0f788f87 1197 // short pieces
78134e48 1198 //
ceb660a9 1199 tpcrrod->AddNode(spart,1,new TGeoTranslation(0.,0.,-114.));
1200 tpcrrod->AddNode(spart,2,new TGeoTranslation(0.,0.,114.));
1201 tpcrrod->AddNode(ringv,23,new TGeoTranslation(0.,0.,-123.));
1202 tpcrrod->AddNode(ringv,24,new TGeoTranslation(0.,0.,123.));
78134e48 1203 //
0f788f87 1204 tpcmrod->AddNode(mrods,1,new TGeoTranslation(0.,0.,-114.));
1205 tpcmrod->AddNode(mrods,2,new TGeoTranslation(0.,0.,114.));
1206 tpcmrod->AddNode(ringv,25,new TGeoTranslation(0.,0.,-123.));
1207 tpcmrod->AddNode(ringv,26,new TGeoTranslation(0.,0.,123.));
1208 //
1209 // left plaque
78134e48 1210 //
0f788f87 1211 TGeoPcon *lp = new TGeoPcon(0.,360.,4);
78134e48 1212 //
0f788f87 1213 lp->DefineSection(0,-125.8,1.92,2.235);
1214 lp->DefineSection(1,-124.8,1.92,2.235);
78134e48 1215 //
0f788f87 1216 lp->DefineSection(2,-124.8,1.92,2.08);
1217 lp->DefineSection(3,-123.1,1.92,2.08);
78134e48 1218 //
0f788f87 1219 TGeoVolume *lpv1 = new TGeoVolume("TPC_lpv1",lp,m6);
1220 TGeoVolume *lpv2 = new TGeoVolume("TPC_lpv2",lp,m6);
1221 // left ring
1222 TGeoTube *lr = new TGeoTube(2.1075,2.235,0.5);
1223 TGeoVolume *lrv = new TGeoVolume("TPC_lrv",lr,m3);
78134e48 1224 //
0f788f87 1225 lpv2->AddNode(lrv,1,new TGeoTranslation(0.,0.,-125.3));
78134e48 1226 //
ceb660a9 1227 tpcrrod->AddNode(lpv2,1);
0f788f87 1228 tpcmrod->AddNode(lpv1,1);
78134e48 1229 //
0f788f87 1230 // right plaque
78134e48 1231 //
f1447ab6 1232 TGeoTube *rp = new TGeoTube(1.92,2.08,2.025);
0f788f87 1233 TGeoVolume *rpv = new TGeoVolume("TPC_rpv",rp,m6);
f1447ab6 1234 tpcrrod->AddNode(rpv,1, new TGeoTranslation(0.,0.,125.125));
1235 tpcmrod->AddNode(rpv,2,new TGeoTranslation(0.,0.,125.125));
78134e48 1236 //
a3d2be59 1237 //
0f788f87 1238 //HV rods - makrolon + 0.58cm (diameter) Cu
cf84f9b1 1239 TGeoTube *hvr = new TGeoTube(0.,1.465,126.5);
1240 TGeoTube *hvc = new TGeoTube(0.,0.29,126.5);
0f788f87 1241 //
1242 TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
1243 TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
1244 hvrv->AddNode(hvcv,1);
78134e48 1245 //
0f788f87 1246 //resistor rod
1247 //
ceb660a9 1248 TGeoTube *cr = new TGeoTube(0.,0.45,126.2);
1249 TGeoTube *cw = new TGeoTube(0.,0.15,126.2);
0f788f87 1250 TGeoVolume *crv = new TGeoVolume("TPC_CR",cr,m10);
ceb660a9 1251 TGeoVolume *cwv = new TGeoVolume("TPC_W",cw,m12);
0f788f87 1252 //
1253 // ceramic rod with water
1254 //
1255 crv->AddNode(cwv,1);
1256 //
1257 //peek rod
1258 //
ceb660a9 1259 TGeoTube *pr =new TGeoTube(0.2,0.35,126.2);
1260 TGeoVolume *prv = new TGeoVolume("TPC_PR",pr,m11);
0f788f87 1261 //
1262 // copper plates with connectors
1263 //
1264 new TGeoTube("tub",0.,1.7,0.025);
1265 //
1266 // half space - points on the plane and a normal vector
1267 //
1268 Double_t n[3],p[3];
1269 Double_t slope = TMath::Tan(22.*TMath::DegToRad());
1270 Double_t intp = 1.245;
1271 //
1272 Double_t b = slope*slope+1.;
1273 p[0]=intp*slope/b;
1274 p[1]=-intp/b;
1275 p[2]=0.;
1276 //
1277 n[0]=-p[0];
1278 n[1]=-p[1];
1279 n[2]=0.;
1280 Double_t norm;
1281 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1282 n[0] /= norm;
1283 n[1] /=norm;
1284 //
1285 new TGeoHalfSpace("sp1",p,n);
1286 //
1287 slope = -slope;
1288 //
1289 p[0]=intp*slope/b;
1290 p[1]=-intp/b;
1291 //
1292 n[0]=-p[0];
1293 n[1]=-p[1];
1294 norm=TMath::Sqrt(n[0]*n[0]+n[1]*n[1]);
1295 n[0] /= norm;
1296 n[1] /=norm;
1297 //
1298 new TGeoHalfSpace("sp2",p,n);
1299 // holes for rods
1300 //holes
1301 new TGeoTube("h1",0.,0.5,0.025);
1302 new TGeoTube("h2",0.,0.35,0.025);
1303 //translations:
1304 TGeoTranslation *ttr11 = new TGeoTranslation("ttr11",-0.866,0.5,0.);
1305 TGeoTranslation *ttr22 = new TGeoTranslation("ttr22",0.866,0.5,0.);
1306 ttr11->RegisterYourself();
1307 ttr22->RegisterYourself();
1308 // elastic connector
1309 new TGeoBBox("elcon",0.72,0.005,0.3);
1310 TGeoRotation *crr1 = new TGeoRotation();
1311 crr1->RotateZ(-22.);
1312TGeoCombiTrans *ctr1 = new TGeoCombiTrans("ctr1",-0.36011, -1.09951,-0.325,crr1);
1313ctr1->RegisterYourself();
1314 TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1",
1315"(((((tub-h1:ttr11)-h1:ttr22)-sp1)-sp2)-h2)+elcon:ctr1");
1316 //
1317 TGeoVolume *csvv = new TGeoVolume("TPC_RR_CU",cs1,m7);
1318 //
1319 // resistor rod assembly 2 ceramic rods, peak rod, Cu plates
1320 // and resistors
1321 //
ceb660a9 1322 TGeoVolumeAssembly *rrod = new TGeoVolumeAssembly("TPC_RRIN");
0f788f87 1323 // rods
1324 rrod->AddNode(crv,1,ttr11);
1325 rrod->AddNode(crv,2,ttr22);
1326 rrod->AddNode(prv,1);
1327 //Cu plates
1328 for(Int_t i=0;i<165;i++){
1329 rrod->AddNode(csvv,i+1,new TGeoTranslation(0.,0.,-122.675+i*1.5));
1330 }
1331 //resistors
1332 TGeoTube *res = new TGeoTube(0.,0.15,0.5);
1333 TGeoVolume *resv = new TGeoVolume("TPC_RES",res,m10);
1334 TGeoVolumeAssembly *ress = new TGeoVolumeAssembly("TPC_RES_CH");
1335 ress->AddNode(resv,1,new TGeoTranslation(0.2,0.,0.));
1336 ress->AddNode(resv,2,new TGeoTranslation(-0.2,0.,0.));
1337 //
1338 TGeoRotation *crr2 = new TGeoRotation();
1339 crr2->RotateY(30.);
1340 TGeoRotation *crr3 = new TGeoRotation();
1341 crr3->RotateY(-30.);
1342 //
1343 for(Int_t i=0;i<164;i+=2){
1344 rrod->AddNode(ress,i+1, new TGeoCombiTrans(0.,1.2,-121.925+i*1.5,crr2));
1345 rrod->AddNode(ress,i+2, new TGeoCombiTrans(0.,1.2,-121.925+(i+1)*1.5,crr3));
1346 }
ceb660a9 1347
d00b3fc6 1348 tpcrrod->AddNode(rrod,1,new TGeoCombiTrans(0.,0.,0.5,crr1));
7f96259a 1349 //
1350 // guard ring resistor chain
1351 //
232c5b28 1352
1353 TGeoTube *gres1 = new TGeoTube(0.,0.375,125.);// inside ifc
7f96259a 1354 //
1355 TGeoVolume *vgres1 = new TGeoVolume("TPC_GRES1",gres1,m10);
232c5b28 1356
7f96259a 1357 //
1358 Double_t xrc,yrc;
1359 //
7f96259a 1360 xrc=79.3*TMath::Cos(350.*TMath::DegToRad());
1361 yrc=79.3*TMath::Sin(350.*TMath::DegToRad());
1362 //
232c5b28 1363 v9->AddNode(vgres1,1,new TGeoTranslation(xrc,yrc,126.9));
1364 v9->AddNode(vgres1,2,new TGeoTranslation(xrc,yrc,-126.9));
1365 //
e079adac 1366 xrc=79.3*TMath::Cos(190.*TMath::DegToRad());
1367 yrc=79.3*TMath::Sin(190.*TMath::DegToRad());
232c5b28 1368 //
1369 v9->AddNode(vgres1,3,new TGeoTranslation(xrc,yrc,126.9));
1370 v9->AddNode(vgres1,4,new TGeoTranslation(xrc,yrc,-126.9));
0f788f87 1371 //------------------------------------------------------------------
1372 TGeoRotation refl("refl",90.,0.,90.,90.,180.,0.);
1373 TGeoRotation rotrod("rotrod");
0f788f87 1374 //
2d1d58a6 1375 TGeoRotation *rotpos[2];
1376 //
1377 TGeoRotation *rotrod1[2];
c449e944 1378 TGeoTubeSeg *irh = new TGeoTubeSeg(78.825,79.25,1.5,358.5,1.5);
1379 TGeoTubeSeg *orh = new TGeoTubeSeg(256.5,257.95,1.5,359.5,0.5);
1380 TGeoTubeSeg *ohh = new TGeoTubeSeg(256.5,257.95,1.5,9.5,10.5);
1381 TGeoVolume *irhv = new TGeoVolume("TPC_IRHH",irh,m4);
1382 TGeoVolume *orhv = new TGeoVolume("TPC_ORHH",orh,m4);
1383 TGeoVolume *ohhv = new TGeoVolume("TPC_OHVHH",ohh,m4);
0f788f87 1384
1385 //v9 - drift gas
1386
7281dc07 1387 for(Int_t i=0;i<18;i++){
c1637e41 1388 Double_t angle,x,y;
1389 Double_t z,r;
1390 angle=TMath::DegToRad()*20.*(Double_t)i;
c449e944 1391 TGeoRotation *roth = new TGeoRotation(); //rotation for rod holders
1392 roth->RotateZ(angle);
0f788f87 1393 //inner rods
c1637e41 1394 r=81.5;
1395 x=r * TMath::Cos(angle);
1396 y=r * TMath::Sin(angle);
cf84f9b1 1397 z = 126.1;
78134e48 1398 //
c449e944 1399 v9->AddNode(irhv,i+1,roth);
1400 v9->AddNode(orhv,i+1,roth);
1401 v9->AddNode(ohhv,i+1,roth);
1402 //
0f788f87 1403 if(i==11){//resistor rod inner
1404 rotrod.RotateZ(-90.+angle);
2d1d58a6 1405 rotrod1[0]= new TGeoRotation();
1406 rotpos[0]= new TGeoRotation();
1407 //
1408 rotrod1[0]->RotateZ(-90.+angle);
1409 *rotpos[0] = refl*rotrod; //rotation+reflection
ceb660a9 1410 v9->AddNode(tpcrrod,1,new TGeoCombiTrans(x,y, z, rotrod1[0])); //A
1411 v9->AddNode(tpcrrod,2,new TGeoCombiTrans(x,y,-z, rotpos[0])); //C
78134e48 1412 }
1413 else {
0f788f87 1414 v9->AddNode(tpcmrod,i+1,new TGeoTranslation(x,y,z));//shaft
1415 v9->AddNode(tpcmrod,i+19,new TGeoCombiTrans(x,y,-z,ref));//muon
37831078 1416 }
0f788f87 1417 // outer rods
c1637e41 1418 r=254.25;
1419 x=r * TMath::Cos(angle);
1420 y=r * TMath::Sin(angle);
cf84f9b1 1421 z=126.3;
78134e48 1422 //
0f788f87 1423 if(i==3){//resistor rod outer
1424 rotrod.RotateZ(90.+angle);
2d1d58a6 1425 rotrod1[1]= new TGeoRotation();
1426 rotpos[1]= new TGeoRotation();
1427 rotrod1[1]->RotateZ(90.+angle);
1428 *rotpos[1] = refl*rotrod;//rotation+reflection
ceb660a9 1429 v9->AddNode(tpcrrod,3,new TGeoCombiTrans(x,y, z, rotrod1[1])); //A
1430 v9->AddNode(tpcrrod,4,new TGeoCombiTrans(x,y, -z, rotpos[1])); //C
78134e48 1431 }
0f788f87 1432 else {
1433 v9->AddNode(tpcmrod,i+37,new TGeoTranslation(x,y,z));//shaft
1434 v9->AddNode(tpcmrod,i+55,new TGeoCombiTrans(x,y,-z,ref));//muon
78134e48 1435 }
0f788f87 1436 if(i==15){
cf84f9b1 1437 v9->AddNode(hvrv,1,new TGeoTranslation(x,y,z+0.7)); //hv->A-side only
78134e48 1438 }
0f788f87 1439 } //end of rods positioning
69776907 1440
bde68ab0 1441 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
1442 alice->AddNode(v1,1);
c1637e41 1443
1283eee5 1444} // end of function
fe4da5cc 1445
1446//_____________________________________________________________________________
ac81c411 1447void AliTPCv2::AddAlignableVolumes() const
1448{
1449 //
1450 // Create entries for alignable volumes associating the symbolic volume
1451 // name with the corresponding volume path. Needs to be syncronized with
1452 // eventual changes in the geometry.
1453 //
1454 SetInnerChambersAlignable();
1455 SetOuterChambersAlignable();
1456}
1457
1458//_____________________________________________________________________________
1459void AliTPCv2::SetInnerChambersAlignable() const
1460{
1461 //
cdf69b9a 1462 AliGeomManager::ELayerID idTPC1 = AliGeomManager::kTPC1;
1463 Int_t modUID, modnum = 0;
d899e254 1464 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1465 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1466 TString vpappend = "/TPC_IROC_1";
1467 TString snstr1="TPC/EndcapA/Sector";
1468 TString snstr2="TPC/EndcapC/Sector";
1469 TString snappend="/InnerChamber";
ac81c411 1470 TString volpath, symname;
1471
1ac29fc4 1472 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 1473 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
1ac29fc4 1474 volpath = vpstr1;
1475 volpath += cnt;
1476 volpath += vpappend;
1477 symname = snstr1;
1478 symname += cnt;
1479 symname += snappend;
cdf69b9a 1480 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 1481 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 1482 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1483 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 1484 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
1485 alignableEntry->SetMatrix(matTtoL);
1ac29fc4 1486 }
65293f49 1487
ac81c411 1488 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 1489 modUID = AliGeomManager::LayerToVolUID(idTPC1,modnum++);
d899e254 1490 volpath = vpstr2;
ac81c411 1491 volpath += cnt;
d899e254 1492 volpath += vpappend;
1493 symname = snstr2;
ac81c411 1494 symname += cnt;
d899e254 1495 symname += snappend;
cdf69b9a 1496 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 1497 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 1498 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1499 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 1500 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
1501 alignableEntry->SetMatrix(matTtoL);
ac81c411 1502 }
1503}
1504
ac81c411 1505//_____________________________________________________________________________
1506void AliTPCv2::SetOuterChambersAlignable() const
1507{
1508 //
cdf69b9a 1509 AliGeomManager::ELayerID idTPC2 = AliGeomManager::kTPC2;
1510 Int_t modUID, modnum = 0;
d899e254 1511 TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
1512 TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
1513 TString vpappend = "/TPC_OROC_1";
1514 TString snstr1="TPC/EndcapA/Sector";
1515 TString snstr2="TPC/EndcapC/Sector";
1516 TString snappend="/OuterChamber";
ac81c411 1517 TString volpath, symname;
1518
1519 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 1520 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
d899e254 1521 volpath = vpstr1;
ac81c411 1522 volpath += cnt;
d899e254 1523 volpath += vpappend;
1524 symname = snstr1;
ac81c411 1525 symname += cnt;
d899e254 1526 symname += snappend;
cdf69b9a 1527 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 1528 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 1529 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1530 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 1531 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
1532 alignableEntry->SetMatrix(matTtoL);
ac81c411 1533 }
84cbbd90 1534
ac81c411 1535 for(Int_t cnt=1; cnt<=18; cnt++){
cdf69b9a 1536 modUID = AliGeomManager::LayerToVolUID(idTPC2,modnum++);
d899e254 1537 volpath = vpstr2;
ac81c411 1538 volpath += cnt;
d899e254 1539 volpath += vpappend;
1540 symname = snstr2;
ac81c411 1541 symname += cnt;
d899e254 1542 symname += snappend;
cdf69b9a 1543 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
84cbbd90 1544 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
cdf69b9a 1545 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID);
1546 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
1ac29fc4 1547 TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
1548 alignableEntry->SetMatrix(matTtoL);
ac81c411 1549 }
1550}
1551
fe4da5cc 1552
1553//_____________________________________________________________________________
1554void AliTPCv2::CreateMaterials()
1555{
1556 //
1557 // Define materials for version 2 of the Time Projection Chamber
1558 //
37831078 1559
fe4da5cc 1560 AliTPC::CreateMaterials();
1561}
1562
1563//_____________________________________________________________________________
1564void AliTPCv2::Init()
1565{
1566 //
1567 // Initialises version 2 of the TPC after that it has been built
1568 //
37831078 1569
1570 Int_t *idtmed = fIdtmed->GetArray();
1571
fe4da5cc 1572 AliTPC::Init();
d4c354b9 1573
c1637e41 1574
1575 fIdSens=gMC->VolId("TPC_Strip"); // one strip is always selected...
d4c354b9 1576
c1637e41 1577 fIDrift=gMC->VolId("TPC_Drift");
1578 fSecOld=-100; // fake number
fe4da5cc 1579
d9888f70 1580 gMC->SetMaxNStep(-30000); // max. number of steps increased
fe4da5cc 1581
4481461d 1582 if (fPrimaryIonisation) {
098dfc1a 1583 // for FLUKA
4481461d 1584 gMC->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential
1585
1586 gMC->Gstpar(idtmed[2],"PRIMIO_N", 14.35);
1587 gMC->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss
8143dfb2 1588 gMC->Gstpar(idtmed[2],"STRA",4);
098dfc1a 1589 }
1590 // specific energy loss for geant3 is now defined in galice.cuts
4481461d 1591
fe4da5cc 1592
a9d15241 1593 AliDebug(1,"*** TPC version 2 initialized ***");
1594 AliDebug(1,Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
fe4da5cc 1595
1596 //
1597
1598}
1599
1600//_____________________________________________________________________________
1601void AliTPCv2::StepManager()
1602{
1603 //
1604 // Called for every step in the Time Projection Chamber
1605 //
1606
1607 //
1608 // parameters used for the energy loss calculations
1609 //
73042f01 1610 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1611 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1612 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
ec6ac410 1613 const Int_t kMaxDistRef =15; // maximal difference between 2 stored references
fe4da5cc 1614
73042f01 1615 const Float_t kbig = 1.e10;
fe4da5cc 1616
1617 Int_t id,copy;
e61fd20d 1618 Float_t hits[5];
fe4da5cc 1619 Int_t vol[2];
37831078 1620 TLorentzVector p;
fe4da5cc 1621
37831078 1622 vol[1]=0; // preset row number to 0
fe4da5cc 1623 //
f6a67d69 1624 if (!fPrimaryIonisation) gMC->SetMaxStep(kbig);
fe4da5cc 1625
0a6d8768 1626 if(!gMC->IsTrackAlive()) return; // particle has disappeared
fe4da5cc 1627
cfce8870 1628 Float_t charge = gMC->TrackCharge();
fe4da5cc 1629
1630 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1631
37831078 1632 // check the sensitive volume
1633
c1637e41 1634 id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
1635 if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume
da33556f 1636
2ddbb964 1637 if ( fPrimaryIonisation && id == fIDrift ) {
1638 Double_t rnd = gMC->GetRandom()->Rndm();
1639 gMC->SetMaxStep(0.2+(2.*rnd-1.)*0.05); // 2 mm +- rndm*0.5mm step
1640 }
1641
1642 //if ( fPrimaryIonisation && id == fIDrift && gMC->IsTrackEntering()) {
1643 // gMC->SetMaxStep(0.2); // 2 mm
1644 //}
1645
c1637e41 1646 gMC->TrackPosition(p);
1647 Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1648 //
1649
1650 //
1651 Double_t angle = TMath::ACos(p[0]/r);
1652 angle = (p[1]<0.) ? TMath::TwoPi()-angle : angle;
1653 //
1654 // angular segment, it is not a real sector number...
1655 //
1656 Int_t sector=TMath::Nint((angle-fTPCParam->GetInnerAngleShift())/
1657 fTPCParam->GetInnerAngle());
1658 // rotate to segment "0"
1659 Float_t cos,sin;
1660 fTPCParam->AdjustCosSin(sector,cos,sin);
1661 Float_t x1=p[0]*cos + p[1]*sin;
1662 // check if within sector's limits
5bd5dbc4 1663 if((x1>=fTPCParam->GetInnerRadiusLow()&&x1<=fTPCParam->GetInnerRadiusUp())
1664 ||(x1>=fTPCParam->GetOuterRadiusLow()&&x1<=fTPCParam->GetOuterRadiusUp())){
c1637e41 1665 // calculate real sector number...
1666 if (x1>fTPCParam->GetOuterRadiusLow()){
1667 sector = TMath::Nint((angle-fTPCParam->GetOuterAngleShift())/
1668 fTPCParam->GetOuterAngle())+fTPCParam->GetNInnerSector();
1669 if (p[2]<0) sector+=(fTPCParam->GetNOuterSector()>>1);
37831078 1670 }
c1637e41 1671 else
1672 if (p[2]<0) sector+=(fTPCParam->GetNInnerSector()>>1);
1673 //
1674 // here I have a sector number
1675 //
37831078 1676
c1637e41 1677 vol[0]=sector;
ec6ac410 1678
1679 static Double_t lastReferenceR=0;
1680 if (TMath::Abs(lastReferenceR-r)>kMaxDistRef){
1681 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
1682 lastReferenceR = r;
1683 }
1684
c1637e41 1685 // check if change of sector
1686 if(sector != fSecOld){
1687 fSecOld=sector;
1688 // add track reference
e6add757 1689 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
c1637e41 1690 }
1691 // track is in the sensitive strip
1692 if(id == fIdSens){
1693 // track is entering the strip
1694 if (gMC->IsTrackEntering()){
1695 Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
1696 vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
1697 // row numbers are autonomous for lower and upper sectors
1698 if(vol[0] > fTPCParam->GetNInnerSector()) {
1699 vol[1] -= fTPCParam->GetNRowLow();
1700 }
1701 //
1702 if(vol[0]<fTPCParam->GetNInnerSector()&&vol[1] == 0){
37831078 1703
c1637e41 1704 // lower sector, row 0, because Jouri wants to have this
6a905708 1705
c1637e41 1706 gMC->TrackMomentum(p);
1707 hits[0]=p[0];
1708 hits[1]=p[1];
1709 hits[2]=p[2];
1710 hits[3]=0.; // this hit has no energy loss
1711 // Get also the track time for pileup simulation
1712 hits[4]=gMC->TrackTime();
e61fd20d 1713
c1637e41 1714 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1715 }
1716 //
e61fd20d 1717
c1637e41 1718 gMC->TrackPosition(p);
1719 hits[0]=p[0];
1720 hits[1]=p[1];
1721 hits[2]=p[2];
1722 hits[3]=0.; // this hit has no energy loss
1723 // Get also the track time for pileup simulation
1724 hits[4]=gMC->TrackTime();
930ee558 1725
c1637e41 1726 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
37831078 1727
c1637e41 1728 }
1729 else return;
1730 }
37831078 1731 //-----------------------------------------------------------------
c1637e41 1732 // charged particle is in the sensitive drift volume
37831078 1733 //-----------------------------------------------------------------
cfce8870 1734 if(gMC->TrackStep() > 0) {
b97617a6 1735 Int_t nel=0;
1736 if (!fPrimaryIonisation) {
1737 nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1738 }
1739 else {
63414189 1740 static Double_t deForNextStep = 0.;
1741 // Geant4 (the meaning of Edep as in Geant3) - wrong
1742 //nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1743
1744 // Geant4 (the meaning of Edep as in Geant3) - NEW
1745 Double_t eAvailable = gMC->Edep() + deForNextStep;
1746 nel = (Int_t)(eAvailable/kwIon);
1747 deForNextStep = eAvailable - nel*kwIon;
b97617a6 1748 }
fe4da5cc 1749 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
c1637e41 1750 //
37831078 1751 gMC->TrackPosition(p);
1752 hits[0]=p[0];
1753 hits[1]=p[1];
1754 hits[2]=p[2];
fe4da5cc 1755 hits[3]=(Float_t)nel;
c1637e41 1756
fe4da5cc 1757 // Add this hit
c1637e41 1758
97d77e7a 1759 // if (fHitType&&2){
1760 if(fHitType){
6a905708 1761 gMC->TrackMomentum(p);
1762 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1763 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1764 fTrackHits->SetHitPrecision(precision);
1765 }
e61fd20d 1766
1767 // Get also the track time for pileup simulation
1768 hits[4]=gMC->TrackTime();
c1637e41 1769
1770 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
0f2ff24c 1771 if (fDebugStreamer){
1772 // You can dump here what you need
1773 // function CreateDebugStremer() to be called in the Config.C macro
1774 // if you want to enable it
1775 // By default debug streaemer is OFF
1776 Float_t edep = gMC->Edep();
1777 Float_t tstep = gMC->TrackStep();
1778 Int_t pid=gMC->TrackPid();
1779 (*fDebugStreamer)<<"hit"<<
1780 "x="<<hits[0]<< // hit position
1781 "y="<<hits[1]<<
1782 "z="<<hits[2]<<
1783 "nel="<<hits[3]<< // number of electorns
1784 "tof="<<hits[4]<< // hit TOF
1785 "edep="<<edep<< // energy deposit
1786 "pid="<<pid<< // pid
1787 "step="<<tstep<<
1788 "p.="<<&p<<
1789 "\n";
1790 }
1791
c1637e41 1792 } // step>0
1793 } //within sector's limits
fe4da5cc 1794 // Stemax calculation for the next step
1795
1796 Float_t pp;
0a6d8768 1797 TLorentzVector mom;
b97617a6 1798 // below is valid only for Geant3 (fPromaryIonisation not set)
1799 if(!fPrimaryIonisation){
1800 gMC->TrackMomentum(mom);
1801 Float_t ptot=mom.Rho();
1802 Float_t betaGamma = ptot/gMC->TrackMass();
595bf2c3 1803
b97617a6 1804 Int_t pid=gMC->TrackPid();
1805 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1806 {
1807 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1808 }
1809 else
1810 {
1811
1812 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
b40afa5e 1813 pp=kprim*AliMathBase::BetheBlochAleph(betaGamma);
595bf2c3 1814
fe4da5cc 1815 }
1816
b97617a6 1817 Double_t rnd = gMC->GetRandom()->Rndm();
fe4da5cc 1818
b97617a6 1819 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1820 }
c1637e41 1821
fe4da5cc 1822}
1823
73042f01 1824