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.12 2001/04/18 12:06:02 barbera
19 Number of modules in layer 5 and 6 re-set to 23 and 26
21 Revision 1.11 2001/03/23 00:12:23 nilsen
22 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
23 not a .det file. Removed redundent calls to BuildGeometry.
25 Revision 1.10 2001/02/14 14:22:58 nilsen
26 Now looking in the right director for the old .det.
28 Revision 1.9 2001/02/14 14:12:43 nilsen
29 Forgot about the nonexisting v in ITSgeometry_5.det.
31 Revision 1.8 2001/02/14 14:06:23 nilsen
32 Wrong default .det file name for old .det file format.
34 Revision 1.7 2001/02/13 16:53:35 nilsen
35 Fixed a but when trying to use GEANT4. Needed to replace
36 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
37 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
38 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
39 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
40 in the same way as in AliITSv5.cxx.
42 Revision 1.6 2001/02/09 20:06:26 nilsen
43 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
45 Revision 1.5 2001/02/09 00:05:31 nilsen
46 Added fMajor/MinorVersion variables and made other changes to better make
47 use of the new code changes in AliITSgeom related classes.
49 Revision 1.4 2001/02/02 23:57:29 nilsen
50 Added include file that are no londer included in AliITSgeom.h
52 Revision 1.3 2001/01/30 09:23:13 hristov
53 Streamers removed (R.Brun)
55 Revision 1.2 2000/11/30 11:13:11 barbera
56 Added changes suggested by Federico Carminati on nov, 30, 2000
58 Revision 1.1 2000/10/07 15:46:38 barbera
59 Version 5 of the geometry with asymmetric services
61 Revision 1.25 2000/10/05 20:50:00 nilsen
62 Now using root generated streamers.
64 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
65 Forward declarations added
67 Revision 1.22 2000/07/10 16:07:19 fca
68 Release version of ITS code
70 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
71 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
73 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
74 Fixed up the comments/documentation.
76 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
77 To make it compatable with the changes in AliRun/AliModule.
79 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
80 This is the version of the files after the merging done in December 1999.
81 See the ReadMe110100.txt file for details
83 Revision 1.14 1999/10/22 08:16:49 fca
84 Correct destructors, thanks to I.Hrivnacova
86 Revision 1.13 1999/10/06 10:15:19 fca
87 Correct bug in allocation of layer name and add destructor
89 Revision 1.12 1999/10/05 08:05:09 fca
90 Minor corrections for uninitialised variables.
92 Revision 1.11 1999/09/29 09:24:20 fca
93 Introduction of the Copyright and cvs Log
97 ///////////////////////////////////////////////////////////////////////////////
99 // Inner Traking System version 5 with asymmetric services
100 // This class contains the base procedures for the Inner Tracking System
102 // Authors: R. Barbera, B. S. Nilsen.
104 // Created October 7 2000.
106 ///////////////////////////////////////////////////////////////////////////////
107 #include <iostream.h>
112 #include <TGeometry.h>
115 #include <TFile.h> // only required for Tracking function?
117 #include <TObjArray.h>
118 #include <TObjString.h>
119 #include <TClonesArray.h>
120 #include <TLorentzVector.h>
126 #include "../TGeant3/TGeant3.h"
127 #include "AliITShit.h"
128 #include "AliITSGeant3Geometry.h"
130 #include "AliITSv5asymm.h"
131 #include "AliITSgeom.h"
132 #include "AliITSgeomSPD.h"
133 #include "AliITSgeomSDD.h"
134 #include "AliITSgeomSSD.h"
136 ClassImp(AliITSv5asymm)
138 //_____________________________________________________________________________
139 AliITSv5asymm::AliITSv5asymm() {
140 ////////////////////////////////////////////////////////////////////////
141 // Standard default constructor for the ITS version 5.
142 ////////////////////////////////////////////////////////////////////////
148 fEuclidOut = kFALSE; // Don't write Euclide file
149 fGeomDetOut = kFALSE; // Don't write .det file
150 fGeomDetIn = kFALSE; // Don't Read .det file
151 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
152 fMajorVersion = IsVersion();
154 for(i=0;i<60;i++) fRead[i] = '\0';
155 for(i=0;i<60;i++) fWrite[i] = '\0';
156 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
158 //_____________________________________________________________________________
159 AliITSv5asymm::AliITSv5asymm(const char *name, const char *title) : AliITS(name, title){
160 /////////////////////////////////////////////////////////////////////////////
161 // Standard constructor for the ITS version 5 with symmetrical services.
162 /////////////////////////////////////////////////////////////////////////////
166 fIdName = new TString[fIdN];
173 fIdSens = new Int_t[fIdN];
174 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
175 fEuclidOut = kFALSE; // Don't write Euclide file
176 fGeomDetOut = kFALSE; // Don't write .det file
177 fGeomDetIn = kFALSE; // Don't Read .det file
178 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
179 fMajorVersion = IsVersion();
181 for(i=0;i<60;i++) fRead[i] = '\0';
182 for(i=0;i<60;i++) fWrite[i] = '\0';
184 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.tme";
185 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.euc";
186 strncpy(fEuclidGeomDet,"$ALICE_ROOT/Euclid/ITSgeometry_5.det",60);
187 strncpy(fRead,fEuclidGeomDet,60);
188 strncpy(fWrite,fEuclidGeomDet,60);
190 //____________________________________________________________________________
191 AliITSv5asymm::AliITSv5asymm(const AliITSv5asymm &source){
192 ////////////////////////////////////////////////////////////////////////
193 // Copy Constructor for ITS version 5.
194 ////////////////////////////////////////////////////////////////////////
195 if(&source == this) return;
196 Warning("Copy Constructor","Not allowed to copy AliITSv5asymm");
199 //_____________________________________________________________________________
200 AliITSv5asymm& AliITSv5asymm::operator=(const AliITSv5asymm &source){
201 ////////////////////////////////////////////////////////////////////////
202 // Assignment operator for the ITS version 5.
203 ////////////////////////////////////////////////////////////////////////
205 if(&source == this) return *this;
206 Warning("= operator","Not allowed to copy AliITSv5asymm");
210 //_____________________________________________________________________________
211 AliITSv5asymm::~AliITSv5asymm() {
212 ////////////////////////////////////////////////////////////////////////
213 // Standard destructor for the ITS version 5.
214 ////////////////////////////////////////////////////////////////////////
216 //_____________________________________________________________________________
217 void AliITSv5asymm::BuildGeometry(){
218 ////////////////////////////////////////////////////////////////////////
219 // Geometry builder for the ITS version 5.
220 ////////////////////////////////////////////////////////////////////////
222 // Build ITS TNODE geometry for event display using detailed geometry.
223 // This function builds a simple ITS geometry used by the ROOT macro
228 //const int kColorITSSPD=kRed;
229 //const int kColorITSSDD=kGreen;
230 const int kColorITSSSD=kBlue;
232 AliITSgeom *gm = this->GetITSgeom();
234 top=gAlice->GetGeometry()->GetNode("alice");
243 //TCanvas *c1 = new TCanvas("c1","ITS");
245 for(lay=1;lay<=2;lay++)
246 for(lad=1;lad<=gm->GetNladders(lay);lad++)
247 for(det=1;det<=gm->GetNdetectors(lay);det++){
249 box = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
252 cout << "EXCEPTION in box = new TBRIK" << endl;
255 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
256 gm->GetRotMatrix(lay,lad,det,rt);
257 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
258 for(i=0;i<9;i++) rtd[i] = rt[i];
260 rm = new TRotMatrix(name,name,rtd);
262 cout << "EXCEPTION in new TRotMatrix" << endl;
266 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
268 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
270 cout << "EXCEPTION in new TNode" << endl;
273 nd->SetLineColor(kColorITSSSD);
277 for(lay=3;lay<=3;lay++)
278 for(lad=1;lad<=gm->GetNladders(lay);lad++)
279 for(det=1;det<=gm->GetNdetectors(lay);det++){
281 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
284 cout << "EXCEPTION in box = new TBRIK" << endl;
287 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
288 gm->GetRotMatrix(lay,lad,det,rt);
289 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
290 for(i=0;i<9;i++) rtd[i] = rt[i];
292 rm = new TRotMatrix(name,name,rtd);
294 cout << "EXCEPTION in new TRotMatrix" << endl;
298 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
300 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
302 cout << "EXCEPTION in new TNode" << endl;
305 nd->SetLineColor(kColorITSSSD);
309 for(lay=4;lay<=4;lay++)
310 for(lad=1;lad<=gm->GetNladders(lay);lad++)
311 for(det=1;det<=gm->GetNdetectors(lay);det++){
313 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
316 cout << "EXCEPTION in box = new TBRIK" << endl;
319 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
320 gm->GetRotMatrix(lay,lad,det,rt);
321 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
322 for(i=0;i<9;i++) rtd[i] = rt[i];
324 rm = new TRotMatrix(name,name,rtd);
326 cout << "EXCEPTION in new TRotMatrix" << endl;
330 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
332 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
334 cout << "EXCEPTION in new TNode" << endl;
337 nd->SetLineColor(kColorITSSSD);
340 for(lay=5;lay<=5;lay++)
341 for(lad=1;lad<=gm->GetNladders(lay);lad++)
342 for(det=1;det<=gm->GetNdetectors(lay);det++){
344 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
347 cout << "EXCEPTION in box = new TBRIK" << endl;
350 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
351 gm->GetRotMatrix(lay,lad,det,rt);
352 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
353 for(i=0;i<9;i++) rtd[i] = rt[i];
355 rm = new TRotMatrix(name,name,rtd);
357 cout << "EXCEPTION in new TRotMatrix" << endl;
361 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
363 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
365 cout << "EXCEPTION in new TNode" << endl;
368 nd->SetLineColor(kColorITSSSD);
372 for(lay=6;lay<=6;lay++)
373 for(lad=1;lad<=gm->GetNladders(lay);lad++)
374 for(det=1;det<=gm->GetNdetectors(lay);det++){
376 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
379 cout << "EXCEPTION in box = new TBRIK" << endl;
383 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
384 gm->GetRotMatrix(lay,lad,det,rt);
385 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
386 for(i=0;i<9;i++) rtd[i] = rt[i];
388 rm = new TRotMatrix(name,name,rtd);
390 cout << "EXCEPTION in new TRotMatrix" << endl;
394 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
396 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
398 cout << "EXCEPTION in new TNode" << endl;
401 nd->SetLineColor(kColorITSSSD);
407 //_____________________________________________________________________________
408 void AliITSv5asymm::CreateMaterials(){
409 ////////////////////////////////////////////////////////////////////////
410 // Read a file containing the materials for the ITS version 5.
411 ////////////////////////////////////////////////////////////////////////
414 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
416 FILE *file = fopen(filtmp,"r");
419 ReadEuclidMedia(filtmp);
421 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
425 //_____________________________________________________________________________
426 void AliITSv5asymm::CreateGeometry(){
427 //////////////////////////////////////////////////////////////////////
428 // This is the geometry used for the ITS Pre-TDR and comes from an
429 // Euclid to Geant conversion. The only difference
430 // is in the details of the ITS supports. The detectors elements,
431 // detector numbering, and local and global reference frames are shown in
432 // the following figures.
435 <img src="picts/ITS/its1+2_convention_front_5.gif">
438 <font size=+2 color=red>
439 <p>This shows the front view of the SPDs.
442 <img src="picts/ITS/its1+2_convention_side_5.gif">
445 <font size=+2 color=red>
446 <p>This shows the perspective view of the SPDs.
448 <img src="picts/ITS/its1+2_tree.gif">
451 <font size=+2 color=red>
452 <p>This shows the geometry Tree for the SPDs.
457 <img src="picts/ITS/its3+4_convention_front_5.gif">
460 <font size=+2 color=red>
461 <p>This shows the front view of the SDDs.
464 <img src="picts/ITS/its3+4_convention_side_5.gif">
467 <font size=+2 color=red>
468 <p>This shows the perspective view of the SDDs.
470 <img src="picts/ITS/its3+4_tree.gif">
473 <font size=+2 color=red>
474 <p>This shows the geometry Tree for the SDDs.
479 <img src="picts/ITS/its5+6_convention_front_5.gif">
482 <font size=+2 color=red>
483 <p>This shows the front view of the SSDs.
486 <img src="picts/ITS/its5+6_convention_side_5.gif">
489 <font size=+2 color=red>
490 <p>This shows the perspective view of the SSDs.
493 <img src="picts/ITS/its5+6_tree.gif">
496 <font size=+2 color=red>
497 <p>This shows the geometry Tree for the SSDs.
502 <img src="picts/ITS/its_layer1-6_2.gif">
505 <font size=+2 color=red>
506 <p>This shows the front view of the whole ITS..
510 <img src="picts/ITS/its_layer1-6_1.gif">
513 <font size=+2 color=red>
514 <p>This shows the perspective view of the whole ITS..
518 <img src="picts/ITS/its1-6_tree.gif">
521 <font size=+2 color=red>
522 <p>This shows the geometry Tree for the whole ITS.
529 // Here are shown the details of the ITS support cones and services.
530 // First is a GEANT tree showing the organization of all of the volumes
531 // that make up the ITS supports and services.
534 <img src="picts/ITS/supports_tree.gif">
537 // What follows are a number of figures showing what these support
538 // structures look like.
542 <img src="picts/ITS/supports_3.gif">
545 <font size=+2 color=red>
546 <p>This shows the geometry of the supports for the Drift and Strip layers only.
550 <img src="picts/ITS/supports_2.gif">
553 <font size=+2 color=red>
554 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
558 <img src="picts/ITS/supports_1.gif">
561 <font size=+2 color=red>
562 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
566 <img src="picts/ITS/suppssd.gif">
569 <font size=+2 color=red>
570 <p>This shows the geometry for the Strip layers supports.
574 <img src="picts/ITS/suppsdd.gif">
577 <font size=+2 color=red>
578 <p>This shows the geometry for the Drift layers supports.
584 // Read a file containing the geometry for the ITS version 5.
585 ////////////////////////////////////////////////////////////////////////
589 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
590 FILE *file = fopen(filtmp,"r");
594 cout << "Ready to read Euclid geometry file" << endl;
595 ReadEuclid(fEuclidGeometry.Data(),topvol);
596 cout << "Read in euclid geometries" << endl;
598 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
599 fEuclidGeometry.Data());
603 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
606 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
608 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
611 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
612 } // end if (fEuclidOut)
614 cout << "finished with euclid geometrys" << endl;
617 //______________________________________________________________________
618 void AliITSv5asymm::ReadOldGeometry(const char *filename){
619 // read in the file containing the transformations for the active
620 // volumes for the ITS version 5. This is expected to be in a file
621 // ending in .det. This geometry is kept in the AliITSgeom class.
626 filtmp = gSystem->ExpandPathName(filename);
627 size = strlen(filtmp);
628 if(size>4 && fGeomDetIn){
629 filtmp[size-3] = 'd'; // change from .euc to .det
630 filtmp[size-2] = 'e';
631 filtmp[size-1] = 't';
632 file = fopen(filtmp,"r");
633 if(file){ // if file exists use it to fill AliITSgeom structure.
635 fITSgeom = new AliITSgeom(filtmp);
636 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
637 // Now define the detector types/shapes.
638 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
639 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
640 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
643 // fill AliITSgeom structure from geant structure just filled above
648 //______________________________________________________________________
649 void AliITSv5asymm::InitAliITSgeom(){
650 // Based on the geometry tree defined in Geant 3.21, this
651 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
653 if(!(dynamic_cast<TGeant3*>(gMC))) {
654 Error("InitAliITSgeom",
655 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
658 cout << "Reading Geometry transformation directly from Geant 3." << endl;
659 const Int_t nlayers = 6;
660 const Int_t ndeep = 7;
661 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
662 Int_t nlad[nlayers],ndet[nlayers];
664 Float_t par[20],att[20];
665 Int_t npar,natt,idshape,imat,imed;
666 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
667 Int_t mod,lay,lad,det,i,j,k;
668 char *names[nlayers][ndeep] = {
669 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
670 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
671 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
672 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
673 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
674 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
675 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
676 {1,1,1,1,10, 4,4}, // lay=2
677 {1,1,1,1,14, 6,1}, // lay=3
678 {1,1,1,1,22, 8,1}, // lay=4
679 {1,1,1,1,34,23,1}, // lay=5
680 {1,1,1,1,38,26,1}};// lay=6
682 // Sorry, but this is not very pritty code. It should be replaced
683 // at some point with a version that can search through the geometry
685 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
686 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
687 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
688 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
690 for(i=0;i<nlayers;i++){
692 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
693 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
697 if(fITSgeom!=0) delete fITSgeom;
698 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
699 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
700 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
702 for(lay=1;lay<=nlayers;lay++){
703 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
704 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
706 case 1: case 2: // layers 1 and 2 are a bit special
708 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
710 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
713 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
716 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
718 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
719 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
720 if(fMinorVersion==1){
721 fITSgeom->ReSetShape(kSPD,
722 new AliITSgeomSPD300());
723 } else if(fMinorVersion==2)
724 fITSgeom->ReSetShape(kSPD,
725 new AliITSgeomSPD300());
730 case 3: case 4: case 5: case 6: // layers 3-6
732 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
734 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
737 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
741 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
742 if(!(fITSgeom->IsShapeDefined(kSDD)))
743 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
746 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
747 if(!(fITSgeom->IsShapeDefined(kSSD)))
748 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
758 //_____________________________________________________________________________
759 void AliITSv5asymm::Init(){
760 ////////////////////////////////////////////////////////////////////////
761 // Initialise the ITS after it has been created.
762 ////////////////////////////////////////////////////////////////////////
766 for(i=0;i<28;i++) cout << "*";cout << " ITSv5asymm_Init ";
767 for(i=0;i<27;i++) cout << "*";cout << endl;
769 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
770 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
771 if(fITSgeom!=0) delete fITSgeom;
772 fITSgeom = new AliITSgeom();
773 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
774 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
776 if(!fGeomDetIn) this->InitAliITSgeom();
777 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
780 for(i=0;i<72;i++) cout << "*";
783 //_____________________________________________________________________________
784 void AliITSv5asymm::StepManager(){
785 ////////////////////////////////////////////////////////////////////////
786 // Called for every step in the ITS, then calles the AliITShit class
787 // creator with the information to be recoreded about that hit.
788 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
789 // printing of information to a file which can be used to create a .det
790 // file read in by the routine CreateGeometry(). If set to 0 or any other
791 // value except 1, the default behavior, then no such file is created nor
792 // it the extra variables and the like used in the printing allocated.
793 ////////////////////////////////////////////////////////////////////////
798 TLorentzVector position, momentum;
799 TClonesArray &lhits = *fHits;
803 if(gMC->IsTrackInside()) vol[3] += 1;
804 if(gMC->IsTrackEntering()) vol[3] += 2;
805 if(gMC->IsTrackExiting()) vol[3] += 4;
806 if(gMC->IsTrackOut()) vol[3] += 8;
807 if(gMC->IsTrackDisappeared()) vol[3] += 16;
808 if(gMC->IsTrackStop()) vol[3] += 32;
809 if(gMC->IsTrackAlive()) vol[3] += 64;
811 // Fill hit structure.
812 if(!(gMC->TrackCharge())) return;
814 // Only entering charged tracks
815 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
817 id = gMC->CurrentVolOffID(0,copy);
818 //detector copy in the ladder = 1<->4 (ITS1)
820 gMC->CurrentVolOffID(1,copy1);
821 //ladder copy in the module = 1<->2 (I186)
822 gMC->CurrentVolOffID(2,copy2);
823 //module copy in the layer = 1<->10 (I132)
824 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
825 } else if(id == fIdSens[1]){
827 id = gMC->CurrentVolOffID(0,copy);
828 //detector copy in the ladder = 1<->4 (ITS2)
830 gMC->CurrentVolOffID(1,copy1);
831 //ladder copy in the module = 1<->4 (I131)
832 gMC->CurrentVolOffID(2,copy2);
833 //module copy in the layer = 1<->10 (I132)
834 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
835 } else if(id == fIdSens[2]){
837 id = gMC->CurrentVolOffID(1,copy);
838 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
840 id = gMC->CurrentVolOffID(2,copy);
841 //ladder copy in the layer = 1<->12 (I316)
843 } else if(id == fIdSens[3]){
845 id = gMC->CurrentVolOffID(1,copy);
846 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
848 id = gMC->CurrentVolOffID(2,copy);
849 //ladder copy in the layer = 1<->22 (I417)
851 }else if(id == fIdSens[4]){
853 id = gMC->CurrentVolOffID(1,copy);
854 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
856 id = gMC->CurrentVolOffID(2,copy);
857 //ladder copy in the layer = 1<->34 (I565)
859 }else if(id == fIdSens[5]){
861 id = gMC->CurrentVolOffID(1,copy);
862 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
864 id = gMC->CurrentVolOffID(2,copy);
865 //ladder copy in the layer = 1<->38 (I569)
868 return; // not an ITS volume?
869 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
871 gMC->TrackPosition(position);
872 gMC->TrackMomentum(momentum);
880 hits[7]=gMC->TrackTime();
881 // Fill hit structure with this new hit.
882 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);