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