major upgrade of TG4StepManager and related classes commented
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.h
CommitLineData
daa2ae2f 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
6ad0bfa0 6/* $Id$ */
7
b2a60966 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)
d15a28e7 14
6c370def 15#include <assert.h>
16
d15a28e7 17// --- ROOT system ---
18
daa2ae2f 19#include "TNamed.h"
20#include "TString.h"
21#include "TObjArray.h"
22#include "TVector3.h"
d15a28e7 23
24// --- AliRoot header files ---
25
daa2ae2f 26#include "AliGeometry.h"
27#include "AliPHOSRecPoint.h"
28
9f616d61 29
daa2ae2f 30class AliPHOSGeometry : public AliGeometry {
31
32public:
33
88714635 34 AliPHOSGeometry() {
35 // default ctor
36 // must be kept public for root persistency purposes, but should never be called by the outside world
071153f8 37 fPHOSAngle = 0 ;
38
88714635 39 } ;
6c370def 40 AliPHOSGeometry(const AliPHOSGeometry & geom) {
41 // cpy ctor requested by Coding Convention
42 // but not yet needed
43 assert(0==1) ;
44 }
45
daa2ae2f 46 virtual ~AliPHOSGeometry(void) ;
282c5906 47 static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ;
daa2ae2f 48 static AliPHOSGeometry * GetInstance() ;
e924dedc 49 virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat);
50 virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) ;
daa2ae2f 51
c6e196df 52 AliPHOSGeometry & operator = (const AliPHOSGeometry & rvalue) const {
6c370def 53 // assignement operator requested by coding convention
54 // but not needed
55 assert(0==1) ;
56 return *(GetInstance()) ;
57 }
cf0c2bc1 58
daa2ae2f 59 // General
60
cf0c2bc1 61 static TString Degre(void) {
62 // a global for degree (deg)
63 return TString("deg") ;
64 }
65
66 static TString Radian(void) {
67 // a global for radian (rad)
68 return TString("rad") ;
69 }
70
b2a60966 71 Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) ; // converts the absolute PHOS numbering to a relative
cf0c2bc1 72 void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = Radian() );
b2a60966 73 // calculates the angular coverage in theta and phi of a EMC module
cf0c2bc1 74 void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) ;
9f616d61 75 // calculates the angular coverage in theta and phi of a
76 // single crystal in a EMC module
cf0c2bc1 77
9f616d61 78 void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & x, Double_t & z) ;
cf0c2bc1 79 // calculates the impact coordinates of a neutral particle
80 // emitted in direction theta and phi in ALICE
81
daa2ae2f 82 void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) ; // gets the position of element (pad or Xtal) relative to
83 // center of PHOS module
84 void RelPosInAlice(const Int_t AbsId, TVector3 & pos) ; // gets the position of element (pad or Xtal) relative to
85 // Alice
86 Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) ; // converts the absolute PHOS numbering to a relative
c198e326 87
daa2ae2f 88
89 ///////////// PHOS related parameters
90
6c370def 91 Bool_t IsInitialized(void) const {
92 //
282c5906 93 return fgInit ; }
6c370def 94 Float_t GetAirFilledBoxSize(Int_t index) const {
95 // Getter
96 return fAirFilledBoxSize[index] ;}
97 Float_t GetCrystalHolderThickness(void) const {
98 // Getter
99 return fCrystalHolderThickness ; }
100 Float_t GetCrystalSize(Int_t index) const {
101 // Getter
102 return fXtlSize[index] ; }
103 Float_t GetCrystalSupportHeight(void) const {
104 // Getter
105 return fCrystalSupportHeight ; }
106 Float_t GetCrystalWrapThickness(void) const {
107 // Getter
108 return fCrystalWrapThickness;}
109 Float_t GetGapBetweenCrystals(void) const {
110 // Getter
111 return fGapBetweenCrystals ; }
112 Float_t GetIPtoCrystalSurface(void) const {
113 // Getter
114 return fIPtoCrystalSurface ; }
115 Float_t GetIPtoOuterCoverDistance(void) const {
116 // Getter
117 return fIPtoOuterCoverDistance ; }
118 Float_t GetIPtoPpsdUp(void) const {
119 // Getter
120 return (fIPtoOuterCoverDistance - fPPSDBoxSize[1] + fPPSDModuleSize[1]/2 ); }
121 Float_t GetIPtoPpsdLow(void) const {
122 // Getter
123 return (fIPtoOuterCoverDistance - fPPSDModuleSize[1]/2 ); }
124 Float_t GetIPtoTopLidDistance(void) const {
125 // Getter
126 return fIPtoTopLidDistance ; }
127 Float_t GetLowerThermoPlateThickness(void) const {
128 // Getter
129 return fLowerThermoPlateThickness ; }
130 Float_t GetLowerTextolitPlateThickness(void) const {
131 // Getter
132 return fLowerTextolitPlateThickness ; }
133 Float_t GetModuleBoxThickness(void) const {
134 // Getter
135 return fModuleBoxThickness ; }
136 Int_t GetNPhi(void) const {
137 // Getter
138 return fNPhi ; }
139 Int_t GetNZ(void) const {
140 // Getter
141 return fNZ ; }
142 Int_t GetNModules(void) const {
143 // Getter
144 return fNModules ; }
145 Float_t GetOuterBoxSize(Int_t index) const {
146 // Getter
147 return fOuterBoxSize[index] ; }
148 Float_t GetOuterBoxThickness(Int_t index) const {
149 // Getter
150 return fOuterBoxThickness[index] ; }
151 Float_t GetPHOSAngle(Int_t index) const {
152 // Getter
153 return fPHOSAngle[index-1] ; }
154 Float_t GetPinDiodeSize(Int_t index) const {
155 // Getter
156 return fPinDiodeSize[index] ; }
157 Float_t GetSecondUpperPlateThickness(void) const {
158 // Getter
159 return fSecondUpperPlateThickness ; }
160 Float_t GetSupportPlateThickness(void) const {
161 // Getter
162 return fSupportPlateThickness ; }
163 Float_t GetTextolitBoxSize(Int_t index) const {
164 // Getter
165 return fTextolitBoxSize[index] ; }
166 Float_t GetTextolitBoxThickness(Int_t index) const {
167 // Getter
168 return fTextolitBoxThickness[index]; }
169 Float_t GetUpperPlateThickness(void) const {
170 // Getter
171 return fUpperPlateThickness ; }
172 Float_t GetUpperCoolingPlateThickness(void) const {
173 // Getter
174 return fUpperCoolingPlateThickness ; }
daa2ae2f 175
d15a28e7 176
daa2ae2f 177 ///////////// PPSD (PHOS PRE SHOWER DETECTOR) related parameters
178
179
6c370def 180 Float_t GetAnodeThickness(void) const {
181 // Getter
182 return fAnodeThickness ; }
183 Float_t GetAvalancheGap(void) const {
184 // Getter
185 return fAvalancheGap ; }
186 Float_t GetCathodeThickness(void) const {
187 // Getter
188 return fCathodeThickness ; }
189 Float_t GetCompositeThickness(void) const {
190 // Getter
191 return fCompositeThickness ; }
192 Float_t GetConversionGap(void) const {
193 // Getter
194 return fConversionGap ; }
195 Float_t GetLeadConverterThickness(void) const {
196 // Getter
197 return fLeadConverterThickness ; }
198 Float_t GetLeadToMicro2Gap(void) const {
199 // Getter
200 return fLeadToMicro2Gap ; }
201 Float_t GetLidThickness(void) const {
202 // Getter
203 return fLidThickness ; }
204 Float_t GetMicromegas1Thickness(void) const {
205 // Getter
206 return fMicromegas1Thickness ; }
207 Float_t GetMicromegas2Thickness(void) const {
208 // Getter
209 return fMicromegas2Thickness ; }
210 Float_t GetMicromegasWallThickness(void) const {
211 // Getter
212 return fMicromegasWallThickness ; }
213 Float_t GetMicro1ToLeadGap(void) const {
214 // Getter
215 return fMicro1ToLeadGap ; }
216 Int_t GetNumberOfPadsPhi(void) const {
217 // Getter
218 return fNumberOfPadsPhi ; }
219 Int_t GetNumberOfPadsZ(void) const {
220 // Getter
221 return fNumberOfPadsZ ; }
222 Int_t GetNumberOfModulesPhi(void) const {
223 // Getter
224 return fNumberOfModulesPhi ; }
225 Int_t GetNumberOfModulesZ(void) const {
226 // Getter
227 return fNumberOfModulesZ ; }
228 Float_t GetPCThickness(void) const {
229 // Getter
230 return fPCThickness ; }
231 Float_t GetPhiDisplacement(void) const {
232 // Getter
233 return fPhiDisplacement ; }
234 Float_t GetPPSDBoxSize(Int_t index) const {
235 // Getter
236 return fPPSDBoxSize[index] ; }
237 Float_t GetPPSDModuleSize(Int_t index) const {
238 // Getter
239 return fPPSDModuleSize[index] ; }
240 Float_t GetZDisplacement(void) const {
241 // Getter
242 return fZDisplacement ; }
2f3366b6 243
244 void SetLeadConverterThickness(Float_t e) ; // should ultimately disappear
daa2ae2f 245
6c370def 246protected:
247
aafe457d 248 AliPHOSGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) {
6c370def 249 // ctor only for internal usage (singleton)
250 Init() ;
251 }
252 void Init(void) ; // steering method for PHOS and CPV
253 void InitPHOS(void) ; // defines the various PHOS geometry parameters
254 void InitPPSD(void) ; // defines the various PPSD geometry parameters
255
daa2ae2f 256private:
6c370def 257
258 void SetPHOSAngles() ; // calculates the PHOS modules PHI angle
daa2ae2f 259
260 ///////////// PHOS related parameters
261
262 Float_t fAirFilledBoxSize[3] ; // Air filled box containing one module
263 Float_t fAirThickness[3] ; // Space filled with air between the module box and the Textolit box
264 Float_t fCrystalSupportHeight ; // Height of the support of the crystal
265 Float_t fCrystalWrapThickness ; // Thickness of Tyvek wrapping the crystal
266 Float_t fCrystalHolderThickness ; // Titanium holder of the crystal
267 Float_t fGapBetweenCrystals ; // Total Gap between two adjacent crystals
daa2ae2f 268 Float_t fIPtoOuterCoverDistance ; // Distances from interaction point to outer cover
269 Float_t fIPtoCrystalSurface ; // Distances from interaction point to Xtal surface
270 Float_t fModuleBoxThickness ; // Thickness of the thermo insulating box containing one crystals module
271 Float_t fLowerTextolitPlateThickness ; // Thickness of lower textolit plate
272 Float_t fLowerThermoPlateThickness ; // Thickness of lower thermo insulating plate
273 Int_t fNModules ; // Number of modules constituing PHOS
274 Int_t fNPhi ; // Number of crystal units in X (phi) direction
275 Int_t fNZ ; // Number of crystal units in Z direction
276 Float_t fOuterBoxSize[3] ; // Size of the outer thermo insulating foam box
277 Float_t fOuterBoxThickness[3] ; // Thickness of the outer thermo insulating foam box
4697edca 278 Float_t * fPHOSAngle ; //[fNModules] Position angles of modules
daa2ae2f 279 Float_t fPinDiodeSize[3] ; // Size of the PIN Diode
280 TObjArray * fRotMatrixArray ; // Liste of rotation matrices (one per phos module)
281 Float_t fSecondUpperPlateThickness ; // Thickness of upper polystyrene foam plate
282 Float_t fSupportPlateThickness ; // Thickness of the Aluminium support plate
283 Float_t fUpperCoolingPlateThickness ; // Thickness of the upper cooling plate
284 Float_t fUpperPlateThickness ; // Thickness of the uper thermo insulating foam plate
285 Float_t fTextolitBoxSize[3] ; // Size of the Textolit box inside the insulating foam box
286 Float_t fTextolitBoxThickness[3] ; // Thicknesses of th Textolit box
287 Float_t fXtlSize[3] ; // PWO4 crystal dimensions
288
289
290 ///////////// PPSD (PHOS PRE SHOWER DETECTOR) related parameters
291
292 Float_t fAnodeThickness ; // Thickness of the copper layer which makes the anode
293 Float_t fAvalancheGap ; // Thickness of the gas in the avalanche stage
294 Float_t fCathodeThickness ; // Thickeness of composite material ensuring rigidity of cathode
295 Float_t fCompositeThickness ; // Thickeness of composite material ensuring rigidity of anode
296 Float_t fConversionGap ; // Thickness of the gas in the conversion stage
297 Float_t fIPtoTopLidDistance ; // Distance from interaction point to top lid of PPSD
298 Float_t fLeadConverterThickness ; // Thickness of the Lead converter
299 Float_t fLeadToMicro2Gap ; // Thickness of the air gap between the Lead and Micromegas 2
300 Float_t fLidThickness ; // Thickness of top lid
301 Float_t fMicromegas1Thickness ; // Thickness of the first downstream Micromegas
302 Float_t fMicromegas2Thickness ; // Thickness of the second downstream Micromegas
303 Float_t fMicromegasWallThickness ; // Thickness of the Micromegas leak tight box
304 Float_t fMicro1ToLeadGap ; // Thickness of the air gap between Micromegas 1 and the Lead
305 Int_t fNumberOfPadsPhi ; // Number of pads on a micromegas module ;
306 Int_t fNumberOfPadsZ ; // Number of pads on a micromegas module ;
307 Int_t fNumberOfModulesPhi ; // Number of micromegas modules in phi
308 Int_t fNumberOfModulesZ ; // Number of micromegas modules in z
309 Float_t fPCThickness ; // Thickness of the printed circuit board of the anode
310 Float_t fPhiDisplacement ; // Phi displacement of micromegas1 with respect to micromegas2
311 Float_t fPPSDBoxSize[3] ; // Size of large box which contains PPSD; matches PHOS module size
312 Float_t fPPSDModuleSize[3] ; // Size of an individual micromegas module
313 Float_t fZDisplacement ; // Z displacement of micromegas1 with respect to micromegas2
314
88714635 315 static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton
282c5906 316 static Bool_t fgInit ; // Tells if geometry has been succesfully set up
daa2ae2f 317
b2a60966 318 ClassDef(AliPHOSGeometry,1) // PHOS geometry class
daa2ae2f 319
320} ;
321
322#endif // AliPHOSGEOMETRY_H