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.7 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.6 2001/02/09 20:06:26 nilsen
27 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
29 Revision 1.5 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.4 2001/02/02 23:57:29 nilsen
34 Added include file that are no londer included in AliITSgeom.h
36 Revision 1.3 2001/01/30 09:23:13 hristov
37 Streamers removed (R.Brun)
39 Revision 1.2 2000/11/30 11:13:11 barbera
40 Added changes suggested by Federico Carminati on nov, 30, 2000
42 Revision 1.1 2000/10/07 15:46:29 barbera
43 Version 5 of the geometry with symmetric services
45 Revision 1.25 2000/10/05 20:50:00 nilsen
46 Now using root generated streamers.
48 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
49 Forward declarations added
51 Revision 1.22 2000/07/10 16:07:19 fca
52 Release version of ITS code
54 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
55 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
57 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
58 Fixed up the comments/documentation.
60 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
61 To make it compatable with the changes in AliRun/AliModule.
63 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
64 This is the version of the files after the merging done in December 1999.
65 See the ReadMe110100.txt file for details
67 Revision 1.14 1999/10/22 08:16:49 fca
68 Correct destructors, thanks to I.Hrivnacova
70 Revision 1.13 1999/10/06 10:15:19 fca
71 Correct bug in allocation of layer name and add destructor
73 Revision 1.12 1999/10/05 08:05:09 fca
74 Minor corrections for uninitialised variables.
76 Revision 1.11 1999/09/29 09:24:20 fca
77 Introduction of the Copyright and cvs Log
81 ///////////////////////////////////////////////////////////////////////////////
83 // Inner Traking System version 5 with symmetric services
84 // This class contains the base procedures for the Inner Tracking System
86 // Authors: R. Barbera, B. S. Nilsen.
88 // Created October 7 2000.
90 ///////////////////////////////////////////////////////////////////////////////
96 #include <TGeometry.h>
99 #include <TFile.h> // only required for Tracking function?
101 #include <TObjArray.h>
102 #include <TLorentzVector.h>
103 #include <TObjString.h>
104 #include <TClonesArray.h>
110 #include "../TGeant3/TGeant3.h"
111 #include "AliITShit.h"
112 #include "AliITSGeant3Geometry.h"
114 #include "AliITSv5symm.h"
115 #include "AliITSgeom.h"
116 #include "AliITSgeomSPD.h"
117 #include "AliITSgeomSDD.h"
118 #include "AliITSgeomSSD.h"
120 ClassImp(AliITSv5symm)
122 //_____________________________________________________________________________
123 AliITSv5symm::AliITSv5symm() {
124 ////////////////////////////////////////////////////////////////////////
125 // Standard default constructor for the ITS version 5.
126 ////////////////////////////////////////////////////////////////////////
132 fEuclidOut = kFALSE; // Don't write Euclide file
133 fGeomDetOut = kFALSE; // Don't write .det file
134 fGeomDetIn = kFALSE; // Don't Read .det file
135 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
136 fMajorVersion = IsVersion();
138 for(i=0;i<60;i++) fRead[i] = '\0';
139 for(i=0;i<60;i++) fWrite[i] = '\0';
140 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
142 //_____________________________________________________________________________
143 AliITSv5symm::AliITSv5symm(const char *name, const char *title) : AliITS(name, title){
144 /////////////////////////////////////////////////////////////////////////////
145 // Standard constructor for the ITS version 5 with symmetrical services.
146 /////////////////////////////////////////////////////////////////////////////
150 fIdName = new TString[fIdN];
157 fIdSens = new Int_t[fIdN];
158 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
159 fEuclidOut = kFALSE; // Don't write Euclide file
160 fGeomDetOut = kFALSE; // Don't write .det file
161 fGeomDetIn = kFALSE; // Don't Read .det file
162 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
163 fMajorVersion = IsVersion();
165 for(i=0;i<60;i++) fRead[i] = '\0';
166 for(i=0;i<60;i++) fWrite[i] = '\0';
168 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.tme";
169 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.euc";
170 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_v5symm.det",60);
171 strncpy(fRead,fEuclidGeomDet,60);
172 strncpy(fWrite,fEuclidGeomDet,60);
174 //____________________________________________________________________________
175 AliITSv5symm::AliITSv5symm(const AliITSv5symm &source){
176 ////////////////////////////////////////////////////////////////////////
177 // Copy Constructor for ITS version 5.
178 ////////////////////////////////////////////////////////////////////////
179 if(&source == this) return;
180 Warning("Copy Constructor","Not allowed to copy AliITSv5symm");
183 //_____________________________________________________________________________
184 AliITSv5symm& AliITSv5symm::operator=(const AliITSv5symm &source){
185 ////////////////////////////////////////////////////////////////////////
186 // Assignment operator for the ITS version 5.
187 ////////////////////////////////////////////////////////////////////////
189 if(&source == this) return *this;
190 Warning("= operator","Not allowed to copy AliITSv5symm");
194 //_____________________________________________________________________________
195 AliITSv5symm::~AliITSv5symm() {
196 ////////////////////////////////////////////////////////////////////////
197 // Standard destructor for the ITS version 5.
198 ////////////////////////////////////////////////////////////////////////
200 //_____________________________________________________________________________
201 void AliITSv5symm::BuildGeometry(){
202 ////////////////////////////////////////////////////////////////////////
203 // Geometry builder for the ITS version 5.
204 ////////////////////////////////////////////////////////////////////////
206 // Build ITS TNODE geometry for event display using detailed geometry.
207 // This function builds a simple ITS geometry used by the ROOT macro
212 //const int kColorITSSPD=kRed;
213 //const int kColorITSSDD=kGreen;
214 const int kColorITSSSD=kBlue;
216 AliITSgeom *gm = this->GetITSgeom();
218 top=gAlice->GetGeometry()->GetNode("alice");
227 //TCanvas *c1 = new TCanvas("c1","ITS");
229 for(lay=1;lay<=2;lay++)
230 for(lad=1;lad<=gm->GetNladders(lay);lad++)
231 for(det=1;det<=gm->GetNdetectors(lay);det++){
233 box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
236 cout << "EXCEPTION in box = new TBRIK" << endl;
239 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
240 gm->GetRotMatrix(lay,lad,det,rt);
241 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
242 for(i=0;i<9;i++) rtd[i] = rt[i];
244 rm = new TRotMatrix(name,name,rtd);
246 cout << "EXCEPTION in new TRotMatrix" << endl;
250 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
252 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
254 cout << "EXCEPTION in new TNode" << endl;
257 nd->SetLineColor(kColorITSSSD);
261 for(lay=3;lay<=3;lay++)
262 for(lad=1;lad<=gm->GetNladders(lay);lad++)
263 for(det=1;det<=gm->GetNdetectors(lay);det++){
265 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD 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("SDD"," ",box,xg[0],xg[1],xg[2],rm);
286 cout << "EXCEPTION in new TNode" << endl;
289 nd->SetLineColor(kColorITSSSD);
293 for(lay=4;lay<=4;lay++)
294 for(lad=1;lad<=gm->GetNladders(lay);lad++)
295 for(det=1;det<=gm->GetNdetectors(lay);det++){
297 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
300 cout << "EXCEPTION in box = new TBRIK" << endl;
303 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
304 gm->GetRotMatrix(lay,lad,det,rt);
305 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
306 for(i=0;i<9;i++) rtd[i] = rt[i];
308 rm = new TRotMatrix(name,name,rtd);
310 cout << "EXCEPTION in new TRotMatrix" << endl;
314 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
316 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
318 cout << "EXCEPTION in new TNode" << endl;
321 nd->SetLineColor(kColorITSSSD);
324 for(lay=5;lay<=5;lay++)
325 for(lad=1;lad<=gm->GetNladders(lay);lad++)
326 for(det=1;det<=gm->GetNdetectors(lay);det++){
328 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
331 cout << "EXCEPTION in box = new TBRIK" << endl;
334 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
335 gm->GetRotMatrix(lay,lad,det,rt);
336 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
337 for(i=0;i<9;i++) rtd[i] = rt[i];
339 rm = new TRotMatrix(name,name,rtd);
341 cout << "EXCEPTION in new TRotMatrix" << endl;
345 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
347 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
349 cout << "EXCEPTION in new TNode" << endl;
352 nd->SetLineColor(kColorITSSSD);
356 for(lay=6;lay<=6;lay++)
357 for(lad=1;lad<=gm->GetNladders(lay);lad++)
358 for(det=1;det<=gm->GetNdetectors(lay);det++){
360 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
363 cout << "EXCEPTION in box = new TBRIK" << endl;
367 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
368 gm->GetRotMatrix(lay,lad,det,rt);
369 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
370 for(i=0;i<9;i++) rtd[i] = rt[i];
372 rm = new TRotMatrix(name,name,rtd);
374 cout << "EXCEPTION in new TRotMatrix" << endl;
378 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
380 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
382 cout << "EXCEPTION in new TNode" << endl;
385 nd->SetLineColor(kColorITSSSD);
391 //_____________________________________________________________________________
392 void AliITSv5symm::CreateMaterials(){
393 ////////////////////////////////////////////////////////////////////////
394 // Read a file containing the materials for the ITS version 5.
395 ////////////////////////////////////////////////////////////////////////
398 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
400 FILE *file = fopen(filtmp,"r");
403 ReadEuclidMedia(filtmp);
405 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
409 //_____________________________________________________________________________
410 void AliITSv5symm::CreateGeometry(){
411 //////////////////////////////////////////////////////////////////////
412 // This is the geometry used for the ITS Pre-TDR and comes from an
413 // Euclid to Geant conversion. The only difference
414 // is in the details of the ITS supports. The detectors elements,
415 // detector numbering, and local and global reference frames are shown in
416 // the following figures.
419 <img src="picts/ITS/its1+2_convention_front_5.gif">
422 <font size=+2 color=red>
423 <p>This shows the front view of the SPDs.
426 <img src="picts/ITS/its1+2_convention_side_5.gif">
429 <font size=+2 color=red>
430 <p>This shows the perspective view of the SPDs.
432 <img src="picts/ITS/its1+2_tree.gif">
435 <font size=+2 color=red>
436 <p>This shows the geometry Tree for the SPDs.
441 <img src="picts/ITS/its3+4_convention_front_5.gif">
444 <font size=+2 color=red>
445 <p>This shows the front view of the SDDs.
448 <img src="picts/ITS/its3+4_convention_side_5.gif">
451 <font size=+2 color=red>
452 <p>This shows the perspective view of the SDDs.
454 <img src="picts/ITS/its3+4_tree.gif">
457 <font size=+2 color=red>
458 <p>This shows the geometry Tree for the SDDs.
463 <img src="picts/ITS/its5+6_convention_front_5.gif">
466 <font size=+2 color=red>
467 <p>This shows the front view of the SSDs.
470 <img src="picts/ITS/its5+6_convention_side_5.gif">
473 <font size=+2 color=red>
474 <p>This shows the perspective view of the SSDs.
477 <img src="picts/ITS/its5+6_tree.gif">
480 <font size=+2 color=red>
481 <p>This shows the geometry Tree for the SSDs.
486 <img src="picts/ITS/its_layer1-6_2.gif">
489 <font size=+2 color=red>
490 <p>This shows the front view of the whole ITS..
494 <img src="picts/ITS/its_layer1-6_1.gif">
497 <font size=+2 color=red>
498 <p>This shows the perspective view of the whole ITS..
502 <img src="picts/ITS/its1-6_tree.gif">
505 <font size=+2 color=red>
506 <p>This shows the geometry Tree for the whole ITS.
513 // Here are shown the details of the ITS support cones and services.
514 // First is a GEANT tree showing the organization of all of the volumes
515 // that make up the ITS supports and services.
518 <img src="picts/ITS/supports_tree.gif">
521 // What follows are a number of figures showing what these support
522 // structures look like.
526 <img src="picts/ITS/supports_3.gif">
529 <font size=+2 color=red>
530 <p>This shows the geometry of the supports for the Drift and Strip layers only.
534 <img src="picts/ITS/supports_2.gif">
537 <font size=+2 color=red>
538 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
542 <img src="picts/ITS/supports_1.gif">
545 <font size=+2 color=red>
546 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
550 <img src="picts/ITS/suppssd.gif">
553 <font size=+2 color=red>
554 <p>This shows the geometry for the Strip layers supports.
558 <img src="picts/ITS/suppsdd.gif">
561 <font size=+2 color=red>
562 <p>This shows the geometry for the Drift layers supports.
568 // Read a file containing the geometry for the ITS version 5.
569 ////////////////////////////////////////////////////////////////////////
573 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
574 FILE *file = fopen(filtmp,"r");
578 printf("Ready to read Euclid geometry file\n");
579 ReadEuclid(fEuclidGeometry.Data(),topvol);
580 printf("Read in euclid geometries\n");
582 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
583 fEuclidGeometry.Data());
587 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
590 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
592 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
595 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
596 } // end if (fEuclidOut)
597 cout << "finished with euclid geometrys" << endl;
599 //______________________________________________________________________
600 void AliITSv5symm::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 filtmp = gSystem->ExpandPathName(filename);
609 size = strlen(filtmp);
610 if(size>4 && fGeomDetIn){
611 filtmp[size-3] = 'd'; // change from .euc to .det
612 filtmp[size-2] = 'e';
613 filtmp[size-1] = 't';
614 file = fopen(filtmp,"r");
615 if(file){ // if file exists use it to fill AliITSgeom structure.
617 fITSgeom = new AliITSgeom(filtmp);
618 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
619 // Now define the detector types/shapes.
620 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
621 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
622 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
625 // fill AliITSgeom structure from geant structure just filled above
630 //______________________________________________________________________
631 void AliITSv5symm::InitAliITSgeom(){
632 // Based on the geometry tree defined in Geant 3.21, this
633 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
635 if(!(dynamic_cast<TGeant3*>(gMC))) {
636 Error("InitAliITSgeom",
637 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
640 cout << "Reading Geometry transformation directly from Geant 3." << endl;
641 const Int_t nlayers = 6;
642 const Int_t ndeep = 7;
643 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
644 Int_t nlad[nlayers],ndet[nlayers];
646 Float_t par[20],att[20];
647 Int_t npar,natt,idshape,imat,imed;
648 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
649 Int_t mod,lay,lad,det,i,j,k;
650 char *names[nlayers][ndeep] = {
651 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
652 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
653 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
654 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
655 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
656 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
657 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
658 {1,1,1,1,10, 4,4}, // lay=2
659 {1,1,1,1,14, 6,1}, // lay=3
660 {1,1,1,1,22, 8,1}, // lay=4
661 {1,1,1,1,34,23,1}, // lay=5
662 {1,1,1,1,38,26,1}};// lay=6
664 // Sorry, but this is not very pritty code. It should be replaced
665 // at some point with a version that can search through the geometry
667 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
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 if(fMinorVersion==1){
703 fITSgeom->ReSetShape(kSPD,
704 new AliITSgeomSPD300());
705 } else if(fMinorVersion==2)
706 fITSgeom->ReSetShape(kSPD,
707 new AliITSgeomSPD300());
712 case 3: case 4: case 5: case 6: // layers 3-6
714 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
716 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
719 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
723 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
724 if(!(fITSgeom->IsShapeDefined(kSDD)))
725 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
728 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
729 if(!(fITSgeom->IsShapeDefined(kSSD)))
730 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
740 //_____________________________________________________________________________
741 void AliITSv5symm::Init(){
742 ////////////////////////////////////////////////////////////////////////
743 // Initialise the ITS after it has been created.
744 ////////////////////////////////////////////////////////////////////////
748 for(i=0;i<28;i++) cout << "*";cout << " ITSv5symm_Init ";
749 for(i=0;i<28;i++) cout << "*";cout << endl;
751 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
752 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
753 if(fITSgeom!=0) delete fITSgeom;
754 fITSgeom = new AliITSgeom();
755 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
756 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
758 if(!fGeomDetIn) this->InitAliITSgeom();
759 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
762 for(i=0;i<72;i++) cout << "*";
765 //_____________________________________________________________________________
766 void AliITSv5symm::StepManager(){
767 ////////////////////////////////////////////////////////////////////////
768 // Called for every step in the ITS, then calles the AliITShit class
769 // creator with the information to be recoreded about that hit.
770 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
771 // printing of information to a file which can be used to create a .det
772 // file read in by the routine CreateGeometry(). If set to 0 or any other
773 // value except 1, the default behavior, then no such file is created nor
774 // it the extra variables and the like used in the printing allocated.
775 ////////////////////////////////////////////////////////////////////////
780 TLorentzVector position, momentum;
781 TClonesArray &lhits = *fHits;
785 if(gMC->IsTrackInside()) vol[3] += 1;
786 if(gMC->IsTrackEntering()) vol[3] += 2;
787 if(gMC->IsTrackExiting()) vol[3] += 4;
788 if(gMC->IsTrackOut()) vol[3] += 8;
789 if(gMC->IsTrackDisappeared()) vol[3] += 16;
790 if(gMC->IsTrackStop()) vol[3] += 32;
791 if(gMC->IsTrackAlive()) vol[3] += 64;
793 // Fill hit structure.
794 if(!(gMC->TrackCharge())) return;
796 // Only entering charged tracks
797 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
799 id = gMC->CurrentVolOffID(0,copy);
800 //detector copy in the ladder = 1<->4 (ITS1)
802 gMC->CurrentVolOffID(1,copy1);
803 //ladder copy in the module = 1<->2 (I186)
804 gMC->CurrentVolOffID(2,copy2);
805 //module copy in the layer = 1<->10 (I132)
806 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
807 } else if(id == fIdSens[1]){
809 id = gMC->CurrentVolOffID(0,copy);
810 //detector copy in the ladder = 1<->4 (ITS2)
812 gMC->CurrentVolOffID(1,copy1);
813 //ladder copy in the module = 1<->4 (I131)
814 gMC->CurrentVolOffID(2,copy2);
815 //module copy in the layer = 1<->10 (I132)
816 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
817 } else if(id == fIdSens[2]){
819 id = gMC->CurrentVolOffID(1,copy);
820 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
822 id = gMC->CurrentVolOffID(2,copy);
823 //ladder copy in the layer = 1<->12 (I316)
825 } else if(id == fIdSens[3]){
827 id = gMC->CurrentVolOffID(1,copy);
828 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
830 id = gMC->CurrentVolOffID(2,copy);
831 //ladder copy in the layer = 1<->22 (I417)
833 }else if(id == fIdSens[4]){
835 id = gMC->CurrentVolOffID(1,copy);
836 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
838 id = gMC->CurrentVolOffID(2,copy);
839 //ladder copy in the layer = 1<->34 (I565)
841 }else if(id == fIdSens[5]){
843 id = gMC->CurrentVolOffID(1,copy);
844 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
846 id = gMC->CurrentVolOffID(2,copy);
847 //ladder copy in the layer = 1<->38 (I569)
850 return; // not an ITS volume?
851 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
853 gMC->TrackPosition(position);
854 gMC->TrackMomentum(momentum);
862 hits[7]=gMC->TrackTime();
863 // Fill hit structure with this new hit.
864 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);