1 #ifndef ALIITSINITGEOMETRY_H
2 #define ALIITSINITGEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 /////////////////////////////////////////////////////////////////////
11 // Class to inilize AliITSgeom and the like for both simulation
12 // and reconstruction.
13 /////////////////////////////////////////////////////////////////////
17 #include "AliITSgeom.h"
20 kvtest=-1,kvDefault=0,
21 kvSPD02=1,kvSDD03=2,kvSSD03=3,kvITS04=4,
22 kvPPRcourseasymm=6,kvPPRasymmFMD=10,
23 kv11=11,kv11Hybrid=110
30 class AliITSInitGeometry : public TObject{
33 AliITSInitGeometry();//Default Constructor
34 AliITSInitGeometry(AliITSVersion_t version,
35 Int_t minorversion=2);//Standard Constructor
36 //virtual ~AliITSInitGeometry(); // Destructor
38 // Create and initialize geometry from TGeo
39 AliITSgeom* CreateAliITSgeom();
40 AliITSgeom* CreateAliITSgeom(Int_t major,Int_t minor);
41 Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize geometry from gGeoManager
42 // Getters and Setters
43 // Getters and Setters
44 void SetVersion(AliITSVersion_t maj,Int_t min) {// Set Major and Minor versions
45 fMajorVersion=maj;fMinorVersion=min;}
46 TString GetGeometryName()const {return fName;}// Return geometry name
47 void SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name
48 Int_t GetMajorVersion()const {return (Int_t)fMajorVersion;} // Return geometry major version
49 Int_t GetMinorVersion()const{return fMinorVersion;}// Return geometry minor version
50 Bool_t GetTiming()const{return fTiming;} // return routine timing flag
51 void SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on)
52 Bool_t GetSegGeom()const{return fSegGeom;} // return flag indecating the use of AliITSsegmentation or AliITSgeomS?D class in fShape.
53 void SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}// Set the use of AliITSsegmentation class' instead of AliITSgeomS?D class in fShape
54 Bool_t GetDecoding()const{return fDecode;}// Return flag indecating wether to use new/old decoding
55 void SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}// Set flag to use new/old decoding
56 // Set debug level. debug=0 no debug info outputted.
57 void SetDebug(Int_t debug=0){fDebug=debug;};
59 Int_t GetDebug()const{return fDebug;};
60 // Decode module number into old layer, ladder, and detector numbers
61 void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
62 // find module number by layer, and copy numbers
63 void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,
64 Int_t cpn1,Int_t cpn2) const;
65 // Given module number, find copy numbers.
66 void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
67 // fills the string str with the major and minor version number
68 Bool_t WriteVersionString(Char_t *str,Int_t length,
69 AliITSVersion_t maj,Int_t min,
70 const Char_t *cvsDate,const Char_t *cvsRev)const;
71 // decodes the string str with the major and minor version number
72 Bool_t ReadVersionString(const Char_t *str,Int_t length,
73 AliITSVersion_t &maj,Int_t &min,TDatime &dt)const;
75 static Bool_t SPDIsTGeoNative() {return !fgkOldSPDbarrel;}
76 static Bool_t SDDIsTGeoNative() {return !fgkOldSDDbarrel;}
77 static Bool_t SSDIsTGeoNative() {return !fgkOldSSDbarrel;}
79 static Bool_t SDDconeIsTGeoNative() {return ! fgkOldSDDcone;}
80 static Bool_t SSDconeIsTGeoNative() {return ! fgkOldSSDcone;}
81 static Bool_t SPDshieldIsTGeoNative() {return ! fgkOldSPDshield;}
82 static Bool_t SDDshieldIsTGeoNative() {return ! fgkOldSDDshield; }
83 static Bool_t SSDshieldIsTGeoNative() {return ! fgkOldSSDshield;}
84 static Bool_t ServicesAreTGeoNative() {return ! fgkOldServices;}
85 static Bool_t SupportIsTGeoNative() {return ! fgkOldSupports;}
88 // Decode module number into old layer, ladder, and detector numbers
89 void DecodeDetectorLayersvtest2(Int_t mod,Int_t &lay,
90 Int_t &lad,Int_t &det) const {
91 lay=mod+1;lad=det=1;};
92 // find module number by layer, and copy numbers
93 void DecodeDetectorvtest2(Int_t &mod,Int_t lay,Int_t cpn0,
94 Int_t cpn1,Int_t cpn2) const{
95 mod=lay-1;cpn0=cpn1=cpn2=1;};
96 // Given module number, find copy numbers.
97 void RecodeDetectorvtest2(Int_t mod,Int_t &cpn0,Int_t &cpn1,
99 mod=cpn0=cpn1=cpn2=1;};
100 // Decode module number into old layer, ladder, and detector numbers
101 void DecodeDetectorLayersvSPD02(Int_t mod,Int_t &lay,
102 Int_t &lad,Int_t &det) const;
103 // find module number by layer, and copy numbers
104 void DecodeDetectorvSPD02(Int_t &mod,Int_t lay,Int_t cpn0,
105 Int_t cpn1,Int_t cpn2) const;
106 // Given module number, find copy numbers.
107 void RecodeDetectorvSPD02(Int_t mod,Int_t &cpn0,Int_t &cpn1,
109 // Decode module number into old layer, ladder, and detector numbers
110 void DecodeDetectorLayersvSDD03(Int_t mod,Int_t &lay,
111 Int_t &lad,Int_t &det) const;
112 // find module number by layer, and copy numbers
113 void DecodeDetectorvSDD03(Int_t &mod,Int_t lay,Int_t cpn0,
114 Int_t cpn1,Int_t cpn2) const;
115 // Given module number, find copy numbers.
116 void RecodeDetectorvSDD03(Int_t mod,Int_t &cpn0,Int_t &cpn1,
118 // Decode module number into old layer, ladder, and detector numbers
119 void DecodeDetectorLayersvSSD03(Int_t mod,Int_t &lay,
120 Int_t &lad,Int_t &det) const;
121 // find module number by layer, and copy numbers
122 void DecodeDetectorvSSD03(Int_t &mod,Int_t lay,Int_t cpn0,
123 Int_t cpn1,Int_t cpn2) const;
124 // Given module number, find copy numbers.
125 void RecodeDetectorvSSD03(Int_t mod,Int_t &cpn0,Int_t &cpn1,
127 // Decode module number into old layer, ladder, and detector numbers
128 void DecodeDetectorLayersvITS04(Int_t mod,Int_t &lay,
129 Int_t &lad,Int_t &det) const;
130 // find module number by layer, and copy numbers
131 void DecodeDetectorvITS04(Int_t &mod,Int_t lay,Int_t cpn0,
132 Int_t cpn1,Int_t cpn2) const;
133 // Given module number, find copy numbers.
134 void RecodeDetectorvITS04(Int_t mod,Int_t &cpn0,Int_t &cpn1,
136 // Decode module number into old layer, ladder, and detector numbers
137 void DecodeDetectorLayersvPPRcourseasymm(Int_t mod,Int_t &lay,
138 Int_t &lad,Int_t &det) const {
139 lay=lad=det=mod;/*Dummy*/};
140 // find module number by layer, and copy numbers
141 void DecodeDetectorvPPRcourseasymm(Int_t &mod,Int_t lay,Int_t cpn0,
142 Int_t cpn1,Int_t cpn2) const{
143 mod=lay=cpn0=cpn1=cpn2;/*Dummy*/};
144 // Given module number, find copy numbers.
145 void RecodeDetectorvPPRcourseasymm(Int_t mod,Int_t &cpn0,Int_t &cpn1,
147 cpn0=cpn1=cpn2=mod;/*Dummy*/};
148 // Decode module number into old layer, ladder, and detector numbers
149 void DecodeDetectorLayersvPPRasymmFMD(Int_t mod,Int_t &lay,
150 Int_t &lad,Int_t &det);
151 // find module number by layer, and copy numbers
152 void DecodeDetectorvPPRasymmFMD(Int_t &mod,Int_t lay,Int_t cpn0,
153 Int_t cpn1,Int_t cpn2) const;
154 // Given module number, find copy numbers.
155 void RecodeDetectorvPPRasymmFMD(Int_t mod,Int_t &cpn0,Int_t &cpn1,
157 // Decode module number into old layer, ladder, and detector numbers
158 void DecodeDetectorLayersv11(Int_t mod,Int_t &lay,
159 Int_t &lad,Int_t &det)const{
161 // find module number by layer, and copy numbers
162 void DecodeDetectorv11(Int_t &mod,Int_t lay,Int_t cpn0,
163 Int_t cpn1,Int_t cpn2) const{
164 mod=lay=cpn0=cpn1=cpn2;};
165 // Given module number, find copy numbers.
166 void RecodeDetectorv11(Int_t mod,Int_t &cpn0,Int_t &cpn1,
168 cpn0=cpn1=cpn2=mod;};
169 // Decode module number into old layer, ladder, and detector numbers
170 void DecodeDetectorv11Hybrid(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,
172 // find module number by layer, and copy numbers
173 void RecodeDetectorv11Hybrid(Int_t mod,Int_t &cpn0,Int_t &cpn1,
175 // Given module number, find copy numbers.
176 void DecodeDetectorLayersv11Hybrid(Int_t mod,Int_t &lay,Int_t &lad,
179 // Virtual MC code reproduction
180 Bool_t InitAliITSgeomSPD02(AliITSgeom *geom);
181 Bool_t InitAliITSgeomSDD03(AliITSgeom *geom);
182 Bool_t InitAliITSgeomSSD03(AliITSgeom *geom);
183 Bool_t InitAliITSgeomITS04(AliITSgeom *geom) const;
184 Bool_t InitAliITSgeomtest2(AliITSgeom *geom);
185 Bool_t InitAliITSgeomPPRasymmFMD(AliITSgeom *geom);
186 Bool_t InitAliITSgeomV11Hybrid(AliITSgeom *geom);
187 Bool_t InitAliITSgeomV11(AliITSgeom *geom);
188 Bool_t InitGeomShapePPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
189 TArrayD &shapePar,AliITSgeom *geom);
190 Bool_t InitSegmentationPPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
191 TArrayD &shapePar,AliITSgeom *geom);
192 Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat);
193 Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par);
194 void TransposeTGeoHMatrix(TGeoHMatrix *m) const;
196 TString fName; // Geometry name
197 Int_t fMinorVersion; // Geometry minor version
198 AliITSVersion_t fMajorVersion; // Geometry swich value
199 Bool_t fTiming; // Flag to start inilization timing
200 Bool_t fSegGeom; // Flag to switch between the old use of
201 // AliITSgeomS?D class, or AliITSsegmentation
202 // class in fShape of AliITSgeom class.
203 Bool_t fDecode; // Flag for new/old decoding
204 Int_t fDebug; // Debug flag
206 static const Bool_t fgkOldSPDbarrel; // use old geo for SPD ?
207 static const Bool_t fgkOldSDDbarrel; // use old geo for SDD ?
208 static const Bool_t fgkOldSSDbarrel; // use old geo for SSD ?
209 static const Bool_t fgkOldSDDcone; // use old geo for SDD cone ?
210 static const Bool_t fgkOldSSDcone; // use old geo for SSD cone?
211 static const Bool_t fgkOldSPDshield; // use old geo for SPD shield ?
212 static const Bool_t fgkOldSDDshield; // use old geo for SDD shield ?
213 static const Bool_t fgkOldSSDshield; // use old geo for SDD shield ?
214 static const Bool_t fgkOldServices; // use old geo for services ?
215 static const Bool_t fgkOldSupports; // use old geo for supports ?
217 ClassDef(AliITSInitGeometry,0) // create/Init AliITSgeom
218 // 0 in ClassDef indicates that this class will not be "saved" in a file.