]>
Commit | Line | Data |
---|---|---|
b79e4bc3 | 1 | #ifndef ALIITSGEOM_H |
2 | #define ALIITSGEOM_H | |
3da30618 | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
58005f18 | 8 | ///////////////////////////////////////////////////////////////////////// |
9 | // ITS geometry manipulation routines. | |
10 | // Created April 15 1999. | |
11 | // version: 0.0.0 | |
12 | // By: Bjorn S. Nilsen | |
13 | // | |
14 | // A package of geometry routines to do transformations between | |
15 | // local, detector active area, and ALICE global coordinate system in such | |
16 | // a way as to allow for detector alignment studies and the like. All of | |
17 | // the information needed to do the coordinate transformation are kept in | |
18 | // a specialized structure for ease of implementation. | |
19 | ///////////////////////////////////////////////////////////////////////// | |
4ae5bbc4 | 20 | #include <Riostream.h> |
85f1e34a | 21 | #include <TObject.h> |
e8189707 | 22 | #include <TObjArray.h> |
23 | #include <TVector.h> | |
023ae34b | 24 | #include <TString.h> |
25 | #include <TArrayI.h> | |
3010c308 | 26 | #include <TMath.h> |
012f0f4c | 27 | // |
269f57ed | 28 | #include "AliITSgeomMatrix.h" |
58005f18 | 29 | |
22e9f252 | 30 | typedef enum {kND=-1,kSPD=0, kSDD=1, kSSD=2, kSSDp=3,kSDDp=4} AliITSDetector; |
58005f18 | 31 | |
32 | //_______________________________________________________________________ | |
33 | ||
34 | class AliITSgeom : public TObject { | |
b79e4bc3 | 35 | |
58005f18 | 36 | public: |
269f57ed | 37 | AliITSgeom(); // Default constructor |
38 | AliITSgeom(const char *filename); // Constructor | |
023ae34b | 39 | AliITSgeom(Int_t itype,Int_t nlayers,const Int_t *nlads,const Int_t *ndets, |
40 | Int_t nmods); // Constructor | |
e56160b8 | 41 | AliITSgeom(const AliITSgeom &source); // Copy constructor |
42 | AliITSgeom& operator=(const AliITSgeom &source);// = operator | |
3f38f7af | 43 | virtual ~AliITSgeom(); // Default destructor |
023ae34b | 44 | // Zero and reinitilizes this class. |
45 | void Init(Int_t itype,Int_t nlayers,const Int_t *nlads, | |
46 | const Int_t *ndets,Int_t mods); | |
85f1e34a | 47 | // this function allocates a AliITSgeomMatrix for a particular module. |
023ae34b | 48 | void CreateMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det, |
49 | AliITSDetector idet,const Double_t tran[3], | |
50 | const Double_t rot[10]); | |
8253cd9a | 51 | void ReadNewFile(const char *filename); // Constructor for new format. |
5cf690c1 | 52 | void WriteNewFile(const char *filename)const; // Output for new format. |
023ae34b | 53 | // Getters |
269f57ed | 54 | Int_t GetTransformationType() const {return fTrans;} |
023ae34b | 55 | // |
85f1e34a | 56 | // returns kTRUE if the transformation defined by this class is |
57 | // for Global GEANT coordinate system to the local GEANT coordinate system | |
8253cd9a | 58 | // of the detector. These are the transformation used by GEANT. |
269f57ed | 59 | Bool_t IsGeantToGeant() const {return (fTrans == 0);} |
85f1e34a | 60 | // returns kTRUE if the transformation defined by this class is |
61 | // for Global GEANT coordinate system to the local "Tracking" coordinate | |
8253cd9a | 62 | // system of the detector. These are the transformation used by the |
63 | // Tracking code. | |
269f57ed | 64 | Bool_t IsGeantToTracking() const {return ((fTrans&&0xfffe)!= 0);} |
85f1e34a | 65 | // returns kTRUE if the transformation defined by this class is |
66 | // for Global GEANT coordinate system to the local GEANT coordinate system | |
67 | // of the detector but may have been displaced by some typically small | |
68 | // amount. These are modified transformation similar to that used by GEANT. | |
269f57ed | 69 | Bool_t IsGeantToDisplaced() const {return ((fTrans&&0xfffd)!= 0);} |
8253cd9a | 70 | // returns kTRUE if the shape defined by ishape has been defined in this |
71 | // set of transformations. Typical values of ishape are kSPD, kSDD, kSSD, | |
023ae34b | 72 | // kSSD2. |
85f1e34a | 73 | Bool_t IsShapeDefined(Int_t ishape)const { |
023ae34b | 74 | return ((fShape.At(ishape))!=0);} |
75 | // | |
8253cd9a | 76 | // This function returns a pointer to the particular AliITSgeomMatrix |
77 | // class for a specific module index. | |
012f0f4c | 78 | AliITSgeomMatrix *GetGeomMatrix(Int_t index){if(index<fGm.GetSize()&& |
79 | index>=0) | |
80 | return (AliITSgeomMatrix*)(fGm.At(index));else | |
81 | Error("GetGeomMatrix","index=%d<0||>=GetSize()=%d", | |
82 | index,fGm.GetSize());return 0;} | |
83 | AliITSgeomMatrix *GetGeomMatrix(Int_t index)const{if(index<fGm.GetSize() | |
84 | &&index>=0) | |
85 | return (AliITSgeomMatrix*)(fGm.At(index));else | |
86 | Error("GetGeomMatrix","index=%d<0||>=GetSize()=%d", | |
87 | index,fGm.GetSize());return 0;} | |
023ae34b | 88 | // This function find and return the number of detector types only. |
5cf690c1 | 89 | Int_t GetNDetTypes()const{Int_t max;return GetNDetTypes(max);}; |
023ae34b | 90 | // This function find and return the number of detector types and the |
91 | // maximum det type value. | |
5cf690c1 | 92 | Int_t GetNDetTypes(Int_t &max)const; |
023ae34b | 93 | // This function finds and return the number of detector types and the |
94 | // and the number of each type in the TArrayI and their types. | |
5cf690c1 | 95 | Int_t GetNDetTypes(TArrayI &maxs,AliITSDetector *types)const; |
269f57ed | 96 | // This function returns the number of detectors/ladder for a give |
97 | // layer. In particular it returns fNdet[layer-1]. | |
c183cf7d | 98 | Int_t GetNdetectors(Int_t lay) const {return fNdet[lay-1];} |
269f57ed | 99 | // This function returns the number of ladders for a give layer. In |
100 | // particular it returns fNlad[layer-1]. | |
7f6ab649 | 101 | Int_t GetNladders(Int_t lay) const {return fNlad[lay-1];}; |
269f57ed | 102 | // This function returns the number of layers defined in the ITS |
103 | // geometry. In particular it returns fNlayers. | |
104 | Int_t GetNlayers() const {return fNlayers;} | |
5cf690c1 | 105 | Int_t GetModuleIndex(Int_t lay,Int_t lad,Int_t det)const; |
269f57ed | 106 | // This function returns the module index number given the layer, |
107 | // ladder and detector numbers put into the array id[3]. | |
5cf690c1 | 108 | Int_t GetModuleIndex(const Int_t *id)const{ |
023ae34b | 109 | return GetModuleIndex(id[0],id[1],id[2]);} |
5cf690c1 | 110 | void GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det)const; |
cd71de57 | 111 | // Returns the detector type |
5cf690c1 | 112 | //Int_t GetModuleType(Int_t index)const{ |
113 | // return GetGeomMatrix(index)->GetDetectorIndex();} | |
114 | AliITSDetector GetModuleType(Int_t index)const{ | |
115 | return (AliITSDetector)(GetGeomMatrix(index)->GetDetectorIndex());} | |
3f38f7af | 116 | // Returns the detector type as a string |
5cf690c1 | 117 | const char * GetModuleTypeName(Int_t index)const{ |
023ae34b | 118 | return GetDetectorTypeName(GetModuleType(index));} |
119 | // Returns the detector type as a string | |
5cf690c1 | 120 | const char * GetDetectorTypeName(Int_t index)const{switch(index) { |
023ae34b | 121 | case kSPD : return "kSPD" ; case kSDD : return "kSDD" ; |
122 | case kSSD : return "kSSD" ; case kSSDp: return "kSSDp"; | |
123 | case kSDDp: return "kSDDp"; default : return "Undefined";};} | |
124 | // | |
5cf690c1 | 125 | Int_t GetStartDet(Int_t dtype )const; |
126 | Int_t GetLastDet(Int_t dtype)const; | |
269f57ed | 127 | // Returns the starting module index number for SPD detector, |
128 | // assuming the modules are placed in the "standard" cylindrical | |
129 | // ITS structure. | |
5cf690c1 | 130 | Int_t GetStartSPD()const{return GetStartDet(kSPD);} |
269f57ed | 131 | // Returns the ending module index number for SPD detector, |
132 | // assuming the modules are placed in the "standard" cylindrical | |
133 | // ITS structure. | |
5cf690c1 | 134 | Int_t GetLastSPD()const{return GetLastDet(kSPD);} |
269f57ed | 135 | // Returns the starting module index number for SDD detector, |
136 | // assuming the modules are placed in the "standard" cylindrical | |
137 | // ITS structure. | |
5cf690c1 | 138 | Int_t GetStartSDD()const{return GetStartDet(kSDD);} |
269f57ed | 139 | // Returns the ending module index number for SDD detector, |
140 | // assuming the modules are placed in the "standard" cylindrical | |
141 | // ITS structure. | |
5cf690c1 | 142 | Int_t GetLastSDD()const{return GetLastDet(kSDD);} |
269f57ed | 143 | // Returns the starting module index number for SSD detector, |
144 | // assuming the modules are placed in the "standard" cylindrical | |
145 | // ITS structure. | |
5cf690c1 | 146 | Int_t GetStartSSD()const{return GetStartDet(kSSD);} |
269f57ed | 147 | // Returns the ending module index number for SSD detector, |
148 | // assuming the modules are placed in the "standard" cylindrical | |
149 | // ITS structure. | |
5cf690c1 | 150 | Int_t GetLastSSD()const{return GetLastDet(kSSD);} |
269f57ed | 151 | // Returns the last module index number. |
85f1e34a | 152 | Int_t GetIndexMax() const {return fNmodules;} |
023ae34b | 153 | // |
269f57ed | 154 | // This function returns the rotation angles for a give module |
155 | // in the Double point array ang[3]. The angles are in radians | |
5cf690c1 | 156 | void GetAngles(Int_t index,Double_t *ang)const{ |
023ae34b | 157 | GetGeomMatrix(index)->GetAngles(ang);} |
269f57ed | 158 | // This function returns the rotation angles for a give module |
159 | // in the three floating point variables provided. rx = frx, | |
160 | // fy = fry, rz = frz. The angles are in radians | |
5cf690c1 | 161 | void GetAngles(Int_t index,Float_t &rx,Float_t &ry,Float_t &rz)const{ |
023ae34b | 162 | Double_t a[3];GetAngles(index,a);rx = a[0];ry = a[1];rz = a[2];} |
269f57ed | 163 | // This function returns the rotation angles for a give detector on |
164 | // a give ladder in a give layer in the three floating point variables | |
165 | // provided. rx = frx, fy = fry, rz = frz. The angles are in radians | |
85f1e34a | 166 | void GetAngles(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 167 | Float_t &rx,Float_t &ry,Float_t &rz)const{ |
023ae34b | 168 | GetAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);} |
169 | // | |
269f57ed | 170 | // This function returns the 6 GEANT rotation angles for a give |
171 | // module in the double point array ang[3]. The angles are in degrees | |
5cf690c1 | 172 | void GetGeantAngles(Int_t index,Double_t *ang)const{ |
8253cd9a | 173 | GetGeomMatrix(index)->SixAnglesFromMatrix(ang);} |
023ae34b | 174 | // |
269f57ed | 175 | // This function returns the Cartesian translation for a give |
176 | // module in the Double array t[3]. The units are | |
177 | // those of the Monte Carlo, generally cm. | |
5cf690c1 | 178 | void GetTrans(Int_t index,Double_t *t)const{ |
023ae34b | 179 | GetGeomMatrix(index)->GetTranslation(t);} |
269f57ed | 180 | // This function returns the Cartesian translation for a give |
181 | // module index in the three floating point variables provided. | |
182 | // x = fx0, y = fy0, z = fz0. The units are those of the Mont | |
183 | // Carlo, generally cm. | |
5cf690c1 | 184 | void GetTrans(Int_t index,Float_t &x,Float_t &y,Float_t &z)const{ |
023ae34b | 185 | Double_t t[3];GetTrans(index,t);x = t[0];y = t[1];z = t[2];} |
269f57ed | 186 | // This function returns the Cartesian translation for a give |
187 | // detector on a give ladder in a give layer in the three floating | |
188 | // point variables provided. x = fx0, y = fy0, z = fz0. The units are | |
189 | // those of the Monte Carlo, generally cm. | |
85f1e34a | 190 | void GetTrans(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 191 | Float_t &x,Float_t &y,Float_t &z)const{ |
023ae34b | 192 | GetTrans(GetModuleIndex(lay,lad,det),x,y,z);} |
193 | // | |
d8cc8493 | 194 | // This function returns the Cartesian translation for a give |
195 | // module in the Double array t[3]. The units are | |
196 | // those of the Monte Carlo, generally cm. | |
5cf690c1 | 197 | void GetTransCyln(Int_t index,Double_t *t)const{ |
023ae34b | 198 | GetGeomMatrix(index)->GetTranslationCylinderical(t);} |
d8cc8493 | 199 | // This function returns the Cartesian translation for a give |
200 | // module index in the three floating point variables provided. | |
201 | // x = fx0, y = fy0, z = fz0. The units are those of the Mont | |
202 | // Carlo, generally cm. | |
5cf690c1 | 203 | void GetTransCyln(Int_t index,Float_t &x,Float_t &y,Float_t &z)const{ |
023ae34b | 204 | Double_t t[3];GetTransCyln(index,t);x = t[0];y = t[1];z = t[2];} |
d8cc8493 | 205 | // This function returns the Cartesian translation for a give |
206 | // detector on a give ladder in a give layer in the three floating | |
207 | // point variables provided. x = fx0, y = fy0, z = fz0. The units are | |
208 | // those of the Monte Carlo, generally cm. | |
85f1e34a | 209 | void GetTransCyln(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 210 | Float_t &x,Float_t &y,Float_t &z)const{ |
023ae34b | 211 | GetTransCyln(GetModuleIndex(lay,lad,det),x,y,z);} |
212 | // | |
269f57ed | 213 | // This function returns the Cartesian translation [cm] and the |
214 | // 6 GEANT rotation angles [degrees]for a given layer ladder and | |
215 | // detector number, in the TVector x (at least 9 elements large). | |
023ae34b | 216 | // This function is required to be in-lined for speed. |
5cf690c1 | 217 | void GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,TVector &x)const{ |
023ae34b | 218 | Double_t t[3],a[6];Int_t i=GetModuleIndex(lay,lad,det);GetTrans(i,t); |
219 | GetGeantAngles(i,a);x(0)=t[0];x(1)=t[1];x(2)=t[2];x(3)=a[0];x(4)=a[1]; | |
220 | x(5)=a[2];x(6)=a[3];x(7)=a[4];x(8)=a[5];} | |
221 | // | |
269f57ed | 222 | // This function returns the rotation matrix in Double |
223 | // precision for a given module. | |
5cf690c1 | 224 | void GetRotMatrix(Int_t index,Double_t mat[3][3])const{ |
023ae34b | 225 | GetGeomMatrix(index)->GetMatrix(mat);} |
269f57ed | 226 | // This function returns the rotation matrix in a Double |
227 | // precision pointer for a given module. mat[i][j] => mat[3*i+j]. | |
5cf690c1 | 228 | void GetRotMatrix(Int_t index,Double_t *mat)const{ |
023ae34b | 229 | Double_t rot[3][3];GetRotMatrix(index,rot); |
230 | for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];} | |
269f57ed | 231 | // This function returns the rotation matrix in a floating |
232 | // precision pointer for a given layer ladder and detector module. | |
233 | // mat[i][j] => mat[3*i+j]. | |
5cf690c1 | 234 | void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,Float_t *mat)const{ |
023ae34b | 235 | GetRotMatrix(GetModuleIndex(lay,lad,det),mat);} |
269f57ed | 236 | // This function returns the rotation matrix in a Double |
237 | // precision pointer for a given layer ladder and detector module. | |
238 | // mat[i][j] => mat[3*i+j]. | |
5cf690c1 | 239 | void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,Double_t *mat)const{ |
023ae34b | 240 | GetRotMatrix(GetModuleIndex(lay,lad,det),mat);} |
269f57ed | 241 | // This function returns the rotation matrix in a floating |
242 | // precision pointer for a given module. mat[i][j] => mat[3*i+j]. | |
5cf690c1 | 243 | void GetRotMatrix(Int_t index,Float_t *mat)const{ |
8253cd9a | 244 | Double_t rot[3][3]; |
023ae34b | 245 | GetGeomMatrix(index)->GetMatrix(rot); |
269f57ed | 246 | for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];} |
fd9cde50 | 247 | // This function sets the rotation matrix in a Double |
248 | // precision pointer for a given module. mat[i][j] => mat[3*i+j]. | |
249 | void SetRotMatrix(Int_t index,Double_t *mat){Double_t rot[3][3]; | |
250 | for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) rot[i][j]=mat[3*i+j]; | |
251 | GetGeomMatrix(index)->SetMatrix(rot);} | |
012f0f4c | 252 | // Return the normal for a specific module |
253 | void GetGlobalNormal(Int_t index,Double_t n[3]){ | |
254 | GetGeomMatrix(index)->GetGlobalNormal(n[0],n[1],n[2]);} | |
023ae34b | 255 | // |
8253cd9a | 256 | // Will define fShape if it isn't already defined. |
023ae34b | 257 | void DefineShapes(Int_t size=5){fShape.Expand(size);} |
258 | // this function returns a pointer to the array of detector | |
259 | // descriptions, Segmentation. | |
260 | virtual TObjArray *GetShapeArray(){return &fShape;}; | |
85f1e34a | 261 | // this function returns a pointer to the class describing a particular |
262 | // detector type based on AliITSDetector value. This will return a pointer | |
023ae34b | 263 | // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or |
264 | // AliITSgeomSSD, for example. | |
265 | virtual TObject *GetShape(AliITSDetector idet){ | |
266 | return fShape.At((Int_t)idet);}; | |
5cf690c1 | 267 | virtual TObject *GetShape(AliITSDetector idet)const{ |
268 | return fShape.At((Int_t)idet);}; | |
269f57ed | 269 | // This function returns a pointer to the class describing the |
270 | // detector for a particular module index. This will return a pointer | |
023ae34b | 271 | // to one of the classes AliITSgeomSPD, AliITSgeomSDD, |
272 | // or AliITSgeomSSD, for example. | |
85f1e34a | 273 | virtual TObject *GetShape(Int_t index){ |
023ae34b | 274 | return fShape.At(GetGeomMatrix(index)->GetDetectorIndex());} |
5cf690c1 | 275 | virtual TObject *GetShape(Int_t index)const{ |
276 | return fShape.At(GetGeomMatrix(index)->GetDetectorIndex());} | |
269f57ed | 277 | // This function returns a pointer to the class describing the |
278 | // detector for a particular layer ladder and detector numbers. This | |
279 | // will return a pointer to one of the classes AliITSgeomSPD, | |
280 | // AliITSgeomSDD, or AliITSgeomSSD, for example. | |
85f1e34a | 281 | virtual TObject *GetShape(Int_t lay,Int_t lad,Int_t det) |
023ae34b | 282 | {return GetShape(GetModuleIndex(lay,lad,det));} |
012f0f4c | 283 | // Determine if a give point is inside of a detectors sensitive |
284 | // volume (as defined by these transformations). | |
285 | virtual Bool_t IsInside(Int_t module,Double_t point[3])const; | |
023ae34b | 286 | // |
287 | // Setters | |
269f57ed | 288 | // Sets the rotation angles and matrix for a give module index |
289 | // via the double precision array a[3] [radians]. | |
85f1e34a | 290 | void SetByAngles(Int_t index,const Double_t a[]){ |
023ae34b | 291 | GetGeomMatrix(index)->SetAngles(a);} |
269f57ed | 292 | // Sets the rotation angles and matrix for a give module index |
293 | // via the 3 floating precision variables rx, ry, and rz [radians]. | |
023ae34b | 294 | void SetByAngles(Int_t index,Float_t rx, Float_t ry, Float_t rz) { |
295 | Double_t a[3];a[0] = rx;a[1] = ry;a[2] = rz; | |
296 | GetGeomMatrix(index)->SetAngles(a);} | |
269f57ed | 297 | // Sets the rotation angles and matrix for a give layer, ladder, |
298 | // and detector numbers via the 3 floating precision variables rx, | |
299 | // ry, and rz [radians]. | |
85f1e34a | 300 | void SetByAngles(Int_t lay,Int_t lad,Int_t det, |
6ba216a4 | 301 | Float_t rx, Float_t ry, Float_t rz) { |
023ae34b | 302 | SetByAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);} |
303 | // | |
269f57ed | 304 | // Sets the rotation angles and matrix for a give module index |
305 | // via the Double precision array a[6] [degree]. The angles are those | |
306 | // defined by GEANT 3.12. | |
85f1e34a | 307 | void SetByGeantAngles(Int_t index,const Double_t *ang){ |
023ae34b | 308 | GetGeomMatrix(index)->MatrixFromSixAngles(ang);} |
269f57ed | 309 | // Sets the rotation angles and matrix for a give layer, ladder |
310 | // and detector, in the array id[3] via the Double precision array | |
311 | // a[6] [degree]. The angles are those defined by GEANT 3.12. | |
312 | void SetByGeantAngles(const Int_t *id,const Double_t *ang){ | |
023ae34b | 313 | SetByGeantAngles(GetModuleIndex(id),ang);} |
269f57ed | 314 | // Sets the rotation angles and matrix for a give layer, ladder |
315 | // and detector, via the Double precision array a[6] [degree]. The | |
316 | // angles are those defined by GEANT 3.12. | |
85f1e34a | 317 | void SetByGeantAngles(Int_t lay,Int_t lad,Int_t det, |
023ae34b | 318 | const Double_t *ang){ |
319 | SetByGeantAngles(GetModuleIndex(lay,lad,det),ang);} | |
320 | // | |
269f57ed | 321 | // This function sets a new translation vector, given by the |
322 | // array x[3], for the Cartesian coordinate transformation | |
323 | // for a give module index. | |
85f1e34a | 324 | void SetTrans(Int_t index,Double_t x[]){ |
023ae34b | 325 | GetGeomMatrix(index)->SetTranslation(x);} |
269f57ed | 326 | // This function sets a new translation vector, given by the three |
327 | // variables x, y, and z, for the Cartesian coordinate transformation | |
328 | // for the detector defined by layer, ladder and detector. | |
85f1e34a | 329 | void SetTrans(Int_t lay,Int_t lad,Int_t det, |
269f57ed | 330 | Float_t x,Float_t y,Float_t z){Double_t t[3]; |
331 | t[0] = x;t[1] = y;t[2] = z; | |
332 | SetTrans(GetModuleIndex(lay,lad,det),t);} | |
023ae34b | 333 | // |
269f57ed | 334 | // This function adds one more shape element to the TObjArray |
335 | // fShape. It is primarily used in the constructor functions of the | |
336 | // AliITSgeom class. The pointer *shape can be the pointer to any | |
337 | // class that is derived from TObject (this is true for nearly every | |
338 | // ROOT class). This does not appear to be working properly at this time. | |
023ae34b | 339 | void AddShape(TObject *shp){fShape.AddLast(shp);} |
269f57ed | 340 | // This function deletes an existing shape element, of type TObject, |
341 | // and replaces it with the one specified. This is primarily used to | |
023ae34b | 342 | // changes the parameters to the geom class for a particular |
269f57ed | 343 | // type of detector. |
85f1e34a | 344 | void ReSetShape(Int_t dtype,TObject *shp){ |
023ae34b | 345 | delete (fShape.At(dtype));fShape.AddAt(shp,dtype);} |
346 | // | |
347 | // transformations | |
269f57ed | 348 | // Transforms from the ALICE Global coordinate system |
349 | // to the detector local coordinate system for the detector | |
350 | // defined by the layer, ladder, and detector numbers. The | |
351 | // global and local coordinate are given in two floating point | |
352 | // arrays g[3], and l[3]. | |
85f1e34a | 353 | void GtoL(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 354 | const Float_t *g,Float_t *l)const{ |
023ae34b | 355 | GtoL(GetModuleIndex(lay,lad,det),g,l);} |
269f57ed | 356 | // Transforms from the ALICE Global coordinate system |
357 | // to the detector local coordinate system for the detector | |
358 | // defined by the id[0], id[1], and id[2] numbers. The | |
359 | // global and local coordinate are given in two floating point | |
360 | // arrays g[3], and l[3]. | |
5cf690c1 | 361 | void GtoL(const Int_t *id,const Float_t *g,Float_t *l)const{ |
023ae34b | 362 | GtoL(GetModuleIndex(id),g,l);} |
269f57ed | 363 | // Transforms from the ALICE Global coordinate system |
364 | // to the detector local coordinate system for the detector | |
365 | // module index number. The global and local coordinate are | |
366 | // given in two floating point arrays g[3], and l[3]. | |
5cf690c1 | 367 | void GtoL(Int_t index,const Float_t *g,Float_t *l)const{ |
023ae34b | 368 | Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i]; |
369 | GetGeomMatrix(index)->GtoLPosition(dg,dl); | |
370 | for(i=0;i<3;i++) l[i] =dl[i];} | |
269f57ed | 371 | // Transforms from the ALICE Global coordinate system |
372 | // to the detector local coordinate system for the detector | |
373 | // defined by the layer, ladder, and detector numbers. The | |
374 | // global and local coordinate are given in two Double point | |
375 | // arrays g[3], and l[3]. | |
85f1e34a | 376 | void GtoL(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 377 | const Double_t *g,Double_t *l)const{ |
023ae34b | 378 | GtoL(GetModuleIndex(lay,lad,det),g,l);} |
269f57ed | 379 | // Transforms from the ALICE Global coordinate system |
380 | // to the detector local coordinate system for the detector | |
381 | // defined by the id[0], id[1], and id[2] numbers. The | |
382 | // global and local coordinate are given in two Double point | |
383 | // arrays g[3], and l[3]. | |
5cf690c1 | 384 | void GtoL(const Int_t *id,const Double_t *g,Double_t *l)const{ |
023ae34b | 385 | GtoL(GetModuleIndex(id),g,l);} |
269f57ed | 386 | // Transforms from the ALICE Global coordinate system |
387 | // to the detector local coordinate system for the detector | |
388 | // module index number. The global and local coordinate are | |
389 | // given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 390 | void GtoL(Int_t index,const Double_t g[3],Double_t l[3])const{ |
391 | GetGeomMatrix(index)->GtoLPosition(g,l);} | |
023ae34b | 392 | // |
269f57ed | 393 | // Transforms from the ALICE Global coordinate system |
394 | // to the detector local coordinate system (used for ITS tracking) | |
395 | // for the detector module index number. The global and local | |
396 | // coordinate are given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 397 | void GtoLtracking(Int_t index,const Double_t *g,Double_t *l)const{ |
023ae34b | 398 | if(IsGeantToTracking()) GtoL(index,g,l); |
399 | else GetGeomMatrix(index)->GtoLPositionTracking(g,l);} | |
269f57ed | 400 | // Transforms from the ALICE Global coordinate system |
401 | // to the detector local coordinate system (used for ITS tracking) | |
402 | // for the detector id[3]. The global and local | |
403 | // coordinate are given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 404 | void GtoLtracking(const Int_t *id,const Double_t *g,Double_t *l)const{ |
023ae34b | 405 | GtoLtracking(GetModuleIndex(id),g,l);} |
269f57ed | 406 | // Transforms from the ALICE Global coordinate system |
407 | // to the detector local coordinate system (used for ITS tracking) | |
408 | // for the detector layer ladder and detector numbers. The global | |
409 | // and local coordinate are given in two Double point arrays g[3], | |
410 | // and l[3]. | |
85f1e34a | 411 | void GtoLtracking(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 412 | const Double_t *g,Double_t *l)const{ |
023ae34b | 413 | GtoLtracking(GetModuleIndex(lay,lad,det),g,l);} |
414 | // | |
269f57ed | 415 | // Transforms of momentum types of quantities from the ALICE |
416 | // Global coordinate system to the detector local coordinate system | |
417 | // for the detector layer ladder and detector numbers. The global | |
418 | // and local coordinate are given in two float point arrays g[3], | |
419 | // and l[3]. | |
85f1e34a | 420 | void GtoLMomentum(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 421 | const Float_t *g,Float_t *l)const{ |
023ae34b | 422 | GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);} |
269f57ed | 423 | // Transforms of momentum types of quantities from the ALICE |
424 | // Global coordinate system to the detector local coordinate system | |
425 | // for the detector module index number. The global and local | |
426 | // coordinate are given in two float point arrays g[3], and l[3]. | |
5cf690c1 | 427 | void GtoLMomentum(Int_t index,const Float_t *g,Float_t *l)const{ |
023ae34b | 428 | Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i]; |
429 | GetGeomMatrix(index)->GtoLMomentum(dg,dl); | |
430 | for(i=0;i<3;i++) l[i] =dl[i];} | |
269f57ed | 431 | // Transforms of momentum types of quantities from the ALICE |
432 | // Global coordinate system to the detector local coordinate system | |
433 | // for the detector layer ladder and detector numbers. The global | |
434 | // and local coordinate are given in two Double point arrays g[3], | |
435 | // and l[3]. | |
85f1e34a | 436 | void GtoLMomentum(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 437 | const Double_t *g,Double_t *l)const{ |
023ae34b | 438 | GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);} |
269f57ed | 439 | // Transforms of momentum types of quantities from the ALICE |
440 | // Global coordinate system to the detector local coordinate system | |
441 | // for the detector module index number. The global and local | |
442 | // coordinate are given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 443 | void GtoLMomentum(Int_t index,const Double_t *g,Double_t *l)const{ |
023ae34b | 444 | Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i]; |
445 | GetGeomMatrix(index)->GtoLMomentum(dg,dl); | |
446 | for(i=0;i<3;i++) l[i] =dl[i];} | |
447 | // | |
269f57ed | 448 | // Transforms of momentum types of quantities from the ALICE |
449 | // Global coordinate system to the detector local coordinate system | |
450 | // (used for ITS tracking) for the detector module index number. | |
451 | // The global and local coordinate are given in two Double point | |
452 | // arrays g[3], and l[3]. | |
5cf690c1 | 453 | void GtoLMomentumTracking(Int_t index,const Double_t *g,Double_t *l)const{ |
023ae34b | 454 | if(IsGeantToTracking()) GtoLMomentum(index,g,l); |
455 | else GetGeomMatrix(index)->GtoLMomentumTracking(g,l);} | |
269f57ed | 456 | // Transforms of momentum types of quantities from the ALICE |
457 | // Global coordinate system to the detector local coordinate system | |
458 | // (used for ITS tracking) for the detector id[3]. | |
459 | // The global and local coordinate are given in two Double point | |
460 | // arrays g[3], and l[3]. | |
5cf690c1 | 461 | void GtoLMomentumTracking(const Int_t *id, |
462 | const Double_t *g,Double_t *l)const{ | |
023ae34b | 463 | GtoLMomentumTracking(GetModuleIndex(id),g,l);} |
269f57ed | 464 | // Transforms of momentum types of quantities from the ALICE |
465 | // Global coordinate system to the detector local coordinate system | |
466 | // (used for ITS tracking) for the detector layer ladder and detector | |
467 | // numbers. The global and local coordinate are given in two Double point | |
468 | // arrays g[3], and l[3]. | |
85f1e34a | 469 | void GtoLMomentumTracking(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 470 | const Double_t *g,Double_t *l)const{ |
023ae34b | 471 | GtoLMomentumTracking(GetModuleIndex(lay,lad,det),g,l);} |
472 | // | |
269f57ed | 473 | // Transforms from the detector local coordinate system |
474 | // to the ALICE Global coordinate system for the detector | |
475 | // defined by the layer, ladder, and detector numbers. The | |
476 | // global and local coordinate are given in two floating point | |
477 | // arrays g[3], and l[3]. | |
85f1e34a | 478 | void LtoG(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 479 | const Float_t *l,Float_t *g)const{ |
023ae34b | 480 | LtoG(GetModuleIndex(lay,lad,det),l,g);} |
269f57ed | 481 | // Transforms from the detector local coordinate system |
482 | // to the ALICE Global coordinate system for the detector | |
483 | // defined by the id[0], id[1], and id[2] numbers. The | |
484 | // global and local coordinate are given in two floating point | |
485 | // arrays g[3], and l[3]. | |
5cf690c1 | 486 | void LtoG(const Int_t *id,const Float_t *l,Float_t *g)const{ |
023ae34b | 487 | LtoG(GetModuleIndex(id),l,g);} |
269f57ed | 488 | // Transforms from the detector local coordinate system |
489 | // to the ALICE Global coordinate system for the detector | |
490 | // module index number. The global and local coordinate are | |
491 | // given in two floating point arrays g[3], and l[3]. | |
5cf690c1 | 492 | void LtoG(Int_t index,const Float_t *l,Float_t *g)const{ |
023ae34b | 493 | Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i]; |
494 | GetGeomMatrix(index)->LtoGPosition(dl,dg); | |
495 | for(i=0;i<3;i++) g[i] =dg[i];} | |
269f57ed | 496 | // Transforms from the detector local coordinate system |
497 | // to the ALICE Global coordinate system for the detector | |
498 | // defined by the layer, ladder, and detector numbers. The | |
499 | // global and local coordinate are given in two Double point | |
500 | // arrays g[3], and l[3]. | |
85f1e34a | 501 | void LtoG(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 502 | const Double_t *l,Double_t *g)const{ |
023ae34b | 503 | LtoG(GetModuleIndex(lay,lad,det),l,g);} |
269f57ed | 504 | // Transforms from the detector local coordinate system |
505 | // to the ALICE Global coordinate system for the detector | |
506 | // defined by the id[0], id[1], and id[2] numbers. The | |
507 | // global and local coordinate are given in two Double point | |
508 | // arrays g[3], and l[3]. | |
5cf690c1 | 509 | void LtoG(const Int_t *id,const Double_t *l,Double_t *g)const{ |
023ae34b | 510 | LtoG(GetModuleIndex(id),l,g);} |
269f57ed | 511 | // Transforms from the detector local coordinate system |
512 | // to the ALICE Global coordinate system for the detector | |
513 | // module index number. The global and local coordinate are | |
514 | // given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 515 | void LtoG(Int_t index,const Double_t *l,Double_t *g)const{ |
516 | GetGeomMatrix(index)->LtoGPosition(l,g);} | |
023ae34b | 517 | // |
269f57ed | 518 | // Transforms from the detector local coordinate system (used |
519 | // for ITS tracking) to the ALICE Global coordinate system | |
520 | // for the detector module index number. The global and local | |
521 | // coordinate are given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 522 | void LtoGtracking(Int_t index,const Double_t *l,Double_t *g)const{ |
023ae34b | 523 | if(IsGeantToTracking()) LtoG(index,l,g); |
524 | else GetGeomMatrix(index)->LtoGPositionTracking(l,g);} | |
269f57ed | 525 | // Transforms from the detector local coordinate system (used |
526 | // for ITS tracking) to the ALICE Global coordinate system | |
527 | // for the detector id[3]. The global and local | |
528 | // coordinate are given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 529 | void LtoGtracking(const Int_t *id,const Double_t *l,Double_t *g)const{ |
023ae34b | 530 | LtoGtracking(GetModuleIndex(id),l,g);} |
269f57ed | 531 | // Transforms from the detector local coordinate system (used |
532 | // for ITS tracking) to the detector local coordinate system | |
533 | // for the detector layer ladder and detector numbers. The global | |
534 | // and local coordinate are given in two Double point arrays g[3], | |
535 | // and l[3]. | |
85f1e34a | 536 | void LtoGtracking(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 537 | const Double_t *l,Double_t *g)const{ |
023ae34b | 538 | LtoGtracking(GetModuleIndex(lay,lad,det),l,g);} |
539 | // | |
269f57ed | 540 | // Transforms of momentum types of quantities from the detector |
541 | // local coordinate system to the ALICE Global coordinate system | |
542 | // for the detector layer ladder and detector numbers. The global | |
543 | // and local coordinate are given in two float point arrays g[3], | |
544 | // and l[3]. | |
85f1e34a | 545 | void LtoGMomentum(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 546 | const Float_t *l,Float_t *g)const{ |
023ae34b | 547 | LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);} |
269f57ed | 548 | // Transforms of momentum types of quantities from the detector |
549 | // local coordinate system to the ALICE Global coordinate system | |
550 | // for the detector module index number. The global and local | |
551 | // coordinate are given in two float point arrays g[3], and l[3]. | |
5cf690c1 | 552 | void LtoGMomentum(Int_t index,const Float_t *l,Float_t *g)const{ |
023ae34b | 553 | Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i]; |
554 | GetGeomMatrix(index)->LtoGMomentum(dl,dg); | |
555 | for(i=0;i<3;i++) g[i] =dg[i];} | |
269f57ed | 556 | // Transforms of momentum types of quantities from the detector |
557 | // local coordinate system to the ALICE Global coordinate system | |
558 | // for the detector layer ladder and detector numbers. The global | |
559 | // and local coordinate are given in two Double point arrays g[3], | |
560 | // and l[3]. | |
85f1e34a | 561 | void LtoGMomentum(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 562 | const Double_t *l,Double_t *g)const{ |
023ae34b | 563 | LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);} |
269f57ed | 564 | // Transforms of momentum types of quantities from the detector |
565 | // local coordinate system to the ALICE Global coordinate system | |
566 | // for the detector module index number. The global and local | |
567 | // coordinate are given in two Double point arrays g[3], and l[3]. | |
5cf690c1 | 568 | void LtoGMomentum(Int_t index,const Double_t *l,Double_t *g)const{ |
023ae34b | 569 | GetGeomMatrix(index)->LtoGMomentum(l,g);} |
570 | // | |
269f57ed | 571 | // Transforms of momentum types of quantities from the detector |
572 | // local coordinate system (used for ITS tracking) to the detector | |
573 | // system ALICE Global for the detector module index number. | |
574 | // The global and local coordinate are given in two Double point | |
575 | // arrays g[3], and l[3]. | |
5cf690c1 | 576 | void LtoGMomentumTracking(Int_t index,const Double_t *l,Double_t *g)const{ |
023ae34b | 577 | if(IsGeantToTracking()) LtoGMomentum(index,l,g); |
578 | else GetGeomMatrix(index)->LtoGMomentumTracking(l,g);} | |
269f57ed | 579 | // Transforms of momentum types of quantities from the detector |
580 | // local coordinate system (used for ITS tracking) to the ALICE | |
581 | // Global coordinate system for the detector id[3]. | |
582 | // The global and local coordinate are given in two Double point | |
583 | // arrays g[3], and l[3]. | |
012f0f4c | 584 | void LtoGMomentumTracking(const Int_t *id,const Double_t *l,Double_t *g) |
585 | const{LtoGMomentumTracking(GetModuleIndex(id),l,g);} | |
269f57ed | 586 | // Transforms of momentum types of quantities from the detector |
587 | // local coordinate system (used for ITS tracking) to the ALICE | |
588 | // Global coordinate system for the detector layer ladder and detector | |
589 | // numbers. The global and local coordinate are given in two Double point | |
590 | // arrays g[3], and l[3]. | |
85f1e34a | 591 | void LtoGMomentumTracking(Int_t lay,Int_t lad,Int_t det, |
5cf690c1 | 592 | const Double_t *l,Double_t *g)const{ |
269f57ed | 593 | LtoGMomentumTracking(GetModuleIndex(lay,lad,det),l,g);} |
023ae34b | 594 | // |
269f57ed | 595 | // Transforms from one detector local coordinate system |
596 | // to another detector local coordinate system for the detector | |
597 | // module index1 number to the detector module index2 number. The | |
598 | // local coordinates are given in two Double point arrays l1[3], | |
599 | // and l2[3]. | |
5cf690c1 | 600 | void LtoL(Int_t index1,Int_t index2,Double_t *l1,Double_t *l2)const{ |
023ae34b | 601 | Double_t g[3]; LtoG(index1,l1,g);GtoL(index2,g,l2);} |
269f57ed | 602 | // Transforms from one detector local coordinate system |
603 | // to another detector local coordinate system for the detector | |
604 | // id1[3] to the detector id2[3]. The local coordinates are given | |
605 | // in two Double point arrays l1[3], and l2[3]. | |
012f0f4c | 606 | void LtoL(const Int_t *id1,const Int_t *id2,Double_t *l1,Double_t *l2) |
607 | const{LtoL(GetModuleIndex(id1[0],id1[1],id1[2]), | |
269f57ed | 608 | GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);} |
023ae34b | 609 | // |
269f57ed | 610 | // Transforms from one detector local coordinate system (used for |
611 | // ITS tracking) to another detector local coordinate system (used | |
612 | // for ITS tracking) for the detector module index1 number to the | |
613 | // detector module index2 number. The local coordinates are given | |
614 | // in two Double point arrays l1[3], and l2[3]. | |
85f1e34a | 615 | void LtoLtracking(Int_t index1,Int_t index2, |
5cf690c1 | 616 | Double_t *l1,Double_t *l2)const{ |
023ae34b | 617 | Double_t g[3]; LtoGtracking(index1,l1,g);GtoLtracking(index2,g,l2);} |
269f57ed | 618 | // Transforms from one detector local coordinate system (used for |
619 | // ITS tracking) to another detector local coordinate system (used | |
620 | // for ITS tracking) for the detector id1[3] to the detector id2[3]. | |
621 | // The local coordinates are given in two Double point arrays l1[3], | |
622 | // and l2[3]. | |
623 | void LtoLtracking(const Int_t *id1,const Int_t *id2, | |
5cf690c1 | 624 | Double_t *l1,Double_t *l2)const{ |
023ae34b | 625 | LtoLtracking(GetModuleIndex(id1[0],id1[1],id1[2]), |
626 | GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);} | |
627 | // | |
269f57ed | 628 | // Transforms of momentum types of quantities from one detector |
629 | // local coordinate system to another detector local coordinate | |
630 | // system for the detector module index1 number to the detector | |
631 | // module index2 number. The local coordinates are given in two | |
632 | // Double point arrays l1[3], and l2[3]. | |
85f1e34a | 633 | void LtoLMomentum(Int_t index1,Int_t index2, |
5cf690c1 | 634 | const Double_t *l1,Double_t *l2)const{ |
023ae34b | 635 | Double_t g[3]; LtoGMomentum(index1,l1,g);GtoLMomentum(index2,g,l2);} |
269f57ed | 636 | // Transforms of momentum types of quantities from one detector |
637 | // local coordinate system to another detector local coordinate | |
638 | // system for the detector id1[3] to the detector id2[3]. The local | |
639 | // coordinates are given in two Double point arrays l1[3], and l2[3]. | |
b79e4bc3 | 640 | void LtoLMomentum(const Int_t *id1,const Int_t *id2, |
5cf690c1 | 641 | const Double_t *l1,Double_t *l2)const{ |
023ae34b | 642 | LtoLMomentum(GetModuleIndex(id1[0],id1[1],id1[2]), |
643 | GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);} | |
644 | // | |
269f57ed | 645 | // Transforms of momentum types of quantities from one detector |
646 | // local coordinate system (used by ITS tracking) to another detector | |
647 | // local coordinate system (used by ITS tracking) for the detector | |
648 | // module index1 number to the detector module index2 number. The | |
649 | // local coordinates are given in two Double point arrays l1[3], | |
650 | // and l2[3]. | |
85f1e34a | 651 | void LtoLMomentumTracking(Int_t index1,Int_t index2, |
5cf690c1 | 652 | Double_t *l1,Double_t *l2)const{ |
023ae34b | 653 | Double_t g[3]; LtoGMomentumTracking(index1,l1,g); |
654 | GtoLMomentumTracking(index2,g,l2);} | |
269f57ed | 655 | // Transforms of momentum types of quantities from one detector |
656 | // local coordinate system (used by ITS tracking) to another detector | |
657 | // local coordinate system (used by ITS tracking) for the detector | |
658 | // id1[3] to the detector id2[3]. The local coordinates are given in | |
659 | // two Double point arrays l1[3], and l2[3]. | |
660 | void LtoLMomentumTracking(const Int_t *id1,const Int_t *id2, | |
5cf690c1 | 661 | Double_t *l1,Double_t *l2)const{ |
023ae34b | 662 | LtoLMomentumTracking(GetModuleIndex(id1[0],id1[1],id1[2]), |
269f57ed | 663 | GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);} |
023ae34b | 664 | // |
269f57ed | 665 | // Transforms a matrix, like an Uncertainty or Error matrix from |
666 | // the ALICE Global coordinate system to a detector local coordinate | |
667 | // system. The specific detector is determined by the module index | |
668 | // number. | |
5cf690c1 | 669 | void GtoLErrorMatrix(Int_t index,const Double_t **g,Double_t **l)const{ |
012f0f4c | 670 | GetGeomMatrix(index)->GtoLPositionError( |
671 | (Double_t (*)[3])g,(Double_t (*)[3])l);} | |
023ae34b | 672 | // |
269f57ed | 673 | // Transforms a matrix, like an Uncertainty or Error matrix from |
674 | // the ALICE Global coordinate system to a detector local coordinate | |
675 | // system (used by ITS tracking). The specific detector is determined | |
676 | // by the module index number. | |
85f1e34a | 677 | void GtoLErrorMatrixTracking(Int_t index,const Double_t **g, |
5cf690c1 | 678 | Double_t **l)const{ |
023ae34b | 679 | if(IsGeantToTracking()) GetGeomMatrix(index)->GtoLPositionError(( |
680 | Double_t (*)[3])g,(Double_t (*)[3])l); | |
681 | else GetGeomMatrix(index)->GtoLPositionErrorTracking( | |
682 | (Double_t (*)[3])g,(Double_t (*)[3])l);} | |
683 | // | |
269f57ed | 684 | // Transforms a matrix, like an Uncertainty or Error matrix from |
685 | // the detector local coordinate system to a ALICE Global coordinate | |
686 | // system. The specific detector is determined by the module index | |
687 | // number. | |
5cf690c1 | 688 | void LtoGErrorMatrix(Int_t index,const Double_t **l,Double_t **g)const{ |
012f0f4c | 689 | GetGeomMatrix(index)->LtoGPositionError( |
690 | (Double_t (*)[3])l,(Double_t (*)[3])g);} | |
691 | // | |
692 | // Transforms a matrix, like an Uncertainty or Error matrix from | |
693 | // the detector local coordinate system to a ALICE Global coordinate | |
694 | // system. The specific detector is determined by the module index | |
695 | // number. | |
696 | void LtoGErrorMatrix(Int_t index,const Double_t l[3][3],Double_t g[3][3]) | |
697 | const{ | |
698 | GetGeomMatrix(index)->LtoGPositionError( | |
699 | (Double_t (*)[3])l,(Double_t (*)[3])g);} | |
700 | ||
023ae34b | 701 | // |
269f57ed | 702 | // Transforms a matrix, like an Uncertainty or Error matrix from |
703 | // the detector local coordinate system (used by ITS tracking) to a | |
704 | // ALICE Global coordinate system. The specific detector is determined | |
705 | // by the module index number. | |
85f1e34a | 706 | void LtoGErrorMatrixTracking(Int_t index,const Double_t **l, |
5cf690c1 | 707 | Double_t **g)const{ |
012f0f4c | 708 | if(IsGeantToTracking()) GetGeomMatrix(index)->LtoGPositionError( |
709 | (Double_t (*)[3])g,(Double_t (*)[3])l); | |
710 | else GetGeomMatrix(index)->LtoGPositionErrorTracking( | |
711 | (Double_t (*)[3])l,(Double_t (*)[3])g);} | |
712 | // | |
713 | // Transforms a matrix, like an Uncertainty or Error matrix from | |
714 | // the detector local coordinate system (used by ITS tracking) to a | |
715 | // ALICE Global coordinate system. The specific detector is determined | |
716 | // by the module index number. | |
717 | void LtoGErrorMatrixTracking(Int_t index,const Double_t l[3][3], | |
718 | Double_t g[3][3])const{ | |
719 | if(IsGeantToTracking()) GetGeomMatrix(index)->LtoGPositionError( | |
720 | (Double_t (*)[3])g,(Double_t (*)[3])l); | |
721 | else GetGeomMatrix(index)->LtoGPositionErrorTracking( | |
722 | (Double_t (*)[3])l,(Double_t (*)[3])g);} | |
023ae34b | 723 | // |
269f57ed | 724 | // Transforms a matrix, like an Uncertainty or Error matrix from |
725 | // one detector local coordinate system to another detector local | |
726 | // coordinate system. The specific detector is determined by the | |
727 | // two module index number index1 and index2. | |
85f1e34a | 728 | void LtoLErrorMatrix(Int_t index1,Int_t index2, |
5cf690c1 | 729 | const Double_t **l1,Double_t **l2)const{ |
023ae34b | 730 | Double_t g[3][3]; |
731 | LtoGErrorMatrix(index1,l1,(Double_t **)g); | |
732 | GtoLErrorMatrix(index2,(const Double_t **)g,l2);} | |
733 | // | |
269f57ed | 734 | // Transforms a matrix, like an Uncertainty or Error matrix from |
735 | // one detector local coordinate system (used by ITS tracking) to | |
736 | // another detector local coordinate system (used by ITS tracking). | |
737 | // The specific detector is determined by the two module index number | |
738 | // index1 and index2. | |
85f1e34a | 739 | void LtoLErrorMatrixTraking(Int_t index1,Int_t index2, |
5cf690c1 | 740 | const Double_t **l1,Double_t **l2)const{ |
023ae34b | 741 | Double_t g[3][3]; |
742 | LtoGErrorMatrixTracking(index1,l1,(Double_t **)g); | |
743 | GtoLErrorMatrixTracking(index2,(const Double_t **)g,l2);} | |
744 | // Find Specific Modules | |
85f1e34a | 745 | // Locate the nearest module to the point g, in ALICE global Cartesian |
746 | // coordinates [cm] in a give layer. If layer = 0 then it search in | |
747 | // all layers. | |
5cf690c1 | 748 | Int_t GetNearest(const Double_t g[3],Int_t lay=0)const; |
85f1e34a | 749 | // Locates the nearest 27 modules, in nearest order, to the point g, in |
750 | // ALICE global Cartesian coordinates [cm] in a give layer. If layer = 0 | |
751 | // then it searches in all layers. (there are 27 elements in a 3x3x3 | |
752 | // cube. | |
5cf690c1 | 753 | void GetNearest27(const Double_t g[3],Int_t n[27],Int_t lay=0)const; |
269f57ed | 754 | // Returns the distance [cm] between the point g[3] and the center of |
755 | // the detector/module specified by the the module index number. | |
5cf690c1 | 756 | Double_t Distance(Int_t index,const Double_t g[3])const{ |
023ae34b | 757 | return TMath::Sqrt(GetGeomMatrix(index)->Distance2(g));} |
758 | // loops over modules and computes the average cylindrical | |
759 | // radius to a given layer and the range. | |
5cf690c1 | 760 | Double_t GetAverageRadiusOfLayer(Int_t layer,Double_t &range)const; |
023ae34b | 761 | // Geometry manipulation |
85f1e34a | 762 | // This function performs a Cartesian translation and rotation of |
763 | // the full ITS from its default position by an amount determined by | |
764 | // the three element arrays tran and rot. | |
269f57ed | 765 | void GlobalChange(const Float_t *tran,const Float_t *rot); |
85f1e34a | 766 | // This function performs a Cylindrical translation and rotation of |
767 | // the full ITS from its default position by an amount determined by | |
768 | // the three element arrays tran and rot. | |
269f57ed | 769 | void GlobalCylindericalChange(const Float_t *tran,const Float_t *rot); |
85f1e34a | 770 | // This function performs a Gaussian random displacement and/or |
771 | // rotation about the present global position of each active | |
772 | // volume/detector of the ITS with variances given by stran and srot. | |
269f57ed | 773 | void RandomChange(const Float_t *stran,const Float_t *srot); |
85f1e34a | 774 | // This function performs a Gaussian random displacement and/or |
775 | // rotation about the present global position of each active | |
776 | // volume/detector of the ITS with variances given by stran and srot. | |
777 | // But in Cylindrical coordinates. | |
269f57ed | 778 | void RandomCylindericalChange(const Float_t *stran,const Float_t *srot); |
85f1e34a | 779 | // This function converts these transformations from Alice global and |
780 | // local to Tracking global and local. | |
012f0f4c | 781 | // |
782 | // This converts the geometry | |
783 | void GeantToTracking(const AliITSgeom &source); | |
023ae34b | 784 | // Other routines. |
85f1e34a | 785 | // This routine prints, to a file, the difference between this class |
786 | // and "other". | |
5cf690c1 | 787 | void PrintComparison(FILE *fp,AliITSgeom *other)const; |
85f1e34a | 788 | // This routine prints, to a file, the contents of this class. |
5cf690c1 | 789 | void PrintData(FILE *fp,Int_t lay,Int_t lad,Int_t det)const; |
85f1e34a | 790 | // This function prints out this class in a single stream. This steam |
791 | // can be read by ReadGeom. | |
012f0f4c | 792 | void PrintGeom(ostream *out)const; |
85f1e34a | 793 | // This function reads in that single steam printed out by PrintGeom. |
012f0f4c | 794 | void ReadGeom(istream *in); |
e8189707 | 795 | |
00a7cc50 | 796 | //Conversion from det. local coordinates to local ("V2") coordinates |
797 | //used for tracking | |
798 | ||
012f0f4c | 799 | void DetLToTrackingV2(Int_t md,Float_t xin,Float_t zin, |
800 | Float_t &yout, Float_t &zout); | |
00a7cc50 | 801 | |
012f0f4c | 802 | void TrackingV2ToDetL(Int_t md,Float_t yin,Float_t zin, |
803 | Float_t &xout,Float_t &zout); | |
4bfbde86 | 804 | |
085bb6ed | 805 | private: |
023ae34b | 806 | TString fVersion; // Transformation version. |
8253cd9a | 807 | Int_t fTrans; // Flag to keep track of which transformation |
808 | Int_t fNmodules;// The total number of modules | |
809 | Int_t fNlayers; // The number of layers. | |
023ae34b | 810 | TArrayI fNlad; // Array of the number of ladders/layer(layer) |
811 | TArrayI fNdet; // Array of the number of detector/ladder(layer) | |
812 | TObjArray fGm; // Structure of translation. and rotation. | |
813 | TObjArray fShape; // Array of shapes and detector information. | |
8253cd9a | 814 | |
023ae34b | 815 | ClassDef(AliITSgeom,3) // ITS geometry class |
012f0f4c | 816 | }; |
817 | // Input and output function for standard C++ input/output. | |
818 | ostream& operator<<(ostream &os,AliITSgeom &source); | |
819 | istream& operator>>(istream &os,AliITSgeom &source); | |
58005f18 | 820 | |
821 | #endif |