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.13 2001/05/09 01:00:19 nilsen
19 Fixed up a typo in the cout of Init(). Now properly indecates which version
20 of code is being used.
22 Revision 1.12 2001/04/18 12:06:02 barbera
23 Number of modules in layer 5 and 6 re-set to 23 and 26
25 Revision 1.11 2001/03/23 00:12:23 nilsen
26 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
27 not a .det file. Removed redundent calls to BuildGeometry.
29 Revision 1.10 2001/02/14 14:22:58 nilsen
30 Now looking in the right director for the old .det.
32 Revision 1.9 2001/02/14 14:12:43 nilsen
33 Forgot about the nonexisting v in ITSgeometry_5.det.
35 Revision 1.8 2001/02/14 14:06:23 nilsen
36 Wrong default .det file name for old .det file format.
38 Revision 1.7 2001/02/13 16:53:35 nilsen
39 Fixed a but when trying to use GEANT4. Needed to replace
40 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
41 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
42 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
43 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
44 in the same way as in AliITSv5.cxx.
46 Revision 1.6 2001/02/09 20:06:26 nilsen
47 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
49 Revision 1.5 2001/02/09 00:05:31 nilsen
50 Added fMajor/MinorVersion variables and made other changes to better make
51 use of the new code changes in AliITSgeom related classes.
53 Revision 1.4 2001/02/02 23:57:29 nilsen
54 Added include file that are no londer included in AliITSgeom.h
56 Revision 1.3 2001/01/30 09:23:13 hristov
57 Streamers removed (R.Brun)
59 Revision 1.2 2000/11/30 11:13:11 barbera
60 Added changes suggested by Federico Carminati on nov, 30, 2000
62 Revision 1.1 2000/10/07 15:46:38 barbera
63 Version 5 of the geometry with asymmetric services
65 Revision 1.25 2000/10/05 20:50:00 nilsen
66 Now using root generated streamers.
68 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
69 Forward declarations added
71 Revision 1.22 2000/07/10 16:07:19 fca
72 Release version of ITS code
74 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
75 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
77 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
78 Fixed up the comments/documentation.
80 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
81 To make it compatable with the changes in AliRun/AliModule.
83 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
84 This is the version of the files after the merging done in December 1999.
85 See the ReadMe110100.txt file for details
87 Revision 1.14 1999/10/22 08:16:49 fca
88 Correct destructors, thanks to I.Hrivnacova
90 Revision 1.13 1999/10/06 10:15:19 fca
91 Correct bug in allocation of layer name and add destructor
93 Revision 1.12 1999/10/05 08:05:09 fca
94 Minor corrections for uninitialised variables.
96 Revision 1.11 1999/09/29 09:24:20 fca
97 Introduction of the Copyright and cvs Log
101 ///////////////////////////////////////////////////////////////////////////////
103 // Inner Traking System version 5 with asymmetric services
104 // This class contains the base procedures for the Inner Tracking System
106 // Authors: R. Barbera, B. S. Nilsen.
108 // Created October 7 2000.
110 ///////////////////////////////////////////////////////////////////////////////
111 #include <iostream.h>
116 #include <TGeometry.h>
119 #include <TFile.h> // only required for Tracking function?
121 #include <TObjArray.h>
122 #include <TObjString.h>
123 #include <TClonesArray.h>
124 #include <TLorentzVector.h>
130 #include "../TGeant3/TGeant3.h"
131 #include "AliITShit.h"
132 #include "AliITSGeant3Geometry.h"
134 #include "AliITSv5asymm.h"
135 #include "AliITSgeom.h"
136 #include "AliITSgeomSPD.h"
137 #include "AliITSgeomSDD.h"
138 #include "AliITSgeomSSD.h"
140 ClassImp(AliITSv5asymm)
142 //_____________________________________________________________________________
143 AliITSv5asymm::AliITSv5asymm() {
144 ////////////////////////////////////////////////////////////////////////
145 // Standard default constructor for the ITS version 5.
146 ////////////////////////////////////////////////////////////////////////
152 fEuclidOut = kFALSE; // Don't write Euclide file
153 fGeomDetOut = kFALSE; // Don't write .det file
154 fGeomDetIn = kFALSE; // Don't Read .det file
155 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
156 fMajorVersion = IsVersion();
158 for(i=0;i<60;i++) fRead[i] = '\0';
159 for(i=0;i<60;i++) fWrite[i] = '\0';
160 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
162 //_____________________________________________________________________________
163 AliITSv5asymm::AliITSv5asymm(const char *name, const char *title) : AliITS(name, title){
164 /////////////////////////////////////////////////////////////////////////////
165 // Standard constructor for the ITS version 5 with symmetrical services.
166 /////////////////////////////////////////////////////////////////////////////
170 fIdName = new TString[fIdN];
177 fIdSens = new Int_t[fIdN];
178 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
179 fEuclidOut = kFALSE; // Don't write Euclide file
180 fGeomDetOut = kFALSE; // Don't write .det file
181 fGeomDetIn = kFALSE; // Don't Read .det file
182 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
183 fMajorVersion = IsVersion();
185 for(i=0;i<60;i++) fRead[i] = '\0';
186 for(i=0;i<60;i++) fWrite[i] = '\0';
188 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.tme";
189 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.euc";
190 strncpy(fEuclidGeomDet,"$ALICE_ROOT/Euclid/ITSgeometry_5.det",60);
191 strncpy(fRead,fEuclidGeomDet,60);
192 strncpy(fWrite,fEuclidGeomDet,60);
194 //____________________________________________________________________________
195 AliITSv5asymm::AliITSv5asymm(const AliITSv5asymm &source){
196 ////////////////////////////////////////////////////////////////////////
197 // Copy Constructor for ITS version 5.
198 ////////////////////////////////////////////////////////////////////////
199 if(&source == this) return;
200 Warning("Copy Constructor","Not allowed to copy AliITSv5asymm");
203 //_____________________________________________________________________________
204 AliITSv5asymm& AliITSv5asymm::operator=(const AliITSv5asymm &source){
205 ////////////////////////////////////////////////////////////////////////
206 // Assignment operator for the ITS version 5.
207 ////////////////////////////////////////////////////////////////////////
209 if(&source == this) return *this;
210 Warning("= operator","Not allowed to copy AliITSv5asymm");
214 //_____________________________________________________________________________
215 AliITSv5asymm::~AliITSv5asymm() {
216 ////////////////////////////////////////////////////////////////////////
217 // Standard destructor for the ITS version 5.
218 ////////////////////////////////////////////////////////////////////////
220 //_____________________________________________________________________________
221 void AliITSv5asymm::BuildGeometry(){
222 ////////////////////////////////////////////////////////////////////////
223 // Geometry builder for the ITS version 5.
224 ////////////////////////////////////////////////////////////////////////
226 // Build ITS TNODE geometry for event display using detailed geometry.
227 // This function builds a simple ITS geometry used by the ROOT macro
232 //const int kColorITSSPD=kRed;
233 //const int kColorITSSDD=kGreen;
234 const int kColorITSSSD=kBlue;
236 AliITSgeom *gm = this->GetITSgeom();
238 top=gAlice->GetGeometry()->GetNode("alice");
247 //TCanvas *c1 = new TCanvas("c1","ITS");
249 for(lay=1;lay<=2;lay++)
250 for(lad=1;lad<=gm->GetNladders(lay);lad++)
251 for(det=1;det<=gm->GetNdetectors(lay);det++){
253 box = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
256 cout << "EXCEPTION in box = new TBRIK" << endl;
259 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
260 gm->GetRotMatrix(lay,lad,det,rt);
261 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
262 for(i=0;i<9;i++) rtd[i] = rt[i];
264 rm = new TRotMatrix(name,name,rtd);
266 cout << "EXCEPTION in new TRotMatrix" << endl;
270 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
272 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
274 cout << "EXCEPTION in new TNode" << endl;
277 nd->SetLineColor(kColorITSSSD);
281 for(lay=3;lay<=3;lay++)
282 for(lad=1;lad<=gm->GetNladders(lay);lad++)
283 for(det=1;det<=gm->GetNdetectors(lay);det++){
285 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
288 cout << "EXCEPTION in box = new TBRIK" << endl;
291 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
292 gm->GetRotMatrix(lay,lad,det,rt);
293 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
294 for(i=0;i<9;i++) rtd[i] = rt[i];
296 rm = new TRotMatrix(name,name,rtd);
298 cout << "EXCEPTION in new TRotMatrix" << endl;
302 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
304 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
306 cout << "EXCEPTION in new TNode" << endl;
309 nd->SetLineColor(kColorITSSSD);
313 for(lay=4;lay<=4;lay++)
314 for(lad=1;lad<=gm->GetNladders(lay);lad++)
315 for(det=1;det<=gm->GetNdetectors(lay);det++){
317 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
320 cout << "EXCEPTION in box = new TBRIK" << endl;
323 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
324 gm->GetRotMatrix(lay,lad,det,rt);
325 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
326 for(i=0;i<9;i++) rtd[i] = rt[i];
328 rm = new TRotMatrix(name,name,rtd);
330 cout << "EXCEPTION in new TRotMatrix" << endl;
334 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
336 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
338 cout << "EXCEPTION in new TNode" << endl;
341 nd->SetLineColor(kColorITSSSD);
344 for(lay=5;lay<=5;lay++)
345 for(lad=1;lad<=gm->GetNladders(lay);lad++)
346 for(det=1;det<=gm->GetNdetectors(lay);det++){
348 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
351 cout << "EXCEPTION in box = new TBRIK" << endl;
354 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
355 gm->GetRotMatrix(lay,lad,det,rt);
356 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
357 for(i=0;i<9;i++) rtd[i] = rt[i];
359 rm = new TRotMatrix(name,name,rtd);
361 cout << "EXCEPTION in new TRotMatrix" << endl;
365 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
367 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
369 cout << "EXCEPTION in new TNode" << endl;
372 nd->SetLineColor(kColorITSSSD);
376 for(lay=6;lay<=6;lay++)
377 for(lad=1;lad<=gm->GetNladders(lay);lad++)
378 for(det=1;det<=gm->GetNdetectors(lay);det++){
380 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
383 cout << "EXCEPTION in box = new TBRIK" << endl;
387 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
388 gm->GetRotMatrix(lay,lad,det,rt);
389 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
390 for(i=0;i<9;i++) rtd[i] = rt[i];
392 rm = new TRotMatrix(name,name,rtd);
394 cout << "EXCEPTION in new TRotMatrix" << endl;
398 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
400 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
402 cout << "EXCEPTION in new TNode" << endl;
405 nd->SetLineColor(kColorITSSSD);
411 //_____________________________________________________________________________
412 void AliITSv5asymm::CreateMaterials(){
413 ////////////////////////////////////////////////////////////////////////
414 // Read a file containing the materials for the ITS version 5.
415 ////////////////////////////////////////////////////////////////////////
418 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
420 FILE *file = fopen(filtmp,"r");
423 ReadEuclidMedia(filtmp);
425 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
429 //_____________________________________________________________________________
430 void AliITSv5asymm::CreateGeometry(){
431 //////////////////////////////////////////////////////////////////////
432 // This is the geometry used for the ITS Pre-TDR and comes from an
433 // Euclid to Geant conversion. The only difference
434 // is in the details of the ITS supports. The detectors elements,
435 // detector numbering, and local and global reference frames are shown in
436 // the following figures.
439 <img src="picts/ITS/its1+2_convention_front_5.gif">
442 <font size=+2 color=red>
443 <p>This shows the front view of the SPDs.
446 <img src="picts/ITS/its1+2_convention_side_5.gif">
449 <font size=+2 color=red>
450 <p>This shows the perspective view of the SPDs.
452 <img src="picts/ITS/its1+2_tree.gif">
455 <font size=+2 color=red>
456 <p>This shows the geometry Tree for the SPDs.
461 <img src="picts/ITS/its3+4_convention_front_5.gif">
464 <font size=+2 color=red>
465 <p>This shows the front view of the SDDs.
468 <img src="picts/ITS/its3+4_convention_side_5.gif">
471 <font size=+2 color=red>
472 <p>This shows the perspective view of the SDDs.
474 <img src="picts/ITS/its3+4_tree.gif">
477 <font size=+2 color=red>
478 <p>This shows the geometry Tree for the SDDs.
483 <img src="picts/ITS/its5+6_convention_front_5.gif">
486 <font size=+2 color=red>
487 <p>This shows the front view of the SSDs.
490 <img src="picts/ITS/its5+6_convention_side_5.gif">
493 <font size=+2 color=red>
494 <p>This shows the perspective view of the SSDs.
497 <img src="picts/ITS/its5+6_tree.gif">
500 <font size=+2 color=red>
501 <p>This shows the geometry Tree for the SSDs.
506 <img src="picts/ITS/its_layer1-6_2.gif">
509 <font size=+2 color=red>
510 <p>This shows the front view of the whole ITS..
514 <img src="picts/ITS/its_layer1-6_1.gif">
517 <font size=+2 color=red>
518 <p>This shows the perspective view of the whole ITS..
522 <img src="picts/ITS/its1-6_tree.gif">
525 <font size=+2 color=red>
526 <p>This shows the geometry Tree for the whole ITS.
533 // Here are shown the details of the ITS support cones and services.
534 // First is a GEANT tree showing the organization of all of the volumes
535 // that make up the ITS supports and services.
538 <img src="picts/ITS/supports_tree.gif">
541 // What follows are a number of figures showing what these support
542 // structures look like.
546 <img src="picts/ITS/supports_3.gif">
549 <font size=+2 color=red>
550 <p>This shows the geometry of the supports for the Drift and Strip layers only.
554 <img src="picts/ITS/supports_2.gif">
557 <font size=+2 color=red>
558 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
562 <img src="picts/ITS/supports_1.gif">
565 <font size=+2 color=red>
566 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
570 <img src="picts/ITS/suppssd.gif">
573 <font size=+2 color=red>
574 <p>This shows the geometry for the Strip layers supports.
578 <img src="picts/ITS/suppsdd.gif">
581 <font size=+2 color=red>
582 <p>This shows the geometry for the Drift layers supports.
588 // Read a file containing the geometry for the ITS version 5.
589 ////////////////////////////////////////////////////////////////////////
593 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
594 FILE *file = fopen(filtmp,"r");
598 if(fDebug) cout << ClassName() << ": Ready to read Euclid geometry file" << endl;
599 ReadEuclid(fEuclidGeometry.Data(),topvol);
600 if(fDebug) cout << ClassName() << ": Read in euclid geometries" << endl;
602 Fatal("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
603 fEuclidGeometry.Data());
606 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
609 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
611 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
614 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
615 } // end if (fEuclidOut)
617 if(fDebug) cout << ClassName() << ": finished with euclid geometrys" << endl;
620 //______________________________________________________________________
621 void AliITSv5asymm::ReadOldGeometry(const char *filename){
622 // read in the file containing the transformations for the active
623 // volumes for the ITS version 5. This is expected to be in a file
624 // ending in .det. This geometry is kept in the AliITSgeom class.
629 filtmp = gSystem->ExpandPathName(filename);
630 size = strlen(filtmp);
631 if(size>4 && fGeomDetIn){
632 filtmp[size-3] = 'd'; // change from .euc to .det
633 filtmp[size-2] = 'e';
634 filtmp[size-1] = 't';
635 file = fopen(filtmp,"r");
636 if(file){ // if file exists use it to fill AliITSgeom structure.
638 fITSgeom = new AliITSgeom(filtmp);
639 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
640 // Now define the detector types/shapes.
641 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
642 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
643 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
646 // fill AliITSgeom structure from geant structure just filled above
651 //______________________________________________________________________
652 void AliITSv5asymm::InitAliITSgeom(){
653 // Based on the geometry tree defined in Geant 3.21, this
654 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
656 if(!(dynamic_cast<TGeant3*>(gMC))) {
657 Error("InitAliITSgeom",
658 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
661 if(fDebug) cout << ClassName()
662 << ": Reading Geometry transformation directly from Geant 3." << endl;
663 const Int_t nlayers = 6;
664 const Int_t ndeep = 7;
665 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
666 Int_t nlad[nlayers],ndet[nlayers];
668 Float_t par[20],att[20];
669 Int_t npar,natt,idshape,imat,imed;
670 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
671 Int_t mod,lay,lad,det,i,j,k;
672 char *names[nlayers][ndeep] = {
673 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
674 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
675 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
676 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
677 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
678 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
679 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
680 {1,1,1,1,10, 4,4}, // lay=2
681 {1,1,1,1,14, 6,1}, // lay=3
682 {1,1,1,1,22, 8,1}, // lay=4
683 {1,1,1,1,34,23,1}, // lay=5
684 {1,1,1,1,38,26,1}};// lay=6
686 // Sorry, but this is not very pritty code. It should be replaced
687 // at some point with a version that can search through the geometry
689 if(fDebug) cout << ClassName()
690 << ": Reading Geometry informaton from Geant3 common blocks" << endl;
691 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
692 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
693 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
695 for(i=0;i<nlayers;i++){
697 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
698 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
702 if(fITSgeom!=0) delete fITSgeom;
703 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
704 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
705 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
707 for(lay=1;lay<=nlayers;lay++){
708 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
709 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
711 case 1: case 2: // layers 1 and 2 are a bit special
713 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
715 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
718 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
721 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
723 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
724 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
725 if(fMinorVersion==1){
726 fITSgeom->ReSetShape(kSPD,
727 new AliITSgeomSPD300());
728 } else if(fMinorVersion==2)
729 fITSgeom->ReSetShape(kSPD,
730 new AliITSgeomSPD300());
735 case 3: case 4: case 5: case 6: // layers 3-6
737 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
739 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
742 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
746 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
747 if(!(fITSgeom->IsShapeDefined(kSDD)))
748 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
751 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
752 if(!(fITSgeom->IsShapeDefined(kSSD)))
753 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
763 //_____________________________________________________________________________
764 void AliITSv5asymm::Init(){
765 ////////////////////////////////////////////////////////////////////////
766 // Initialise the ITS after it has been created.
767 ////////////////////////////////////////////////////////////////////////
771 cout << endl << ClassName() << ": ";
772 for(i=0;i<28;i++) cout << "*";cout << " ITSv5_Init ";
773 for(i=0;i<27;i++) cout << "*";cout << endl;
776 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
777 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
778 if(fITSgeom!=0) delete fITSgeom;
779 fITSgeom = new AliITSgeom();
780 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
781 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
783 if(!fGeomDetIn) this->InitAliITSgeom();
784 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
788 cout << ClassName() << ": ";
789 for(i=0;i<72;i++) cout << "*";
793 //_____________________________________________________________________________
794 void AliITSv5asymm::StepManager(){
795 ////////////////////////////////////////////////////////////////////////
796 // Called for every step in the ITS, then calles the AliITShit class
797 // creator with the information to be recoreded about that hit.
798 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
799 // printing of information to a file which can be used to create a .det
800 // file read in by the routine CreateGeometry(). If set to 0 or any other
801 // value except 1, the default behavior, then no such file is created nor
802 // it the extra variables and the like used in the printing allocated.
803 ////////////////////////////////////////////////////////////////////////
808 TLorentzVector position, momentum;
809 TClonesArray &lhits = *fHits;
813 if(gMC->IsTrackInside()) vol[3] += 1;
814 if(gMC->IsTrackEntering()) vol[3] += 2;
815 if(gMC->IsTrackExiting()) vol[3] += 4;
816 if(gMC->IsTrackOut()) vol[3] += 8;
817 if(gMC->IsTrackDisappeared()) vol[3] += 16;
818 if(gMC->IsTrackStop()) vol[3] += 32;
819 if(gMC->IsTrackAlive()) vol[3] += 64;
821 // Fill hit structure.
822 if(!(gMC->TrackCharge())) return;
824 // Only entering charged tracks
825 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
827 id = gMC->CurrentVolOffID(0,copy);
828 //detector copy in the ladder = 1<->4 (ITS1)
830 gMC->CurrentVolOffID(1,copy1);
831 //ladder copy in the module = 1<->2 (I186)
832 gMC->CurrentVolOffID(2,copy2);
833 //module copy in the layer = 1<->10 (I132)
834 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
835 } else if(id == fIdSens[1]){
837 id = gMC->CurrentVolOffID(0,copy);
838 //detector copy in the ladder = 1<->4 (ITS2)
840 gMC->CurrentVolOffID(1,copy1);
841 //ladder copy in the module = 1<->4 (I131)
842 gMC->CurrentVolOffID(2,copy2);
843 //module copy in the layer = 1<->10 (I132)
844 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
845 } else if(id == fIdSens[2]){
847 id = gMC->CurrentVolOffID(1,copy);
848 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
850 id = gMC->CurrentVolOffID(2,copy);
851 //ladder copy in the layer = 1<->12 (I316)
853 } else if(id == fIdSens[3]){
855 id = gMC->CurrentVolOffID(1,copy);
856 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
858 id = gMC->CurrentVolOffID(2,copy);
859 //ladder copy in the layer = 1<->22 (I417)
861 }else if(id == fIdSens[4]){
863 id = gMC->CurrentVolOffID(1,copy);
864 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
866 id = gMC->CurrentVolOffID(2,copy);
867 //ladder copy in the layer = 1<->34 (I565)
869 }else if(id == fIdSens[5]){
871 id = gMC->CurrentVolOffID(1,copy);
872 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
874 id = gMC->CurrentVolOffID(2,copy);
875 //ladder copy in the layer = 1<->38 (I569)
878 return; // not an ITS volume?
879 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
881 gMC->TrackPosition(position);
882 gMC->TrackMomentum(momentum);
890 hits[7]=gMC->TrackTime();
891 // Fill hit structure with this new hit.
892 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);