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.14 2002/10/14 14:57:08 hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
21 Revision 1.13.10.2 2002/08/30 15:45:54 alibrary
22 Adding geant4vmc support
24 Revision 1.13.10.1 2002/06/10 17:51:15 hristov
27 Revision 1.13 2001/05/30 16:15:47 fca
28 Correct comparison wiht AliGeant3::Class() introduced. Thanks to I.Hrivnacova
30 Revision 1.12 2001/05/30 15:55:35 hristov
31 Strings compared instead of pointers
33 Revision 1.11 2001/05/30 14:04:31 hristov
34 Dynamic cast replaced (F.Carminati)
36 Revision 1.10 2001/05/25 06:47:16 hristov
37 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)
39 Revision 1.9 2001/04/18 12:07:37 barbera
40 Number of modules in layer 5 and 6 re-set to 23 and 26
42 Revision 1.8 2001/03/23 00:12:23 nilsen
43 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
44 not a .det file. Removed redundent calls to BuildGeometry.
46 Revision 1.7 2001/02/13 16:53:35 nilsen
47 Fixed a but when trying to use GEANT4. Needed to replace
48 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
49 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
50 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
51 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
52 in the same way as in AliITSv5.cxx.
54 Revision 1.6 2001/02/09 20:06:26 nilsen
55 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
57 Revision 1.5 2001/02/09 00:05:31 nilsen
58 Added fMajor/MinorVersion variables and made other changes to better make
59 use of the new code changes in AliITSgeom related classes.
61 Revision 1.4 2001/02/02 23:57:29 nilsen
62 Added include file that are no londer included in AliITSgeom.h
64 Revision 1.3 2001/01/30 09:23:13 hristov
65 Streamers removed (R.Brun)
67 Revision 1.2 2000/11/30 11:13:11 barbera
68 Added changes suggested by Federico Carminati on nov, 30, 2000
70 Revision 1.1 2000/10/07 15:46:29 barbera
71 Version 5 of the geometry with symmetric services
73 Revision 1.25 2000/10/05 20:50:00 nilsen
74 Now using root generated streamers.
76 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
77 Forward declarations added
79 Revision 1.22 2000/07/10 16:07:19 fca
80 Release version of ITS code
82 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
83 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
85 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
86 Fixed up the comments/documentation.
88 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
89 To make it compatable with the changes in AliRun/AliModule.
91 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
92 This is the version of the files after the merging done in December 1999.
93 See the ReadMe110100.txt file for details
95 Revision 1.14 1999/10/22 08:16:49 fca
96 Correct destructors, thanks to I.Hrivnacova
98 Revision 1.13 1999/10/06 10:15:19 fca
99 Correct bug in allocation of layer name and add destructor
101 Revision 1.12 1999/10/05 08:05:09 fca
102 Minor corrections for uninitialised variables.
104 Revision 1.11 1999/09/29 09:24:20 fca
105 Introduction of the Copyright and cvs Log
109 ///////////////////////////////////////////////////////////////////////////////
111 // Inner Traking System version 5 with symmetric services
112 // This class contains the base procedures for the Inner Tracking System
114 // Authors: R. Barbera, B. S. Nilsen.
116 // Created October 7 2000.
118 ///////////////////////////////////////////////////////////////////////////////
119 #include <Riostream.h>
123 #include <TGeometry.h>
126 #include <TFile.h> // only required for Tracking function?
128 #include <TObjArray.h>
129 #include <TLorentzVector.h>
130 #include <TObjString.h>
131 #include <TClonesArray.h>
137 #include "AliITShit.h"
138 #include "AliITSGeant3Geometry.h"
140 #include "AliITSv5symm.h"
141 #include "AliITSgeom.h"
142 #include "AliITSgeomSPD.h"
143 #include "AliITSgeomSDD.h"
144 #include "AliITSgeomSSD.h"
146 ClassImp(AliITSv5symm)
148 //_____________________________________________________________________________
149 AliITSv5symm::AliITSv5symm() {
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 AliITSv5symm::AliITSv5symm(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_5symm.tme";
195 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5symm.euc";
196 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_v5symm.det",60);
197 strncpy(fRead,fEuclidGeomDet,60);
198 strncpy(fWrite,fEuclidGeomDet,60);
200 //____________________________________________________________________________
201 AliITSv5symm::AliITSv5symm(const AliITSv5symm &source){
202 ////////////////////////////////////////////////////////////////////////
203 // Copy Constructor for ITS version 5.
204 ////////////////////////////////////////////////////////////////////////
205 if(&source == this) return;
206 Warning("Copy Constructor","Not allowed to copy AliITSv5symm");
209 //_____________________________________________________________________________
210 AliITSv5symm& AliITSv5symm::operator=(const AliITSv5symm &source){
211 ////////////////////////////////////////////////////////////////////////
212 // Assignment operator for the ITS version 5.
213 ////////////////////////////////////////////////////////////////////////
215 if(&source == this) return *this;
216 Warning("= operator","Not allowed to copy AliITSv5symm");
220 //_____________________________________________________________________________
221 AliITSv5symm::~AliITSv5symm() {
222 ////////////////////////////////////////////////////////////////////////
223 // Standard destructor for the ITS version 5.
224 ////////////////////////////////////////////////////////////////////////
226 //_____________________________________________________________________________
227 void AliITSv5symm::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 AliITSv5symm::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 AliITSv5symm::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 printf("Ready to read Euclid geometry file\n");
605 ReadEuclid(fEuclidGeometry.Data(),topvol);
606 printf("Read in euclid geometries\n");
608 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
609 fEuclidGeometry.Data());
613 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
616 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
618 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
621 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
622 } // end if (fEuclidOut)
623 cout << "finished with euclid geometrys" << endl;
625 //______________________________________________________________________
626 void AliITSv5symm::ReadOldGeometry(const char *filename){
627 // read in the file containing the transformations for the active
628 // volumes for the ITS version 5. This is expected to be in a file
629 // ending in .det. This geometry is kept in the AliITSgeom class.
634 filtmp = gSystem->ExpandPathName(filename);
635 size = strlen(filtmp);
636 if(size>4 && fGeomDetIn){
637 filtmp[size-3] = 'd'; // change from .euc to .det
638 filtmp[size-2] = 'e';
639 filtmp[size-1] = 't';
640 file = fopen(filtmp,"r");
641 if(file){ // if file exists use it to fill AliITSgeom structure.
643 fITSgeom = new AliITSgeom(filtmp);
644 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
645 // Now define the detector types/shapes.
646 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
647 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
648 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
651 // fill AliITSgeom structure from geant structure just filled above
656 //______________________________________________________________________
657 void AliITSv5symm::InitAliITSgeom(){
658 // Based on the geometry tree defined in Geant 3.21, this
659 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
661 // if(gMC->IsA()!=TGeant3::Class()) {
662 if(strcmp(gMC->GetName(),"TGeant3")) {
663 Error("InitAliITSgeom",
664 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
667 cout << "Reading Geometry transformation directly from Geant 3." << endl;
668 const Int_t nlayers = 6;
669 const Int_t ndeep = 7;
670 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
671 Int_t nlad[nlayers],ndet[nlayers];
673 Float_t par[20],att[20];
674 Int_t npar,natt,idshape,imat,imed;
675 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
676 Int_t mod,lay,lad,det,i,j,k;
677 char *names[nlayers][ndeep] = {
678 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
679 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
680 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
681 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
682 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
683 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
684 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
685 {1,1,1,1,10, 4,4}, // lay=2
686 {1,1,1,1,14, 6,1}, // lay=3
687 {1,1,1,1,22, 8,1}, // lay=4
688 {1,1,1,1,34,23,1}, // lay=5
689 {1,1,1,1,38,26,1}};// lay=6
691 // Sorry, but this is not very pritty code. It should be replaced
692 // at some point with a version that can search through the geometry
694 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
695 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
696 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
697 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
699 for(i=0;i<nlayers;i++){
701 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
702 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
706 if(fITSgeom!=0) delete fITSgeom;
707 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
708 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
709 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
711 for(lay=1;lay<=nlayers;lay++){
712 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
713 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
715 case 1: case 2: // layers 1 and 2 are a bit special
717 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
719 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
722 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
725 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
727 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
728 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
729 if(fMinorVersion==1){
730 fITSgeom->ReSetShape(kSPD,
731 new AliITSgeomSPD300());
732 } else if(fMinorVersion==2){
733 fITSgeom->ReSetShape(kSPD,
734 new AliITSgeomSPD300());
735 }else if(fMinorVersion==3){
736 fITSgeom->ReSetShape(kSPD,
737 new AliITSgeomSPD425Long());
739 fITSgeom->ReSetShape(kSPD,
740 new AliITSgeomSPD300());
746 case 3: case 4: case 5: case 6: // layers 3-6
748 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
750 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
753 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
757 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
758 if(!(fITSgeom->IsShapeDefined(kSDD)))
759 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
762 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
763 if(!(fITSgeom->IsShapeDefined(kSSD)))
764 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
774 //_____________________________________________________________________________
775 void AliITSv5symm::Init(){
776 ////////////////////////////////////////////////////////////////////////
777 // Initialise the ITS after it has been created.
778 ////////////////////////////////////////////////////////////////////////
782 for(i=0;i<28;i++) cout << "*";cout << " ITSv5symm_Init ";
783 for(i=0;i<28;i++) cout << "*";cout << endl;
785 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
786 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
787 if(fITSgeom!=0) delete fITSgeom;
788 fITSgeom = new AliITSgeom();
789 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
790 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
792 if(!fGeomDetIn) this->InitAliITSgeom();
793 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
796 for(i=0;i<72;i++) cout << "*";
799 //_____________________________________________________________________________
800 void AliITSv5symm::StepManager(){
801 ////////////////////////////////////////////////////////////////////////
802 // Called for every step in the ITS, then calles the AliITShit class
803 // creator with the information to be recoreded about that hit.
804 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
805 // printing of information to a file which can be used to create a .det
806 // file read in by the routine CreateGeometry(). If set to 0 or any other
807 // value except 1, the default behavior, then no such file is created nor
808 // it the extra variables and the like used in the printing allocated.
809 ////////////////////////////////////////////////////////////////////////
814 TLorentzVector position, momentum;
815 TClonesArray &lhits = *fHits;
819 if(gMC->IsTrackInside()) vol[3] += 1;
820 if(gMC->IsTrackEntering()) vol[3] += 2;
821 if(gMC->IsTrackExiting()) vol[3] += 4;
822 if(gMC->IsTrackOut()) vol[3] += 8;
823 if(gMC->IsTrackDisappeared()) vol[3] += 16;
824 if(gMC->IsTrackStop()) vol[3] += 32;
825 if(gMC->IsTrackAlive()) vol[3] += 64;
827 // Fill hit structure.
828 if(!(gMC->TrackCharge())) return;
830 // Only entering charged tracks
831 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
833 id = gMC->CurrentVolOffID(0,copy);
834 //detector copy in the ladder = 1<->4 (ITS1)
836 gMC->CurrentVolOffID(1,copy1);
837 //ladder copy in the module = 1<->2 (I186)
838 gMC->CurrentVolOffID(2,copy2);
839 //module copy in the layer = 1<->10 (I132)
840 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
841 } else if(id == fIdSens[1]){
843 id = gMC->CurrentVolOffID(0,copy);
844 //detector copy in the ladder = 1<->4 (ITS2)
846 gMC->CurrentVolOffID(1,copy1);
847 //ladder copy in the module = 1<->4 (I131)
848 gMC->CurrentVolOffID(2,copy2);
849 //module copy in the layer = 1<->10 (I132)
850 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
851 } else if(id == fIdSens[2]){
853 id = gMC->CurrentVolOffID(1,copy);
854 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
856 id = gMC->CurrentVolOffID(2,copy);
857 //ladder copy in the layer = 1<->12 (I316)
859 } else if(id == fIdSens[3]){
861 id = gMC->CurrentVolOffID(1,copy);
862 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
864 id = gMC->CurrentVolOffID(2,copy);
865 //ladder copy in the layer = 1<->22 (I417)
867 }else if(id == fIdSens[4]){
869 id = gMC->CurrentVolOffID(1,copy);
870 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
872 id = gMC->CurrentVolOffID(2,copy);
873 //ladder copy in the layer = 1<->34 (I565)
875 }else if(id == fIdSens[5]){
877 id = gMC->CurrentVolOffID(1,copy);
878 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
880 id = gMC->CurrentVolOffID(2,copy);
881 //ladder copy in the layer = 1<->38 (I569)
884 return; // not an ITS volume?
885 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
887 gMC->TrackPosition(position);
888 gMC->TrackMomentum(momentum);
896 hits[7]=gMC->TrackTime();
897 // Fill hit structure with this new hit.
898 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);