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.9 2001/02/14 14:12:43 nilsen
19 Forgot about the nonexisting v in ITSgeometry_5.det.
21 Revision 1.8 2001/02/14 14:06:23 nilsen
22 Wrong default .det file name for old .det file format.
24 Revision 1.7 2001/02/13 16:53:35 nilsen
25 Fixed a but when trying to use GEANT4. Needed to replace
26 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
27 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
28 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
29 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
30 in the same way as in AliITSv5.cxx.
32 Revision 1.6 2001/02/09 20:06:26 nilsen
33 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
35 Revision 1.5 2001/02/09 00:05:31 nilsen
36 Added fMajor/MinorVersion variables and made other changes to better make
37 use of the new code changes in AliITSgeom related classes.
39 Revision 1.4 2001/02/02 23:57:29 nilsen
40 Added include file that are no londer included in AliITSgeom.h
42 Revision 1.3 2001/01/30 09:23:13 hristov
43 Streamers removed (R.Brun)
45 Revision 1.2 2000/11/30 11:13:11 barbera
46 Added changes suggested by Federico Carminati on nov, 30, 2000
48 Revision 1.1 2000/10/07 15:46:38 barbera
49 Version 5 of the geometry with asymmetric services
51 Revision 1.25 2000/10/05 20:50:00 nilsen
52 Now using root generated streamers.
54 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
55 Forward declarations added
57 Revision 1.22 2000/07/10 16:07:19 fca
58 Release version of ITS code
60 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
61 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
63 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
64 Fixed up the comments/documentation.
66 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
67 To make it compatable with the changes in AliRun/AliModule.
69 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
70 This is the version of the files after the merging done in December 1999.
71 See the ReadMe110100.txt file for details
73 Revision 1.14 1999/10/22 08:16:49 fca
74 Correct destructors, thanks to I.Hrivnacova
76 Revision 1.13 1999/10/06 10:15:19 fca
77 Correct bug in allocation of layer name and add destructor
79 Revision 1.12 1999/10/05 08:05:09 fca
80 Minor corrections for uninitialised variables.
82 Revision 1.11 1999/09/29 09:24:20 fca
83 Introduction of the Copyright and cvs Log
87 ///////////////////////////////////////////////////////////////////////////////
89 // Inner Traking System version 5 with asymmetric services
90 // This class contains the base procedures for the Inner Tracking System
92 // Authors: R. Barbera, B. S. Nilsen.
94 // Created October 7 2000.
96 ///////////////////////////////////////////////////////////////////////////////
102 #include <TGeometry.h>
105 #include <TFile.h> // only required for Tracking function?
107 #include <TObjArray.h>
108 #include <TObjString.h>
109 #include <TClonesArray.h>
110 #include <TLorentzVector.h>
116 #include "../TGeant3/TGeant3.h"
117 #include "AliITShit.h"
118 #include "AliITSGeant3Geometry.h"
120 #include "AliITSv5asymm.h"
121 #include "AliITSgeom.h"
122 #include "AliITSgeomSPD.h"
123 #include "AliITSgeomSDD.h"
124 #include "AliITSgeomSSD.h"
126 ClassImp(AliITSv5asymm)
128 //_____________________________________________________________________________
129 AliITSv5asymm::AliITSv5asymm() {
130 ////////////////////////////////////////////////////////////////////////
131 // Standard default constructor for the ITS version 5.
132 ////////////////////////////////////////////////////////////////////////
138 fEuclidOut = kFALSE; // Don't write Euclide file
139 fGeomDetOut = kFALSE; // Don't write .det file
140 fGeomDetIn = kTRUE; // Read .det file
141 fGeomOldDetIn = kTRUE; // Read old formatted .det file
142 fMajorVersion = IsVersion();
144 for(i=0;i<60;i++) fRead[i] = '\0';
145 for(i=0;i<60;i++) fWrite[i] = '\0';
146 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
148 //_____________________________________________________________________________
149 AliITSv5asymm::AliITSv5asymm(const char *name, const char *title) : AliITS(name, title){
150 /////////////////////////////////////////////////////////////////////////////
151 // Standard constructor for the ITS version 5 with symmetrical services.
152 /////////////////////////////////////////////////////////////////////////////
156 fIdName = new TString[fIdN];
163 fIdSens = new Int_t[fIdN];
164 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
165 fEuclidOut = kFALSE; // Don't write Euclide file
166 fGeomDetOut = kFALSE; // Don't write .det file
167 fGeomDetIn = kTRUE; // Read .det file
168 fGeomOldDetIn = kTRUE; // Read old formatted .det file
169 fMajorVersion = IsVersion();
171 for(i=0;i<60;i++) fRead[i] = '\0';
172 for(i=0;i<60;i++) fWrite[i] = '\0';
174 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.tme";
175 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.euc";
176 strncpy(fEuclidGeomDet,"$ALICE_ROOT/Euclid/ITSgeometry_5.det",60);
177 strncpy(fRead,fEuclidGeomDet,60);
178 strncpy(fWrite,fEuclidGeomDet,60);
180 //____________________________________________________________________________
181 AliITSv5asymm::AliITSv5asymm(const AliITSv5asymm &source){
182 ////////////////////////////////////////////////////////////////////////
183 // Copy Constructor for ITS version 5.
184 ////////////////////////////////////////////////////////////////////////
185 if(&source == this) return;
186 Warning("Copy Constructor","Not allowed to copy AliITSv5asymm");
189 //_____________________________________________________________________________
190 AliITSv5asymm& AliITSv5asymm::operator=(const AliITSv5asymm &source){
191 ////////////////////////////////////////////////////////////////////////
192 // Assignment operator for the ITS version 5.
193 ////////////////////////////////////////////////////////////////////////
195 if(&source == this) return *this;
196 Warning("= operator","Not allowed to copy AliITSv5asymm");
200 //_____________________________________________________________________________
201 AliITSv5asymm::~AliITSv5asymm() {
202 ////////////////////////////////////////////////////////////////////////
203 // Standard destructor for the ITS version 5.
204 ////////////////////////////////////////////////////////////////////////
206 //_____________________________________________________________________________
207 void AliITSv5asymm::BuildGeometry(){
208 ////////////////////////////////////////////////////////////////////////
209 // Geometry builder for the ITS version 5.
210 ////////////////////////////////////////////////////////////////////////
212 // Build ITS TNODE geometry for event display using detailed geometry.
213 // This function builds a simple ITS geometry used by the ROOT macro
218 //const int kColorITSSPD=kRed;
219 //const int kColorITSSDD=kGreen;
220 const int kColorITSSSD=kBlue;
222 AliITSgeom *gm = this->GetITSgeom();
224 top=gAlice->GetGeometry()->GetNode("alice");
233 //TCanvas *c1 = new TCanvas("c1","ITS");
235 for(lay=1;lay<=2;lay++)
236 for(lad=1;lad<=gm->GetNladders(lay);lad++)
237 for(det=1;det<=gm->GetNdetectors(lay);det++){
239 box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
242 cout << "EXCEPTION in box = new TBRIK" << endl;
245 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
246 gm->GetRotMatrix(lay,lad,det,rt);
247 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
248 for(i=0;i<9;i++) rtd[i] = rt[i];
250 rm = new TRotMatrix(name,name,rtd);
252 cout << "EXCEPTION in new TRotMatrix" << endl;
256 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
258 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
260 cout << "EXCEPTION in new TNode" << endl;
263 nd->SetLineColor(kColorITSSSD);
267 for(lay=3;lay<=3;lay++)
268 for(lad=1;lad<=gm->GetNladders(lay);lad++)
269 for(det=1;det<=gm->GetNdetectors(lay);det++){
271 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
274 cout << "EXCEPTION in box = new TBRIK" << endl;
277 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
278 gm->GetRotMatrix(lay,lad,det,rt);
279 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
280 for(i=0;i<9;i++) rtd[i] = rt[i];
282 rm = new TRotMatrix(name,name,rtd);
284 cout << "EXCEPTION in new TRotMatrix" << endl;
288 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
290 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
292 cout << "EXCEPTION in new TNode" << endl;
295 nd->SetLineColor(kColorITSSSD);
299 for(lay=4;lay<=4;lay++)
300 for(lad=1;lad<=gm->GetNladders(lay);lad++)
301 for(det=1;det<=gm->GetNdetectors(lay);det++){
303 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
306 cout << "EXCEPTION in box = new TBRIK" << endl;
309 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
310 gm->GetRotMatrix(lay,lad,det,rt);
311 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
312 for(i=0;i<9;i++) rtd[i] = rt[i];
314 rm = new TRotMatrix(name,name,rtd);
316 cout << "EXCEPTION in new TRotMatrix" << endl;
320 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
322 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
324 cout << "EXCEPTION in new TNode" << endl;
327 nd->SetLineColor(kColorITSSSD);
330 for(lay=5;lay<=5;lay++)
331 for(lad=1;lad<=gm->GetNladders(lay);lad++)
332 for(det=1;det<=gm->GetNdetectors(lay);det++){
334 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
337 cout << "EXCEPTION in box = new TBRIK" << endl;
340 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
341 gm->GetRotMatrix(lay,lad,det,rt);
342 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
343 for(i=0;i<9;i++) rtd[i] = rt[i];
345 rm = new TRotMatrix(name,name,rtd);
347 cout << "EXCEPTION in new TRotMatrix" << endl;
351 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
353 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
355 cout << "EXCEPTION in new TNode" << endl;
358 nd->SetLineColor(kColorITSSSD);
362 for(lay=6;lay<=6;lay++)
363 for(lad=1;lad<=gm->GetNladders(lay);lad++)
364 for(det=1;det<=gm->GetNdetectors(lay);det++){
366 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
369 cout << "EXCEPTION in box = new TBRIK" << endl;
373 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
374 gm->GetRotMatrix(lay,lad,det,rt);
375 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
376 for(i=0;i<9;i++) rtd[i] = rt[i];
378 rm = new TRotMatrix(name,name,rtd);
380 cout << "EXCEPTION in new TRotMatrix" << endl;
384 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
386 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
388 cout << "EXCEPTION in new TNode" << endl;
391 nd->SetLineColor(kColorITSSSD);
397 //_____________________________________________________________________________
398 void AliITSv5asymm::CreateMaterials(){
399 ////////////////////////////////////////////////////////////////////////
400 // Read a file containing the materials for the ITS version 5.
401 ////////////////////////////////////////////////////////////////////////
404 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
406 FILE *file = fopen(filtmp,"r");
409 ReadEuclidMedia(filtmp);
411 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
415 //_____________________________________________________________________________
416 void AliITSv5asymm::CreateGeometry(){
417 //////////////////////////////////////////////////////////////////////
418 // This is the geometry used for the ITS Pre-TDR and comes from an
419 // Euclid to Geant conversion. The only difference
420 // is in the details of the ITS supports. The detectors elements,
421 // detector numbering, and local and global reference frames are shown in
422 // the following figures.
425 <img src="picts/ITS/its1+2_convention_front_5.gif">
428 <font size=+2 color=red>
429 <p>This shows the front view of the SPDs.
432 <img src="picts/ITS/its1+2_convention_side_5.gif">
435 <font size=+2 color=red>
436 <p>This shows the perspective view of the SPDs.
438 <img src="picts/ITS/its1+2_tree.gif">
441 <font size=+2 color=red>
442 <p>This shows the geometry Tree for the SPDs.
447 <img src="picts/ITS/its3+4_convention_front_5.gif">
450 <font size=+2 color=red>
451 <p>This shows the front view of the SDDs.
454 <img src="picts/ITS/its3+4_convention_side_5.gif">
457 <font size=+2 color=red>
458 <p>This shows the perspective view of the SDDs.
460 <img src="picts/ITS/its3+4_tree.gif">
463 <font size=+2 color=red>
464 <p>This shows the geometry Tree for the SDDs.
469 <img src="picts/ITS/its5+6_convention_front_5.gif">
472 <font size=+2 color=red>
473 <p>This shows the front view of the SSDs.
476 <img src="picts/ITS/its5+6_convention_side_5.gif">
479 <font size=+2 color=red>
480 <p>This shows the perspective view of the SSDs.
483 <img src="picts/ITS/its5+6_tree.gif">
486 <font size=+2 color=red>
487 <p>This shows the geometry Tree for the SSDs.
492 <img src="picts/ITS/its_layer1-6_2.gif">
495 <font size=+2 color=red>
496 <p>This shows the front view of the whole ITS..
500 <img src="picts/ITS/its_layer1-6_1.gif">
503 <font size=+2 color=red>
504 <p>This shows the perspective view of the whole ITS..
508 <img src="picts/ITS/its1-6_tree.gif">
511 <font size=+2 color=red>
512 <p>This shows the geometry Tree for the whole ITS.
519 // Here are shown the details of the ITS support cones and services.
520 // First is a GEANT tree showing the organization of all of the volumes
521 // that make up the ITS supports and services.
524 <img src="picts/ITS/supports_tree.gif">
527 // What follows are a number of figures showing what these support
528 // structures look like.
532 <img src="picts/ITS/supports_3.gif">
535 <font size=+2 color=red>
536 <p>This shows the geometry of the supports for the Drift and Strip layers only.
540 <img src="picts/ITS/supports_2.gif">
543 <font size=+2 color=red>
544 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
548 <img src="picts/ITS/supports_1.gif">
551 <font size=+2 color=red>
552 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
556 <img src="picts/ITS/suppssd.gif">
559 <font size=+2 color=red>
560 <p>This shows the geometry for the Strip layers supports.
564 <img src="picts/ITS/suppsdd.gif">
567 <font size=+2 color=red>
568 <p>This shows the geometry for the Drift layers supports.
574 // Read a file containing the geometry for the ITS version 5.
575 ////////////////////////////////////////////////////////////////////////
579 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
580 FILE *file = fopen(filtmp,"r");
584 cout << "Ready to read Euclid geometry file" << endl;
585 ReadEuclid(fEuclidGeometry.Data(),topvol);
586 cout << "Read in euclid geometries" << endl;
588 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
589 fEuclidGeometry.Data());
593 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
596 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
598 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
601 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
602 } // end if (fEuclidOut)
604 cout << "finished with euclid geometrys" << endl;
607 //______________________________________________________________________
608 void AliITSv5asymm::ReadOldGeometry(const char *filename){
609 // read in the file containing the transformations for the active
610 // volumes for the ITS version 5. This is expected to be in a file
611 // ending in .det. This geometry is kept in the AliITSgeom class.
616 filtmp = gSystem->ExpandPathName(filename);
617 size = strlen(filtmp);
618 if(size>4 && fGeomDetIn){
619 filtmp[size-3] = 'd'; // change from .euc to .det
620 filtmp[size-2] = 'e';
621 filtmp[size-1] = 't';
622 file = fopen(filtmp,"r");
623 if(file){ // if file exists use it to fill AliITSgeom structure.
625 fITSgeom = new AliITSgeom(filtmp);
626 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
627 // Now define the detector types/shapes.
628 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
629 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
630 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
633 // fill AliITSgeom structure from geant structure just filled above
638 //______________________________________________________________________
639 void AliITSv5asymm::InitAliITSgeom(){
640 // Based on the geometry tree defined in Geant 3.21, this
641 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
643 if(!(dynamic_cast<TGeant3*>(gMC))) {
644 Error("InitAliITSgeom",
645 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
648 cout << "Reading Geometry transformation directly from Geant 3." << endl;
649 const Int_t nlayers = 6;
650 const Int_t ndeep = 7;
651 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
652 Int_t nlad[nlayers],ndet[nlayers];
654 Float_t par[20],att[20];
655 Int_t npar,natt,idshape,imat,imed;
656 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
657 Int_t mod,lay,lad,det,i,j,k;
658 char *names[nlayers][ndeep] = {
659 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
660 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
661 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
662 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
663 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
664 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
665 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
666 {1,1,1,1,10, 4,4}, // lay=2
667 {1,1,1,1,14, 6,1}, // lay=3
668 {1,1,1,1,22, 8,1}, // lay=4
669 {1,1,1,1,34,23,1}, // lay=5
670 {1,1,1,1,38,26,1}};// lay=6
672 // Sorry, but this is not very pritty code. It should be replaced
673 // at some point with a version that can search through the geometry
675 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
676 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
677 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
678 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
680 for(i=0;i<nlayers;i++){
682 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
683 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
687 if(fITSgeom!=0) delete fITSgeom;
688 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
689 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25;
690 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
692 for(lay=1;lay<=nlayers;lay++){
693 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
694 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
696 case 1: case 2: // layers 1 and 2 are a bit special
698 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
700 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
703 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
706 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
708 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
709 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
710 if(fMinorVersion==1){
711 fITSgeom->ReSetShape(kSPD,
712 new AliITSgeomSPD300());
713 } else if(fMinorVersion==2)
714 fITSgeom->ReSetShape(kSPD,
715 new AliITSgeomSPD300());
720 case 3: case 4: case 5: case 6: // layers 3-6
722 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
724 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
727 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
731 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
732 if(!(fITSgeom->IsShapeDefined(kSDD)))
733 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
736 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
737 if(!(fITSgeom->IsShapeDefined(kSSD)))
738 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
748 //_____________________________________________________________________________
749 void AliITSv5asymm::Init(){
750 ////////////////////////////////////////////////////////////////////////
751 // Initialise the ITS after it has been created.
752 ////////////////////////////////////////////////////////////////////////
757 for(i=0;i<30;i++) cout << "*";cout << " ITSv5_Init ";
758 for(i=0;i<30;i++) cout << "*";cout << endl;
760 if(fITSgeom==0) bg = kTRUE;
761 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
762 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
763 if(fITSgeom!=0) delete fITSgeom;
764 fITSgeom = new AliITSgeom();
765 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
766 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
768 if(!fGeomDetIn) this->InitAliITSgeom();
769 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
770 if(bg) BuildGeometry(); // call BuildGeometry here if fITSgeom was not
774 for(i=0;i<72;i++) cout << "*";
777 //_____________________________________________________________________________
778 void AliITSv5asymm::StepManager(){
779 ////////////////////////////////////////////////////////////////////////
780 // Called for every step in the ITS, then calles the AliITShit class
781 // creator with the information to be recoreded about that hit.
782 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
783 // printing of information to a file which can be used to create a .det
784 // file read in by the routine CreateGeometry(). If set to 0 or any other
785 // value except 1, the default behavior, then no such file is created nor
786 // it the extra variables and the like used in the printing allocated.
787 ////////////////////////////////////////////////////////////////////////
792 TLorentzVector position, momentum;
793 TClonesArray &lhits = *fHits;
797 if(gMC->IsTrackInside()) vol[3] += 1;
798 if(gMC->IsTrackEntering()) vol[3] += 2;
799 if(gMC->IsTrackExiting()) vol[3] += 4;
800 if(gMC->IsTrackOut()) vol[3] += 8;
801 if(gMC->IsTrackDisappeared()) vol[3] += 16;
802 if(gMC->IsTrackStop()) vol[3] += 32;
803 if(gMC->IsTrackAlive()) vol[3] += 64;
805 // Fill hit structure.
806 if(!(gMC->TrackCharge())) return;
808 // Only entering charged tracks
809 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
811 id = gMC->CurrentVolOffID(0,copy);
812 //detector copy in the ladder = 1<->4 (ITS1)
814 gMC->CurrentVolOffID(1,copy1);
815 //ladder copy in the module = 1<->2 (I186)
816 gMC->CurrentVolOffID(2,copy2);
817 //module copy in the layer = 1<->10 (I132)
818 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
819 } else if(id == fIdSens[1]){
821 id = gMC->CurrentVolOffID(0,copy);
822 //detector copy in the ladder = 1<->4 (ITS2)
824 gMC->CurrentVolOffID(1,copy1);
825 //ladder copy in the module = 1<->4 (I131)
826 gMC->CurrentVolOffID(2,copy2);
827 //module copy in the layer = 1<->10 (I132)
828 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
829 } else if(id == fIdSens[2]){
831 id = gMC->CurrentVolOffID(1,copy);
832 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
834 id = gMC->CurrentVolOffID(2,copy);
835 //ladder copy in the layer = 1<->12 (I316)
837 } else if(id == fIdSens[3]){
839 id = gMC->CurrentVolOffID(1,copy);
840 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
842 id = gMC->CurrentVolOffID(2,copy);
843 //ladder copy in the layer = 1<->22 (I417)
845 }else if(id == fIdSens[4]){
847 id = gMC->CurrentVolOffID(1,copy);
848 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
850 id = gMC->CurrentVolOffID(2,copy);
851 //ladder copy in the layer = 1<->34 (I565)
853 }else if(id == fIdSens[5]){
855 id = gMC->CurrentVolOffID(1,copy);
856 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
858 id = gMC->CurrentVolOffID(2,copy);
859 //ladder copy in the layer = 1<->38 (I569)
862 return; // not an ITS volume?
863 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
865 gMC->TrackPosition(position);
866 gMC->TrackMomentum(momentum);
874 hits[7]=gMC->TrackTime();
875 // Fill hit structure with this new hit.
876 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);