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