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.17 2001/05/30 15:55:35 hristov
19 Strings compared instead of pointers
21 Revision 1.16 2001/05/30 14:04:31 hristov
22 Dynamic cast replaced (F.Carminati)
24 Revision 1.15 2001/05/25 06:47:16 hristov
25 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)
27 Revision 1.14 2001/05/16 14:57:16 alibrary
28 New files for folders and Stack
30 Revision 1.13 2001/05/09 01:00:19 nilsen
31 Fixed up a typo in the cout of Init(). Now properly indecates which version
32 of code is being used.
34 Revision 1.12 2001/04/18 12:06:02 barbera
35 Number of modules in layer 5 and 6 re-set to 23 and 26
37 Revision 1.11 2001/03/23 00:12:23 nilsen
38 Set Reading of AliITSgeom data from Geant3 common blocks as the default and
39 not a .det file. Removed redundent calls to BuildGeometry.
41 Revision 1.10 2001/02/14 14:22:58 nilsen
42 Now looking in the right director for the old .det.
44 Revision 1.9 2001/02/14 14:12:43 nilsen
45 Forgot about the nonexisting v in ITSgeometry_5.det.
47 Revision 1.8 2001/02/14 14:06:23 nilsen
48 Wrong default .det file name for old .det file format.
50 Revision 1.7 2001/02/13 16:53:35 nilsen
51 Fixed a but when trying to use GEANT4. Needed to replace
52 if(!((TGeant3*)gMC)) with if(!(dynamic_casst<TGeant3*>(gMC)))
53 because just casting gMC to be TGeant3* even when it realy is a TGeant3 pointer
54 did not result in a zero value. For AliITSv5asymm and AliITSv5symm, needed
55 to fix a bug in the initilizers and a bug in BuildGeometry. This is now done
56 in the same way as in AliITSv5.cxx.
58 Revision 1.6 2001/02/09 20:06:26 nilsen
59 Fixed bug in distructor. Can't distroy fixxed length arrays. Thanks Peter.
61 Revision 1.5 2001/02/09 00:05:31 nilsen
62 Added fMajor/MinorVersion variables and made other changes to better make
63 use of the new code changes in AliITSgeom related classes.
65 Revision 1.4 2001/02/02 23:57:29 nilsen
66 Added include file that are no londer included in AliITSgeom.h
68 Revision 1.3 2001/01/30 09:23:13 hristov
69 Streamers removed (R.Brun)
71 Revision 1.2 2000/11/30 11:13:11 barbera
72 Added changes suggested by Federico Carminati on nov, 30, 2000
74 Revision 1.1 2000/10/07 15:46:38 barbera
75 Version 5 of the geometry with asymmetric services
77 Revision 1.25 2000/10/05 20:50:00 nilsen
78 Now using root generated streamers.
80 Revision 1.14.4.12 2000/10/02 16:04:03 barbera
81 Forward declarations added
83 Revision 1.22 2000/07/10 16:07:19 fca
84 Release version of ITS code
86 Revision 1.14.4.4 2000/05/19 10:10:21 nilsen
87 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
89 Revision 1.14.4.3 2000/03/04 23:46:38 nilsen
90 Fixed up the comments/documentation.
92 Revision 1.14.4.2 2000/03/02 21:53:02 nilsen
93 To make it compatable with the changes in AliRun/AliModule.
95 Revision 1.14.4.1 2000/01/12 19:03:33 nilsen
96 This is the version of the files after the merging done in December 1999.
97 See the ReadMe110100.txt file for details
99 Revision 1.14 1999/10/22 08:16:49 fca
100 Correct destructors, thanks to I.Hrivnacova
102 Revision 1.13 1999/10/06 10:15:19 fca
103 Correct bug in allocation of layer name and add destructor
105 Revision 1.12 1999/10/05 08:05:09 fca
106 Minor corrections for uninitialised variables.
108 Revision 1.11 1999/09/29 09:24:20 fca
109 Introduction of the Copyright and cvs Log
113 ///////////////////////////////////////////////////////////////////////////////
115 // Inner Traking System version 5 with asymmetric services
116 // This class contains the base procedures for the Inner Tracking System
118 // Authors: R. Barbera, B. S. Nilsen.
120 // Created October 7 2000.
122 ///////////////////////////////////////////////////////////////////////////////
123 #include <iostream.h>
128 #include <TGeometry.h>
131 #include <TFile.h> // only required for Tracking function?
133 #include <TObjArray.h>
134 #include <TObjString.h>
135 #include <TClonesArray.h>
136 #include <TLorentzVector.h>
142 #include "AliGeant3.h"
143 #include "AliITShit.h"
144 #include "AliITSGeant3Geometry.h"
146 #include "AliITSv5asymm.h"
147 #include "AliITSgeom.h"
148 #include "AliITSgeomSPD.h"
149 #include "AliITSgeomSDD.h"
150 #include "AliITSgeomSSD.h"
152 ClassImp(AliITSv5asymm)
154 //_____________________________________________________________________________
155 AliITSv5asymm::AliITSv5asymm() {
156 ////////////////////////////////////////////////////////////////////////
157 // Standard default constructor for the ITS version 5.
158 ////////////////////////////////////////////////////////////////////////
164 fEuclidOut = kFALSE; // Don't write Euclide file
165 fGeomDetOut = kFALSE; // Don't write .det file
166 fGeomDetIn = kFALSE; // Don't Read .det file
167 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
168 fMajorVersion = IsVersion();
170 for(i=0;i<60;i++) fRead[i] = '\0';
171 for(i=0;i<60;i++) fWrite[i] = '\0';
172 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
174 //_____________________________________________________________________________
175 AliITSv5asymm::AliITSv5asymm(const char *name, const char *title) : AliITS(name, title){
176 /////////////////////////////////////////////////////////////////////////////
177 // Standard constructor for the ITS version 5 with symmetrical services.
178 /////////////////////////////////////////////////////////////////////////////
182 fIdName = new TString[fIdN];
189 fIdSens = new Int_t[fIdN];
190 for (i=0;i<fIdN;i++) fIdSens[i] = 0;
191 fEuclidOut = kFALSE; // Don't write Euclide file
192 fGeomDetOut = kFALSE; // Don't write .det file
193 fGeomDetIn = kFALSE; // Don't Read .det file
194 fGeomOldDetIn = kFALSE; // Don't Read old formatted .det file
195 fMajorVersion = IsVersion();
197 for(i=0;i<60;i++) fRead[i] = '\0';
198 for(i=0;i<60;i++) fWrite[i] = '\0';
200 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.tme";
201 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5asymm.euc";
202 strncpy(fEuclidGeomDet,"$ALICE_ROOT/Euclid/ITSgeometry_5.det",60);
203 strncpy(fRead,fEuclidGeomDet,60);
204 strncpy(fWrite,fEuclidGeomDet,60);
206 //____________________________________________________________________________
207 AliITSv5asymm::AliITSv5asymm(const AliITSv5asymm &source){
208 ////////////////////////////////////////////////////////////////////////
209 // Copy Constructor for ITS version 5.
210 ////////////////////////////////////////////////////////////////////////
211 if(&source == this) return;
212 Warning("Copy Constructor","Not allowed to copy AliITSv5asymm");
215 //_____________________________________________________________________________
216 AliITSv5asymm& AliITSv5asymm::operator=(const AliITSv5asymm &source){
217 ////////////////////////////////////////////////////////////////////////
218 // Assignment operator for the ITS version 5.
219 ////////////////////////////////////////////////////////////////////////
221 if(&source == this) return *this;
222 Warning("= operator","Not allowed to copy AliITSv5asymm");
226 //_____________________________________________________________________________
227 AliITSv5asymm::~AliITSv5asymm() {
228 ////////////////////////////////////////////////////////////////////////
229 // Standard destructor for the ITS version 5.
230 ////////////////////////////////////////////////////////////////////////
232 //_____________________________________________________________________________
233 void AliITSv5asymm::BuildGeometry(){
234 ////////////////////////////////////////////////////////////////////////
235 // Geometry builder for the ITS version 5.
236 ////////////////////////////////////////////////////////////////////////
238 // Build ITS TNODE geometry for event display using detailed geometry.
239 // This function builds a simple ITS geometry used by the ROOT macro
244 //const int kColorITSSPD=kRed;
245 //const int kColorITSSDD=kGreen;
246 const int kColorITSSSD=kBlue;
248 AliITSgeom *gm = this->GetITSgeom();
250 top=gAlice->GetGeometry()->GetNode("alice");
259 //TCanvas *c1 = new TCanvas("c1","ITS");
261 for(lay=1;lay<=2;lay++)
262 for(lad=1;lad<=gm->GetNladders(lay);lad++)
263 for(det=1;det<=gm->GetNdetectors(lay);det++){
265 box = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
268 cout << "EXCEPTION in box = new TBRIK" << endl;
271 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
272 gm->GetRotMatrix(lay,lad,det,rt);
273 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
274 for(i=0;i<9;i++) rtd[i] = rt[i];
276 rm = new TRotMatrix(name,name,rtd);
278 cout << "EXCEPTION in new TRotMatrix" << endl;
282 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
284 nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
286 cout << "EXCEPTION in new TNode" << endl;
289 nd->SetLineColor(kColorITSSSD);
293 for(lay=3;lay<=3;lay++)
294 for(lad=1;lad<=gm->GetNladders(lay);lad++)
295 for(det=1;det<=gm->GetNdetectors(lay);det++){
297 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
300 cout << "EXCEPTION in box = new TBRIK" << endl;
303 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
304 gm->GetRotMatrix(lay,lad,det,rt);
305 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
306 for(i=0;i<9;i++) rtd[i] = rt[i];
308 rm = new TRotMatrix(name,name,rtd);
310 cout << "EXCEPTION in new TRotMatrix" << endl;
314 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
316 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
318 cout << "EXCEPTION in new TNode" << endl;
321 nd->SetLineColor(kColorITSSSD);
325 for(lay=4;lay<=4;lay++)
326 for(lad=1;lad<=gm->GetNladders(lay);lad++)
327 for(det=1;det<=gm->GetNdetectors(lay);det++){
329 box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
332 cout << "EXCEPTION in box = new TBRIK" << endl;
335 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
336 gm->GetRotMatrix(lay,lad,det,rt);
337 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
338 for(i=0;i<9;i++) rtd[i] = rt[i];
340 rm = new TRotMatrix(name,name,rtd);
342 cout << "EXCEPTION in new TRotMatrix" << endl;
346 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
348 nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
350 cout << "EXCEPTION in new TNode" << endl;
353 nd->SetLineColor(kColorITSSSD);
356 for(lay=5;lay<=5;lay++)
357 for(lad=1;lad<=gm->GetNladders(lay);lad++)
358 for(det=1;det<=gm->GetNdetectors(lay);det++){
360 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
363 cout << "EXCEPTION in box = new TBRIK" << endl;
366 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
367 gm->GetRotMatrix(lay,lad,det,rt);
368 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
369 for(i=0;i<9;i++) rtd[i] = rt[i];
371 rm = new TRotMatrix(name,name,rtd);
373 cout << "EXCEPTION in new TRotMatrix" << endl;
377 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
379 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
381 cout << "EXCEPTION in new TNode" << endl;
384 nd->SetLineColor(kColorITSSSD);
388 for(lay=6;lay<=6;lay++)
389 for(lad=1;lad<=gm->GetNladders(lay);lad++)
390 for(det=1;det<=gm->GetNdetectors(lay);det++){
392 box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
395 cout << "EXCEPTION in box = new TBRIK" << endl;
399 gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
400 gm->GetRotMatrix(lay,lad,det,rt);
401 //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
402 for(i=0;i<9;i++) rtd[i] = rt[i];
404 rm = new TRotMatrix(name,name,rtd);
406 cout << "EXCEPTION in new TRotMatrix" << endl;
410 //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
412 nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
414 cout << "EXCEPTION in new TNode" << endl;
417 nd->SetLineColor(kColorITSSSD);
423 //_____________________________________________________________________________
424 void AliITSv5asymm::CreateMaterials(){
425 ////////////////////////////////////////////////////////////////////////
426 // Read a file containing the materials for the ITS version 5.
427 ////////////////////////////////////////////////////////////////////////
430 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
432 FILE *file = fopen(filtmp,"r");
435 ReadEuclidMedia(filtmp);
437 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",filtmp);
441 //_____________________________________________________________________________
442 void AliITSv5asymm::CreateGeometry(){
443 //////////////////////////////////////////////////////////////////////
444 // This is the geometry used for the ITS Pre-TDR and comes from an
445 // Euclid to Geant conversion. The only difference
446 // is in the details of the ITS supports. The detectors elements,
447 // detector numbering, and local and global reference frames are shown in
448 // the following figures.
451 <img src="picts/ITS/its1+2_convention_front_5.gif">
454 <font size=+2 color=red>
455 <p>This shows the front view of the SPDs.
458 <img src="picts/ITS/its1+2_convention_side_5.gif">
461 <font size=+2 color=red>
462 <p>This shows the perspective view of the SPDs.
464 <img src="picts/ITS/its1+2_tree.gif">
467 <font size=+2 color=red>
468 <p>This shows the geometry Tree for the SPDs.
473 <img src="picts/ITS/its3+4_convention_front_5.gif">
476 <font size=+2 color=red>
477 <p>This shows the front view of the SDDs.
480 <img src="picts/ITS/its3+4_convention_side_5.gif">
483 <font size=+2 color=red>
484 <p>This shows the perspective view of the SDDs.
486 <img src="picts/ITS/its3+4_tree.gif">
489 <font size=+2 color=red>
490 <p>This shows the geometry Tree for the SDDs.
495 <img src="picts/ITS/its5+6_convention_front_5.gif">
498 <font size=+2 color=red>
499 <p>This shows the front view of the SSDs.
502 <img src="picts/ITS/its5+6_convention_side_5.gif">
505 <font size=+2 color=red>
506 <p>This shows the perspective view of the SSDs.
509 <img src="picts/ITS/its5+6_tree.gif">
512 <font size=+2 color=red>
513 <p>This shows the geometry Tree for the SSDs.
518 <img src="picts/ITS/its_layer1-6_2.gif">
521 <font size=+2 color=red>
522 <p>This shows the front view of the whole ITS..
526 <img src="picts/ITS/its_layer1-6_1.gif">
529 <font size=+2 color=red>
530 <p>This shows the perspective view of the whole ITS..
534 <img src="picts/ITS/its1-6_tree.gif">
537 <font size=+2 color=red>
538 <p>This shows the geometry Tree for the whole ITS.
545 // Here are shown the details of the ITS support cones and services.
546 // First is a GEANT tree showing the organization of all of the volumes
547 // that make up the ITS supports and services.
550 <img src="picts/ITS/supports_tree.gif">
553 // What follows are a number of figures showing what these support
554 // structures look like.
558 <img src="picts/ITS/supports_3.gif">
561 <font size=+2 color=red>
562 <p>This shows the geometry of the supports for the Drift and Strip layers only.
566 <img src="picts/ITS/supports_2.gif">
569 <font size=+2 color=red>
570 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
574 <img src="picts/ITS/supports_1.gif">
577 <font size=+2 color=red>
578 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
582 <img src="picts/ITS/suppssd.gif">
585 <font size=+2 color=red>
586 <p>This shows the geometry for the Strip layers supports.
590 <img src="picts/ITS/suppsdd.gif">
593 <font size=+2 color=red>
594 <p>This shows the geometry for the Drift layers supports.
600 // Read a file containing the geometry for the ITS version 5.
601 ////////////////////////////////////////////////////////////////////////
605 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
606 FILE *file = fopen(filtmp,"r");
610 if(fDebug) cout << ClassName() << ": Ready to read Euclid geometry file" << endl;
611 ReadEuclid(fEuclidGeometry.Data(),topvol);
612 if(fDebug) cout << ClassName() << ": Read in euclid geometries" << endl;
614 Fatal("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
615 fEuclidGeometry.Data());
618 // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
621 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
623 // Outputs the geometry tree in the EUCLID/CAD format if requested to do so
626 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
627 } // end if (fEuclidOut)
629 if(fDebug) cout << ClassName() << ": finished with euclid geometrys" << endl;
632 //______________________________________________________________________
633 void AliITSv5asymm::ReadOldGeometry(const char *filename){
634 // read in the file containing the transformations for the active
635 // volumes for the ITS version 5. This is expected to be in a file
636 // ending in .det. This geometry is kept in the AliITSgeom class.
641 filtmp = gSystem->ExpandPathName(filename);
642 size = strlen(filtmp);
643 if(size>4 && fGeomDetIn){
644 filtmp[size-3] = 'd'; // change from .euc to .det
645 filtmp[size-2] = 'e';
646 filtmp[size-1] = 't';
647 file = fopen(filtmp,"r");
648 if(file){ // if file exists use it to fill AliITSgeom structure.
650 fITSgeom = new AliITSgeom(filtmp);
651 fITSgeom->DefineShapes(3); // if fShape isn't defined define it.
652 // Now define the detector types/shapes.
653 fITSgeom->ReSetShape(kSPD,(TObject *) new AliITSgeomSPD300());
654 fITSgeom->ReSetShape(kSDD,(TObject *) new AliITSgeomSDD300());
655 fITSgeom->ReSetShape(kSSD,(TObject *) new AliITSgeomSSD());
658 // fill AliITSgeom structure from geant structure just filled above
663 //______________________________________________________________________
664 void AliITSv5asymm::InitAliITSgeom(){
665 // Based on the geometry tree defined in Geant 3.21, this
666 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
668 if(gMC->IsA()!=AliGeant3::Class()) {
669 Error("InitAliITSgeom",
670 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
673 if(fDebug) cout << ClassName()
674 << ": Reading Geometry transformation directly from Geant 3." << endl;
675 const Int_t nlayers = 6;
676 const Int_t ndeep = 7;
677 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
678 Int_t nlad[nlayers],ndet[nlayers];
680 Float_t par[20],att[20];
681 Int_t npar,natt,idshape,imat,imed;
682 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
683 Int_t mod,lay,lad,det,i,j,k;
684 char *names[nlayers][ndeep] = {
685 {"ALIC","ITSV","ITSD","IT12","I132","I186","ITS1"}, // lay=1
686 {"ALIC","ITSV","ITSD","IT12","I132","I131","ITS2"}, // lay=2
687 {"ALIC","ITSV","ITSD","IT34","I004","I302","ITS3"}, // lay=3
688 {"ALIC","ITSV","ITSD","IT34","I005","I402","ITS4"}, // lay=4
689 {"ALIC","ITSV","ITSD","IT56","I565","I562","ITS5"}, // lay=5
690 {"ALIC","ITSV","ITSD","IT56","I569","I566","ITS6"}};// lay=6
691 Int_t itsGeomTreeCopys[nlayers][ndeep] = {{1,1,1,1,10, 2,4}, // lay=1
692 {1,1,1,1,10, 4,4}, // lay=2
693 {1,1,1,1,14, 6,1}, // lay=3
694 {1,1,1,1,22, 8,1}, // lay=4
695 {1,1,1,1,34,23,1}, // lay=5
696 {1,1,1,1,38,26,1}};// lay=6
698 // Sorry, but this is not very pritty code. It should be replaced
699 // at some point with a version that can search through the geometry
701 if(fDebug) cout << ClassName()
702 << ": Reading Geometry informaton from Geant3 common blocks" << endl;
703 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
704 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
705 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
707 for(i=0;i<nlayers;i++){
709 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
710 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
714 if(fITSgeom!=0) delete fITSgeom;
715 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
716 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=23;ndet[5]=26;
717 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
719 for(lay=1;lay<=nlayers;lay++){
720 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
721 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
723 case 1: case 2: // layers 1 and 2 are a bit special
725 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
727 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
730 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
733 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
735 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
736 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
737 if(fMinorVersion==1){
738 fITSgeom->ReSetShape(kSPD,
739 new AliITSgeomSPD300());
740 } else if(fMinorVersion==2){
741 fITSgeom->ReSetShape(kSPD,
742 new AliITSgeomSPD300());
743 }else if(fMinorVersion==3){
744 fITSgeom->ReSetShape(kSPD,
745 new AliITSgeomSPD425Long());
747 fITSgeom->ReSetShape(kSPD,
748 new AliITSgeomSPD300());
754 case 3: case 4: case 5: case 6: // layers 3-6
756 for(lad=1;lad<=itsGeomTreeCopys[lay-1][4];lad++){
758 for(det=1;det<=itsGeomTreeCopys[lay-1][5];det++){
761 ig->GetGeometry(7,lnam,lnum,t,r,idshape,npar,natt,
765 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
766 if(!(fITSgeom->IsShapeDefined(kSDD)))
767 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD300());
770 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
771 if(!(fITSgeom->IsShapeDefined(kSSD)))
772 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD175());
782 //_____________________________________________________________________________
783 void AliITSv5asymm::Init(){
784 ////////////////////////////////////////////////////////////////////////
785 // Initialise the ITS after it has been created.
786 ////////////////////////////////////////////////////////////////////////
790 cout << endl << ClassName() << ": ";
791 for(i=0;i<28;i++) cout << "*";cout << " ITSv5_Init ";
792 for(i=0;i<27;i++) cout << "*";cout << endl;
795 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
796 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
797 if(fITSgeom!=0) delete fITSgeom;
798 fITSgeom = new AliITSgeom();
799 if(fGeomDetIn && !fGeomOldDetIn) fITSgeom->ReadNewFile(fRead);
800 if(fGeomDetIn && fGeomOldDetIn) this->ReadOldGeometry(fRead);
802 if(!fGeomDetIn) this->InitAliITSgeom();
803 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
807 cout << ClassName() << ": ";
808 for(i=0;i<72;i++) cout << "*";
812 //_____________________________________________________________________________
813 void AliITSv5asymm::StepManager(){
814 ////////////////////////////////////////////////////////////////////////
815 // Called for every step in the ITS, then calles the AliITShit class
816 // creator with the information to be recoreded about that hit.
817 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
818 // printing of information to a file which can be used to create a .det
819 // file read in by the routine CreateGeometry(). If set to 0 or any other
820 // value except 1, the default behavior, then no such file is created nor
821 // it the extra variables and the like used in the printing allocated.
822 ////////////////////////////////////////////////////////////////////////
827 TLorentzVector position, momentum;
828 TClonesArray &lhits = *fHits;
832 if(gMC->IsTrackInside()) vol[3] += 1;
833 if(gMC->IsTrackEntering()) vol[3] += 2;
834 if(gMC->IsTrackExiting()) vol[3] += 4;
835 if(gMC->IsTrackOut()) vol[3] += 8;
836 if(gMC->IsTrackDisappeared()) vol[3] += 16;
837 if(gMC->IsTrackStop()) vol[3] += 32;
838 if(gMC->IsTrackAlive()) vol[3] += 64;
840 // Fill hit structure.
841 if(!(gMC->TrackCharge())) return;
843 // Only entering charged tracks
844 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
846 id = gMC->CurrentVolOffID(0,copy);
847 //detector copy in the ladder = 1<->4 (ITS1)
849 gMC->CurrentVolOffID(1,copy1);
850 //ladder copy in the module = 1<->2 (I186)
851 gMC->CurrentVolOffID(2,copy2);
852 //module copy in the layer = 1<->10 (I132)
853 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
854 } else if(id == fIdSens[1]){
856 id = gMC->CurrentVolOffID(0,copy);
857 //detector copy in the ladder = 1<->4 (ITS2)
859 gMC->CurrentVolOffID(1,copy1);
860 //ladder copy in the module = 1<->4 (I131)
861 gMC->CurrentVolOffID(2,copy2);
862 //module copy in the layer = 1<->10 (I132)
863 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
864 } else if(id == fIdSens[2]){
866 id = gMC->CurrentVolOffID(1,copy);
867 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
869 id = gMC->CurrentVolOffID(2,copy);
870 //ladder copy in the layer = 1<->12 (I316)
872 } else if(id == fIdSens[3]){
874 id = gMC->CurrentVolOffID(1,copy);
875 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
877 id = gMC->CurrentVolOffID(2,copy);
878 //ladder copy in the layer = 1<->22 (I417)
880 }else if(id == fIdSens[4]){
882 id = gMC->CurrentVolOffID(1,copy);
883 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
885 id = gMC->CurrentVolOffID(2,copy);
886 //ladder copy in the layer = 1<->34 (I565)
888 }else if(id == fIdSens[5]){
890 id = gMC->CurrentVolOffID(1,copy);
891 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
893 id = gMC->CurrentVolOffID(2,copy);
894 //ladder copy in the layer = 1<->38 (I569)
897 return; // not an ITS volume?
898 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
900 gMC->TrackPosition(position);
901 gMC->TrackMomentum(momentum);
909 hits[7]=gMC->TrackTime();
910 // Fill hit structure with this new hit.
911 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);