]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDgeometry.h
Removing obsolete macro
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometry.h
1 #ifndef ALITRDGEOMETRY_H
2 #define ALITRDGEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  TRD geometry class                                                       //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "AliGeometry.h"
15 #include "TObjArray.h"
16 class AliRunLoader;
17 class TGeoHMatrix;
18
19 class AliTRDgeometry : public AliGeometry {
20
21  public:
22
23   enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540, kNdets = 30 };
24
25   AliTRDgeometry();
26   virtual ~AliTRDgeometry();
27
28   virtual void     CreateGeometry(Int_t *idtmed);
29   virtual Int_t    IsVersion() const = 0;
30   virtual void     Init();
31   virtual Bool_t   Impact(const TParticle* ) const { return kTRUE; };
32   virtual Bool_t   Local2Global(Int_t d, Double_t *local, Double_t *global) const;
33   virtual Bool_t   Local2Global(Int_t p, Int_t c, Int_t s
34                                 , Double_t *local, Double_t *global) const;
35
36   virtual Bool_t   Global2Local(Int_t mode, Double_t *local, Double_t *global
37                                , Int_t* index) const;
38   virtual Bool_t   Global2Detector(Double_t global[3], Int_t index[3]);
39
40   virtual Bool_t   Rotate(Int_t d, Double_t *pos, Double_t *rot) const;
41   virtual Bool_t   RotateBack(Int_t d, Double_t *rot, Double_t *pos) const;
42
43   Bool_t   ReadGeoMatrices();  
44   TGeoHMatrix *    GetGeoMatrix(Int_t detector){ return (TGeoHMatrix*)fMatrixGeo->At(detector);}
45   TGeoHMatrix *    GetMatrix(Int_t detector){ return (TGeoHMatrix*)fMatrixArray->At(detector);}
46   TGeoHMatrix *    GetCorrectionMatrix(Int_t detector){ return (TGeoHMatrix*)fMatrixCorrectionArray->At(detector);}
47
48   static  Int_t    Nsect()   { return fgkNsect; };
49   static  Int_t    Nplan()   { return fgkNplan; };
50   static  Int_t    Ncham()   { return fgkNcham; };
51   static  Int_t    Ndet()    { return fgkNdet;  };
52
53   static  Float_t  Rmin()    { return fgkRmin;  };
54   static  Float_t  Rmax()    { return fgkRmax;  };
55   static  Float_t  Zmax1()   { return fgkZmax1; };
56   static  Float_t  Zmax2()   { return fgkZmax2; };
57
58   static  Float_t  Cwidcha() { return (fgkSwidth2 - fgkSwidth1) 
59                              / fgkSheight * (fgkCH + fgkVspace); };
60   static  Float_t  Cheight() { return fgkCH;      };
61   static  Float_t  Cspace()  { return fgkVspace;  };
62   static  Float_t  CraHght() { return fgkCraH;    };
63   static  Float_t  CdrHght() { return fgkCdrH;    };
64   static  Float_t  CamHght() { return fgkCamH;    };
65   static  Float_t  CroHght() { return fgkCroH;    };
66   static  Float_t  CroWid()  { return fgkCroW;    };
67   static  Float_t  MyThick() { return fgkMyThick; };
68   static  Float_t  DrThick() { return fgkDrThick; };
69   static  Float_t  AmThick() { return fgkAmThick; };
70   static  Float_t  DrZpos()  { return fgkDrZpos;  };
71   static  Float_t  RpadW()   { return fgkRpadW;   };
72   static  Float_t  CpadW()   { return fgkCpadW;   };
73
74   virtual void     SetPHOShole() = 0;
75   virtual void     SetRICHhole() = 0;
76
77   virtual Bool_t   GetPHOShole() const = 0;
78   virtual Bool_t   GetRICHhole() const = 0;
79   virtual Bool_t   IsHole(Int_t /*iplan*/, Int_t /*icham*/, Int_t /*isect*/) const {return kFALSE;}
80   static  Int_t    GetDetectorSec(Int_t p, Int_t c);
81   static  Int_t    GetDetector(Int_t p, Int_t c, Int_t s);
82   virtual Int_t    GetPlane(Int_t d)   const;
83   virtual Int_t    GetChamber(Int_t d) const;
84   virtual Int_t    GetSector(Int_t d)  const;
85
86           Float_t  GetChamberWidth(Int_t p) const           { return fCwidth[p];     };
87           Float_t  GetChamberLength(Int_t p, Int_t c) const { return fClength[p][c]; }; 
88
89   virtual void     GetGlobal(const AliRecPoint* , TVector3& , TMatrixF& ) const { }; 
90   virtual void     GetGlobal(const AliRecPoint* , TVector3& ) const { };
91  
92   static  Double_t GetAlpha()  { return 2 * 3.14159265358979323846 / fgkNsect; }; 
93
94   static  AliTRDgeometry* GetGeometry(AliRunLoader* runLoader = NULL);
95   
96   static Float_t  GetTime0(Int_t p)                        { return fgkTime0[p];          };
97
98  protected:
99  
100   static const Int_t   fgkNsect;                            // Number of sectors in the full detector (18)
101   static const Int_t   fgkNplan;                            // Number of planes of the TRD (6)
102   static const Int_t   fgkNcham;                            // Number of chambers in z-direction (5)
103   static const Int_t   fgkNdet;                             // Total number of detectors (18 * 6 * 5 = 540)
104
105   static const Float_t fgkRmin;                             // Minimal radius of the TRD
106   static const Float_t fgkRmax;                             // Maximal radius of the TRD
107
108   static const Float_t fgkZmax1;                            // Half-length of the TRD at outer radius
109   static const Float_t fgkZmax2;                            // Half-length of the TRD at inner radius
110
111   static const Float_t fgkSheight;                          // Height of the TRD-volume in spaceframe (BTR1-3)
112   static const Float_t fgkSwidth1;                          // Lower width of the TRD-volume in spaceframe (BTR1-3)
113   static const Float_t fgkSwidth2;                          // Upper width of the TRD-volume in spaceframe (BTR1-3)
114   static const Float_t fgkSlenTR1;                          // Length of the TRD-volume in spaceframe (BTR1)
115   static const Float_t fgkSlenTR2;                          // Length of the TRD-volume in spaceframe (BTR2)
116   static const Float_t fgkSlenTR3;                          // Length of the TRD-volume in spaceframe (BTR3)
117
118   static const Float_t fgkSMpltT;                           // Thickness of the super module side plates
119   static const Float_t fgkSMgapT;                           // Thickness of the gap between side plates and space frame
120
121   static const Float_t fgkCraH;                             // Height of the radiator part of the chambers
122   static const Float_t fgkCdrH;                             // Height of the drift region of the chambers
123   static const Float_t fgkCamH;                             // Height of the amplification region of the chambers
124   static const Float_t fgkCroH;                             // Height of the readout of the chambers
125   static const Float_t fgkCH;                               // Total height of the chambers
126
127   static const Float_t fgkVspace;                           // Vertical spacing of the chambers
128   static const Float_t fgkHspace;                           // Horizontal spacing of the chambers
129
130   static const Float_t fgkCalT;                             // Thickness of the lower aluminum frame
131   static const Float_t fgkCclsT;                            // Thickness of the lower G10 frame sides
132   static const Float_t fgkCclfT;                            // Thickness of the lower G10 frame front
133   static const Float_t fgkCcuT;                             // Thickness of the upper G10 frame
134   static const Float_t fgkCauT;                             // Thickness of the upper aluminum frame
135
136   static const Float_t fgkCroW;                             // Additional width of the readout chamber frames
137
138   static const Float_t fgkCpadW;                            // Difference of outer chamber width and pad plane width
139   static const Float_t fgkRpadW;                            // Difference of outer chamber width and pad plane width
140
141   static const Float_t fgkRaThick;                          // Thickness of the radiator
142   static const Float_t fgkMyThick;                          // Thickness of the mylar-layer
143   static const Float_t fgkXeThick;                          // Thickness of the gas volume
144   static const Float_t fgkDrThick;                          // Thickness of the drift region
145   static const Float_t fgkAmThick;                          // Thickness of the amplification region
146   static const Float_t fgkCuThick;                          // Thickness of the pad plane
147   static const Float_t fgkSuThick;                          // Thickness of the HEXCEL+G10 support structure
148   static const Float_t fgkFeThick;                          // Thickness of the FEE + signal lines
149   static const Float_t fgkCoThick;                          // Thickness of the PE of the cooling device
150   static const Float_t fgkWaThick;                          // Thickness of the cooling water
151
152   static const Float_t fgkRaZpos;                           // Position of the radiator
153   static const Float_t fgkMyZpos;                           // Position of the mylar-layer
154   static const Float_t fgkDrZpos;                           // Position of the drift region
155   static const Float_t fgkAmZpos;                           // Position of the amplification region
156   static const Float_t fgkCuZpos;                           // Position of the pad plane
157   static const Float_t fgkSuZpos;                           // Position of the HEXCEL+G10 support structure
158   static const Float_t fgkFeZpos;                           // Position of the FEE + signal lines
159   static const Float_t fgkCoZpos;                           // Position of the PE of the cooling device
160   static const Float_t fgkWaZpos;                           // Position of the colling water
161
162   Float_t              fCwidth[kNplan];                     // Outer widths of the chambers
163   Float_t              fClength[kNplan][kNcham];            // Outer lengths of the chambers
164   Float_t              fClengthPH[kNplan][kNcham];          // For sectors with holes for the PHOS
165   Float_t              fClengthRH[kNplan][kNcham];          // For sectors with holes for the RICH
166
167   Float_t              fRotA11[kNsect];                     // Matrix elements for the rotation
168   Float_t              fRotA12[kNsect];                     // Matrix elements for the rotation
169   Float_t              fRotA21[kNsect];                     // Matrix elements for the rotation
170   Float_t              fRotA22[kNsect];                     // Matrix elements for the rotation
171
172   Float_t              fRotB11[kNsect];                     // Matrix elements for the backward rotation
173   Float_t              fRotB12[kNsect];                     // Matrix elements for the backward rotation
174   Float_t              fRotB21[kNsect];                     // Matrix elements for the backward rotation
175   Float_t              fRotB22[kNsect];                     // Matrix elements for the backward rotation
176
177   static const Double_t fgkTime0Base;                       // Base value for calculation of Time-position of pad 0
178   static const Float_t fgkTime0[kNplan];                    //  Time-position of pad 0
179   
180   Float_t              fChamberUAorig[3*kNdets][3];         // Volumes origin in
181   Float_t              fChamberUDorig[3*kNdets][3];         // the chamber
182   Float_t              fChamberUForig[3*kNdets][3];         // [3] = x, y, z
183   Float_t              fChamberUUorig[3*kNdets][3];
184
185   Float_t              fChamberUAboxd[3*kNdets][3];         // Volumes box
186   Float_t              fChamberUDboxd[3*kNdets][3];         // dimensions (half)
187   Float_t              fChamberUFboxd[3*kNdets][3];         // [3] = x, y, z
188   Float_t              fChamberUUboxd[3*kNdets][3];
189   TObjArray *          fMatrixArray;                        //! array of matrix - Transformation Global to Local
190   TObjArray *          fMatrixCorrectionArray;              //! array of Matrix - Transformation Cluster to  Tracking systerm
191   TObjArray *          fMatrixGeo;                          //! geo matrices
192   ClassDef(AliTRDgeometry,7)                                // TRD geometry base class
193
194 };
195
196 #endif