]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDgeometry.h
Comments updated and merge problems solved.
[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
16 class AliTRDgeometry : public AliGeometry {
17
18  public:
19
20   enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
21
22   AliTRDgeometry();
23   virtual ~AliTRDgeometry();
24
25   virtual void     CreateGeometry(Int_t *idtmed);
26   virtual Int_t    IsVersion() const = 0;
27   virtual void     Init();
28   virtual Bool_t   Local2Global(Int_t d, Float_t *local, Float_t *global) const;
29   virtual Bool_t   Local2Global(Int_t p, Int_t c, Int_t s, Float_t *local, Float_t *global) const;
30   virtual Bool_t   Rotate(Int_t d, Float_t *pos, Float_t *rot) const;
31   virtual Bool_t   RotateBack(Int_t d, Float_t *rot, Float_t *pos) const;
32
33   static  Int_t    Nsect()   { return fgkNsect; };
34   static  Int_t    Nplan()   { return fgkNplan; };
35   static  Int_t    Ncham()   { return fgkNcham; };
36   static  Int_t    Ndet()    { return fgkNdet;  };
37
38   static  Float_t  Rmin()    { return fgkRmin;  };
39   static  Float_t  Rmax()    { return fgkRmax;  };
40   static  Float_t  Zmax1()   { return fgkZmax1; };
41   static  Float_t  Zmax2()   { return fgkZmax2; };
42
43   static  Float_t  Cwidcha() { return (fgkSwidth2 - fgkSwidth1) 
44                              / fgkSheight * (fgkCH + fgkVspace); };
45   static  Float_t  Cheight() { return fgkCH;      };
46   static  Float_t  Cspace()  { return fgkVspace;  };
47   static  Float_t  CraHght() { return fgkCraH;    };
48   static  Float_t  CdrHght() { return fgkCdrH;    };
49   static  Float_t  CamHght() { return fgkCamH;    };
50   static  Float_t  CroHght() { return fgkCroH;    };
51   static  Float_t  MyThick() { return fgkMyThick; };
52   static  Float_t  DrThick() { return fgkDrThick; };
53   static  Float_t  AmThick() { return fgkAmThick; };
54   static  Float_t  DrZpos()  { return fgkDrZpos;  };
55   static  Float_t  RpadW()   { return fgkRpadW;   };
56   static  Float_t  CpadW()   { return fgkCpadW;   };
57
58   virtual void     SetPHOShole() = 0;
59   virtual void     SetRICHhole() = 0;
60
61   virtual void     SetNRowPad();
62   virtual void     SetNRowPad(const Int_t p, const Int_t c, const Int_t npad);
63   virtual void     SetColPadSize(const Int_t p, const Float_t s);
64   virtual void     SetNTimeBin(const Int_t nbin);
65   virtual void     SetExpandTimeBin(const Int_t nbefore, const Int_t nafter)
66                                                                   { fTimeBefore = nbefore;
67                                                                     fTimeAfter  = nafter; };
68
69   virtual Bool_t   GetPHOShole() const = 0;
70   virtual Bool_t   GetRICHhole() const = 0;
71
72   virtual Int_t    GetDetectorSec(const Int_t p, const Int_t c) const;
73   virtual Int_t    GetDetector(const Int_t p, const Int_t c, const Int_t s) const;
74   virtual Int_t    GetPlane(const Int_t d)   const;
75   virtual Int_t    GetChamber(const Int_t d) const;
76   virtual Int_t    GetSector(const Int_t d)  const;
77
78           Float_t  GetChamberWidth(const Int_t p)                 const { return fCwidth[p];     };
79           Float_t  GetChamberLength(const Int_t p, const Int_t c) const { return fClength[p][c]; }; 
80
81    
82           Int_t    GetRowMax(const Int_t p, const Int_t c, const Int_t s)     
83                                                             const { return fRowMax[p][c][s]; };
84           Int_t    GetColMax(const Int_t p)                 const { return fColMax[p];       };
85           Int_t    GetTimeMax()                             const { return fTimeMax;         };
86           Int_t    GetTimeBefore()                          const { return fTimeBefore;      }; 
87           Int_t    GetTimeAfter()                           const { return fTimeAfter;       }; 
88           Int_t    GetTimeTotal()                           const { return fTimeMax 
89                                                                          + fTimeBefore 
90                                                                          + fTimeAfter; };
91
92           Float_t  GetRow0(const Int_t p, const Int_t c, const Int_t s)       
93                                                             const { return fRow0[p][c][s]; };
94           Float_t  GetCol0(const Int_t p)                   const { return fCol0[p];       };
95           Float_t  GetTime0(const Int_t p)                  const { return fTime0[p];      };
96
97           Float_t  GetRowPadSize(const Int_t p, const Int_t c, const Int_t s) 
98                                                             const { return fRowPadSize[p][c][s]; };
99           Float_t  GetColPadSize(const Int_t p)             const { return fColPadSize[p];       };
100           Float_t  GetTimeBinSize()                         const { return fTimeBinSize;         };
101
102   virtual void     GetGlobal(const AliRecPoint *p, TVector3 &pos, TMatrix &mat) const; 
103   virtual void     GetGlobal(const AliRecPoint *p, TVector3 &pos) const;   
104
105   static  Double_t GetAlpha()  { return 2 * 3.14159265358979323846 / fgkNsect; }; 
106
107  protected:
108
109   static const Int_t   fgkNsect;                            // Number of sectors in the full detector (18)
110   static const Int_t   fgkNplan;                            // Number of planes of the TRD (6)
111   static const Int_t   fgkNcham;                            // Number of chambers in z-direction (5)
112   static const Int_t   fgkNdet;                             // Total number of detectors (18 * 6 * 5 = 540)
113
114   static const Float_t fgkRmin;                             // Minimal radius of the TRD
115   static const Float_t fgkRmax;                             // Maximal radius of the TRD
116
117   static const Float_t fgkZmax1;                            // Half-length of the TRD at outer radius
118   static const Float_t fgkZmax2;                            // Half-length of the TRD at inner radius
119
120   static const Float_t fgkSheight;                          // Height of the TRD-volume in spaceframe (BTR1-3)
121   static const Float_t fgkSwidth1;                          // Lower width of the TRD-volume in spaceframe (BTR1-3)
122   static const Float_t fgkSwidth2;                          // Upper width of the TRD-volume in spaceframe (BTR1-3)
123   static const Float_t fgkSlenTR1;                          // Length of the TRD-volume in spaceframe (BTR1)
124   static const Float_t fgkSlenTR2;                          // Length of the TRD-volume in spaceframe (BTR2)
125   static const Float_t fgkSlenTR3;                          // Length of the TRD-volume in spaceframe (BTR3)
126
127   static const Float_t fgkCraH;                             // Height of the radiator part of the chambers
128   static const Float_t fgkCdrH;                             // Height of the drift region of the chambers
129   static const Float_t fgkCamH;                             // Height of the amplification region of the chambers
130   static const Float_t fgkCroH;                             // Height of the readout of the chambers
131   static const Float_t fgkCH;                               // Total height of the chambers
132
133   static const Float_t fgkVspace;                           // Vertical spacing of the chambers
134   static const Float_t fgkHspace;                           // Horizontal spacing of the chambers
135
136   static const Float_t fgkCalT;                             // Thickness of the lower aluminum frame
137   static const Float_t fgkCclsT;                            // Thickness of the lower G10 frame sides
138   static const Float_t fgkCclfT;                            // Thickness of the lower G10 frame front
139   static const Float_t fgkCcuT;                             // Thickness of the upper G10 frame
140   static const Float_t fgkCauT;                             // Thickness of the upper aluminum frame
141
142   static const Float_t fgkCroW;                             // Additional width of the readout chamber frames
143
144   static const Float_t fgkCpadW;                            // Difference of outer chamber width and pad plane width
145   static const Float_t fgkRpadW;                            // Difference of outer chamber width and pad plane width
146
147   static const Float_t fgkRaThick;                          // Thickness of the radiator
148   static const Float_t fgkMyThick;                          // Thickness of the mylar-layer
149   static const Float_t fgkXeThick;                          // Thickness of the gas volume
150   static const Float_t fgkDrThick;                          // Thickness of the drift region
151   static const Float_t fgkAmThick;                          // Thickness of the amplification region
152   static const Float_t fgkCuThick;                          // Thickness of the pad plane
153   static const Float_t fgkSuThick;                          // Thickness of the HEXCEL+G10 support structure
154   static const Float_t fgkFeThick;                          // Thickness of the FEE + signal lines
155   static const Float_t fgkCoThick;                          // Thickness of the PE of the cooling device
156   static const Float_t fgkWaThick;                          // Thickness of the cooling water
157
158   static const Float_t fgkRaZpos;                           // Position of the radiator
159   static const Float_t fgkMyZpos;                           // Position of the mylar-layer
160   static const Float_t fgkDrZpos;                           // Position of the drift region
161   static const Float_t fgkAmZpos;                           // Position of the amplification region
162   static const Float_t fgkCuZpos;                           // Position of the pad plane
163   static const Float_t fgkSuZpos;                           // Position of the HEXCEL+G10 support structure
164   static const Float_t fgkFeZpos;                           // Position of the FEE + signal lines
165   static const Float_t fgkCoZpos;                           // Position of the PE of the cooling device
166   static const Float_t fgkWaZpos;                           // Position of the colling water
167
168   Int_t                fRowMax[kNplan][kNcham][kNsect];     // Number of pad-rows
169   Int_t                fColMax[kNplan];                     // Number of pad-columns
170   Int_t                fTimeMax;                            // Number of timebins in the drift region
171   Int_t                fTimeBefore;                         // Number of timebins before the drift region
172   Int_t                fTimeAfter;                          // Number of timebins after the drift region
173
174   Float_t              fCwidth[kNplan];                     // Outer widths of the chambers
175   Float_t              fClength[kNplan][kNcham];            // Outer lengths of the chambers
176   Float_t              fClengthPH[kNplan][kNcham];          // For sectors with holes for the PHOS
177   Float_t              fClengthRH[kNplan][kNcham];          // For sectors with holes for the RICH
178
179   Float_t              fRow0[kNplan][kNcham][kNsect];       // Row-position of pad 0
180   Float_t              fCol0[kNplan];                       // Column-position of pad 0
181   Float_t              fTime0[kNplan];                      // Time-position of pad 0
182
183   Float_t              fRowPadSize[kNplan][kNcham][kNsect]; // Pad size in z-direction
184   Float_t              fColPadSize[kNplan];                 // Pad size in rphi-direction
185   Float_t              fTimeBinSize;                        // Size of the time buckets
186
187   Float_t              fRotA11[kNsect];                     // Matrix elements for the rotation
188   Float_t              fRotA12[kNsect];                     // Matrix elements for the rotation
189   Float_t              fRotA21[kNsect];                     // Matrix elements for the rotation
190   Float_t              fRotA22[kNsect];                     // Matrix elements for the rotation
191
192   Float_t              fRotB11[kNsect];                     // Matrix elements for the backward rotation
193   Float_t              fRotB12[kNsect];                     // Matrix elements for the backward rotation
194   Float_t              fRotB21[kNsect];                     // Matrix elements for the backward rotation
195   Float_t              fRotB22[kNsect];                     // Matrix elements for the backward rotation
196
197   ClassDef(AliTRDgeometry,4)                                // TRD geometry base class
198
199 };
200
201 #endif