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 asymmetric 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 "AliITSv5asymm.h"
58 ClassImp(AliITSv5asymm)
60 //_____________________________________________________________________________
61 AliITSv5asymm::AliITSv5asymm() {
62 ////////////////////////////////////////////////////////////////////////
63 // Standard default constructor for the ITS version 5.
64 ////////////////////////////////////////////////////////////////////////
70 fEuclidOut = kFALSE; // Don't write Euclide file
71 fGeomDetOut = kFALSE; // Don't write .det file
72 fGeomDetIn = kFALSE; // Don't Read .det file
73 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
74 fMajorVersion = IsVersion();
76 for(i=0;i<60;i++) fRead[i] = '\0';
77 for(i=0;i<60;i++) fWrite[i] = '\0';
78 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
80 //_____________________________________________________________________________
81 AliITSv5asymm::AliITSv5asymm(const char *name, const char *title) : AliITS(name, title){
82 /////////////////////////////////////////////////////////////////////////////
83 // Standard constructor for the ITS version 5 with symmetrical services.
84 /////////////////////////////////////////////////////////////////////////////
88 fIdName = new TString[fIdN];
95 fIdSens = new Int_t[fIdN];
96 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
97 fEuclidOut = kFALSE; // Don't write Euclide file
98 fGeomDetOut = kFALSE; // Don't write .det file
99 fGeomDetIn = kFALSE; // Don't Read .det file
100 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
101 fMajorVersion = IsVersion();
103 for(i=0;i<60;i++) fRead[i] = '\0';
104 for(i=0;i<60;i++) fWrite[i] = '\0';
106 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.tme";
107 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.euc";
108 strncpy(fEuclidGeomDet,"$ALICE_ROOT/Euclid/ITSgeometry_5.det",60);
109 strncpy(fRead,fEuclidGeomDet,60);
110 strncpy(fWrite,fEuclidGeomDet,60);
112 //____________________________________________________________________________
113 AliITSv5asymm::AliITSv5asymm(const AliITSv5asymm &source):AliITS(source){
114 ////////////////////////////////////////////////////////////////////////
115 // Copy Constructor for ITS version 5.
116 ////////////////////////////////////////////////////////////////////////
117 if(&source == this) return;
118 Warning("Copy Constructor","Not allowed to copy AliITSv5asymm");
121 //_____________________________________________________________________________
122 AliITSv5asymm& AliITSv5asymm::operator=(const AliITSv5asymm &source){
123 ////////////////////////////////////////////////////////////////////////
124 // Assignment operator for the ITS version 5.
125 ////////////////////////////////////////////////////////////////////////
127 if(&source == this) return *this;
128 Warning("= operator","Not allowed to copy AliITSv5asymm");
132 //_____________________________________________________________________________
133 AliITSv5asymm::~AliITSv5asymm() {
134 ////////////////////////////////////////////////////////////////////////
135 // Standard destructor for the ITS version 5.
136 ////////////////////////////////////////////////////////////////////////
138 //_____________________________________________________________________________
139 void AliITSv5asymm::BuildGeometry(){
140 ////////////////////////////////////////////////////////////////////////
141 // Geometry builder for the ITS version 5.
142 ////////////////////////////////////////////////////////////////////////
144 // Build ITS TNODE geometry for event display using detailed geometry.
145 // This function builds a simple ITS geometry used by the ROOT macro
150 //const int kColorITSSPD=kRed;
151 //const int kColorITSSDD=kGreen;
152 const int kColorITSSSD=kBlue;
154 AliITSgeom *gm = this->GetITSgeom();
156 top=gAlice->GetGeometry()->GetNode("alice");
165 //TCanvas *c1 = new TCanvas("c1","ITS");
167 for(lay=1;lay<=2;lay++)
168 for(lad=1;lad<=gm->GetNladders(lay);lad++)
169 for(det=1;det<=gm->GetNdetectors(lay);det++){
171 box = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
174 cout << "EXCEPTION in box = new TBRIK" << endl;
177 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
178 gm->GetRotMatrix(lay,lad,det,rt);
179 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
180 for(i=0;i<9;i++) rtd[i] = rt[i];
182 rm = new TRotMatrix(name,name,rtd);
184 cout << "EXCEPTION in new TRotMatrix" << endl;
188 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
190 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
192 cout << "EXCEPTION in new TNode" << endl;
195 nd->SetLineColor(kColorITSSSD);
199 for(lay=3;lay<=3;lay++)
200 for(lad=1;lad<=gm->GetNladders(lay);lad++)
201 for(det=1;det<=gm->GetNdetectors(lay);det++){
203 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
206 cout << "EXCEPTION in box = new TBRIK" << endl;
209 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
210 gm->GetRotMatrix(lay,lad,det,rt);
211 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
212 for(i=0;i<9;i++) rtd[i] = rt[i];
214 rm = new TRotMatrix(name,name,rtd);
216 cout << "EXCEPTION in new TRotMatrix" << endl;
220 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
222 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
224 cout << "EXCEPTION in new TNode" << endl;
227 nd->SetLineColor(kColorITSSSD);
231 for(lay=4;lay<=4;lay++)
232 for(lad=1;lad<=gm->GetNladders(lay);lad++)
233 for(det=1;det<=gm->GetNdetectors(lay);det++){
235 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
238 cout << "EXCEPTION in box = new TBRIK" << endl;
241 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
242 gm->GetRotMatrix(lay,lad,det,rt);
243 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
244 for(i=0;i<9;i++) rtd[i] = rt[i];
246 rm = new TRotMatrix(name,name,rtd);
248 cout << "EXCEPTION in new TRotMatrix" << endl;
252 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
254 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
256 cout << "EXCEPTION in new TNode" << endl;
259 nd->SetLineColor(kColorITSSSD);
262 for(lay=5;lay<=5;lay++)
263 for(lad=1;lad<=gm->GetNladders(lay);lad++)
264 for(det=1;det<=gm->GetNdetectors(lay);det++){
266 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
269 cout << "EXCEPTION in box = new TBRIK" << endl;
272 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
273 gm->GetRotMatrix(lay,lad,det,rt);
274 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
275 for(i=0;i<9;i++) rtd[i] = rt[i];
277 rm = new TRotMatrix(name,name,rtd);
279 cout << "EXCEPTION in new TRotMatrix" << endl;
283 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
285 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
287 cout << "EXCEPTION in new TNode" << endl;
290 nd->SetLineColor(kColorITSSSD);
294 for(lay=6;lay<=6;lay++)
295 for(lad=1;lad<=gm->GetNladders(lay);lad++)
296 for(det=1;det<=gm->GetNdetectors(lay);det++){
298 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
301 cout << "EXCEPTION in box = new TBRIK" << endl;
305 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
306 gm->GetRotMatrix(lay,lad,det,rt);
307 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
308 for(i=0;i<9;i++) rtd[i] = rt[i];
310 rm = new TRotMatrix(name,name,rtd);
312 cout << "EXCEPTION in new TRotMatrix" << endl;
316 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
318 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
320 cout << "EXCEPTION in new TNode" << endl;
323 nd->SetLineColor(kColorITSSSD);
329 //_____________________________________________________________________________
330 void AliITSv5asymm::CreateMaterials(){
331 ////////////////////////////////////////////////////////////////////////
332 // Read a file containing the materials for the ITS version 5.
333 ////////////////////////////////////////////////////////////////////////
336 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
338 FILE *file = fopen(filtmp,"r");
341 ReadEuclidMedia(filtmp);
343 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
347 //_____________________________________________________________________________
348 void AliITSv5asymm::CreateGeometry(){
349 //////////////////////////////////////////////////////////////////////
350 // This is the geometry used for the ITS Pre-TDR and comes from an
351 // Euclid to Geant conversion. The only difference
352 // is in the details of the ITS supports. The detectors elements,
353 // detector numbering, and local and global reference frames are shown in
354 // the following figures.
357 <img src="picts/ITS/its1+2_convention_front_5.gif">
360 <font size=+2 color=red>
361 <p>This shows the front view of the SPDs.
364 <img src="picts/ITS/its1+2_convention_side_5.gif">
367 <font size=+2 color=red>
368 <p>This shows the perspective view of the SPDs.
370 <img src="picts/ITS/its1+2_tree.gif">
373 <font size=+2 color=red>
374 <p>This shows the geometry Tree for the SPDs.
379 <img src="picts/ITS/its3+4_convention_front_5.gif">
382 <font size=+2 color=red>
383 <p>This shows the front view of the SDDs.
386 <img src="picts/ITS/its3+4_convention_side_5.gif">
389 <font size=+2 color=red>
390 <p>This shows the perspective view of the SDDs.
392 <img src="picts/ITS/its3+4_tree.gif">
395 <font size=+2 color=red>
396 <p>This shows the geometry Tree for the SDDs.
401 <img src="picts/ITS/its5+6_convention_front_5.gif">
404 <font size=+2 color=red>
405 <p>This shows the front view of the SSDs.
408 <img src="picts/ITS/its5+6_convention_side_5.gif">
411 <font size=+2 color=red>
412 <p>This shows the perspective view of the SSDs.
415 <img src="picts/ITS/its5+6_tree.gif">
418 <font size=+2 color=red>
419 <p>This shows the geometry Tree for the SSDs.
424 <img src="picts/ITS/its_layer1-6_2.gif">
427 <font size=+2 color=red>
428 <p>This shows the front view of the whole ITS..
432 <img src="picts/ITS/its_layer1-6_1.gif">
435 <font size=+2 color=red>
436 <p>This shows the perspective view of the whole ITS..
440 <img src="picts/ITS/its1-6_tree.gif">
443 <font size=+2 color=red>
444 <p>This shows the geometry Tree for the whole ITS.
451 // Here are shown the details of the ITS support cones and services.
452 // First is a GEANT tree showing the organization of all of the volumes
453 // that make up the ITS supports and services.
456 <img src="picts/ITS/supports_tree.gif">
459 // What follows are a number of figures showing what these support
460 // structures look like.
464 <img src="picts/ITS/supports_3.gif">
467 <font size=+2 color=red>
468 <p>This shows the geometry of the supports for the Drift and Strip layers only.
472 <img src="picts/ITS/supports_2.gif">
475 <font size=+2 color=red>
476 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
480 <img src="picts/ITS/supports_1.gif">
483 <font size=+2 color=red>
484 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
488 <img src="picts/ITS/suppssd.gif">
491 <font size=+2 color=red>
492 <p>This shows the geometry for the Strip layers supports.
496 <img src="picts/ITS/suppsdd.gif">
499 <font size=+2 color=red>
500 <p>This shows the geometry for the Drift layers supports.
506 // Read a file containing the geometry for the ITS version 5.
507 ////////////////////////////////////////////////////////////////////////
511 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
512 FILE *file = fopen(filtmp,"r");
516 if(fDebug) cout << ClassName() << ": Ready to read Euclid geometry file" << endl;
517 ReadEuclid(fEuclidGeometry.Data(),topvol);
518 if(fDebug) cout << ClassName() << ": Read in euclid geometries" << endl;
520 Fatal("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
521 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)
535 if(fDebug) cout << ClassName() << ": finished with euclid geometrys" << endl;
538 //______________________________________________________________________
539 void AliITSv5asymm::ReadOldGeometry(const char *filename){
540 // read in the file containing the transformations for the active
541 // volumes for the ITS version 5. This is expected to be in a file
542 // ending in .det. This geometry is kept in the AliITSgeom class.
547 filtmp = gSystem->ExpandPathName(filename);
548 size = strlen(filtmp);
549 if(size>4 && fGeomDetIn){
550 filtmp[size-3] = 'd'; // change from .euc to .det
551 filtmp[size-2] = 'e';
552 filtmp[size-1] = 't';
553 file = fopen(filtmp,"r");
554 if(file){ // if file exists use it to fill AliITSgeom structure.
556 fITSgeom = new AliITSgeom(filtmp);
557 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
558 // Now define the detector types/shapes.
559 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
560 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
561 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
564 // fill AliITSgeom structure from geant structure just filled above
569 //______________________________________________________________________
570 void AliITSv5asymm::InitAliITSgeom(){
571 // Based on the geometry tree defined in Geant 3.21, this
572 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
574 // if(gMC->IsA()!=TGeant3::Class()) {
575 if(strcmp(gMC->GetName(),"TGeant3")) {
576 Error("InitAliITSgeom",
577 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
580 if(fDebug) cout << ClassName()
581 << ": Reading Geometry transformation directly from Geant 3." << endl;
582 const Int_t nlayers = 6;
583 const Int_t ndeep = 7;
584 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
585 Int_t nlad[nlayers],ndet[nlayers];
587 Float_t par[20],att[20];
588 Int_t npar,natt,idshape,imat,imed;
589 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
590 Int_t mod,lay,lad,det,i,j,k;
591 char *names[nlayers][ndeep] = {
592 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
593 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
594 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
595 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
596 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
597 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
598 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
599 {1,1,1,1,10, 4,4}, // lay=2
600 {1,1,1,1,14, 6,1}, // lay=3
601 {1,1,1,1,22, 8,1}, // lay=4
602 {1,1,1,1,34,23,1}, // lay=5
603 {1,1,1,1,38,26,1}};// lay=6
605 // Sorry, but this is not very pritty code. It should be replaced
606 // at some point with a version that can search through the geometry
608 if(fDebug) cout << ClassName()
609 << ": Reading Geometry informaton from Geant3 common blocks" << endl;
610 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
611 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
612 strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4);
613 // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
615 for(i=0;i<nlayers;i++){
617 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
618 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
622 if(fITSgeom!=0) delete fITSgeom;
623 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
624 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
625 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
627 for(lay=1;lay<=nlayers;lay++){
628 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
629 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
631 case 1: case 2: // layers 1 and 2 are a bit special
633 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
635 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
638 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
641 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
643 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
644 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
645 if(fMinorVersion==1){
646 fITSgeom->ReSetShape(kSPD,
647 new AliITSgeomSPD300());
648 } else if(fMinorVersion==2){
649 fITSgeom->ReSetShape(kSPD,
650 new AliITSgeomSPD300());
651 }else if(fMinorVersion==3){
652 fITSgeom->ReSetShape(kSPD,
653 new AliITSgeomSPD425Long());
655 fITSgeom->ReSetShape(kSPD,
656 new AliITSgeomSPD300());
662 case 3: case 4: case 5: case 6: // layers 3-6
664 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
666 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
669 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
673 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
674 if(!(fITSgeom->IsShapeDefined(kSDD)))
675 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
678 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
679 if(!(fITSgeom->IsShapeDefined(kSSD)))
680 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
690 //_____________________________________________________________________________
691 void AliITSv5asymm::Init(){
692 ////////////////////////////////////////////////////////////////////////
693 // Initialise the ITS after it has been created.
694 ////////////////////////////////////////////////////////////////////////
698 cout << endl << ClassName() << ": ";
699 for(i=0;i<28;i++) cout << "*";cout << " ITSv5_Init ";
700 for(i=0;i<27;i++) cout << "*";cout << endl;
703 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
704 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
705 if(fITSgeom!=0) delete fITSgeom;
706 fITSgeom = new AliITSgeom();
707 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
708 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
710 if(!fGeomDetIn) this->InitAliITSgeom();
711 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
715 cout << ClassName() << ": ";
716 for(i=0;i<72;i++) cout << "*";
720 //_____________________________________________________________________________
721 void AliITSv5asymm::StepManager(){
722 ////////////////////////////////////////////////////////////////////////
723 // Called for every step in the ITS, then calles the AliITShit class
724 // creator with the information to be recoreded about that hit.
725 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
726 // printing of information to a file which can be used to create a .det
727 // file read in by the routine CreateGeometry(). If set to 0 or any other
728 // value except 1, the default behavior, then no such file is created nor
729 // it the extra variables and the like used in the printing allocated.
730 ////////////////////////////////////////////////////////////////////////
735 TLorentzVector position, momentum;
736 TClonesArray &lhits = *fHits;
740 if(gMC->IsTrackInside()) vol[3] += 1;
741 if(gMC->IsTrackEntering()) vol[3] += 2;
742 if(gMC->IsTrackExiting()) vol[3] += 4;
743 if(gMC->IsTrackOut()) vol[3] += 8;
744 if(gMC->IsTrackDisappeared()) vol[3] += 16;
745 if(gMC->IsTrackStop()) vol[3] += 32;
746 if(gMC->IsTrackAlive()) vol[3] += 64;
748 // Fill hit structure.
749 if(!(gMC->TrackCharge())) return;
751 // Only entering charged tracks
752 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
754 id = gMC->CurrentVolOffID(0,copy);
755 //detector copy in the ladder = 1<->4 (ITS1)
757 gMC->CurrentVolOffID(1,copy1);
758 //ladder copy in the module = 1<->2 (I186)
759 gMC->CurrentVolOffID(2,copy2);
760 //module copy in the layer = 1<->10 (I132)
761 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
762 } else if(id == fIdSens[1]){
764 id = gMC->CurrentVolOffID(0,copy);
765 //detector copy in the ladder = 1<->4 (ITS2)
767 gMC->CurrentVolOffID(1,copy1);
768 //ladder copy in the module = 1<->4 (I131)
769 gMC->CurrentVolOffID(2,copy2);
770 //module copy in the layer = 1<->10 (I132)
771 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
772 } else if(id == fIdSens[2]){
774 id = gMC->CurrentVolOffID(1,copy);
775 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
777 id = gMC->CurrentVolOffID(2,copy);
778 //ladder copy in the layer = 1<->12 (I316)
780 } else if(id == fIdSens[3]){
782 id = gMC->CurrentVolOffID(1,copy);
783 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
785 id = gMC->CurrentVolOffID(2,copy);
786 //ladder copy in the layer = 1<->22 (I417)
788 }else if(id == fIdSens[4]){
790 id = gMC->CurrentVolOffID(1,copy);
791 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
793 id = gMC->CurrentVolOffID(2,copy);
794 //ladder copy in the layer = 1<->34 (I565)
796 }else if(id == fIdSens[5]){
798 id = gMC->CurrentVolOffID(1,copy);
799 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
801 id = gMC->CurrentVolOffID(2,copy);
802 //ladder copy in the layer = 1<->38 (I569)
805 return; // not an ITS volume?
806 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
808 gMC->TrackPosition(position);
809 gMC->TrackMomentum(momentum);
817 hits[7]=gMC->TrackTime();
818 // Fill hit structure with this new hit.
819 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);