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