]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSGeometry.h
Corrections to comply with coding convention
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.h
1 #ifndef ALIPHOSGEOMETRY_H
2 #define ALIPHOSGEOMETRY_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 // Geometry class  for PHOS : singleton  
10 // The EMC modules are parametrized so that any configuration can be easily implemented 
11 // The title is used to identify the type of CPV used. So far only PPSD implemented
12 //                  
13 //*-- Author: Yves Schutz (SUBATECH)
14
15 // --- ROOT system ---
16
17 #include "TNamed.h"
18 #include "TString.h"
19 #include "TObjArray.h"
20 #include "TVector3.h" 
21
22 // --- AliRoot header files ---
23
24 #include "AliGeometry.h"
25 #include "AliPHOSRecPoint.h"
26
27 static const TString kDegre("deg") ; 
28 static const TString kRadian("rad") ; 
29
30 class AliPHOSGeometry : public AliGeometry {
31
32 public: 
33
34   AliPHOSGeometry() {
35     // default ctor 
36     // must be kept public for root persistency purposes, but should never be called by the outside world
37   } ;  
38   virtual ~AliPHOSGeometry(void) ; 
39   static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title) ; 
40   static AliPHOSGeometry * GetInstance() ; 
41   virtual void  GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat)  ;
42   virtual void  GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos)  ; 
43
44 protected:
45
46   AliPHOSGeometry(const Text_t* name, const Text_t* title) : AliGeometry(name, title) { Init() ; }  
47   void Init(void) ;            // steering method for PHOS and CPV
48   void InitPHOS(void) ;        // defines the various PHOS geometry parameters
49   void InitPPSD(void) ;        // defines the various PPSD geometry parameters
50
51 public: 
52
53   // General
54
55   Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) ; // converts the absolute PHOS numbering to a relative 
56   void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = kRadian);    
57                                                          // calculates the angular coverage in theta and phi of a EMC module
58   void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = kRadian) ; 
59                                                                          // calculates the angular coverage in theta and phi of a 
60                                                                          // single crystal in a EMC module
61   void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & x, Double_t & z) ; 
62                                                                          // calculates the impact coordinates of a neutral particle  
63                                                                          // emitted in direction theta and phi in ALICE
64   void   RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) ; // gets the position of element (pad or Xtal) relative to 
65                                                                          // center of PHOS module  
66   void   RelPosInAlice(const Int_t AbsId, TVector3 &  pos) ;             // gets the position of element (pad or Xtal) relative to 
67                                                                          // Alice
68   Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) ;         // converts the absolute PHOS numbering to a relative 
69                                                                        
70
71   ///////////// PHOS related parameters
72
73   Bool_t     IsInitialized(void)                  const { return fInit ; }  
74   Float_t    GetAirFilledBoxSize(Int_t index)     const { return fAirFilledBoxSize[index] ;}
75   Float_t    GetCrystalHolderThickness(void)      const { return fCrystalHolderThickness ; } 
76   Float_t    GetCrystalSize(Int_t index)          const { return fXtlSize[index] ; }
77   Float_t    GetCrystalSupportHeight(void)        const { return fCrystalSupportHeight ; } 
78   Float_t    GetCrystalWrapThickness(void)        const { return fCrystalWrapThickness;}
79   Float_t    GetGapBetweenCrystals(void)          const { return fGapBetweenCrystals ; }
80   Float_t    GetIPtoCrystalSurface(void)          const { return fIPtoCrystalSurface ; }
81   Float_t    GetIPtoOuterCoverDistance(void)      const { return fIPtoOuterCoverDistance ; }
82   Float_t    GetIPtoPpsdUp(void)                  const { return (fIPtoOuterCoverDistance - fPPSDBoxSize[1] + fPPSDModuleSize[1]/2 ); } 
83   Float_t    GetIPtoPpsdLow(void)                 const { return (fIPtoOuterCoverDistance - fPPSDModuleSize[1]/2 ); } 
84   Float_t    GetIPtoTopLidDistance(void)          const { return fIPtoTopLidDistance ; }
85   Float_t    GetLowerThermoPlateThickness(void)   const { return fLowerThermoPlateThickness ; }
86   Float_t    GetLowerTextolitPlateThickness(void) const { return fLowerTextolitPlateThickness ; }
87   Float_t    GetModuleBoxThickness(void)          const { return fModuleBoxThickness ; }
88   Int_t      GetNPhi(void)                        const { return fNPhi ; }
89   Int_t      GetNZ(void)                          const { return fNZ ; }
90   Int_t      GetNModules(void)                    const { return fNModules ; }
91   Float_t    GetOuterBoxSize(Int_t index)         const { return fOuterBoxSize[index] ;    }
92   Float_t    GetOuterBoxThickness(Int_t index)    const { return fOuterBoxThickness[index] ; } 
93   Float_t    GetPHOSAngle(Int_t index)            const { return fPHOSAngle[index-1] ; } 
94   Float_t    GetPinDiodeSize(Int_t index)         const { return fPinDiodeSize[index] ; }
95   Float_t    GetSecondUpperPlateThickness(void)   const { return fSecondUpperPlateThickness ; }
96   Float_t    GetSupportPlateThickness(void)       const { return fSupportPlateThickness ; }    
97   Float_t    GetTextolitBoxSize(Int_t index)      const { return fTextolitBoxSize[index] ; }
98   Float_t    GetTextolitBoxThickness(Int_t index) const { return fTextolitBoxThickness[index]; } 
99   Float_t    GetUpperPlateThickness(void)         const { return fUpperPlateThickness ; }
100   Float_t    GetUpperCoolingPlateThickness(void)  const { return fUpperCoolingPlateThickness ; }
101
102 private:
103
104   void       SetPHOSAngles() ; // calculates the PHOS modules PHI angle
105
106 public: 
107  
108   ///////////// PPSD (PHOS PRE SHOWER DETECTOR)  related parameters
109
110
111   Float_t GetAnodeThickness(void)          const { return fAnodeThickness ; } 
112   Float_t GetAvalancheGap(void)            const { return fAvalancheGap ; }
113   Float_t GetCathodeThickness(void)        const { return fCathodeThickness ; } 
114   Float_t GetCompositeThickness(void)      const { return fCompositeThickness ; } 
115   Float_t GetConversionGap(void)           const { return fConversionGap ; } 
116   Float_t GetLeadConverterThickness(void)  const { return fLeadConverterThickness ; }
117   Float_t GetLeadToMicro2Gap(void)         const { return fLeadToMicro2Gap ; }       
118   Float_t GetLidThickness(void)            const { return fLidThickness ; }
119   Float_t GetMicromegas1Thickness(void)    const { return fMicromegas1Thickness ; } 
120   Float_t GetMicromegas2Thickness(void)    const { return fMicromegas2Thickness ; } 
121   Float_t GetMicromegasWallThickness(void) const { return fMicromegasWallThickness ; } 
122   Float_t GetMicro1ToLeadGap(void)         const { return fMicro1ToLeadGap ; } 
123   Int_t   GetNumberOfPadsPhi(void)         const { return fNumberOfPadsPhi ; }
124   Int_t   GetNumberOfPadsZ(void)           const { return fNumberOfPadsZ ; }
125   Int_t   GetNumberOfModulesPhi(void)      const { return fNumberOfModulesPhi ; }          
126   Int_t   GetNumberOfModulesZ(void)        const { return fNumberOfModulesZ ; }               
127   Float_t GetPCThickness(void)             const { return fPCThickness ; }   
128   Float_t GetPhiDisplacement(void)         const { return fPhiDisplacement ; }                           
129   Float_t GetPPSDBoxSize(Int_t index)      const { return fPPSDBoxSize[index] ; }
130   Float_t GetPPSDModuleSize(Int_t index)   const { return fPPSDModuleSize[index] ; } 
131   Float_t GetZDisplacement(void)           const { return fZDisplacement ; }                           
132  
133   void SetLeadConverterThickness(Float_t e) ; // should ultimately disappear 
134
135 private:
136   
137   ///////////// PHOS related parameters
138
139   Float_t fAirFilledBoxSize[3] ;          // Air filled box containing one module
140   Float_t fAirThickness[3] ;              // Space filled with air between the module box and the Textolit box
141   Float_t fCrystalSupportHeight ;         // Height of the support of the crystal    
142   Float_t fCrystalWrapThickness ;         // Thickness of Tyvek wrapping the crystal
143   Float_t fCrystalHolderThickness ;       // Titanium holder of the crystal
144   Float_t fGapBetweenCrystals ;           // Total Gap between two adjacent crystals 
145   Bool_t  fInit ;                         // Tells if geometry has been succesfully set up 
146   Float_t fIPtoOuterCoverDistance ;       // Distances from interaction point to outer cover 
147   Float_t fIPtoCrystalSurface ;           // Distances from interaction point to Xtal surface
148   Float_t fModuleBoxThickness ;           // Thickness of the thermo insulating box containing one crystals module 
149   Float_t fLowerTextolitPlateThickness ;  // Thickness of lower textolit plate
150   Float_t fLowerThermoPlateThickness ;    // Thickness of lower thermo insulating plate
151   Int_t   fNModules ;                     // Number of modules constituing PHOS
152   Int_t   fNPhi ;                         // Number of crystal units in X (phi) direction
153   Int_t   fNZ ;                           // Number of crystal units in Z direction
154   Float_t fOuterBoxSize[3] ;              // Size of the outer  thermo insulating foam box
155   Float_t fOuterBoxThickness[3] ;         // Thickness of the outer thermo insulating foam box
156   Float_t * fPHOSAngle ;                  //[fNModules] Position angles of modules
157   Float_t fPinDiodeSize[3] ;              // Size of the PIN Diode 
158   TObjArray *  fRotMatrixArray ;          // Liste of rotation matrices (one per phos module)
159   Float_t fSecondUpperPlateThickness ;    // Thickness of  upper polystyrene foam plate
160   Float_t fSupportPlateThickness ;        // Thickness of the Aluminium support plate  
161   Float_t fUpperCoolingPlateThickness ;   // Thickness of the upper cooling plate 
162   Float_t fUpperPlateThickness ;          // Thickness of the uper thermo insulating foam plate 
163   Float_t fTextolitBoxSize[3] ;           // Size of the Textolit box inside the insulating foam box
164   Float_t fTextolitBoxThickness[3] ;      // Thicknesses of th Textolit box
165   Float_t fXtlSize[3] ;                   // PWO4 crystal dimensions
166
167
168   ///////////// PPSD (PHOS PRE SHOWER DETECTOR)  related parameters
169
170   Float_t fAnodeThickness ;               // Thickness of the copper layer which makes the anode 
171   Float_t fAvalancheGap ;                 // Thickness of the gas in the avalanche stage
172   Float_t fCathodeThickness ;             // Thickeness of composite material ensuring rigidity of cathode
173   Float_t fCompositeThickness ;           // Thickeness of composite material ensuring rigidity of anode
174   Float_t fConversionGap ;                // Thickness of the gas in the conversion stage
175   Float_t fIPtoTopLidDistance ;           // Distance from interaction point to top lid of PPSD
176   Float_t fLeadConverterThickness ;       // Thickness of the Lead converter 
177   Float_t fLeadToMicro2Gap ;              // Thickness of the air gap between the Lead and Micromegas 2        
178   Float_t fLidThickness ;                 // Thickness of top lid 
179   Float_t fMicromegas1Thickness ;         // Thickness of the first downstream Micromegas 
180   Float_t fMicromegas2Thickness ;         // Thickness of the second downstream Micromegas 
181   Float_t fMicromegasWallThickness ;      // Thickness of the Micromegas leak tight box
182   Float_t fMicro1ToLeadGap ;              // Thickness of the air gap between Micromegas 1 and the Lead
183   Int_t   fNumberOfPadsPhi ;              // Number of pads on a micromegas module ;  
184   Int_t   fNumberOfPadsZ ;                // Number of pads on a micromegas module ;  
185   Int_t   fNumberOfModulesPhi ;           // Number of micromegas modules in phi
186   Int_t   fNumberOfModulesZ ;             // Number of micromegas modules in z
187   Float_t fPCThickness ;                  // Thickness of the printed circuit board of the anode   
188   Float_t fPhiDisplacement ;              // Phi displacement of micromegas1 with respect to micromegas2  
189   Float_t fPPSDBoxSize[3] ;               // Size of large box which contains PPSD; matches PHOS module size
190   Float_t fPPSDModuleSize[3] ;            // Size of an individual micromegas module
191   Float_t fZDisplacement ;                // Z displacement of micromegas1 with respect to micromegas2  
192
193   static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton 
194
195   ClassDef(AliPHOSGeometry,1)  // PHOS geometry class 
196
197 } ;
198
199 #endif // AliPHOSGEOMETRY_H