]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDgeometry.h
Outer radius of composite ring corrected.
[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 #include "TObjArray.h"
17
18 class AliRunLoader;
19 class TGeoHMatrix;
20
21 class AliTRDgeometry : public AliGeometry {
22
23  public:
24
25   enum { kNplan =   6
26        , kNcham =   5
27        , kNsect =  18
28        , kNdet  = 540 
29        , kNdets =  30 };
30
31   AliTRDgeometry();
32   AliTRDgeometry(const AliTRDgeometry &g);
33   virtual ~AliTRDgeometry();
34   AliTRDgeometry &operator=(const AliTRDgeometry &g);
35
36   virtual void     Init();
37   virtual void     CreateGeometry(Int_t *idtmed);
38   virtual Int_t    IsVersion()                                         { return 1;               }
39   virtual Bool_t   Impact(const TParticle* ) const                     { return kTRUE;           }
40   virtual Bool_t   IsHole(Int_t /*p*/, Int_t /*c*/, Int_t /*s*/) const { return kFALSE;          }
41
42   virtual Bool_t   Rotate(Int_t d, Double_t *pos, Double_t *rot) const;
43   virtual Bool_t   RotateBack(Int_t d, Double_t *rot, Double_t *pos) const;
44
45           void     GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed);
46           void     CreateFrame(Int_t *idtmed);
47           void     CreateServices(Int_t *idtmed);
48
49           Bool_t   ReadGeoMatrices();  
50
51           void     SetSMstatus(Int_t sm, Char_t status)                { fSMstatus[sm] = status; }
52
53   static  AliTRDgeometry* GetGeometry(AliRunLoader *runLoader = NULL);
54   
55   static  Int_t    GetDetectorSec(Int_t p, Int_t c);
56   static  Int_t    GetDetector(Int_t p, Int_t c, Int_t s);
57   virtual Int_t    GetPlane(Int_t d) const;
58   virtual Int_t    GetChamber(Int_t d) const;
59   virtual Int_t    GetSector(Int_t d) const;
60
61   // Translation from MCM to Pad and vice versa
62   virtual Int_t    GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
63   virtual Int_t    GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
64   virtual Int_t    GetMCMfromPad(Int_t irow, Int_t icol) const;
65   virtual Int_t    GetROBfromPad(Int_t irow, Int_t icol) const;
66   virtual Int_t    GetRobSide(Int_t irob) const;
67   virtual Int_t    GetColSide(Int_t icol) const;
68
69   static Float_t   GetTime0(Int_t p)                                   { return fgkTime0[p];     }
70
71           Char_t   GetSMstatus(Int_t sm) const                         { return fSMstatus[sm];   }
72           Float_t  GetChamberWidth(Int_t p) const                      { return fCwidth[p];      }
73           Float_t  GetChamberLength(Int_t p, Int_t c) const            { return fClength[p][c];  }
74
75   virtual void     GetGlobal(const AliRecPoint*, TVector3&, TMatrixF& ) const { }; 
76   virtual void     GetGlobal(const AliRecPoint*, TVector3& ) const            { };
77  
78   static  Double_t GetAlpha()                                          { return 2.0 
79                                                                            * 3.14159265358979324 
80                                                                            / fgkNsect;           } 
81
82   static  Int_t    Nsect()                                             { return fgkNsect;        }
83   static  Int_t    Nplan()                                             { return fgkNplan;        }
84   static  Int_t    Ncham()                                             { return fgkNcham;        }
85   static  Int_t    Ndet()                                              { return fgkNdet;         }
86
87   static  Float_t  Cheight()                                           { return fgkCH;           }
88   static  Float_t  Cspace()                                            { return fgkVspace;       }
89   static  Float_t  CraHght()                                           { return fgkCraH;         }
90   static  Float_t  CdrHght()                                           { return fgkCdrH;         }
91   static  Float_t  CamHght()                                           { return fgkCamH;         }
92   static  Float_t  CroHght()                                           { return fgkCroH;         }
93   static  Float_t  CroWid()                                            { return fgkCroW;         }
94   static  Float_t  MyThick()                                           { return fgkMyThick;      }
95   static  Float_t  DrThick()                                           { return fgkDrThick;      }
96   static  Float_t  AmThick()                                           { return fgkAmThick;      }
97   static  Float_t  DrZpos()                                            { return fgkDrZpos;       }
98   static  Float_t  RpadW()                                             { return fgkRpadW;        }
99   static  Float_t  CpadW()                                             { return fgkCpadW;        }
100
101   static  Float_t  Cwidcha()                                           { return (fgkSwidth2 - fgkSwidth1) 
102                                                                                 / fgkSheight 
103                                                                                 * (fgkCH + fgkVspace);      }
104
105   static  Int_t    MCMmax()                                            { return fgkMCMmax;       }
106   static  Int_t    MCMrow()                                            { return fgkMCMrow;       }
107   static  Int_t    ROBmaxC0()                                          { return fgkROBmaxC0;     }
108   static  Int_t    ROBmaxC1()                                          { return fgkROBmaxC1;     }
109   static  Int_t    ADCmax()                                            { return fgkADCmax;       }
110   static  Int_t    TBmax()                                             { return fgkTBmax;        }            
111   static  Int_t    Padmax()                                            { return fgkPadmax;       }
112   static  Int_t    Colmax()                                            { return fgkColmax;       }
113   static  Int_t    RowmaxC0()                                          { return fgkRowmaxC0;     }
114   static  Int_t    RowmaxC1()                                          { return fgkRowmaxC1;     }
115
116   TGeoHMatrix     *GetGeoMatrix(Int_t det)                             { return (TGeoHMatrix *) 
117                                                                            fMatrixGeo->At(det);             }
118   TGeoHMatrix     *GetMatrix(Int_t det)                                { return (TGeoHMatrix *) 
119                                                                            fMatrixArray->At(det);           }
120   TGeoHMatrix     *GetCorrectionMatrix(Int_t det)                      { return (TGeoHMatrix *) 
121                                                                            fMatrixCorrectionArray->At(det); }
122
123  protected:
124
125   static const Int_t    fgkNsect;                            //  Number of sectors in the full detector (18)
126   static const Int_t    fgkNplan;                            //  Number of planes of the TRD (6)
127   static const Int_t    fgkNcham;                            //  Number of chambers in z-direction (5)
128   static const Int_t    fgkNdet;                             //  Total number of detectors (18 * 6 * 5 = 540)
129
130   static const Float_t  fgkSheight;                          //  Height of the TRD-volume in spaceframe (BTRD)
131   static const Float_t  fgkSwidth1;                          //  Lower width of the TRD-volume in spaceframe (BTRD)
132   static const Float_t  fgkSwidth2;                          //  Upper width of the TRD-volume in spaceframe (BTRD)
133   static const Float_t  fgkSlength;                          //  Length of the TRD-volume in spaceframe (BTRD)
134
135   static const Float_t  fgkSMpltT;                           //  Thickness of the super module side plates
136
137   static const Float_t  fgkCraH;                             //  Height of the radiator part of the chambers
138   static const Float_t  fgkCdrH;                             //  Height of the drift region of the chambers
139   static const Float_t  fgkCamH;                             //  Height of the amplification region of the chambers
140   static const Float_t  fgkCroH;                             //  Height of the readout of the chambers
141   static const Float_t  fgkCH;                               //  Total height of the chambers
142
143   static const Float_t  fgkVspace;                           //  Vertical spacing of the chambers
144   static const Float_t  fgkHspace;                           //  Horizontal spacing of the chambers
145   static const Float_t  fgkVrocsm;                           //  Radial distance of the first ROC to the outer SM plates
146   static const Float_t  fgkCalT;                             //  Thickness of the lower aluminum frame
147   static const Float_t  fgkCalW;                             //  Width of additional aluminum on lower frame
148   static const Float_t  fgkCclsT;                            //  Thickness of the lower Wacosit frame sides
149   static const Float_t  fgkCclfT;                            //  Thickness of the lower Wacosit frame front
150   static const Float_t  fgkCglT;                             //  Thichness of the glue around the radiator
151   static const Float_t  fgkCcuT;                             //  Thickness of the upper Wacosit frame
152   static const Float_t  fgkCauT;                             //  Thickness of the aluminum frame of the back panel
153
154   static const Float_t  fgkCroW;                             //  Additional width of the readout chamber frames
155
156   static const Float_t  fgkCpadW;                            //  Difference of outer chamber width and pad plane width
157   static const Float_t  fgkRpadW;                            //  Difference of outer chamber width and pad plane width
158
159   static const Float_t  fgkMyThick;                          //  Thickness of the mylar-layer
160   static const Float_t  fgkRaThick;                          //  Thickness of the radiator
161   static const Float_t  fgkXeThick;                          //  Thickness of the gas volume
162   static const Float_t  fgkDrThick;                          //  Thickness of the drift region
163   static const Float_t  fgkAmThick;                          //  Thickness of the amplification region
164   static const Float_t  fgkWrThick;                          //  Thickness of the wire planes
165   static const Float_t  fgkCuThick;                          //  Thickness of the pad plane
166   static const Float_t  fgkGlThick;                          //  Thickness of the glue layer
167   static const Float_t  fgkSuThick;                          //  Thickness of the NOMEX support structure
168   static const Float_t  fgkRpThick;                          //  Thickness of the PCB readout boards
169   static const Float_t  fgkRcThick;                          //  Thickness of the PCB copper layers
170   static const Float_t  fgkRoThick;                          //  Thickness of all other ROB componentes (caps, etc.)
171
172   static const Float_t  fgkRaZpos;                           //  Position of the radiator
173   static const Float_t  fgkDrZpos;                           //  Position of the drift region
174   static const Float_t  fgkAmZpos;                           //  Position of the amplification region
175   static const Float_t  fgkWrZpos;                           //  Position of the wire planes
176   static const Float_t  fgkCuZpos;                           //  Position of the pad plane
177   static const Float_t  fgkGlZpos;                           //  Position of the glue layer
178   static const Float_t  fgkSuZpos;                           //  Position of the HEXCEL+G10 support structure
179   static const Float_t  fgkRpZpos;                           //  Position of the PCB readout boards
180   static const Float_t  fgkRcZpos;                           //  Position of the PCB copper layers
181   static const Float_t  fgkRoZpos;                           //  Position of all other ROB componentes (caps, etc.)
182
183   static const Int_t    fgkMCMmax;                           //  Maximum number of MCMs per ROB
184   static const Int_t    fgkMCMrow;                           //  Maximum number of MCMs per ROB Row
185   static const Int_t    fgkROBmaxC0;                         //  Maximum number of ROBs per C0 chamber
186   static const Int_t    fgkROBmaxC1;                         //  Maximum number of ROBs per C1 chamber
187   static const Int_t    fgkADCmax;                           //  Maximum number of ADC channels per MCM
188   static const Int_t    fgkTBmax;                            //  Maximum number of Time bins
189   static const Int_t    fgkPadmax;                           //  Maximum number of pads per MCM
190   static const Int_t    fgkColmax;                           //  Maximum number of pads per padplane row
191   static const Int_t    fgkRowmaxC0;                         //  Maximum number of Rows per C0 chamber
192   static const Int_t    fgkRowmaxC1;                         //  Maximum number of Rows per C1 chamber
193
194   Char_t                fSMstatus[kNsect];                   //  Super module status byte
195
196   Float_t               fCwidth[kNplan];                     //  Outer widths of the chambers
197   Float_t               fClength[kNplan][kNcham];            //  Outer lengths of the chambers
198
199   Float_t               fRotA11[kNsect];                     //  Matrix elements for the rotation
200   Float_t               fRotA12[kNsect];                     //  Matrix elements for the rotation
201   Float_t               fRotA21[kNsect];                     //  Matrix elements for the rotation
202   Float_t               fRotA22[kNsect];                     //  Matrix elements for the rotation
203
204   Float_t               fRotB11[kNsect];                     //  Matrix elements for the backward rotation
205   Float_t               fRotB12[kNsect];                     //  Matrix elements for the backward rotation
206   Float_t               fRotB21[kNsect];                     //  Matrix elements for the backward rotation
207   Float_t               fRotB22[kNsect];                     //  Matrix elements for the backward rotation
208
209   static const Double_t fgkTime0Base;                        //  Base value for calculation of Time-position of pad 0
210   static const Float_t  fgkTime0[kNplan];                    //  Time-position of pad 0
211   
212   Float_t               fChamberUAorig[3*kNdets][3];         //  Volumes origin in
213   Float_t               fChamberUDorig[3*kNdets][3];         //  the chamber
214   Float_t               fChamberUForig[3*kNdets][3];         //  [3] = x, y, z
215   Float_t               fChamberUUorig[3*kNdets][3];         //
216
217   Float_t               fChamberUAboxd[3*kNdets][3];         //  Volumes box
218   Float_t               fChamberUDboxd[3*kNdets][3];         //  dimensions (half)
219   Float_t               fChamberUFboxd[3*kNdets][3];         //  [3] = x, y, z
220   Float_t               fChamberUUboxd[3*kNdets][3];         // 
221
222   TObjArray            *fMatrixArray;                        //! Transformation Global to Local
223   TObjArray            *fMatrixCorrectionArray;              //! Transformation Cluster to  Tracking systerm
224   TObjArray            *fMatrixGeo;                          //! Geo matrices
225
226   ClassDef(AliTRDgeometry,12)                                //  TRD geometry class
227
228 };
229
230 #endif