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.8 2001/03/23 00:12:23 nilsen
19 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
20 not a .det file. Removed redundent calls to BuildGeometry.
22 Revision 1.7 2001/02/13 16:53:35 nilsen
23 Fixed a but when trying to use GEANT4. Needed to replace
24 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
25 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
26 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
27 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
28 in the same way as in AliITSv5.cxx.
30 Revision 1.6 2001/02/09 20:06:26 nilsen
31 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
33 Revision 1.5 2001/02/09 00:05:31 nilsen
34 Added fMajor/MinorVersion variables and made other changes to better make
35 use of the new code changes in AliITSgeom related classes.
37 Revision 1.4 2001/02/02 23:57:29 nilsen
38 Added include file that are no londer included in AliITSgeom.h
40 Revision 1.3 2001/01/30 09:23:13 hristov
41 Streamers removed (R.Brun)
43 Revision 1.2 2000/11/30 11:13:11 barbera
44 Added changes suggested by Federico Carminati on nov, 30, 2000
46 Revision 1.1 2000/10/07 15:46:29 barbera
47 Version 5 of the geometry with symmetric services
49 Revision 1.25 2000/10/05 20:50:00 nilsen
50 Now using root generated streamers.
52 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
53 Forward declarations added
55 Revision 1.22 2000/07/10 16:07:19 fca
56 Release version of ITS code
58 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
59 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
61 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
62 Fixed up the comments/documentation.
64 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
65 To make it compatable with the changes in AliRun/AliModule.
67 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
68 This is the version of the files after the merging done in December 1999.
69 See the ReadMe110100.txt file for details
71 Revision 1.14 1999/10/22 08:16:49 fca
72 Correct destructors, thanks to I.Hrivnacova
74 Revision 1.13 1999/10/06 10:15:19 fca
75 Correct bug in allocation of layer name and add destructor
77 Revision 1.12 1999/10/05 08:05:09 fca
78 Minor corrections for uninitialised variables.
80 Revision 1.11 1999/09/29 09:24:20 fca
81 Introduction of the Copyright and cvs Log
85 ///////////////////////////////////////////////////////////////////////////////
87 // Inner Traking System version 5 with symmetric services
88 // This class contains the base procedures for the Inner Tracking System
90 // Authors: R. Barbera, B. S. Nilsen.
92 // Created October 7 2000.
94 ///////////////////////////////////////////////////////////////////////////////
100 #include <TGeometry.h>
103 #include <TFile.h> // only required for Tracking function?
105 #include <TObjArray.h>
106 #include <TLorentzVector.h>
107 #include <TObjString.h>
108 #include <TClonesArray.h>
114 #include "../TGeant3/TGeant3.h"
115 #include "AliITShit.h"
116 #include "AliITSGeant3Geometry.h"
118 #include "AliITSv5symm.h"
119 #include "AliITSgeom.h"
120 #include "AliITSgeomSPD.h"
121 #include "AliITSgeomSDD.h"
122 #include "AliITSgeomSSD.h"
124 ClassImp(AliITSv5symm)
126 //_____________________________________________________________________________
127 AliITSv5symm::AliITSv5symm() {
128 ////////////////////////////////////////////////////////////////////////
129 // Standard default constructor for the ITS version 5.
130 ////////////////////////////////////////////////////////////////////////
136 fEuclidOut = kFALSE; // Don't write Euclide file
137 fGeomDetOut = kFALSE; // Don't write .det file
138 fGeomDetIn = kFALSE; // Don't Read .det file
139 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
140 fMajorVersion = IsVersion();
142 for(i=0;i<60;i++) fRead[i] = '\0';
143 for(i=0;i<60;i++) fWrite[i] = '\0';
144 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
146 //_____________________________________________________________________________
147 AliITSv5symm::AliITSv5symm(const char *name, const char *title) : AliITS(name, title){
148 /////////////////////////////////////////////////////////////////////////////
149 // Standard constructor for the ITS version 5 with symmetrical services.
150 /////////////////////////////////////////////////////////////////////////////
154 fIdName = new TString[fIdN];
161 fIdSens = new Int_t[fIdN];
162 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
163 fEuclidOut = kFALSE; // Don't write Euclide file
164 fGeomDetOut = kFALSE; // Don't write .det file
165 fGeomDetIn = kFALSE; // Don't Read .det file
166 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
167 fMajorVersion = IsVersion();
169 for(i=0;i<60;i++) fRead[i] = '\0';
170 for(i=0;i<60;i++) fWrite[i] = '\0';
172 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.tme";
173 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.euc";
174 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_v5symm.det",60);
175 strncpy(fRead,fEuclidGeomDet,60);
176 strncpy(fWrite,fEuclidGeomDet,60);
178 //____________________________________________________________________________
179 AliITSv5symm::AliITSv5symm(const AliITSv5symm &source){
180 ////////////////////////////////////////////////////////////////////////
181 // Copy Constructor for ITS version 5.
182 ////////////////////////////////////////////////////////////////////////
183 if(&source == this) return;
184 Warning("Copy Constructor","Not allowed to copy AliITSv5symm");
187 //_____________________________________________________________________________
188 AliITSv5symm& AliITSv5symm::operator=(const AliITSv5symm &source){
189 ////////////////////////////////////////////////////////////////////////
190 // Assignment operator for the ITS version 5.
191 ////////////////////////////////////////////////////////////////////////
193 if(&source == this) return *this;
194 Warning("= operator","Not allowed to copy AliITSv5symm");
198 //_____________________________________________________________________________
199 AliITSv5symm::~AliITSv5symm() {
200 ////////////////////////////////////////////////////////////////////////
201 // Standard destructor for the ITS version 5.
202 ////////////////////////////////////////////////////////////////////////
204 //_____________________________________________________________________________
205 void AliITSv5symm::BuildGeometry(){
206 ////////////////////////////////////////////////////////////////////////
207 // Geometry builder for the ITS version 5.
208 ////////////////////////////////////////////////////////////////////////
210 // Build ITS TNODE geometry for event display using detailed geometry.
211 // This function builds a simple ITS geometry used by the ROOT macro
216 //const int kColorITSSPD=kRed;
217 //const int kColorITSSDD=kGreen;
218 const int kColorITSSSD=kBlue;
220 AliITSgeom *gm = this->GetITSgeom();
222 top=gAlice->GetGeometry()->GetNode("alice");
231 //TCanvas *c1 = new TCanvas("c1","ITS");
233 for(lay=1;lay<=2;lay++)
234 for(lad=1;lad<=gm->GetNladders(lay);lad++)
235 for(det=1;det<=gm->GetNdetectors(lay);det++){
237 box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
240 cout << "EXCEPTION in box = new TBRIK" << endl;
243 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
244 gm->GetRotMatrix(lay,lad,det,rt);
245 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
246 for(i=0;i<9;i++) rtd[i] = rt[i];
248 rm = new TRotMatrix(name,name,rtd);
250 cout << "EXCEPTION in new TRotMatrix" << endl;
254 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
256 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
258 cout << "EXCEPTION in new TNode" << endl;
261 nd->SetLineColor(kColorITSSSD);
265 for(lay=3;lay<=3;lay++)
266 for(lad=1;lad<=gm->GetNladders(lay);lad++)
267 for(det=1;det<=gm->GetNdetectors(lay);det++){
269 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
272 cout << "EXCEPTION in box = new TBRIK" << endl;
275 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
276 gm->GetRotMatrix(lay,lad,det,rt);
277 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
278 for(i=0;i<9;i++) rtd[i] = rt[i];
280 rm = new TRotMatrix(name,name,rtd);
282 cout << "EXCEPTION in new TRotMatrix" << endl;
286 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
288 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
290 cout << "EXCEPTION in new TNode" << endl;
293 nd->SetLineColor(kColorITSSSD);
297 for(lay=4;lay<=4;lay++)
298 for(lad=1;lad<=gm->GetNladders(lay);lad++)
299 for(det=1;det<=gm->GetNdetectors(lay);det++){
301 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
304 cout << "EXCEPTION in box = new TBRIK" << endl;
307 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
308 gm->GetRotMatrix(lay,lad,det,rt);
309 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
310 for(i=0;i<9;i++) rtd[i] = rt[i];
312 rm = new TRotMatrix(name,name,rtd);
314 cout << "EXCEPTION in new TRotMatrix" << endl;
318 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
320 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
322 cout << "EXCEPTION in new TNode" << endl;
325 nd->SetLineColor(kColorITSSSD);
328 for(lay=5;lay<=5;lay++)
329 for(lad=1;lad<=gm->GetNladders(lay);lad++)
330 for(det=1;det<=gm->GetNdetectors(lay);det++){
332 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
335 cout << "EXCEPTION in box = new TBRIK" << endl;
338 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
339 gm->GetRotMatrix(lay,lad,det,rt);
340 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
341 for(i=0;i<9;i++) rtd[i] = rt[i];
343 rm = new TRotMatrix(name,name,rtd);
345 cout << "EXCEPTION in new TRotMatrix" << endl;
349 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
351 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
353 cout << "EXCEPTION in new TNode" << endl;
356 nd->SetLineColor(kColorITSSSD);
360 for(lay=6;lay<=6;lay++)
361 for(lad=1;lad<=gm->GetNladders(lay);lad++)
362 for(det=1;det<=gm->GetNdetectors(lay);det++){
364 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
367 cout << "EXCEPTION in box = new TBRIK" << endl;
371 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
372 gm->GetRotMatrix(lay,lad,det,rt);
373 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
374 for(i=0;i<9;i++) rtd[i] = rt[i];
376 rm = new TRotMatrix(name,name,rtd);
378 cout << "EXCEPTION in new TRotMatrix" << endl;
382 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
384 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
386 cout << "EXCEPTION in new TNode" << endl;
389 nd->SetLineColor(kColorITSSSD);
395 //_____________________________________________________________________________
396 void AliITSv5symm::CreateMaterials(){
397 ////////////////////////////////////////////////////////////////////////
398 // Read a file containing the materials for the ITS version 5.
399 ////////////////////////////////////////////////////////////////////////
402 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
404 FILE *file = fopen(filtmp,"r");
407 ReadEuclidMedia(filtmp);
409 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
413 //_____________________________________________________________________________
414 void AliITSv5symm::CreateGeometry(){
415 //////////////////////////////////////////////////////////////////////
416 // This is the geometry used for the ITS Pre-TDR and comes from an
417 // Euclid to Geant conversion. The only difference
418 // is in the details of the ITS supports. The detectors elements,
419 // detector numbering, and local and global reference frames are shown in
420 // the following figures.
423 <img src="picts/ITS/its1+2_convention_front_5.gif">
426 <font size=+2 color=red>
427 <p>This shows the front view of the SPDs.
430 <img src="picts/ITS/its1+2_convention_side_5.gif">
433 <font size=+2 color=red>
434 <p>This shows the perspective view of the SPDs.
436 <img src="picts/ITS/its1+2_tree.gif">
439 <font size=+2 color=red>
440 <p>This shows the geometry Tree for the SPDs.
445 <img src="picts/ITS/its3+4_convention_front_5.gif">
448 <font size=+2 color=red>
449 <p>This shows the front view of the SDDs.
452 <img src="picts/ITS/its3+4_convention_side_5.gif">
455 <font size=+2 color=red>
456 <p>This shows the perspective view of the SDDs.
458 <img src="picts/ITS/its3+4_tree.gif">
461 <font size=+2 color=red>
462 <p>This shows the geometry Tree for the SDDs.
467 <img src="picts/ITS/its5+6_convention_front_5.gif">
470 <font size=+2 color=red>
471 <p>This shows the front view of the SSDs.
474 <img src="picts/ITS/its5+6_convention_side_5.gif">
477 <font size=+2 color=red>
478 <p>This shows the perspective view of the SSDs.
481 <img src="picts/ITS/its5+6_tree.gif">
484 <font size=+2 color=red>
485 <p>This shows the geometry Tree for the SSDs.
490 <img src="picts/ITS/its_layer1-6_2.gif">
493 <font size=+2 color=red>
494 <p>This shows the front view of the whole ITS..
498 <img src="picts/ITS/its_layer1-6_1.gif">
501 <font size=+2 color=red>
502 <p>This shows the perspective view of the whole ITS..
506 <img src="picts/ITS/its1-6_tree.gif">
509 <font size=+2 color=red>
510 <p>This shows the geometry Tree for the whole ITS.
517 // Here are shown the details of the ITS support cones and services.
518 // First is a GEANT tree showing the organization of all of the volumes
519 // that make up the ITS supports and services.
522 <img src="picts/ITS/supports_tree.gif">
525 // What follows are a number of figures showing what these support
526 // structures look like.
530 <img src="picts/ITS/supports_3.gif">
533 <font size=+2 color=red>
534 <p>This shows the geometry of the supports for the Drift and Strip layers only.
538 <img src="picts/ITS/supports_2.gif">
541 <font size=+2 color=red>
542 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
546 <img src="picts/ITS/supports_1.gif">
549 <font size=+2 color=red>
550 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
554 <img src="picts/ITS/suppssd.gif">
557 <font size=+2 color=red>
558 <p>This shows the geometry for the Strip layers supports.
562 <img src="picts/ITS/suppsdd.gif">
565 <font size=+2 color=red>
566 <p>This shows the geometry for the Drift layers supports.
572 // Read a file containing the geometry for the ITS version 5.
573 ////////////////////////////////////////////////////////////////////////
577 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
578 FILE *file = fopen(filtmp,"r");
582 printf("Ready to read Euclid geometry file\n");
583 ReadEuclid(fEuclidGeometry.Data(),topvol);
584 printf("Read in euclid geometries\n");
586 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
587 fEuclidGeometry.Data());
591 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
594 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
596 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
599 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
600 } // end if (fEuclidOut)
601 cout << "finished with euclid geometrys" << endl;
603 //______________________________________________________________________
604 void AliITSv5symm::ReadOldGeometry(const char *filename){
605 // read in the file containing the transformations for the active
606 // volumes for the ITS version 5. This is expected to be in a file
607 // ending in .det. This geometry is kept in the AliITSgeom class.
612 filtmp = gSystem->ExpandPathName(filename);
613 size = strlen(filtmp);
614 if(size>4 && fGeomDetIn){
615 filtmp[size-3] = 'd'; // change from .euc to .det
616 filtmp[size-2] = 'e';
617 filtmp[size-1] = 't';
618 file = fopen(filtmp,"r");
619 if(file){ // if file exists use it to fill AliITSgeom structure.
621 fITSgeom = new AliITSgeom(filtmp);
622 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
623 // Now define the detector types/shapes.
624 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
625 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
626 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
629 // fill AliITSgeom structure from geant structure just filled above
634 //______________________________________________________________________
635 void AliITSv5symm::InitAliITSgeom(){
636 // Based on the geometry tree defined in Geant 3.21, this
637 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
639 if(!(dynamic_cast<TGeant3*>(gMC))) {
640 Error("InitAliITSgeom",
641 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
644 cout << "Reading Geometry transformation directly from Geant 3." << endl;
645 const Int_t nlayers = 6;
646 const Int_t ndeep = 7;
647 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
648 Int_t nlad[nlayers],ndet[nlayers];
650 Float_t par[20],att[20];
651 Int_t npar,natt,idshape,imat,imed;
652 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
653 Int_t mod,lay,lad,det,i,j,k;
654 char *names[nlayers][ndeep] = {
655 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
656 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
657 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
658 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
659 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
660 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
661 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
662 {1,1,1,1,10, 4,4}, // lay=2
663 {1,1,1,1,14, 6,1}, // lay=3
664 {1,1,1,1,22, 8,1}, // lay=4
665 {1,1,1,1,34,23,1}, // lay=5
666 {1,1,1,1,38,26,1}};// lay=6
668 // Sorry, but this is not very pritty code. It should be replaced
669 // at some point with a version that can search through the geometry
671 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
672 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
673 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
674 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
676 for(i=0;i<nlayers;i++){
678 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
679 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
683 if(fITSgeom!=0) delete fITSgeom;
684 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
685 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
686 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
688 for(lay=1;lay<=nlayers;lay++){
689 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
690 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
692 case 1: case 2: // layers 1 and 2 are a bit special
694 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
696 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
699 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
702 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
704 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
705 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
706 if(fMinorVersion==1){
707 fITSgeom->ReSetShape(kSPD,
708 new AliITSgeomSPD300());
709 } else if(fMinorVersion==2)
710 fITSgeom->ReSetShape(kSPD,
711 new AliITSgeomSPD300());
716 case 3: case 4: case 5: case 6: // layers 3-6
718 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
720 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
723 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
727 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
728 if(!(fITSgeom->IsShapeDefined(kSDD)))
729 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
732 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
733 if(!(fITSgeom->IsShapeDefined(kSSD)))
734 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
744 //_____________________________________________________________________________
745 void AliITSv5symm::Init(){
746 ////////////////////////////////////////////////////////////////////////
747 // Initialise the ITS after it has been created.
748 ////////////////////////////////////////////////////////////////////////
752 for(i=0;i<28;i++) cout << "*";cout << " ITSv5symm_Init ";
753 for(i=0;i<28;i++) cout << "*";cout << endl;
755 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
756 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
757 if(fITSgeom!=0) delete fITSgeom;
758 fITSgeom = new AliITSgeom();
759 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
760 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
762 if(!fGeomDetIn) this->InitAliITSgeom();
763 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
766 for(i=0;i<72;i++) cout << "*";
769 //_____________________________________________________________________________
770 void AliITSv5symm::StepManager(){
771 ////////////////////////////////////////////////////////////////////////
772 // Called for every step in the ITS, then calles the AliITShit class
773 // creator with the information to be recoreded about that hit.
774 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
775 // printing of information to a file which can be used to create a .det
776 // file read in by the routine CreateGeometry(). If set to 0 or any other
777 // value except 1, the default behavior, then no such file is created nor
778 // it the extra variables and the like used in the printing allocated.
779 ////////////////////////////////////////////////////////////////////////
784 TLorentzVector position, momentum;
785 TClonesArray &lhits = *fHits;
789 if(gMC->IsTrackInside()) vol[3] += 1;
790 if(gMC->IsTrackEntering()) vol[3] += 2;
791 if(gMC->IsTrackExiting()) vol[3] += 4;
792 if(gMC->IsTrackOut()) vol[3] += 8;
793 if(gMC->IsTrackDisappeared()) vol[3] += 16;
794 if(gMC->IsTrackStop()) vol[3] += 32;
795 if(gMC->IsTrackAlive()) vol[3] += 64;
797 // Fill hit structure.
798 if(!(gMC->TrackCharge())) return;
800 // Only entering charged tracks
801 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
803 id = gMC->CurrentVolOffID(0,copy);
804 //detector copy in the ladder = 1<->4 (ITS1)
806 gMC->CurrentVolOffID(1,copy1);
807 //ladder copy in the module = 1<->2 (I186)
808 gMC->CurrentVolOffID(2,copy2);
809 //module copy in the layer = 1<->10 (I132)
810 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
811 } else if(id == fIdSens[1]){
813 id = gMC->CurrentVolOffID(0,copy);
814 //detector copy in the ladder = 1<->4 (ITS2)
816 gMC->CurrentVolOffID(1,copy1);
817 //ladder copy in the module = 1<->4 (I131)
818 gMC->CurrentVolOffID(2,copy2);
819 //module copy in the layer = 1<->10 (I132)
820 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
821 } else if(id == fIdSens[2]){
823 id = gMC->CurrentVolOffID(1,copy);
824 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
826 id = gMC->CurrentVolOffID(2,copy);
827 //ladder copy in the layer = 1<->12 (I316)
829 } else if(id == fIdSens[3]){
831 id = gMC->CurrentVolOffID(1,copy);
832 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
834 id = gMC->CurrentVolOffID(2,copy);
835 //ladder copy in the layer = 1<->22 (I417)
837 }else if(id == fIdSens[4]){
839 id = gMC->CurrentVolOffID(1,copy);
840 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
842 id = gMC->CurrentVolOffID(2,copy);
843 //ladder copy in the layer = 1<->34 (I565)
845 }else if(id == fIdSens[5]){
847 id = gMC->CurrentVolOffID(1,copy);
848 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
850 id = gMC->CurrentVolOffID(2,copy);
851 //ladder copy in the layer = 1<->38 (I569)
854 return; // not an ITS volume?
855 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
857 gMC->TrackPosition(position);
858 gMC->TrackMomentum(momentum);
866 hits[7]=gMC->TrackTime();
867 // Fill hit structure with this new hit.
868 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);