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 Revision 1.31 2001/02/13 16:53:35 nilsen
19 Fixed a but when trying to use GEANT4. Needed to replace
20 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
21 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
22 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
23 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
24 in the same way as in AliITSv5.cxx.
26 Revision 1.30 2001/02/09 20:06:26 nilsen
27 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
29 Revision 1.29 2001/02/09 00:05:31 nilsen
30 Added fMajor/MinorVersion variables and made other changes to better make
31 use of the new code changes in AliITSgeom related classes.
33 Revision 1.28 2001/02/02 23:57:28 nilsen
34 Added include file that are no londer included in AliITSgeom.h
36 Revision 1.27 2001/01/30 09:23:13 hristov
37 Streamers removed (R.Brun)
39 Revision 1.26 2000/11/30 11:13:11 barbera
40 Added changes suggested by Federico Carminati on nov, 30, 2000
42 Revision 1.25 2000/10/05 20:50:00 nilsen
43 Now using root generated streamers.
45 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
46 Forward declarations added
48 Revision 1.22 2000/07/10 16:07:19 fca
49 Release version of ITS code
51 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
52 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
54 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
55 Fixed up the comments/documentation.
57 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
58 To make it compatable with the changes in AliRun/AliModule.
60 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
61 This is the version of the files after the merging done in December 1999.
62 See the ReadMe110100.txt file for details
64 Revision 1.14 1999/10/22 08:16:49 fca
65 Correct destructors, thanks to I.Hrivnacova
67 Revision 1.13 1999/10/06 10:15:19 fca
68 Correct bug in allocation of layer name and add destructor
70 Revision 1.12 1999/10/05 08:05:09 fca
71 Minor corrections for uninitialised variables.
73 Revision 1.11 1999/09/29 09:24:20 fca
74 Introduction of the Copyright and cvs Log
78 ///////////////////////////////////////////////////////////////////////////////
80 // Inner Traking System version 5
81 // This class contains the base procedures for the Inner Tracking System
83 // Authors: R. Barbera, B. S. Nilsen.
85 // Created September 17 1999.
87 ///////////////////////////////////////////////////////////////////////////////
93 #include <TGeometry.h>
96 #include <TFile.h> // only required for Tracking function?
98 #include <TObjArray.h>
99 #include <TLorentzVector.h>
100 #include <TObjString.h>
101 #include <TClonesArray.h>
107 #include "../TGeant3/TGeant3.h"
108 #include "AliITShit.h"
109 #include "AliITSGeant3Geometry.h"
111 #include "AliITSv5.h"
112 #include "AliITSgeom.h"
113 #include "AliITSgeomSPD.h"
114 #include "AliITSgeomSDD.h"
115 #include "AliITSgeomSSD.h"
119 //_____________________________________________________________________________
120 AliITSv5::AliITSv5() {
121 ////////////////////////////////////////////////////////////////////////
122 // Standard default constructor for the ITS version 5.
123 ////////////////////////////////////////////////////////////////////////
129 fEuclidOut = kFALSE; // Don't write Euclide file
130 fGeomDetOut = kFALSE; // Don't write .det file
131 fGeomDetIn = kFALSE; // Don't Read .det file
132 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
133 fMajorVersion = IsVersion();
135 for(i=0;i<60;i++) fRead[i] = '\0';
136 for(i=0;i<60;i++) fWrite[i] = '\0';
137 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
139 //_____________________________________________________________________________
140 AliITSv5::AliITSv5(const char *name, const char *title) : AliITS(name, title){
141 ////////////////////////////////////////////////////////////////////////
142 // Standard constructor for the ITS version 5.
143 ////////////////////////////////////////////////////////////////////////
147 fIdName = new TString[fIdN];
154 fIdSens = new Int_t[fIdN];
155 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
156 fEuclidOut = kFALSE; // Don't write Euclide file
157 fGeomDetOut = kFALSE; // Don't write .det file
158 fGeomDetIn = kFALSE; // Don't Read .det file
159 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
160 fMajorVersion = IsVersion();
162 for(i=0;i<60;i++) fRead[i] = '\0';
163 for(i=0;i<60;i++) fWrite[i] = '\0';
165 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5.tme";
166 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5.euc";
167 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_v5.det",60);
168 strncpy(fRead,fEuclidGeomDet,60);
169 strncpy(fWrite,fEuclidGeomDet,60);
171 //____________________________________________________________________________
172 AliITSv5::AliITSv5(const AliITSv5 &source){
173 ////////////////////////////////////////////////////////////////////////
174 // Copy Constructor for ITS version 5.
175 ////////////////////////////////////////////////////////////////////////
176 if(&source == this) return;
177 Warning("Copy Constructor","Not allowed to copy AliITSv5");
180 //_____________________________________________________________________________
181 AliITSv5& AliITSv5::operator=(const AliITSv5 &source){
182 ////////////////////////////////////////////////////////////////////////
183 // Assignment operator for the ITS version 5.
184 ////////////////////////////////////////////////////////////////////////
186 if(&source == this) return *this;
187 Warning("= operator","Not allowed to copy AliITSv5");
191 //_____________________________________________________________________________
192 AliITSv5::~AliITSv5() {
193 ////////////////////////////////////////////////////////////////////////
194 // Standard destructor for the ITS version 5.
195 ////////////////////////////////////////////////////////////////////////
197 //______________________________________________________________________
198 void AliITSv5::BuildGeometry(){
199 ////////////////////////////////////////////////////////////////////////
200 // Geometry builder for the ITS version 5.
201 ////////////////////////////////////////////////////////////////////////
203 // Build ITS TNODE geometry for event display using detailed geometry.
204 // This function builds a simple ITS geometry used by the ROOT macro
209 //const int kColorITSSPD=kRed;
210 //const int kColorITSSDD=kGreen;
211 const int kColorITSSSD=kBlue;
213 AliITSgeom *gm = this->GetITSgeom();
215 top=gAlice->GetGeometry()->GetNode("alice");
224 //TCanvas *c1 = new TCanvas("c1","ITS");
226 for(lay=1;lay<=2;lay++)
227 for(lad=1;lad<=gm->GetNladders(lay);lad++)
228 for(det=1;det<=gm->GetNdetectors(lay);det++){
230 box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
233 cout << "EXCEPTION in box = new TBRIK" << endl;
236 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
237 gm->GetRotMatrix(lay,lad,det,rt);
238 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
239 for(i=0;i<9;i++) rtd[i] = rt[i];
241 rm = new TRotMatrix(name,name,rtd);
243 cout << "EXCEPTION in new TRotMatrix" << endl;
247 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
249 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
251 cout << "EXCEPTION in new TNode" << endl;
254 nd->SetLineColor(kColorITSSSD);
258 for(lay=3;lay<=3;lay++)
259 for(lad=1;lad<=gm->GetNladders(lay);lad++)
260 for(det=1;det<=gm->GetNdetectors(lay);det++){
262 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
265 cout << "EXCEPTION in box = new TBRIK" << endl;
268 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
269 gm->GetRotMatrix(lay,lad,det,rt);
270 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
271 for(i=0;i<9;i++) rtd[i] = rt[i];
273 rm = new TRotMatrix(name,name,rtd);
275 cout << "EXCEPTION in new TRotMatrix" << endl;
279 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
281 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
283 cout << "EXCEPTION in new TNode" << endl;
286 nd->SetLineColor(kColorITSSSD);
290 for(lay=4;lay<=4;lay++)
291 for(lad=1;lad<=gm->GetNladders(lay);lad++)
292 for(det=1;det<=gm->GetNdetectors(lay);det++){
294 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
297 cout << "EXCEPTION in box = new TBRIK" << endl;
300 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
301 gm->GetRotMatrix(lay,lad,det,rt);
302 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
303 for(i=0;i<9;i++) rtd[i] = rt[i];
305 rm = new TRotMatrix(name,name,rtd);
307 cout << "EXCEPTION in new TRotMatrix" << endl;
311 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
313 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
315 cout << "EXCEPTION in new TNode" << endl;
318 nd->SetLineColor(kColorITSSSD);
321 for(lay=5;lay<=5;lay++)
322 for(lad=1;lad<=gm->GetNladders(lay);lad++)
323 for(det=1;det<=gm->GetNdetectors(lay);det++){
325 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
328 cout << "EXCEPTION in box = new TBRIK" << endl;
331 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
332 gm->GetRotMatrix(lay,lad,det,rt);
333 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
334 for(i=0;i<9;i++) rtd[i] = rt[i];
336 rm = new TRotMatrix(name,name,rtd);
338 cout << "EXCEPTION in new TRotMatrix" << endl;
342 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
344 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
346 cout << "EXCEPTION in new TNode" << endl;
349 nd->SetLineColor(kColorITSSSD);
353 for(lay=6;lay<=6;lay++)
354 for(lad=1;lad<=gm->GetNladders(lay);lad++)
355 for(det=1;det<=gm->GetNdetectors(lay);det++){
357 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
360 cout << "EXCEPTION in box = new TBRIK" << endl;
364 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
365 gm->GetRotMatrix(lay,lad,det,rt);
366 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
367 for(i=0;i<9;i++) rtd[i] = rt[i];
369 rm = new TRotMatrix(name,name,rtd);
371 cout << "EXCEPTION in new TRotMatrix" << endl;
375 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
377 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
379 cout << "EXCEPTION in new TNode" << endl;
382 nd->SetLineColor(kColorITSSSD);
388 //_____________________________________________________________________________
389 void AliITSv5::CreateMaterials(){
390 ////////////////////////////////////////////////////////////////////////
391 // Read a file containing the materials for the ITS version 5.
392 ////////////////////////////////////////////////////////////////////////
395 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
397 FILE *file = fopen(filtmp,"r");
400 ReadEuclidMedia(filtmp);
402 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
406 //_____________________________________________________________________________
407 void AliITSv5::CreateGeometry(){
408 //////////////////////////////////////////////////////////////////////
409 // This is the geometry used for the ITS Pre-TDR and comes from an
410 // Euclid to Geant conversion. The only difference
411 // is in the details of the ITS supports. The detectors elements,
412 // detector numbering, and local and global reference frames are shown in
413 // the following figures.
416 <img src="picts/ITS/its1+2_convention_front_5.gif">
419 <font size=+2 color=red>
420 <p>This shows the front view of the SPDs.
423 <img src="picts/ITS/its1+2_convention_side_5.gif">
426 <font size=+2 color=red>
427 <p>This shows the perspective view of the SPDs.
429 <img src="picts/ITS/its1+2_tree.gif">
432 <font size=+2 color=red>
433 <p>This shows the geometry Tree for the SPDs.
438 <img src="picts/ITS/its3+4_convention_front_5.gif">
441 <font size=+2 color=red>
442 <p>This shows the front view of the SDDs.
445 <img src="picts/ITS/its3+4_convention_side_5.gif">
448 <font size=+2 color=red>
449 <p>This shows the perspective view of the SDDs.
451 <img src="picts/ITS/its3+4_tree.gif">
454 <font size=+2 color=red>
455 <p>This shows the geometry Tree for the SDDs.
460 <img src="picts/ITS/its5+6_convention_front_5.gif">
463 <font size=+2 color=red>
464 <p>This shows the front view of the SSDs.
467 <img src="picts/ITS/its5+6_convention_side_5.gif">
470 <font size=+2 color=red>
471 <p>This shows the perspective view of the SSDs.
474 <img src="picts/ITS/its5+6_tree.gif">
477 <font size=+2 color=red>
478 <p>This shows the geometry Tree for the SSDs.
483 <img src="picts/ITS/its_layer1-6_2.gif">
486 <font size=+2 color=red>
487 <p>This shows the front view of the whole ITS..
491 <img src="picts/ITS/its_layer1-6_1.gif">
494 <font size=+2 color=red>
495 <p>This shows the perspective view of the whole ITS..
499 <img src="picts/ITS/its1-6_tree.gif">
502 <font size=+2 color=red>
503 <p>This shows the geometry Tree for the whole ITS.
510 // Here are shown the details of the ITS support cones and services.
511 // First is a GEANT tree showing the organization of all of the volumes
512 // that make up the ITS supports and services.
515 <img src="picts/ITS/supports_tree.gif">
518 // What follows are a number of figures showing what these support
519 // structures look like.
523 <img src="picts/ITS/supports_3.gif">
526 <font size=+2 color=red>
527 <p>This shows the geometry of the supports for the Drift and Strip layers only.
531 <img src="picts/ITS/supports_2.gif">
534 <font size=+2 color=red>
535 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
539 <img src="picts/ITS/supports_1.gif">
542 <font size=+2 color=red>
543 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
547 <img src="picts/ITS/suppssd.gif">
550 <font size=+2 color=red>
551 <p>This shows the geometry for the Strip layers supports.
555 <img src="picts/ITS/suppsdd.gif">
558 <font size=+2 color=red>
559 <p>This shows the geometry for the Drift layers supports.
565 // Read a file containing the geometry for the ITS version 5.
566 ////////////////////////////////////////////////////////////////////////
572 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
573 FILE *file = fopen(filtmp,"r");
577 cout << "Ready to read Euclid geometry file" << endl;
578 ReadEuclid(fEuclidGeometry.Data(),topvol);
579 printf("Read in euclid geometries\n");
581 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
582 fEuclidGeometry.Data());
586 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
589 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
591 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
594 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
595 } // end if (fEuclidOut)
597 cout << "finished with euclid geometrys" << endl;
599 //______________________________________________________________________
600 void AliITSv5::ReadOldGeometry(const char *filename){
601 // read in the file containing the transformations for the active
602 // volumes for the ITS version 5. This is expected to be in a file
603 // ending in .det. This geometry is kept in the AliITSgeom class.
608 if(fITSgeom!=0) delete fITSgeom;
609 filtmp = gSystem->ExpandPathName(filename);
610 size = strlen(filtmp);
611 if(size>4 && fGeomDetIn){
612 filtmp[size-3] = 'd'; // change from .euc to .det
613 filtmp[size-2] = 'e';
614 filtmp[size-1] = 't';
615 file = fopen(filtmp,"r");
616 if(file){ // if file exists use it to fill AliITSgeom structure.
618 fITSgeom = new AliITSgeom(filtmp);
619 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
620 // Now define the detector types/shapes.
621 fITSgeom->ReSetShape(kSPD,new AliITSgeomSPD300());
622 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
623 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
626 // fill AliITSgeom structure from geant structure just filled above
631 //______________________________________________________________________
632 void AliITSv5::InitAliITSgeom(){
633 // Based on the geometry tree defined in Geant 3.21, this
634 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
636 if(!(dynamic_cast<TGeant3*>(gMC))) {
637 Error("InitAliITSgeom",
638 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
641 cout << "Reading Geometry transformation directly from Geant 3." << endl;
642 const Int_t nlayers = 6;
643 const Int_t ndeep = 7;
644 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
645 Int_t nlad[nlayers],ndet[nlayers];
647 Float_t par[20],att[20];
648 Int_t npar,natt,idshape,imat,imed;
649 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
650 Int_t mod,lay,lad,det,i,j,k;
651 char *names[nlayers][ndeep] = {
652 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
653 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
654 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
655 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
656 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
657 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
658 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
659 {1,1,1,1,10, 4,4}, // lay=2
660 {1,1,1,1,14, 6,1}, // lay=3
661 {1,1,1,1,22, 8,1}, // lay=4
662 {1,1,1,1,34,23,1}, // lay=5
663 {1,1,1,1,38,26,1}};// lay=6
665 // Sorry, but this is not very pritty code. It should be replaced
666 // at some point with a version that can search through the geometry
668 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
669 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
670 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
672 for(i=0;i<nlayers;i++){
674 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
675 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
679 if(fITSgeom!=0) delete fITSgeom;
680 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
681 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25;
682 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
684 for(lay=1;lay<=nlayers;lay++){
685 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
686 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
688 case 1: case 2: // layers 1 and 2 are a bit special
690 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
692 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
695 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
698 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
700 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
701 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
702 fITSgeom->ReSetShape(kSPD,
703 new AliITSgeomSPD300());
708 case 3: case 4: case 5: case 6: // layers 3-6
710 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
712 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
715 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
719 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
720 if(!(fITSgeom->IsShapeDefined(kSDD)))
721 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
724 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
725 if(!(fITSgeom->IsShapeDefined(kSSD)))
726 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
736 //_____________________________________________________________________________
737 void AliITSv5::Init(){
738 ////////////////////////////////////////////////////////////////////////
739 // Initialise the ITS after it has been created.
740 ////////////////////////////////////////////////////////////////////////
744 for(i=0;i<30;i++) cout << "*";cout << " ITSv5_Init ";
745 for(i=0;i<30;i++) cout << "*";cout << endl;
747 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
748 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
749 if(fGeomDetIn && !fGeomOldDetIn){
750 if(fITSgeom!=0) delete fITSgeom;
751 fITSgeom = new AliITSgeom();
752 fITSgeom->ReadNewFile(fRead);
754 if(fGeomDetIn && fGeomOldDetIn) ReadOldGeometry(fEuclidGeometry.Data());
756 if(!fGeomDetIn) this->InitAliITSgeom();
757 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
760 for(i=0;i<72;i++) cout << "*";
763 //_____________________________________________________________________________
764 void AliITSv5::StepManager(){
765 ////////////////////////////////////////////////////////////////////////
766 // Called for every step in the ITS, then calles the AliITShit class
767 // creator with the information to be recoreded about that hit.
768 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
769 // printing of information to a file which can be used to create a .det
770 // file read in by the routine CreateGeometry(). If set to 0 or any other
771 // value except 1, the default behavior, then no such file is created nor
772 // it the extra variables and the like used in the printing allocated.
773 ////////////////////////////////////////////////////////////////////////
778 TLorentzVector position, momentum;
779 TClonesArray &lhits = *fHits;
783 if(gMC->IsTrackInside()) vol[3] += 1;
784 if(gMC->IsTrackEntering()) vol[3] += 2;
785 if(gMC->IsTrackExiting()) vol[3] += 4;
786 if(gMC->IsTrackOut()) vol[3] += 8;
787 if(gMC->IsTrackDisappeared()) vol[3] += 16;
788 if(gMC->IsTrackStop()) vol[3] += 32;
789 if(gMC->IsTrackAlive()) vol[3] += 64;
791 // Fill hit structure.
792 if(!(gMC->TrackCharge())) return;
794 // Only entering charged tracks
795 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
797 id = gMC->CurrentVolOffID(0,copy);
798 //detector copy in the ladder = 1<->4 (ITS1)
800 gMC->CurrentVolOffID(1,copy1);
801 //ladder copy in the module = 1<->2 (I186)
802 gMC->CurrentVolOffID(2,copy2);
803 //module copy in the layer = 1<->10 (I132)
804 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
805 } else if(id == fIdSens[1]){
807 id = gMC->CurrentVolOffID(0,copy);
808 //detector copy in the ladder = 1<->4 (ITS2)
810 gMC->CurrentVolOffID(1,copy1);
811 //ladder copy in the module = 1<->4 (I131)
812 gMC->CurrentVolOffID(2,copy2);
813 //module copy in the layer = 1<->10 (I132)
814 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
815 } else if(id == fIdSens[2]){
817 id = gMC->CurrentVolOffID(1,copy);
818 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
820 id = gMC->CurrentVolOffID(2,copy);
821 //ladder copy in the layer = 1<->12 (I316)
823 } else if(id == fIdSens[3]){
825 id = gMC->CurrentVolOffID(1,copy);
826 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
828 id = gMC->CurrentVolOffID(2,copy);
829 //ladder copy in the layer = 1<->22 (I417)
831 }else if(id == fIdSens[4]){
833 id = gMC->CurrentVolOffID(1,copy);
834 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
836 id = gMC->CurrentVolOffID(2,copy);
837 //ladder copy in the layer = 1<->34 (I565)
839 }else if(id == fIdSens[5]){
841 id = gMC->CurrentVolOffID(1,copy);
842 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
844 id = gMC->CurrentVolOffID(2,copy);
845 //ladder copy in the layer = 1<->38 (I569)
848 return; // not an ITS volume?
849 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
851 gMC->TrackPosition(position);
852 gMC->TrackMomentum(momentum);
860 hits[7]=gMC->TrackTime();
861 // Fill hit structure with this new hit.
862 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);