]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSv11.cxx
- AliPhysicsSelection: protected writing of fHistBunchCrossing and fHistTriggerPattern
[u/mrichter/AliRoot.git] / ITS / AliITSv11.cxx
CommitLineData
2b680d9b 1/**************************************************************************
effd7456 2 * Copyright(c) 2007-2008, ALICE Experiment at CERN, All rights reserved. *
2b680d9b 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
effd7456 16
b7943f00 17//************************************************************************
effd7456 18//
b7943f00 19// Inner Traking System geometry v11
20//
21// Based on ROOT geometrical modeler
b7943f00 22//
23// B. Nilsen, L. Gaudichet
24//************************************************************************
25
541f7ba6 26#include <TClonesArray.h>
7dd2cbe4 27#include <TGeoManager.h>
28#include <TGeoPcon.h>
29#include <TGeoVolume.h>
2b680d9b 30#include <TLorentzVector.h>
7dd2cbe4 31#include <TVirtualMC.h>
b7943f00 32
33#include "AliITS.h"
7dd2cbe4 34#include "AliITSCalibrationSDD.h"
531d6cdc 35#include "AliITSDetTypeSim.h"
b7943f00 36#include "AliITSgeom.h"
b7943f00 37#include "AliITShit.h"
2b680d9b 38#include "AliITSsegmentationSDD.h"
b7943f00 39#include "AliITSsegmentationSPD.h"
40#include "AliITSsegmentationSSD.h"
108bd0fe 41#include "AliITSv11.h"
db486a6e 42#include "AliITSv11GeometrySDD.h"
7dd2cbe4 43#include "AliITSv11GeometrySPD.h"
54c9a3d9 44#include "AliITSv11GeometrySSD.h"
45#include "AliITSv11GeometrySupport.h"
7dd2cbe4 46#include "AliMC.h"
47#include "AliMagF.h"
48#include "AliRun.h"
49#include "AliTrackReference.h"
541f7ba6 50
b7943f00 51ClassImp(AliITSv11)
52
33ddec7d 53//______________________________________________________________________
012f0f4c 54AliITSv11::AliITSv11() :
012f0f4c 55fByThick(kTRUE),
56fMajorVersion(IsVersion()),
57fMinorVersion(0),
54c9a3d9 58fSPDgeom(),
012f0f4c 59fSDDgeom(0),
54c9a3d9 60fSSDgeom(),
61fSupgeom(),
012f0f4c 62fIgm(kv11)
33ddec7d 63{
b7943f00 64 // Standard default constructor for the ITS version 11.
f7315efc 65
531d6cdc 66 fIdN = 0;
67 fIdName = 0;
68 fIdSens = 0;
2b680d9b 69}
b7943f00 70
fa4639a3 71
72//______________________________________________________________________
012f0f4c 73AliITSv11::AliITSv11(const char *name, const char *title):
74AliITS("ITS", title),
012f0f4c 75fByThick(kTRUE),
76fMajorVersion(IsVersion()),
77fMinorVersion(0),
54c9a3d9 78fSPDgeom(),
012f0f4c 79fSDDgeom(0),
54c9a3d9 80fSSDgeom(),
81fSupgeom(),
012f0f4c 82fIgm(kv11)
33ddec7d 83{
fa4639a3 84 // Standard constructor for the ITS version 11.
85
531d6cdc 86 fSDDgeom = new AliITSv11GeometrySDD(0);
fa4639a3 87
88 Int_t i;
531d6cdc 89 fIdN = 6;
90 fIdName = new TString[fIdN];
91 fIdName[0] = name; // removes warning message
92 fIdName[0] = "ITS1";
93 fIdName[1] = "ITS2";
108bd0fe 94 fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
95 fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
531d6cdc 96 fIdName[4] = "ITS5";
97 fIdName[5] = "ITS6";
fa4639a3 98 fIdSens = new Int_t[fIdN];
531d6cdc 99 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
33ddec7d 100 // not needed, fByThick set to kTRUE in in the member initialization lis
531d6cdc 101
fa4639a3 102}
2b680d9b 103//______________________________________________________________________
db486a6e 104AliITSv11::AliITSv11(Int_t debugITS,Int_t debugSPD,Int_t debugSDD,
b7943f00 105 Int_t debugSSD,Int_t debugSUP) :
012f0f4c 106AliITS("ITS","ITS geometry v11"),
012f0f4c 107fByThick(kTRUE),
108fMajorVersion(IsVersion()),
109fMinorVersion(0),
54c9a3d9 110fSPDgeom(),
012f0f4c 111fSDDgeom(0),
54c9a3d9 112fSSDgeom(),
113fSupgeom(),
012f0f4c 114fIgm(kv11)
115{
b7943f00 116 // Standard default constructor for the ITS version 11.
b7943f00 117
b7943f00 118
531d6cdc 119 // fSPDgeom = new AliITSv11GeometrySPD(debugSPD);
120 fSDDgeom = new AliITSv11GeometrySDD(debugSDD);
121 fSDDgeom->SetDebug(debugSDD);
122 // fSupgeom = new AliITSv11GeometrySupport(debugSUP);
123
124 Int_t i;
125 fIdN = 6;
126 fIdName = new TString[fIdN];
54c9a3d9 127 fIdName[0] = fSPDgeom->GetSenstiveVolumeName1();
128 fIdName[1] = fSPDgeom->GetSenstiveVolumeName2();
108bd0fe 129 fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
130 fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
54c9a3d9 131 fIdName[4] = fSSDgeom->GetSenstiveVolumeName5();
132 fIdName[5] = fSSDgeom->GetSenstiveVolumeName6();
531d6cdc 133 fIdSens = new Int_t[fIdN];
134 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
fa4639a3 135 debugITS = (debugSPD && debugSSD && debugSUP && debugSDD); //remove temp. warnings
162acd47 136}
dfefbaec 137//______________________________________________________________________
b7943f00 138AliITSv11::~AliITSv11() {
139 delete fSDDgeom;
2b680d9b 140}
141//______________________________________________________________________
aa9bc63b 142void AliITSv11::CreateGeometry(){
012f0f4c 143 //
144 // Create ROOT geometry
145 //
146 // These constant character strings are set by cvs during commit
147 // do not change them unless you know what you are doing!
148 const Char_t *cvsDate="$Date$";
149 const Char_t *cvsRevision="$Revision$";
150
151 TGeoManager *geoManager = gGeoManager;
152 TGeoVolume *vALIC = geoManager->GetTopVolume();
153
154 TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2);
155
156 // DefineSection(section number, Z, Rmin, Rmax).
157 const Double_t kcm = 1.0;
158 sITS->DefineSection(0,-300.0*kcm,0.01*kcm,50.0*kcm);
159 sITS->DefineSection(1,+300.0*kcm,0.01*kcm,50.0*kcm);
160
161 TGeoMedium *air = gGeoManager->GetMedium("ITS_AIR$");
162 TGeoVolume *vITS = new TGeoVolume("ITSV",sITS,air);
163 vITS->SetVisibility(kFALSE);
164 const Int_t length=100;
165 Char_t vstrng[length];
166 if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
167 fMinorVersion,cvsDate,cvsRevision))
168 vITS->SetTitle(vstrng);
169 //printf("Title set to %s\n",vstrng);
170 vALIC->AddNode(vITS,1,0);
b7943f00 171
172// fSPDgeom->CenteralSPD(vITS);
fa4639a3 173
b7943f00 174 fSDDgeom->Layer3(vITS);
175 fSDDgeom->Layer4(vITS);
fa4639a3 176
b7943f00 177// fSupgeom->SPDCone(vITS);
178// fSupgeom->SPDThermalSheald(vITS);
179// fSupgeom->SDDCone(vITS);
180// fSupgeom->SSDCone(vITS);
181// fSupgeom->ServicesCableSupport(vITS);
182
541f7ba6 183}
184//______________________________________________________________________
185void AliITSv11::CreateMaterials(){
54c9a3d9 186 // Create Standard ITS Materials
187 // Inputs:
188 // none.
189 // Outputs:
190 // none.
191 // Return:
192 // none.
531d6cdc 193
531d6cdc 194
54c9a3d9 195 //
196 fSPDgeom->AliITSv11Geometry::CreateDefaultMaterials();
197 // Detector specific material definistions
198 fSPDgeom->CreateMaterials();
199 fSDDgeom->CreateMaterials();
200 fSSDgeom->CreateMaterials();
201 fSupgeom->CreateMaterials();
dfefbaec 202}
012f0f4c 203/*
dfefbaec 204//______________________________________________________________________
205void AliITSv11::InitAliITSgeom(){
b7943f00 206 //
207 // Fill fITSgeom with the 3 sub-detector geometries
208 //
209
108bd0fe 210 if (gGeoManager) gGeoManager->Export("geometry.root");
211
531d6cdc 212 const Int_t knlayers = 6;
213 const Int_t kndeep = 3;
108bd0fe 214 const AliITSDetector kidet[knlayers]={kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
215 const TString knames[knlayers] = {
216 "AliITSv11:spd missing", // lay=1
217 "AliITSv11:spd missing", // lay=2
531d6cdc 218 "/ALIC_1/ITSV_1/ITSsddLayer3_1/ITSsddLadd_%d/ITSsddSensor_%d/ITSsddWafer_%d", // lay=3
219 "/ALIC_1/ITSV_1/ITSsddLayer4_1/ITSsddLadd_%d/ITSsddSensor_%d/ITSsddWafer_%d", // lay=4
108bd0fe 220 "AliITSv11:ssd missing", // lay=5
221 "AliITSv11:ssd missing" // lay=6
222 };
223
224 const Int_t kitsGeomTreeCopys[knlayers][kndeep]= {{10, 2, 4},// lay=1
225 {10, 4, 4}, // lay=2
226 {14, 6, 1}, // lay=3
227 {22, 8, 1}, // lay=4
228 {34,22, 1}, // lay=5
229 {38,25, 1}};// lay=6
531d6cdc 230 Int_t nlad[knlayers],ndet[knlayers];
231 Int_t mod,lay,lad=0,det=0,i,j,k,cp0,cp1,cp2;
232 TString path,shapeName;
233 TGeoHMatrix materix;
234 Double_t trans[3]={3*0.0},rot[10]={9*0.0,1.0};
235 TArrayD shapePar;
236 TArrayF shapeParF;
108bd0fe 237 Bool_t shapeDefined[3]={kFALSE,kFALSE,kFALSE};
531d6cdc 238
239 AliDebug(1,"Reading Geometry transformation directly from Modler.");
240 mod = 0;
241 for(i=0;i<knlayers;i++){
242 k = 1;
108bd0fe 243 for(j=0;j<kndeep;j++) if(kitsGeomTreeCopys[i][j]!=0)
244 k *= TMath::Abs(kitsGeomTreeCopys[i][j]);
531d6cdc 245 mod += k;
246 } // end for i
247
531d6cdc 248 SetITSgeom(0);
249 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
250 ndet[0]= 4;ndet[1]= 4;ndet[2]= 6;ndet[3]= 8;ndet[4]=22;ndet[5]=25;
251 AliITSgeom* geom = new AliITSgeom(0,6,nlad,ndet,mod);
252 SetITSgeom(geom);
253 mod = 0;
254 for(lay=1;lay<=knlayers;lay++){
108bd0fe 255
256 for(cp0=0; cp0<kitsGeomTreeCopys[lay-1][0]; cp0++){
257 for(cp1=0; cp1<kitsGeomTreeCopys[lay-1][1]; cp1++){
258 for(cp2=1; cp2<=kitsGeomTreeCopys[lay-1][2]; cp2++){
259
260 path.Form(knames[lay-1].Data(),
531d6cdc 261 cp0,cp1,cp2);
262 switch (lay){
263 case 1:{
264 det = cp2;
265 lad = cp1+2*(cp0-1);
266 }break;
267 case 2:{
268 det = cp2;
269 lad = cp1+4*(cp0-1);
270 } break;
271 case 3: case 4: case 5: case 6:{
272 det = cp1;
273 lad = cp0;
274 } break;
275 } // end switch
276 //AliInfo(Form("path=%s lay=%d lad=%d det=%d",
277 // path.Data(),lay,lad,det));
278 gMC->GetTransformation(path.Data(),materix);
279 gMC->GetShape(path.Data(),shapeName,shapePar);
280 shapeParF.Set(shapePar.GetSize());
281 for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i];
108bd0fe 282 geom->CreateMatrix(mod,lay,lad,det,kidet[lay-1],trans,rot);
531d6cdc 283 geom->SetTrans(mod,materix.GetTranslation());
284 geom->SetRotMatrix(mod,materix.GetRotationMatrix());
108bd0fe 285 geom->GetGeomMatrix(mod)->SetPath(path.Data());
531d6cdc 286 switch (lay){
108bd0fe 287 case 1: case 2:
288 if(!shapeDefined[kSPD]){
531d6cdc 289 geom->ReSetShape(kSPD,new AliITSgeomSPD425Short(
290 shapeParF.GetSize(),shapeParF.GetArray()));
108bd0fe 291 shapeDefined[kSPD] = kTRUE;
531d6cdc 292 }break;
108bd0fe 293 case 3: case 4:
294 if(!shapeDefined[kSDD]){
531d6cdc 295 geom->ReSetShape(kSDD,new AliITSgeomSDD256(
296 shapeParF.GetSize(),shapeParF.GetArray()));
108bd0fe 297 shapeDefined[kSDD] = kTRUE;
531d6cdc 298 }break;
108bd0fe 299 case 5: case 6:
300 if(!shapeDefined[kSSD]){
531d6cdc 301 geom->ReSetShape(kSSD,new AliITSgeomSSD75and275(
302 shapeParF.GetSize(),shapeParF.GetArray()));
108bd0fe 303 shapeDefined[kSSD] = kTRUE;
531d6cdc 304 }break;
305 default:{
306 }break;
307 } // end switch
308 mod++;
309 } /// end for cp2
310 } // end for cp1
311 } // end for cp0
312 } // end for lay
531d6cdc 313
314// fSDDgeom->ExportSensorGeometry(GetITSgeom(), +3, 0); //SDD
dfefbaec 315}
012f0f4c 316*/
dfefbaec 317//______________________________________________________________________
318void AliITSv11::Init(){
b7943f00 319 //
320 // Initialise the ITS after it has been created.
321 //
322
531d6cdc 323 //AliInfo(Form("Minor version %d",fMinorVersion));
324 //
012f0f4c 325 UpdateInternalGeometry();
326 AliITS::Init();
012f0f4c 327
328 //
329/*
531d6cdc 330 if(GetITSgeom()!=0) SetITSgeom(0x0);
331 AliITSgeom* geom = new AliITSgeom();
332 SetITSgeom(geom);
b7943f00 333 AliITS::Init();
012f0f4c 334*/ //
dfefbaec 335}
b7943f00 336
108bd0fe 337
dfefbaec 338//______________________________________________________________________
339void AliITSv11::SetDefaults(){
b7943f00 340 //
108bd0fe 341 // Set response and segmentation models for SPD, SDD and SSD
b7943f00 342 //
343
108bd0fe 344// if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
345// fDetTypeSim->SetITSgeom(GetITSgeom());
346 if(!fDetTypeSim) {
347 Warning("SetDefaults","Error fDetTypeSim not defined");
348 return;
349 }
531d6cdc 350
531d6cdc 351 fDetTypeSim->ResetCalibrationArray();
352 fDetTypeSim->ResetSegmentation();
353 fDetTypeSim->SetDefaults();
354
531d6cdc 355 if(fgkNTYPES>3){
356 Warning("SetDefaults",
357 "Only the four basic detector types are initialised!");
358 }// end if
359
360
361 return;
362}
b7943f00 363
364
108bd0fe 365
366
367
dfefbaec 368//______________________________________________________________________
b7943f00 369void AliITSv11::DrawModule() const{
370
dfefbaec 371}
b7943f00 372
108bd0fe 373// //______________________________________________________________________
374// void AliITSv11::StepManager(){
375// //
376// // Called for every step in the ITS, then calles the AliITShit class
377// // creator with the information to be recoreded about that hit.
378// //
379// Int_t copy, id;
380// TLorentzVector position, momentum;
381// static TLorentzVector position0;
382// static Int_t stat0=0;
383
384// if(!(this->IsActive())){
385// return;
386// } // end if !Active volume.
387
388// if(!(gMC->TrackCharge())) return;
389
390// id=gMC->CurrentVolID(copy);
391
392// Bool_t sensvol = kFALSE;
393// for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
394// if(sensvol && (gMC->IsTrackExiting())){
395// copy = fTrackReferences->GetEntriesFast();
396// TClonesArray &lTR = *fTrackReferences;
397// // Fill TrackReference structure with this new TrackReference.
398// new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
399// } // if Outer ITS mother Volume
400
401
402// Int_t copy1,copy2;
403// Int_t vol[5];
404// TClonesArray &lhits = *fHits;
405// //
406// // Track status
407// vol[3] = 0;
408// vol[4] = 0;
409// if(gMC->IsTrackInside()) vol[3] += 1;
410// if(gMC->IsTrackEntering()) vol[3] += 2;
411// if(gMC->IsTrackExiting()) vol[3] += 4;
412// if(gMC->IsTrackOut()) vol[3] += 8;
413// if(gMC->IsTrackDisappeared()) vol[3] += 16;
414// if(gMC->IsTrackStop()) vol[3] += 32;
415// if(gMC->IsTrackAlive()) vol[3] += 64;
416// //
417// // Fill hit structure.
418// if(!(gMC->TrackCharge())) return;
419// //
420// // Only entering charged tracks
421// if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
422// vol[0] = 1;
423// id = gMC->CurrentVolOffID(2,copy);
424// //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
425// vol[1] = copy;
426// gMC->CurrentVolOffID(3,copy1);
427// //ladder copy in the module = 1<->2 (I10A < I12A)
428// gMC->CurrentVolOffID(4,copy2);
429// //module copy in the layer = 1<->10 (I12A < IT12)
430// vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
431// } else if(id == fIdSens[1]){
432// vol[0] = 2;
433// id = gMC->CurrentVolOffID(2,copy);
434// //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
435// vol[1] = copy;
436// gMC->CurrentVolOffID(3,copy1);
437// //ladder copy in the module = 1<->4 (I20A < I12A)
438// gMC->CurrentVolOffID(4,copy2);
439// //module copy in the layer = 1<->10 (I12A < IT12)
440// vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
441// } else if(id == fIdSens[2]){
442// vol[0] = 3;
443// id = gMC->CurrentVolOffID(1,copy);
444// //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
445// vol[1] = copy;
446// id = gMC->CurrentVolOffID(2,copy);
447// //ladder copy in the layer = 1<->14 (I004 < IT34)
448// vol[2] = copy;
449// } else if(id == fIdSens[3]){
450// vol[0] = 4;
451// id = gMC->CurrentVolOffID(1,copy);
452// //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
453// vol[1] = copy;
454// id = gMC->CurrentVolOffID(2,copy);
455// //ladder copy in the layer = 1<->22 (I005 < IT34))
456// vol[2] = copy;
457// }else if(id == fIdSens[4]){
458// vol[0] = 5;
459// id = gMC->CurrentVolOffID(1,copy);
460// //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
461// vol[1] = copy;
462// id = gMC->CurrentVolOffID(2,copy);
463// //ladder copy in the layer = 1<->34 (I565 < IT56)
464// vol[2] = copy;
465// }else if(id == fIdSens[5]){
466// vol[0] = 6;
467// id = gMC->CurrentVolOffID(1,copy);
468// //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
469// vol[1] = copy;
470// id = gMC->CurrentVolOffID(2,copy);
471// //ladder copy in the layer = 1<->38 (I569 < IT56)
472// vol[2] = copy;
473// } else {
474// return; // not an ITS volume?
475// } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
476// //
477// gMC->TrackPosition(position);
478// gMC->TrackMomentum(momentum);
479// vol[4] = stat0;
480// if(gMC->IsTrackEntering()){
481// position0 = position;
482// stat0 = vol[3];
483// return;
484// } // end if IsEntering
485// // Fill hit structure with this new hit.
486
487// new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
488// gMC->Edep(),gMC->TrackTime(),position,
489// position0,momentum);
490
491// position0 = position;
492// stat0 = vol[3];
493
494// return;
495// }
496
497
dfefbaec 498//______________________________________________________________________
499void AliITSv11::StepManager(){
b7943f00 500 //
501 // Called for every step in the ITS, then calles the AliITShit class
502 // creator with the information to be recoreded about that hit.
503 //
531d6cdc 504 Int_t copy, id;
505 TLorentzVector position, momentum;
506 static TLorentzVector position0;
507 static Int_t stat0=0;
508
509 if(!(this->IsActive())){
510 return;
511 } // end if !Active volume.
512
513 if(!(gMC->TrackCharge())) return;
514
515 id=gMC->CurrentVolID(copy);
516
517 Bool_t sensvol = kFALSE;
518 for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
519 if(sensvol && (gMC->IsTrackExiting())){
e6add757 520 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS);
531d6cdc 521 } // if Outer ITS mother Volume
522
523
524 Int_t copy1,copy2;
525 Int_t vol[5];
526 TClonesArray &lhits = *fHits;
527 //
528 // Track status
529 vol[3] = 0;
530 vol[4] = 0;
531 if(gMC->IsTrackInside()) vol[3] += 1;
532 if(gMC->IsTrackEntering()) vol[3] += 2;
533 if(gMC->IsTrackExiting()) vol[3] += 4;
534 if(gMC->IsTrackOut()) vol[3] += 8;
535 if(gMC->IsTrackDisappeared()) vol[3] += 16;
536 if(gMC->IsTrackStop()) vol[3] += 32;
537 if(gMC->IsTrackAlive()) vol[3] += 64;
538 //
539 // Fill hit structure.
540 if(!(gMC->TrackCharge())) return;
108bd0fe 541
531d6cdc 542 // Only entering charged tracks
543 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
544 vol[0] = 1;
545 id = gMC->CurrentVolOffID(2,copy);
546 //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
547 vol[1] = copy;
548 gMC->CurrentVolOffID(3,copy1);
549 //ladder copy in the module = 1<->2 (I10A < I12A)
550 gMC->CurrentVolOffID(4,copy2);
551 //module copy in the layer = 1<->10 (I12A < IT12)
552 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
108bd0fe 553
531d6cdc 554 } else if(id == fIdSens[1]){
555 vol[0] = 2;
556 id = gMC->CurrentVolOffID(2,copy);
557 //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
558 vol[1] = copy;
559 gMC->CurrentVolOffID(3,copy1);
560 //ladder copy in the module = 1<->4 (I20A < I12A)
561 gMC->CurrentVolOffID(4,copy2);
562 //module copy in the layer = 1<->10 (I12A < IT12)
563 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
108bd0fe 564
531d6cdc 565 } else if(id == fIdSens[2]){
566 vol[0] = 3;
567 id = gMC->CurrentVolOffID(1,copy);
568 //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
569 vol[1] = copy;
570 id = gMC->CurrentVolOffID(2,copy);
571 //ladder copy in the layer = 1<->14 (I004 < IT34)
572 vol[2] = copy;
108bd0fe 573
531d6cdc 574 } else if(id == fIdSens[3]){
575 vol[0] = 4;
576 id = gMC->CurrentVolOffID(1,copy);
577 //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
578 vol[1] = copy;
579 id = gMC->CurrentVolOffID(2,copy);
580 //ladder copy in the layer = 1<->22 (I005 < IT34))
581 vol[2] = copy;
108bd0fe 582
531d6cdc 583 }else if(id == fIdSens[4]){
584 vol[0] = 5;
585 id = gMC->CurrentVolOffID(1,copy);
586 //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
587 vol[1] = copy;
588 id = gMC->CurrentVolOffID(2,copy);
589 //ladder copy in the layer = 1<->34 (I565 < IT56)
590 vol[2] = copy;
108bd0fe 591
531d6cdc 592 }else if(id == fIdSens[5]){
593 vol[0] = 6;
594 id = gMC->CurrentVolOffID(1,copy);
595 //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
596 vol[1] = copy;
597 id = gMC->CurrentVolOffID(2,copy);
598 //ladder copy in the layer = 1<->38 (I569 < IT56)
599 vol[2] = copy;
600 } else {
601 return; // not an ITS volume?
602 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
603 //
604 gMC->TrackPosition(position);
605 gMC->TrackMomentum(momentum);
606 vol[4] = stat0;
607 if(gMC->IsTrackEntering()){
608 position0 = position;
609 stat0 = vol[3];
610 return;
611 } // end if IsEntering
612 // Fill hit structure with this new hit.
b7943f00 613
531d6cdc 614 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
615 gMC->Edep(),gMC->TrackTime(),position,
616 position0,momentum);
b7943f00 617
b7943f00 618 position0 = position;
619 stat0 = vol[3];
531d6cdc 620
b7943f00 621 return;
531d6cdc 622}
108bd0fe 623