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 2002/10/22 14:45:47 alibrary
19 Introducing Riostream.h
21 Revision 1.14 2002/10/14 14:57:08 hristov
22 Merging the VirtualMC branch to the main development branch (HEAD)
24 Revision 1.13.10.2 2002/08/30 15:45:54 alibrary
25 Adding geant4vmc support
27 Revision 1.13.10.1 2002/06/10 17:51:15 hristov
30 Revision 1.13 2001/05/30 16:15:47 fca
31 Correct comparison wiht AliGeant3::Class() introduced. Thanks to I.Hrivnacova
33 Revision 1.12 2001/05/30 15:55:35 hristov
34 Strings compared instead of pointers
36 Revision 1.11 2001/05/30 14:04:31 hristov
37 Dynamic cast replaced (F.Carminati)
39 Revision 1.10 2001/05/25 06:47:16 hristov
40 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)
42 Revision 1.9 2001/04/18 12:07:37 barbera
43 Number of modules in layer 5 and 6 re-set to 23 and 26
45 Revision 1.8 2001/03/23 00:12:23 nilsen
46 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
47 not a .det file. Removed redundent calls to BuildGeometry.
49 Revision 1.7 2001/02/13 16:53:35 nilsen
50 Fixed a but when trying to use GEANT4. Needed to replace
51 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
52 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
53 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
54 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
55 in the same way as in AliITSv5.cxx.
57 Revision 1.6 2001/02/09 20:06:26 nilsen
58 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
60 Revision 1.5 2001/02/09 00:05:31 nilsen
61 Added fMajor/MinorVersion variables and made other changes to better make
62 use of the new code changes in AliITSgeom related classes.
64 Revision 1.4 2001/02/02 23:57:29 nilsen
65 Added include file that are no londer included in AliITSgeom.h
67 Revision 1.3 2001/01/30 09:23:13 hristov
68 Streamers removed (R.Brun)
70 Revision 1.2 2000/11/30 11:13:11 barbera
71 Added changes suggested by Federico Carminati on nov, 30, 2000
73 Revision 1.1 2000/10/07 15:46:29 barbera
74 Version 5 of the geometry with symmetric services
76 Revision 1.25 2000/10/05 20:50:00 nilsen
77 Now using root generated streamers.
79 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
80 Forward declarations added
82 Revision 1.22 2000/07/10 16:07:19 fca
83 Release version of ITS code
85 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
86 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
88 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
89 Fixed up the comments/documentation.
91 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
92 To make it compatable with the changes in AliRun/AliModule.
94 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
95 This is the version of the files after the merging done in December 1999.
96 See the ReadMe110100.txt file for details
98 Revision 1.14 1999/10/22 08:16:49 fca
99 Correct destructors, thanks to I.Hrivnacova
101 Revision 1.13 1999/10/06 10:15:19 fca
102 Correct bug in allocation of layer name and add destructor
104 Revision 1.12 1999/10/05 08:05:09 fca
105 Minor corrections for uninitialised variables.
107 Revision 1.11 1999/09/29 09:24:20 fca
108 Introduction of the Copyright and cvs Log
112 ///////////////////////////////////////////////////////////////////////////////
114 // Inner Traking System version 5 with symmetric services
115 // This class contains the base procedures for the Inner Tracking System
117 // Authors: R. Barbera, B. S. Nilsen.
119 // Created October 7 2000.
121 ///////////////////////////////////////////////////////////////////////////////
122 #include <Riostream.h>
126 #include <TGeometry.h>
129 #include <TFile.h> // only required for Tracking function?
131 #include <TObjArray.h>
132 #include <TLorentzVector.h>
133 #include <TObjString.h>
134 #include <TClonesArray.h>
139 #include "AliITShit.h"
140 #include "AliITSGeant3Geometry.h"
142 #include "AliITSv5symm.h"
143 #include "AliITSgeom.h"
144 #include "AliITSgeomSPD.h"
145 #include "AliITSgeomSDD.h"
146 #include "AliITSgeomSSD.h"
148 ClassImp(AliITSv5symm)
150 //_____________________________________________________________________________
151 AliITSv5symm::AliITSv5symm() {
152 ////////////////////////////////////////////////////////////////////////
153 // Standard default constructor for the ITS version 5.
154 ////////////////////////////////////////////////////////////////////////
160 fEuclidOut = kFALSE; // Don't write Euclide file
161 fGeomDetOut = kFALSE; // Don't write .det file
162 fGeomDetIn = kFALSE; // Don't Read .det file
163 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
164 fMajorVersion = IsVersion();
166 for(i=0;i<60;i++) fRead[i] = '\0';
167 for(i=0;i<60;i++) fWrite[i] = '\0';
168 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
170 //_____________________________________________________________________________
171 AliITSv5symm::AliITSv5symm(const char *name, const char *title) : AliITS(name, title){
172 /////////////////////////////////////////////////////////////////////////////
173 // Standard constructor for the ITS version 5 with symmetrical services.
174 /////////////////////////////////////////////////////////////////////////////
178 fIdName = new TString[fIdN];
185 fIdSens = new Int_t[fIdN];
186 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
187 fEuclidOut = kFALSE; // Don't write Euclide file
188 fGeomDetOut = kFALSE; // Don't write .det file
189 fGeomDetIn = kFALSE; // Don't Read .det file
190 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
191 fMajorVersion = IsVersion();
193 for(i=0;i<60;i++) fRead[i] = '\0';
194 for(i=0;i<60;i++) fWrite[i] = '\0';
196 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.tme";
197 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.euc";
198 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_v5symm.det",60);
199 strncpy(fRead,fEuclidGeomDet,60);
200 strncpy(fWrite,fEuclidGeomDet,60);
202 //____________________________________________________________________________
203 AliITSv5symm::AliITSv5symm(const AliITSv5symm &source){
204 ////////////////////////////////////////////////////////////////////////
205 // Copy Constructor for ITS version 5.
206 ////////////////////////////////////////////////////////////////////////
207 if(&source == this) return;
208 Warning("Copy Constructor","Not allowed to copy AliITSv5symm");
211 //_____________________________________________________________________________
212 AliITSv5symm& AliITSv5symm::operator=(const AliITSv5symm &source){
213 ////////////////////////////////////////////////////////////////////////
214 // Assignment operator for the ITS version 5.
215 ////////////////////////////////////////////////////////////////////////
217 if(&source == this) return *this;
218 Warning("= operator","Not allowed to copy AliITSv5symm");
222 //_____________________________________________________________________________
223 AliITSv5symm::~AliITSv5symm() {
224 ////////////////////////////////////////////////////////////////////////
225 // Standard destructor for the ITS version 5.
226 ////////////////////////////////////////////////////////////////////////
228 //_____________________________________________________________________________
229 void AliITSv5symm::BuildGeometry(){
230 ////////////////////////////////////////////////////////////////////////
231 // Geometry builder for the ITS version 5.
232 ////////////////////////////////////////////////////////////////////////
234 // Build ITS TNODE geometry for event display using detailed geometry.
235 // This function builds a simple ITS geometry used by the ROOT macro
240 //const int kColorITSSPD=kRed;
241 //const int kColorITSSDD=kGreen;
242 const int kColorITSSSD=kBlue;
244 AliITSgeom *gm = this->GetITSgeom();
246 top=gAlice->GetGeometry()->GetNode("alice");
255 //TCanvas *c1 = new TCanvas("c1","ITS");
257 for(lay=1;lay<=2;lay++)
258 for(lad=1;lad<=gm->GetNladders(lay);lad++)
259 for(det=1;det<=gm->GetNdetectors(lay);det++){
261 box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
264 cout << "EXCEPTION in box = new TBRIK" << endl;
267 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
268 gm->GetRotMatrix(lay,lad,det,rt);
269 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
270 for(i=0;i<9;i++) rtd[i] = rt[i];
272 rm = new TRotMatrix(name,name,rtd);
274 cout << "EXCEPTION in new TRotMatrix" << endl;
278 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
280 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
282 cout << "EXCEPTION in new TNode" << endl;
285 nd->SetLineColor(kColorITSSSD);
289 for(lay=3;lay<=3;lay++)
290 for(lad=1;lad<=gm->GetNladders(lay);lad++)
291 for(det=1;det<=gm->GetNdetectors(lay);det++){
293 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
296 cout << "EXCEPTION in box = new TBRIK" << endl;
299 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
300 gm->GetRotMatrix(lay,lad,det,rt);
301 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
302 for(i=0;i<9;i++) rtd[i] = rt[i];
304 rm = new TRotMatrix(name,name,rtd);
306 cout << "EXCEPTION in new TRotMatrix" << endl;
310 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
312 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
314 cout << "EXCEPTION in new TNode" << endl;
317 nd->SetLineColor(kColorITSSSD);
321 for(lay=4;lay<=4;lay++)
322 for(lad=1;lad<=gm->GetNladders(lay);lad++)
323 for(det=1;det<=gm->GetNdetectors(lay);det++){
325 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
328 cout << "EXCEPTION in box = new TBRIK" << endl;
331 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
332 gm->GetRotMatrix(lay,lad,det,rt);
333 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
334 for(i=0;i<9;i++) rtd[i] = rt[i];
336 rm = new TRotMatrix(name,name,rtd);
338 cout << "EXCEPTION in new TRotMatrix" << endl;
342 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
344 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
346 cout << "EXCEPTION in new TNode" << endl;
349 nd->SetLineColor(kColorITSSSD);
352 for(lay=5;lay<=5;lay++)
353 for(lad=1;lad<=gm->GetNladders(lay);lad++)
354 for(det=1;det<=gm->GetNdetectors(lay);det++){
356 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
359 cout << "EXCEPTION in box = new TBRIK" << endl;
362 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
363 gm->GetRotMatrix(lay,lad,det,rt);
364 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
365 for(i=0;i<9;i++) rtd[i] = rt[i];
367 rm = new TRotMatrix(name,name,rtd);
369 cout << "EXCEPTION in new TRotMatrix" << endl;
373 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
375 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
377 cout << "EXCEPTION in new TNode" << endl;
380 nd->SetLineColor(kColorITSSSD);
384 for(lay=6;lay<=6;lay++)
385 for(lad=1;lad<=gm->GetNladders(lay);lad++)
386 for(det=1;det<=gm->GetNdetectors(lay);det++){
388 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
391 cout << "EXCEPTION in box = new TBRIK" << endl;
395 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
396 gm->GetRotMatrix(lay,lad,det,rt);
397 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
398 for(i=0;i<9;i++) rtd[i] = rt[i];
400 rm = new TRotMatrix(name,name,rtd);
402 cout << "EXCEPTION in new TRotMatrix" << endl;
406 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
408 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
410 cout << "EXCEPTION in new TNode" << endl;
413 nd->SetLineColor(kColorITSSSD);
419 //_____________________________________________________________________________
420 void AliITSv5symm::CreateMaterials(){
421 ////////////////////////////////////////////////////////////////////////
422 // Read a file containing the materials for the ITS version 5.
423 ////////////////////////////////////////////////////////////////////////
426 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
428 FILE *file = fopen(filtmp,"r");
431 ReadEuclidMedia(filtmp);
433 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
437 //_____________________________________________________________________________
438 void AliITSv5symm::CreateGeometry(){
439 //////////////////////////////////////////////////////////////////////
440 // This is the geometry used for the ITS Pre-TDR and comes from an
441 // Euclid to Geant conversion. The only difference
442 // is in the details of the ITS supports. The detectors elements,
443 // detector numbering, and local and global reference frames are shown in
444 // the following figures.
447 <img src="picts/ITS/its1+2_convention_front_5.gif">
450 <font size=+2 color=red>
451 <p>This shows the front view of the SPDs.
454 <img src="picts/ITS/its1+2_convention_side_5.gif">
457 <font size=+2 color=red>
458 <p>This shows the perspective view of the SPDs.
460 <img src="picts/ITS/its1+2_tree.gif">
463 <font size=+2 color=red>
464 <p>This shows the geometry Tree for the SPDs.
469 <img src="picts/ITS/its3+4_convention_front_5.gif">
472 <font size=+2 color=red>
473 <p>This shows the front view of the SDDs.
476 <img src="picts/ITS/its3+4_convention_side_5.gif">
479 <font size=+2 color=red>
480 <p>This shows the perspective view of the SDDs.
482 <img src="picts/ITS/its3+4_tree.gif">
485 <font size=+2 color=red>
486 <p>This shows the geometry Tree for the SDDs.
491 <img src="picts/ITS/its5+6_convention_front_5.gif">
494 <font size=+2 color=red>
495 <p>This shows the front view of the SSDs.
498 <img src="picts/ITS/its5+6_convention_side_5.gif">
501 <font size=+2 color=red>
502 <p>This shows the perspective view of the SSDs.
505 <img src="picts/ITS/its5+6_tree.gif">
508 <font size=+2 color=red>
509 <p>This shows the geometry Tree for the SSDs.
514 <img src="picts/ITS/its_layer1-6_2.gif">
517 <font size=+2 color=red>
518 <p>This shows the front view of the whole ITS..
522 <img src="picts/ITS/its_layer1-6_1.gif">
525 <font size=+2 color=red>
526 <p>This shows the perspective view of the whole ITS..
530 <img src="picts/ITS/its1-6_tree.gif">
533 <font size=+2 color=red>
534 <p>This shows the geometry Tree for the whole ITS.
541 // Here are shown the details of the ITS support cones and services.
542 // First is a GEANT tree showing the organization of all of the volumes
543 // that make up the ITS supports and services.
546 <img src="picts/ITS/supports_tree.gif">
549 // What follows are a number of figures showing what these support
550 // structures look like.
554 <img src="picts/ITS/supports_3.gif">
557 <font size=+2 color=red>
558 <p>This shows the geometry of the supports for the Drift and Strip layers only.
562 <img src="picts/ITS/supports_2.gif">
565 <font size=+2 color=red>
566 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
570 <img src="picts/ITS/supports_1.gif">
573 <font size=+2 color=red>
574 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
578 <img src="picts/ITS/suppssd.gif">
581 <font size=+2 color=red>
582 <p>This shows the geometry for the Strip layers supports.
586 <img src="picts/ITS/suppsdd.gif">
589 <font size=+2 color=red>
590 <p>This shows the geometry for the Drift layers supports.
596 // Read a file containing the geometry for the ITS version 5.
597 ////////////////////////////////////////////////////////////////////////
601 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
602 FILE *file = fopen(filtmp,"r");
606 printf("Ready to read Euclid geometry file\n");
607 ReadEuclid(fEuclidGeometry.Data(),topvol);
608 printf("Read in euclid geometries\n");
610 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
611 fEuclidGeometry.Data());
615 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
618 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
620 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
623 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
624 } // end if (fEuclidOut)
625 cout << "finished with euclid geometrys" << endl;
627 //______________________________________________________________________
628 void AliITSv5symm::ReadOldGeometry(const char *filename){
629 // read in the file containing the transformations for the active
630 // volumes for the ITS version 5. This is expected to be in a file
631 // ending in .det. This geometry is kept in the AliITSgeom class.
636 filtmp = gSystem->ExpandPathName(filename);
637 size = strlen(filtmp);
638 if(size>4 && fGeomDetIn){
639 filtmp[size-3] = 'd'; // change from .euc to .det
640 filtmp[size-2] = 'e';
641 filtmp[size-1] = 't';
642 file = fopen(filtmp,"r");
643 if(file){ // if file exists use it to fill AliITSgeom structure.
645 fITSgeom = new AliITSgeom(filtmp);
646 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
647 // Now define the detector types/shapes.
648 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
649 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
650 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
653 // fill AliITSgeom structure from geant structure just filled above
658 //______________________________________________________________________
659 void AliITSv5symm::InitAliITSgeom(){
660 // Based on the geometry tree defined in Geant 3.21, this
661 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
663 // if(gMC->IsA()!=TGeant3::Class()) {
664 if(strcmp(gMC->GetName(),"TGeant3")) {
665 Error("InitAliITSgeom",
666 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
669 cout << "Reading Geometry transformation directly from Geant 3." << endl;
670 const Int_t nlayers = 6;
671 const Int_t ndeep = 7;
672 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
673 Int_t nlad[nlayers],ndet[nlayers];
675 Float_t par[20],att[20];
676 Int_t npar,natt,idshape,imat,imed;
677 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
678 Int_t mod,lay,lad,det,i,j,k;
679 char *names[nlayers][ndeep] = {
680 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
681 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
682 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
683 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
684 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
685 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
686 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
687 {1,1,1,1,10, 4,4}, // lay=2
688 {1,1,1,1,14, 6,1}, // lay=3
689 {1,1,1,1,22, 8,1}, // lay=4
690 {1,1,1,1,34,23,1}, // lay=5
691 {1,1,1,1,38,26,1}};// lay=6
693 // Sorry, but this is not very pritty code. It should be replaced
694 // at some point with a version that can search through the geometry
696 cout << "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 AliITSv5symm::Init(){
778 ////////////////////////////////////////////////////////////////////////
779 // Initialise the ITS after it has been created.
780 ////////////////////////////////////////////////////////////////////////
784 for(i=0;i<28;i++) cout << "*";cout << " ITSv5symm_Init ";
785 for(i=0;i<28;i++) cout << "*";cout << endl;
787 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
788 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
789 if(fITSgeom!=0) delete fITSgeom;
790 fITSgeom = new AliITSgeom();
791 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
792 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
794 if(!fGeomDetIn) this->InitAliITSgeom();
795 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
798 for(i=0;i<72;i++) cout << "*";
801 //_____________________________________________________________________________
802 void AliITSv5symm::StepManager(){
803 ////////////////////////////////////////////////////////////////////////
804 // Called for every step in the ITS, then calles the AliITShit class
805 // creator with the information to be recoreded about that hit.
806 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
807 // printing of information to a file which can be used to create a .det
808 // file read in by the routine CreateGeometry(). If set to 0 or any other
809 // value except 1, the default behavior, then no such file is created nor
810 // it the extra variables and the like used in the printing allocated.
811 ////////////////////////////////////////////////////////////////////////
816 TLorentzVector position, momentum;
817 TClonesArray &lhits = *fHits;
821 if(gMC->IsTrackInside()) vol[3] += 1;
822 if(gMC->IsTrackEntering()) vol[3] += 2;
823 if(gMC->IsTrackExiting()) vol[3] += 4;
824 if(gMC->IsTrackOut()) vol[3] += 8;
825 if(gMC->IsTrackDisappeared()) vol[3] += 16;
826 if(gMC->IsTrackStop()) vol[3] += 32;
827 if(gMC->IsTrackAlive()) vol[3] += 64;
829 // Fill hit structure.
830 if(!(gMC->TrackCharge())) return;
832 // Only entering charged tracks
833 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
835 id = gMC->CurrentVolOffID(0,copy);
836 //detector copy in the ladder = 1<->4 (ITS1)
838 gMC->CurrentVolOffID(1,copy1);
839 //ladder copy in the module = 1<->2 (I186)
840 gMC->CurrentVolOffID(2,copy2);
841 //module copy in the layer = 1<->10 (I132)
842 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
843 } else if(id == fIdSens[1]){
845 id = gMC->CurrentVolOffID(0,copy);
846 //detector copy in the ladder = 1<->4 (ITS2)
848 gMC->CurrentVolOffID(1,copy1);
849 //ladder copy in the module = 1<->4 (I131)
850 gMC->CurrentVolOffID(2,copy2);
851 //module copy in the layer = 1<->10 (I132)
852 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
853 } else if(id == fIdSens[2]){
855 id = gMC->CurrentVolOffID(1,copy);
856 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
858 id = gMC->CurrentVolOffID(2,copy);
859 //ladder copy in the layer = 1<->12 (I316)
861 } else if(id == fIdSens[3]){
863 id = gMC->CurrentVolOffID(1,copy);
864 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
866 id = gMC->CurrentVolOffID(2,copy);
867 //ladder copy in the layer = 1<->22 (I417)
869 }else if(id == fIdSens[4]){
871 id = gMC->CurrentVolOffID(1,copy);
872 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
874 id = gMC->CurrentVolOffID(2,copy);
875 //ladder copy in the layer = 1<->34 (I565)
877 }else if(id == fIdSens[5]){
879 id = gMC->CurrentVolOffID(1,copy);
880 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
882 id = gMC->CurrentVolOffID(2,copy);
883 //ladder copy in the layer = 1<->38 (I569)
886 return; // not an ITS volume?
887 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
889 gMC->TrackPosition(position);
890 gMC->TrackMomentum(momentum);
898 hits[7]=gMC->TrackTime();
899 // Fill hit structure with this new hit.
900 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);