1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Inner Traking System version 5 with symmetric services
21 // This class contains the base procedures for the Inner Tracking System
23 // Authors: R. Barbera, B. S. Nilsen.
25 // Created October 7 2000.
27 ///////////////////////////////////////////////////////////////////////////////
28 #include <Riostream.h>
34 #include <TClonesArray.h>
35 #include <TFile.h> // only required for Tracking function?
36 #include <TGeometry.h>
37 #include <TLorentzVector.h>
40 #include <TObjArray.h>
41 #include <TObjString.h>
44 #include <TVirtualMC.h>
47 #include "AliITShit.h"
48 #include "AliITSGeant3Geometry.h"
49 #include "AliITSgeom.h"
50 #include "AliITSgeomSDD.h"
51 #include "AliITSgeomSPD.h"
52 #include "AliITSgeomSSD.h"
53 #include "AliITShit.h"
54 #include "AliITSv5symm.h"
57 ClassImp(AliITSv5symm)
59 //_____________________________________________________________________________
60 AliITSv5symm::AliITSv5symm() {
61 ////////////////////////////////////////////////////////////////////////
62 // Standard default constructor for the ITS version 5.
63 ////////////////////////////////////////////////////////////////////////
69 fEuclidOut = kFALSE; // Don't write Euclide file
70 fGeomDetOut = kFALSE; // Don't write .det file
71 fGeomDetIn = kFALSE; // Don't Read .det file
72 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
73 fMajorVersion = IsVersion();
75 for(i=0;i<60;i++) fRead[i] = '\0';
76 for(i=0;i<60;i++) fWrite[i] = '\0';
77 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
79 //_____________________________________________________________________________
80 AliITSv5symm::AliITSv5symm(const char *name, const char *title) : AliITS(name, title){
81 /////////////////////////////////////////////////////////////////////////////
82 // Standard constructor for the ITS version 5 with symmetrical services.
83 /////////////////////////////////////////////////////////////////////////////
87 fIdName = new TString[fIdN];
94 fIdSens = new Int_t[fIdN];
95 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
96 fEuclidOut = kFALSE; // Don't write Euclide file
97 fGeomDetOut = kFALSE; // Don't write .det file
98 fGeomDetIn = kFALSE; // Don't Read .det file
99 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
100 fMajorVersion = IsVersion();
102 for(i=0;i<60;i++) fRead[i] = '\0';
103 for(i=0;i<60;i++) fWrite[i] = '\0';
105 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.tme";
106 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.euc";
107 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_v5symm.det",60);
108 strncpy(fRead,fEuclidGeomDet,60);
109 strncpy(fWrite,fEuclidGeomDet,60);
111 //____________________________________________________________________________
112 AliITSv5symm::AliITSv5symm(const AliITSv5symm &source){
113 ////////////////////////////////////////////////////////////////////////
114 // Copy Constructor for ITS version 5.
115 ////////////////////////////////////////////////////////////////////////
116 if(&source == this) return;
117 Warning("Copy Constructor","Not allowed to copy AliITSv5symm");
120 //_____________________________________________________________________________
121 AliITSv5symm& AliITSv5symm::operator=(const AliITSv5symm &source){
122 ////////////////////////////////////////////////////////////////////////
123 // Assignment operator for the ITS version 5.
124 ////////////////////////////////////////////////////////////////////////
126 if(&source == this) return *this;
127 Warning("= operator","Not allowed to copy AliITSv5symm");
131 //_____________________________________________________________________________
132 AliITSv5symm::~AliITSv5symm() {
133 ////////////////////////////////////////////////////////////////////////
134 // Standard destructor for the ITS version 5.
135 ////////////////////////////////////////////////////////////////////////
137 //_____________________________________________________________________________
138 void AliITSv5symm::BuildGeometry(){
139 ////////////////////////////////////////////////////////////////////////
140 // Geometry builder for the ITS version 5.
141 ////////////////////////////////////////////////////////////////////////
143 // Build ITS TNODE geometry for event display using detailed geometry.
144 // This function builds a simple ITS geometry used by the ROOT macro
149 //const int kColorITSSPD=kRed;
150 //const int kColorITSSDD=kGreen;
151 const int kColorITSSSD=kBlue;
153 AliITSgeom *gm = this->GetITSgeom();
155 top=gAlice->GetGeometry()->GetNode("alice");
164 //TCanvas *c1 = new TCanvas("c1","ITS");
166 for(lay=1;lay<=2;lay++)
167 for(lad=1;lad<=gm->GetNladders(lay);lad++)
168 for(det=1;det<=gm->GetNdetectors(lay);det++){
170 box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
173 cout << "EXCEPTION in box = new TBRIK" << endl;
176 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
177 gm->GetRotMatrix(lay,lad,det,rt);
178 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
179 for(i=0;i<9;i++) rtd[i] = rt[i];
181 rm = new TRotMatrix(name,name,rtd);
183 cout << "EXCEPTION in new TRotMatrix" << endl;
187 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
189 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
191 cout << "EXCEPTION in new TNode" << endl;
194 nd->SetLineColor(kColorITSSSD);
198 for(lay=3;lay<=3;lay++)
199 for(lad=1;lad<=gm->GetNladders(lay);lad++)
200 for(det=1;det<=gm->GetNdetectors(lay);det++){
202 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
205 cout << "EXCEPTION in box = new TBRIK" << endl;
208 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
209 gm->GetRotMatrix(lay,lad,det,rt);
210 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
211 for(i=0;i<9;i++) rtd[i] = rt[i];
213 rm = new TRotMatrix(name,name,rtd);
215 cout << "EXCEPTION in new TRotMatrix" << endl;
219 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
221 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
223 cout << "EXCEPTION in new TNode" << endl;
226 nd->SetLineColor(kColorITSSSD);
230 for(lay=4;lay<=4;lay++)
231 for(lad=1;lad<=gm->GetNladders(lay);lad++)
232 for(det=1;det<=gm->GetNdetectors(lay);det++){
234 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
237 cout << "EXCEPTION in box = new TBRIK" << endl;
240 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
241 gm->GetRotMatrix(lay,lad,det,rt);
242 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
243 for(i=0;i<9;i++) rtd[i] = rt[i];
245 rm = new TRotMatrix(name,name,rtd);
247 cout << "EXCEPTION in new TRotMatrix" << endl;
251 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
253 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
255 cout << "EXCEPTION in new TNode" << endl;
258 nd->SetLineColor(kColorITSSSD);
261 for(lay=5;lay<=5;lay++)
262 for(lad=1;lad<=gm->GetNladders(lay);lad++)
263 for(det=1;det<=gm->GetNdetectors(lay);det++){
265 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
268 cout << "EXCEPTION in box = new TBRIK" << endl;
271 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
272 gm->GetRotMatrix(lay,lad,det,rt);
273 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
274 for(i=0;i<9;i++) rtd[i] = rt[i];
276 rm = new TRotMatrix(name,name,rtd);
278 cout << "EXCEPTION in new TRotMatrix" << endl;
282 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
284 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
286 cout << "EXCEPTION in new TNode" << endl;
289 nd->SetLineColor(kColorITSSSD);
293 for(lay=6;lay<=6;lay++)
294 for(lad=1;lad<=gm->GetNladders(lay);lad++)
295 for(det=1;det<=gm->GetNdetectors(lay);det++){
297 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
300 cout << "EXCEPTION in box = new TBRIK" << endl;
304 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
305 gm->GetRotMatrix(lay,lad,det,rt);
306 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
307 for(i=0;i<9;i++) rtd[i] = rt[i];
309 rm = new TRotMatrix(name,name,rtd);
311 cout << "EXCEPTION in new TRotMatrix" << endl;
315 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
317 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
319 cout << "EXCEPTION in new TNode" << endl;
322 nd->SetLineColor(kColorITSSSD);
328 //_____________________________________________________________________________
329 void AliITSv5symm::CreateMaterials(){
330 ////////////////////////////////////////////////////////////////////////
331 // Read a file containing the materials for the ITS version 5.
332 ////////////////////////////////////////////////////////////////////////
335 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
337 FILE *file = fopen(filtmp,"r");
340 ReadEuclidMedia(filtmp);
342 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
346 //_____________________________________________________________________________
347 void AliITSv5symm::CreateGeometry(){
348 //////////////////////////////////////////////////////////////////////
349 // This is the geometry used for the ITS Pre-TDR and comes from an
350 // Euclid to Geant conversion. The only difference
351 // is in the details of the ITS supports. The detectors elements,
352 // detector numbering, and local and global reference frames are shown in
353 // the following figures.
356 <img src="picts/ITS/its1+2_convention_front_5.gif">
359 <font size=+2 color=red>
360 <p>This shows the front view of the SPDs.
363 <img src="picts/ITS/its1+2_convention_side_5.gif">
366 <font size=+2 color=red>
367 <p>This shows the perspective view of the SPDs.
369 <img src="picts/ITS/its1+2_tree.gif">
372 <font size=+2 color=red>
373 <p>This shows the geometry Tree for the SPDs.
378 <img src="picts/ITS/its3+4_convention_front_5.gif">
381 <font size=+2 color=red>
382 <p>This shows the front view of the SDDs.
385 <img src="picts/ITS/its3+4_convention_side_5.gif">
388 <font size=+2 color=red>
389 <p>This shows the perspective view of the SDDs.
391 <img src="picts/ITS/its3+4_tree.gif">
394 <font size=+2 color=red>
395 <p>This shows the geometry Tree for the SDDs.
400 <img src="picts/ITS/its5+6_convention_front_5.gif">
403 <font size=+2 color=red>
404 <p>This shows the front view of the SSDs.
407 <img src="picts/ITS/its5+6_convention_side_5.gif">
410 <font size=+2 color=red>
411 <p>This shows the perspective view of the SSDs.
414 <img src="picts/ITS/its5+6_tree.gif">
417 <font size=+2 color=red>
418 <p>This shows the geometry Tree for the SSDs.
423 <img src="picts/ITS/its_layer1-6_2.gif">
426 <font size=+2 color=red>
427 <p>This shows the front view of the whole ITS..
431 <img src="picts/ITS/its_layer1-6_1.gif">
434 <font size=+2 color=red>
435 <p>This shows the perspective view of the whole ITS..
439 <img src="picts/ITS/its1-6_tree.gif">
442 <font size=+2 color=red>
443 <p>This shows the geometry Tree for the whole ITS.
450 // Here are shown the details of the ITS support cones and services.
451 // First is a GEANT tree showing the organization of all of the volumes
452 // that make up the ITS supports and services.
455 <img src="picts/ITS/supports_tree.gif">
458 // What follows are a number of figures showing what these support
459 // structures look like.
463 <img src="picts/ITS/supports_3.gif">
466 <font size=+2 color=red>
467 <p>This shows the geometry of the supports for the Drift and Strip layers only.
471 <img src="picts/ITS/supports_2.gif">
474 <font size=+2 color=red>
475 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
479 <img src="picts/ITS/supports_1.gif">
482 <font size=+2 color=red>
483 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
487 <img src="picts/ITS/suppssd.gif">
490 <font size=+2 color=red>
491 <p>This shows the geometry for the Strip layers supports.
495 <img src="picts/ITS/suppsdd.gif">
498 <font size=+2 color=red>
499 <p>This shows the geometry for the Drift layers supports.
505 // Read a file containing the geometry for the ITS version 5.
506 ////////////////////////////////////////////////////////////////////////
510 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
511 FILE *file = fopen(filtmp,"r");
515 printf("Ready to read Euclid geometry file\n");
516 ReadEuclid(fEuclidGeometry.Data(),topvol);
517 printf("Read in euclid geometries\n");
519 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
520 fEuclidGeometry.Data());
524 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
527 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
529 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
532 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
533 } // end if (fEuclidOut)
534 cout << "finished with euclid geometrys" << endl;
536 //______________________________________________________________________
537 void AliITSv5symm::ReadOldGeometry(const char *filename){
538 // read in the file containing the transformations for the active
539 // volumes for the ITS version 5. This is expected to be in a file
540 // ending in .det. This geometry is kept in the AliITSgeom class.
545 filtmp = gSystem->ExpandPathName(filename);
546 size = strlen(filtmp);
547 if(size>4 && fGeomDetIn){
548 filtmp[size-3] = 'd'; // change from .euc to .det
549 filtmp[size-2] = 'e';
550 filtmp[size-1] = 't';
551 file = fopen(filtmp,"r");
552 if(file){ // if file exists use it to fill AliITSgeom structure.
554 fITSgeom = new AliITSgeom(filtmp);
555 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
556 // Now define the detector types/shapes.
557 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
558 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
559 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
562 // fill AliITSgeom structure from geant structure just filled above
567 //______________________________________________________________________
568 void AliITSv5symm::InitAliITSgeom(){
569 // Based on the geometry tree defined in Geant 3.21, this
570 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
572 // if(gMC->IsA()!=TGeant3::Class()) {
573 if(strcmp(gMC->GetName(),"TGeant3")) {
574 Error("InitAliITSgeom",
575 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
578 cout << "Reading Geometry transformation directly from Geant 3." << endl;
579 const Int_t nlayers = 6;
580 const Int_t ndeep = 7;
581 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
582 Int_t nlad[nlayers],ndet[nlayers];
584 Float_t par[20],att[20];
585 Int_t npar,natt,idshape,imat,imed;
586 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
587 Int_t mod,lay,lad,det,i,j,k;
588 char *names[nlayers][ndeep] = {
589 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
590 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
591 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
592 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
593 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
594 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
595 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
596 {1,1,1,1,10, 4,4}, // lay=2
597 {1,1,1,1,14, 6,1}, // lay=3
598 {1,1,1,1,22, 8,1}, // lay=4
599 {1,1,1,1,34,23,1}, // lay=5
600 {1,1,1,1,38,26,1}};// lay=6
602 // Sorry, but this is not very pritty code. It should be replaced
603 // at some point with a version that can search through the geometry
605 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
606 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
607 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
608 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
610 for(i=0;i<nlayers;i++){
612 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
613 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
617 if(fITSgeom!=0) delete fITSgeom;
618 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
619 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
620 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
622 for(lay=1;lay<=nlayers;lay++){
623 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
624 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
626 case 1: case 2: // layers 1 and 2 are a bit special
628 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
630 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
633 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
636 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
638 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
639 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
640 if(fMinorVersion==1){
641 fITSgeom->ReSetShape(kSPD,
642 new AliITSgeomSPD300());
643 } else if(fMinorVersion==2){
644 fITSgeom->ReSetShape(kSPD,
645 new AliITSgeomSPD300());
646 }else if(fMinorVersion==3){
647 fITSgeom->ReSetShape(kSPD,
648 new AliITSgeomSPD425Long());
650 fITSgeom->ReSetShape(kSPD,
651 new AliITSgeomSPD300());
657 case 3: case 4: case 5: case 6: // layers 3-6
659 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
661 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
664 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
668 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
669 if(!(fITSgeom->IsShapeDefined(kSDD)))
670 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
673 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
674 if(!(fITSgeom->IsShapeDefined(kSSD)))
675 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
685 //_____________________________________________________________________________
686 void AliITSv5symm::Init(){
687 ////////////////////////////////////////////////////////////////////////
688 // Initialise the ITS after it has been created.
689 ////////////////////////////////////////////////////////////////////////
693 for(i=0;i<28;i++) cout << "*";cout << " ITSv5symm_Init ";
694 for(i=0;i<28;i++) cout << "*";cout << endl;
696 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
697 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
698 if(fITSgeom!=0) delete fITSgeom;
699 fITSgeom = new AliITSgeom();
700 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
701 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
703 if(!fGeomDetIn) this->InitAliITSgeom();
704 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
707 for(i=0;i<72;i++) cout << "*";
710 //_____________________________________________________________________________
711 void AliITSv5symm::StepManager(){
712 ////////////////////////////////////////////////////////////////////////
713 // Called for every step in the ITS, then calles the AliITShit class
714 // creator with the information to be recoreded about that hit.
715 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
716 // printing of information to a file which can be used to create a .det
717 // file read in by the routine CreateGeometry(). If set to 0 or any other
718 // value except 1, the default behavior, then no such file is created nor
719 // it the extra variables and the like used in the printing allocated.
720 ////////////////////////////////////////////////////////////////////////
725 TLorentzVector position, momentum;
726 TClonesArray &lhits = *fHits;
730 if(gMC->IsTrackInside()) vol[3] += 1;
731 if(gMC->IsTrackEntering()) vol[3] += 2;
732 if(gMC->IsTrackExiting()) vol[3] += 4;
733 if(gMC->IsTrackOut()) vol[3] += 8;
734 if(gMC->IsTrackDisappeared()) vol[3] += 16;
735 if(gMC->IsTrackStop()) vol[3] += 32;
736 if(gMC->IsTrackAlive()) vol[3] += 64;
738 // Fill hit structure.
739 if(!(gMC->TrackCharge())) return;
741 // Only entering charged tracks
742 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
744 id = gMC->CurrentVolOffID(0,copy);
745 //detector copy in the ladder = 1<->4 (ITS1)
747 gMC->CurrentVolOffID(1,copy1);
748 //ladder copy in the module = 1<->2 (I186)
749 gMC->CurrentVolOffID(2,copy2);
750 //module copy in the layer = 1<->10 (I132)
751 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
752 } else if(id == fIdSens[1]){
754 id = gMC->CurrentVolOffID(0,copy);
755 //detector copy in the ladder = 1<->4 (ITS2)
757 gMC->CurrentVolOffID(1,copy1);
758 //ladder copy in the module = 1<->4 (I131)
759 gMC->CurrentVolOffID(2,copy2);
760 //module copy in the layer = 1<->10 (I132)
761 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
762 } else if(id == fIdSens[2]){
764 id = gMC->CurrentVolOffID(1,copy);
765 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
767 id = gMC->CurrentVolOffID(2,copy);
768 //ladder copy in the layer = 1<->12 (I316)
770 } else if(id == fIdSens[3]){
772 id = gMC->CurrentVolOffID(1,copy);
773 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
775 id = gMC->CurrentVolOffID(2,copy);
776 //ladder copy in the layer = 1<->22 (I417)
778 }else if(id == fIdSens[4]){
780 id = gMC->CurrentVolOffID(1,copy);
781 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
783 id = gMC->CurrentVolOffID(2,copy);
784 //ladder copy in the layer = 1<->34 (I565)
786 }else if(id == fIdSens[5]){
788 id = gMC->CurrentVolOffID(1,copy);
789 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
791 id = gMC->CurrentVolOffID(2,copy);
792 //ladder copy in the layer = 1<->38 (I569)
795 return; // not an ITS volume?
796 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
798 gMC->TrackPosition(position);
799 gMC->TrackMomentum(momentum);
807 hits[7]=gMC->TrackTime();
808 // Fill hit structure with this new hit.
809 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);