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.15 2001/05/25 06:47:16 hristov
19 Bug fix in the creation of the AliITSgeom::fShape entry for SPD. Now there is both a proper shape entry and a default, should there be future changes. This bug was related to fMinorVersion=3 was not antisipated. (B.Nilsen)
21 Revision 1.14 2001/05/16 14:57:16 alibrary
22 New files for folders and Stack
24 Revision 1.13 2001/05/09 01:00:19 nilsen
25 Fixed up a typo in the cout of Init(). Now properly indecates which version
26 of code is being used.
28 Revision 1.12 2001/04/18 12:06:02 barbera
29 Number of modules in layer 5 and 6 re-set to 23 and 26
31 Revision 1.11 2001/03/23 00:12:23 nilsen
32 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
33 not a .det file. Removed redundent calls to BuildGeometry.
35 Revision 1.10 2001/02/14 14:22:58 nilsen
36 Now looking in the right director for the old .det.
38 Revision 1.9 2001/02/14 14:12:43 nilsen
39 Forgot about the nonexisting v in ITSgeometry_5.det.
41 Revision 1.8 2001/02/14 14:06:23 nilsen
42 Wrong default .det file name for old .det file format.
44 Revision 1.7 2001/02/13 16:53:35 nilsen
45 Fixed a but when trying to use GEANT4. Needed to replace
46 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
47 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
48 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
49 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
50 in the same way as in AliITSv5.cxx.
52 Revision 1.6 2001/02/09 20:06:26 nilsen
53 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
55 Revision 1.5 2001/02/09 00:05:31 nilsen
56 Added fMajor/MinorVersion variables and made other changes to better make
57 use of the new code changes in AliITSgeom related classes.
59 Revision 1.4 2001/02/02 23:57:29 nilsen
60 Added include file that are no londer included in AliITSgeom.h
62 Revision 1.3 2001/01/30 09:23:13 hristov
63 Streamers removed (R.Brun)
65 Revision 1.2 2000/11/30 11:13:11 barbera
66 Added changes suggested by Federico Carminati on nov, 30, 2000
68 Revision 1.1 2000/10/07 15:46:38 barbera
69 Version 5 of the geometry with asymmetric services
71 Revision 1.25 2000/10/05 20:50:00 nilsen
72 Now using root generated streamers.
74 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
75 Forward declarations added
77 Revision 1.22 2000/07/10 16:07:19 fca
78 Release version of ITS code
80 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
81 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
83 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
84 Fixed up the comments/documentation.
86 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
87 To make it compatable with the changes in AliRun/AliModule.
89 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
90 This is the version of the files after the merging done in December 1999.
91 See the ReadMe110100.txt file for details
93 Revision 1.14 1999/10/22 08:16:49 fca
94 Correct destructors, thanks to I.Hrivnacova
96 Revision 1.13 1999/10/06 10:15:19 fca
97 Correct bug in allocation of layer name and add destructor
99 Revision 1.12 1999/10/05 08:05:09 fca
100 Minor corrections for uninitialised variables.
102 Revision 1.11 1999/09/29 09:24:20 fca
103 Introduction of the Copyright and cvs Log
107 ///////////////////////////////////////////////////////////////////////////////
109 // Inner Traking System version 5 with asymmetric services
110 // This class contains the base procedures for the Inner Tracking System
112 // Authors: R. Barbera, B. S. Nilsen.
114 // Created October 7 2000.
116 ///////////////////////////////////////////////////////////////////////////////
117 #include <iostream.h>
122 #include <TGeometry.h>
125 #include <TFile.h> // only required for Tracking function?
127 #include <TObjArray.h>
128 #include <TObjString.h>
129 #include <TClonesArray.h>
130 #include <TLorentzVector.h>
136 #include "../TGeant3/TGeant3.h"
137 #include "AliITShit.h"
138 #include "AliITSGeant3Geometry.h"
140 #include "AliITSv5asymm.h"
141 #include "AliITSgeom.h"
142 #include "AliITSgeomSPD.h"
143 #include "AliITSgeomSDD.h"
144 #include "AliITSgeomSSD.h"
146 ClassImp(AliITSv5asymm)
148 //_____________________________________________________________________________
149 AliITSv5asymm::AliITSv5asymm() {
150 ////////////////////////////////////////////////////////////////////////
151 // Standard default constructor for the ITS version 5.
152 ////////////////////////////////////////////////////////////////////////
158 fEuclidOut = kFALSE; // Don't write Euclide file
159 fGeomDetOut = kFALSE; // Don't write .det file
160 fGeomDetIn = kFALSE; // Don't Read .det file
161 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
162 fMajorVersion = IsVersion();
164 for(i=0;i<60;i++) fRead[i] = '\0';
165 for(i=0;i<60;i++) fWrite[i] = '\0';
166 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
168 //_____________________________________________________________________________
169 AliITSv5asymm::AliITSv5asymm(const char *name, const char *title) : AliITS(name, title){
170 /////////////////////////////////////////////////////////////////////////////
171 // Standard constructor for the ITS version 5 with symmetrical services.
172 /////////////////////////////////////////////////////////////////////////////
176 fIdName = new TString[fIdN];
183 fIdSens = new Int_t[fIdN];
184 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
185 fEuclidOut = kFALSE; // Don't write Euclide file
186 fGeomDetOut = kFALSE; // Don't write .det file
187 fGeomDetIn = kFALSE; // Don't Read .det file
188 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
189 fMajorVersion = IsVersion();
191 for(i=0;i<60;i++) fRead[i] = '\0';
192 for(i=0;i<60;i++) fWrite[i] = '\0';
194 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.tme";
195 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.euc";
196 strncpy(fEuclidGeomDet,"$ALICE_ROOT/Euclid/ITSgeometry_5.det",60);
197 strncpy(fRead,fEuclidGeomDet,60);
198 strncpy(fWrite,fEuclidGeomDet,60);
200 //____________________________________________________________________________
201 AliITSv5asymm::AliITSv5asymm(const AliITSv5asymm &source){
202 ////////////////////////////////////////////////////////////////////////
203 // Copy Constructor for ITS version 5.
204 ////////////////////////////////////////////////////////////////////////
205 if(&source == this) return;
206 Warning("Copy Constructor","Not allowed to copy AliITSv5asymm");
209 //_____________________________________________________________________________
210 AliITSv5asymm& AliITSv5asymm::operator=(const AliITSv5asymm &source){
211 ////////////////////////////////////////////////////////////////////////
212 // Assignment operator for the ITS version 5.
213 ////////////////////////////////////////////////////////////////////////
215 if(&source == this) return *this;
216 Warning("= operator","Not allowed to copy AliITSv5asymm");
220 //_____________________________________________________________________________
221 AliITSv5asymm::~AliITSv5asymm() {
222 ////////////////////////////////////////////////////////////////////////
223 // Standard destructor for the ITS version 5.
224 ////////////////////////////////////////////////////////////////////////
226 //_____________________________________________________________________________
227 void AliITSv5asymm::BuildGeometry(){
228 ////////////////////////////////////////////////////////////////////////
229 // Geometry builder for the ITS version 5.
230 ////////////////////////////////////////////////////////////////////////
232 // Build ITS TNODE geometry for event display using detailed geometry.
233 // This function builds a simple ITS geometry used by the ROOT macro
238 //const int kColorITSSPD=kRed;
239 //const int kColorITSSDD=kGreen;
240 const int kColorITSSSD=kBlue;
242 AliITSgeom *gm = this->GetITSgeom();
244 top=gAlice->GetGeometry()->GetNode("alice");
253 //TCanvas *c1 = new TCanvas("c1","ITS");
255 for(lay=1;lay<=2;lay++)
256 for(lad=1;lad<=gm->GetNladders(lay);lad++)
257 for(det=1;det<=gm->GetNdetectors(lay);det++){
259 box = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
262 cout << "EXCEPTION in box = new TBRIK" << endl;
265 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
266 gm->GetRotMatrix(lay,lad,det,rt);
267 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
268 for(i=0;i<9;i++) rtd[i] = rt[i];
270 rm = new TRotMatrix(name,name,rtd);
272 cout << "EXCEPTION in new TRotMatrix" << endl;
276 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
278 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
280 cout << "EXCEPTION in new TNode" << endl;
283 nd->SetLineColor(kColorITSSSD);
287 for(lay=3;lay<=3;lay++)
288 for(lad=1;lad<=gm->GetNladders(lay);lad++)
289 for(det=1;det<=gm->GetNdetectors(lay);det++){
291 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
294 cout << "EXCEPTION in box = new TBRIK" << endl;
297 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
298 gm->GetRotMatrix(lay,lad,det,rt);
299 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
300 for(i=0;i<9;i++) rtd[i] = rt[i];
302 rm = new TRotMatrix(name,name,rtd);
304 cout << "EXCEPTION in new TRotMatrix" << endl;
308 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
310 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
312 cout << "EXCEPTION in new TNode" << endl;
315 nd->SetLineColor(kColorITSSSD);
319 for(lay=4;lay<=4;lay++)
320 for(lad=1;lad<=gm->GetNladders(lay);lad++)
321 for(det=1;det<=gm->GetNdetectors(lay);det++){
323 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
326 cout << "EXCEPTION in box = new TBRIK" << endl;
329 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
330 gm->GetRotMatrix(lay,lad,det,rt);
331 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
332 for(i=0;i<9;i++) rtd[i] = rt[i];
334 rm = new TRotMatrix(name,name,rtd);
336 cout << "EXCEPTION in new TRotMatrix" << endl;
340 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
342 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
344 cout << "EXCEPTION in new TNode" << endl;
347 nd->SetLineColor(kColorITSSSD);
350 for(lay=5;lay<=5;lay++)
351 for(lad=1;lad<=gm->GetNladders(lay);lad++)
352 for(det=1;det<=gm->GetNdetectors(lay);det++){
354 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
357 cout << "EXCEPTION in box = new TBRIK" << endl;
360 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
361 gm->GetRotMatrix(lay,lad,det,rt);
362 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
363 for(i=0;i<9;i++) rtd[i] = rt[i];
365 rm = new TRotMatrix(name,name,rtd);
367 cout << "EXCEPTION in new TRotMatrix" << endl;
371 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
373 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
375 cout << "EXCEPTION in new TNode" << endl;
378 nd->SetLineColor(kColorITSSSD);
382 for(lay=6;lay<=6;lay++)
383 for(lad=1;lad<=gm->GetNladders(lay);lad++)
384 for(det=1;det<=gm->GetNdetectors(lay);det++){
386 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
389 cout << "EXCEPTION in box = new TBRIK" << endl;
393 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
394 gm->GetRotMatrix(lay,lad,det,rt);
395 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
396 for(i=0;i<9;i++) rtd[i] = rt[i];
398 rm = new TRotMatrix(name,name,rtd);
400 cout << "EXCEPTION in new TRotMatrix" << endl;
404 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
406 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
408 cout << "EXCEPTION in new TNode" << endl;
411 nd->SetLineColor(kColorITSSSD);
417 //_____________________________________________________________________________
418 void AliITSv5asymm::CreateMaterials(){
419 ////////////////////////////////////////////////////////////////////////
420 // Read a file containing the materials for the ITS version 5.
421 ////////////////////////////////////////////////////////////////////////
424 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
426 FILE *file = fopen(filtmp,"r");
429 ReadEuclidMedia(filtmp);
431 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
435 //_____________________________________________________________________________
436 void AliITSv5asymm::CreateGeometry(){
437 //////////////////////////////////////////////////////////////////////
438 // This is the geometry used for the ITS Pre-TDR and comes from an
439 // Euclid to Geant conversion. The only difference
440 // is in the details of the ITS supports. The detectors elements,
441 // detector numbering, and local and global reference frames are shown in
442 // the following figures.
445 <img src="picts/ITS/its1+2_convention_front_5.gif">
448 <font size=+2 color=red>
449 <p>This shows the front view of the SPDs.
452 <img src="picts/ITS/its1+2_convention_side_5.gif">
455 <font size=+2 color=red>
456 <p>This shows the perspective view of the SPDs.
458 <img src="picts/ITS/its1+2_tree.gif">
461 <font size=+2 color=red>
462 <p>This shows the geometry Tree for the SPDs.
467 <img src="picts/ITS/its3+4_convention_front_5.gif">
470 <font size=+2 color=red>
471 <p>This shows the front view of the SDDs.
474 <img src="picts/ITS/its3+4_convention_side_5.gif">
477 <font size=+2 color=red>
478 <p>This shows the perspective view of the SDDs.
480 <img src="picts/ITS/its3+4_tree.gif">
483 <font size=+2 color=red>
484 <p>This shows the geometry Tree for the SDDs.
489 <img src="picts/ITS/its5+6_convention_front_5.gif">
492 <font size=+2 color=red>
493 <p>This shows the front view of the SSDs.
496 <img src="picts/ITS/its5+6_convention_side_5.gif">
499 <font size=+2 color=red>
500 <p>This shows the perspective view of the SSDs.
503 <img src="picts/ITS/its5+6_tree.gif">
506 <font size=+2 color=red>
507 <p>This shows the geometry Tree for the SSDs.
512 <img src="picts/ITS/its_layer1-6_2.gif">
515 <font size=+2 color=red>
516 <p>This shows the front view of the whole ITS..
520 <img src="picts/ITS/its_layer1-6_1.gif">
523 <font size=+2 color=red>
524 <p>This shows the perspective view of the whole ITS..
528 <img src="picts/ITS/its1-6_tree.gif">
531 <font size=+2 color=red>
532 <p>This shows the geometry Tree for the whole ITS.
539 // Here are shown the details of the ITS support cones and services.
540 // First is a GEANT tree showing the organization of all of the volumes
541 // that make up the ITS supports and services.
544 <img src="picts/ITS/supports_tree.gif">
547 // What follows are a number of figures showing what these support
548 // structures look like.
552 <img src="picts/ITS/supports_3.gif">
555 <font size=+2 color=red>
556 <p>This shows the geometry of the supports for the Drift and Strip layers only.
560 <img src="picts/ITS/supports_2.gif">
563 <font size=+2 color=red>
564 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
568 <img src="picts/ITS/supports_1.gif">
571 <font size=+2 color=red>
572 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
576 <img src="picts/ITS/suppssd.gif">
579 <font size=+2 color=red>
580 <p>This shows the geometry for the Strip layers supports.
584 <img src="picts/ITS/suppsdd.gif">
587 <font size=+2 color=red>
588 <p>This shows the geometry for the Drift layers supports.
594 // Read a file containing the geometry for the ITS version 5.
595 ////////////////////////////////////////////////////////////////////////
599 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
600 FILE *file = fopen(filtmp,"r");
604 if(fDebug) cout << ClassName() << ": Ready to read Euclid geometry file" << endl;
605 ReadEuclid(fEuclidGeometry.Data(),topvol);
606 if(fDebug) cout << ClassName() << ": Read in euclid geometries" << endl;
608 Fatal("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
609 fEuclidGeometry.Data());
612 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
615 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
617 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
620 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
621 } // end if (fEuclidOut)
623 if(fDebug) cout << ClassName() << ": finished with euclid geometrys" << endl;
626 //______________________________________________________________________
627 void AliITSv5asymm::ReadOldGeometry(const char *filename){
628 // read in the file containing the transformations for the active
629 // volumes for the ITS version 5. This is expected to be in a file
630 // ending in .det. This geometry is kept in the AliITSgeom class.
635 filtmp = gSystem->ExpandPathName(filename);
636 size = strlen(filtmp);
637 if(size>4 && fGeomDetIn){
638 filtmp[size-3] = 'd'; // change from .euc to .det
639 filtmp[size-2] = 'e';
640 filtmp[size-1] = 't';
641 file = fopen(filtmp,"r");
642 if(file){ // if file exists use it to fill AliITSgeom structure.
644 fITSgeom = new AliITSgeom(filtmp);
645 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
646 // Now define the detector types/shapes.
647 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
648 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
649 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
652 // fill AliITSgeom structure from geant structure just filled above
657 //______________________________________________________________________
658 void AliITSv5asymm::InitAliITSgeom(){
659 // Based on the geometry tree defined in Geant 3.21, this
660 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
662 if(gMC->IsA()!=TGeant3::Class()) {
663 Error("InitAliITSgeom",
664 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
667 if(fDebug) cout << ClassName()
668 << ": Reading Geometry transformation directly from Geant 3." << endl;
669 const Int_t nlayers = 6;
670 const Int_t ndeep = 7;
671 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
672 Int_t nlad[nlayers],ndet[nlayers];
674 Float_t par[20],att[20];
675 Int_t npar,natt,idshape,imat,imed;
676 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
677 Int_t mod,lay,lad,det,i,j,k;
678 char *names[nlayers][ndeep] = {
679 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
680 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
681 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
682 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
683 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
684 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
685 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
686 {1,1,1,1,10, 4,4}, // lay=2
687 {1,1,1,1,14, 6,1}, // lay=3
688 {1,1,1,1,22, 8,1}, // lay=4
689 {1,1,1,1,34,23,1}, // lay=5
690 {1,1,1,1,38,26,1}};// lay=6
692 // Sorry, but this is not very pritty code. It should be replaced
693 // at some point with a version that can search through the geometry
695 if(fDebug) cout << ClassName()
696 << ": Reading Geometry informaton from Geant3 common blocks" << endl;
697 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
698 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
699 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
701 for(i=0;i<nlayers;i++){
703 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
704 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
708 if(fITSgeom!=0) delete fITSgeom;
709 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
710 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
711 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
713 for(lay=1;lay<=nlayers;lay++){
714 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
715 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
717 case 1: case 2: // layers 1 and 2 are a bit special
719 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
721 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
724 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
727 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
729 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
730 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
731 if(fMinorVersion==1){
732 fITSgeom->ReSetShape(kSPD,
733 new AliITSgeomSPD300());
734 } else if(fMinorVersion==2){
735 fITSgeom->ReSetShape(kSPD,
736 new AliITSgeomSPD300());
737 }else if(fMinorVersion==3){
738 fITSgeom->ReSetShape(kSPD,
739 new AliITSgeomSPD425Long());
741 fITSgeom->ReSetShape(kSPD,
742 new AliITSgeomSPD300());
748 case 3: case 4: case 5: case 6: // layers 3-6
750 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
752 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
755 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
759 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
760 if(!(fITSgeom->IsShapeDefined(kSDD)))
761 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
764 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
765 if(!(fITSgeom->IsShapeDefined(kSSD)))
766 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
776 //_____________________________________________________________________________
777 void AliITSv5asymm::Init(){
778 ////////////////////////////////////////////////////////////////////////
779 // Initialise the ITS after it has been created.
780 ////////////////////////////////////////////////////////////////////////
784 cout << endl << ClassName() << ": ";
785 for(i=0;i<28;i++) cout << "*";cout << " ITSv5_Init ";
786 for(i=0;i<27;i++) cout << "*";cout << endl;
789 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
790 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
791 if(fITSgeom!=0) delete fITSgeom;
792 fITSgeom = new AliITSgeom();
793 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
794 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
796 if(!fGeomDetIn) this->InitAliITSgeom();
797 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
801 cout << ClassName() << ": ";
802 for(i=0;i<72;i++) cout << "*";
806 //_____________________________________________________________________________
807 void AliITSv5asymm::StepManager(){
808 ////////////////////////////////////////////////////////////////////////
809 // Called for every step in the ITS, then calles the AliITShit class
810 // creator with the information to be recoreded about that hit.
811 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
812 // printing of information to a file which can be used to create a .det
813 // file read in by the routine CreateGeometry(). If set to 0 or any other
814 // value except 1, the default behavior, then no such file is created nor
815 // it the extra variables and the like used in the printing allocated.
816 ////////////////////////////////////////////////////////////////////////
821 TLorentzVector position, momentum;
822 TClonesArray &lhits = *fHits;
826 if(gMC->IsTrackInside()) vol[3] += 1;
827 if(gMC->IsTrackEntering()) vol[3] += 2;
828 if(gMC->IsTrackExiting()) vol[3] += 4;
829 if(gMC->IsTrackOut()) vol[3] += 8;
830 if(gMC->IsTrackDisappeared()) vol[3] += 16;
831 if(gMC->IsTrackStop()) vol[3] += 32;
832 if(gMC->IsTrackAlive()) vol[3] += 64;
834 // Fill hit structure.
835 if(!(gMC->TrackCharge())) return;
837 // Only entering charged tracks
838 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
840 id = gMC->CurrentVolOffID(0,copy);
841 //detector copy in the ladder = 1<->4 (ITS1)
843 gMC->CurrentVolOffID(1,copy1);
844 //ladder copy in the module = 1<->2 (I186)
845 gMC->CurrentVolOffID(2,copy2);
846 //module copy in the layer = 1<->10 (I132)
847 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
848 } else if(id == fIdSens[1]){
850 id = gMC->CurrentVolOffID(0,copy);
851 //detector copy in the ladder = 1<->4 (ITS2)
853 gMC->CurrentVolOffID(1,copy1);
854 //ladder copy in the module = 1<->4 (I131)
855 gMC->CurrentVolOffID(2,copy2);
856 //module copy in the layer = 1<->10 (I132)
857 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
858 } else if(id == fIdSens[2]){
860 id = gMC->CurrentVolOffID(1,copy);
861 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
863 id = gMC->CurrentVolOffID(2,copy);
864 //ladder copy in the layer = 1<->12 (I316)
866 } else if(id == fIdSens[3]){
868 id = gMC->CurrentVolOffID(1,copy);
869 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
871 id = gMC->CurrentVolOffID(2,copy);
872 //ladder copy in the layer = 1<->22 (I417)
874 }else if(id == fIdSens[4]){
876 id = gMC->CurrentVolOffID(1,copy);
877 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
879 id = gMC->CurrentVolOffID(2,copy);
880 //ladder copy in the layer = 1<->34 (I565)
882 }else if(id == fIdSens[5]){
884 id = gMC->CurrentVolOffID(1,copy);
885 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
887 id = gMC->CurrentVolOffID(2,copy);
888 //ladder copy in the layer = 1<->38 (I569)
891 return; // not an ITS volume?
892 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
894 gMC->TrackPosition(position);
895 gMC->TrackMomentum(momentum);
903 hits[7]=gMC->TrackTime();
904 // Fill hit structure with this new hit.
905 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);