]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSGeometry.h
TLorentzVector.h adde to satisfy the latest changes by Federico
[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//_________________________________________________________________________
a3dfe79c 9// Geometry class for PHOS : singleton
10// PHOS consists of the electromagnetic calorimeter (EMCA)
11// and a charged particle veto either in the Subatech's version (PPSD)
12// or in the IHEP's one (CPV).
13// The EMCA/PPSD/CPV modules are parametrized so that any configuration
14// can be easily implemented
15// The title is used to identify the version of CPV used.
16//
b2a60966 17//*-- Author: Yves Schutz (SUBATECH)
d15a28e7 18
6c370def 19#include <assert.h>
20
d15a28e7 21// --- ROOT system ---
22
daa2ae2f 23#include "TNamed.h"
24#include "TString.h"
25#include "TObjArray.h"
26#include "TVector3.h"
d15a28e7 27
28// --- AliRoot header files ---
29
daa2ae2f 30#include "AliGeometry.h"
eb92d866 31#include "AliPHOSEMCAGeometry.h"
32#include "AliPHOSCPVGeometry.h"
33#include "AliPHOSPPSDGeometry.h"
ed19b2e1 34#include "AliPHOSSupportGeometry.h"
daa2ae2f 35#include "AliPHOSRecPoint.h"
36
9f616d61 37
daa2ae2f 38class AliPHOSGeometry : public AliGeometry {
39
40public:
41
88714635 42 AliPHOSGeometry() {
43 // default ctor
44 // must be kept public for root persistency purposes, but should never be called by the outside world
071153f8 45 fPHOSAngle = 0 ;
88714635 46 } ;
52a36ffd 47
6c370def 48 AliPHOSGeometry(const AliPHOSGeometry & geom) {
52a36ffd 49 // cpy ctor requested by Coding Convention but not yet needed
6c370def 50 assert(0==1) ;
51 }
52
daa2ae2f 53 virtual ~AliPHOSGeometry(void) ;
282c5906 54 static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ;
daa2ae2f 55 static AliPHOSGeometry * GetInstance() ;
5cda30f6 56 virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat) const ;
52a36ffd 57 virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ;
daa2ae2f 58
c6e196df 59 AliPHOSGeometry & operator = (const AliPHOSGeometry & rvalue) const {
52a36ffd 60 // assignement operator requested by coding convention but not needed
6c370def 61 assert(0==1) ;
62 return *(GetInstance()) ;
63 }
cf0c2bc1 64
daa2ae2f 65 // General
66
cf0c2bc1 67 static TString Degre(void) {
68 // a global for degree (deg)
69 return TString("deg") ;
70 }
71
72 static TString Radian(void) {
73 // a global for radian (rad)
74 return TString("rad") ;
52a36ffd 75 }
76
b2a60966 77 Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) ; // converts the absolute PHOS numbering to a relative
52a36ffd 78
79 void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = Radian() );
b2a60966 80 // calculates the angular coverage in theta and phi of a EMC module
cf0c2bc1 81 void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) ;
52a36ffd 82 // calculates the angular coverage in theta and phi of a
83 // single crystal in a EMC module
cf0c2bc1 84
9f616d61 85 void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & x, Double_t & z) ;
52a36ffd 86 // calculates the impact coordinates of a neutral particle
87 // emitted in direction theta and phi in ALICE
cf0c2bc1 88
daa2ae2f 89 void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) ; // gets the position of element (pad or Xtal) relative to
90 // center of PHOS module
91 void RelPosInAlice(const Int_t AbsId, TVector3 & pos) ; // gets the position of element (pad or Xtal) relative to
92 // Alice
93 Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) ; // converts the absolute PHOS numbering to a relative
52a36ffd 94
95 Bool_t IsInitialized(void) const { return fgInit ; }
c198e326 96
52a36ffd 97 // Return general PHOS parameters
98
99 Int_t GetNModules(void) const { return fNModules ; }
100 Float_t GetPHOSAngle(Int_t index) const { return fPHOSAngle[index-1] ; }
101
102 // Return EMCA geometrical parameters
103
104 Float_t GetOuterBoxSize(Int_t index) const { return fGeometryEMCA->GetOuterBoxSize(index); }
105 Float_t GetAirFilledBoxSize(Int_t index) const { return fGeometryEMCA->GetAirFilledBoxSize(index) ; }
106 Float_t GetCrystalHolderThickness(void) const { return fGeometryEMCA->GetCrystalHolderThickness() ; }
107 Float_t GetCrystalSize(Int_t index) const { return fGeometryEMCA->GetCrystalSize(index) ; }
108 Float_t GetCrystalSupportHeight(void) const { return fGeometryEMCA->GetCrystalSupportHeight() ; }
109 Float_t GetCrystalWrapThickness(void) const { return fGeometryEMCA->GetCrystalWrapThickness() ; }
110 Float_t GetGapBetweenCrystals(void) const { return fGeometryEMCA->GetGapBetweenCrystals() ; }
111 Float_t GetIPtoCrystalSurface(void) const { return fGeometryEMCA->GetIPtoCrystalSurface() ; }
112 Float_t GetIPtoOuterCoverDistance(void) const { return fGeometryEMCA->GetIPtoOuterCoverDistance() ; }
113 Float_t GetLowerThermoPlateThickness(void) const { return fGeometryEMCA->GetLowerThermoPlateThickness() ; }
114 Float_t GetLowerTextolitPlateThickness(void) const { return fGeometryEMCA->GetLowerTextolitPlateThickness() ; }
115 Float_t GetModuleBoxThickness(void) const { return fGeometryEMCA->GetModuleBoxThickness() ; }
116 Int_t GetNPhi(void) const { return fGeometryEMCA->GetNPhi() ; }
117 Int_t GetNZ(void) const { return fGeometryEMCA->GetNZ() ; }
118 Float_t GetOuterBoxThickness(Int_t index) const { return fGeometryEMCA->GetOuterBoxThickness(index) ; }
119 Float_t GetPinDiodeSize(Int_t index) const { return fGeometryEMCA->GetPinDiodeSize(index) ; }
120 Float_t GetSecondUpperPlateThickness(void) const { return fGeometryEMCA->GetSecondUpperPlateThickness() ; }
121 Float_t GetSupportPlateThickness(void) const { return fGeometryEMCA->GetSupportPlateThickness() ; }
122 Float_t GetTextolitBoxSize(Int_t index) const { return fGeometryEMCA->GetTextolitBoxSize(index) ; }
123 Float_t GetTextolitBoxThickness(Int_t index) const { return fGeometryEMCA->GetTextolitBoxThickness(index); }
124 Float_t GetUpperPlateThickness(void) const { return fGeometryEMCA->GetUpperPlateThickness() ; }
125 Float_t GetUpperCoolingPlateThickness(void) const { return fGeometryEMCA->GetUpperCoolingPlateThickness() ; }
126
127 // Return PPSD geometrical parameters
128
eb92d866 129 Float_t GetAnodeThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetAnodeThickness(); }
130 Float_t GetAvalancheGap(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetAvalancheGap(); }
131 Float_t GetCathodeThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetCathodeThickness(); }
132 Float_t GetCompositeThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetCompositeThickness(); }
133 Float_t GetConversionGap(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetConversionGap(); }
134 Float_t GetLeadConverterThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetLeadConverterThickness(); }
135 Float_t GetLeadToMicro2Gap(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetLeadToMicro2Gap(); }
136 Float_t GetLidThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetLidThickness(); }
137 Float_t GetMicromegas1Thickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetMicromegas1Thickness(); }
138 Float_t GetMicromegas2Thickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetMicromegas2Thickness(); }
139 Float_t GetMicromegasWallThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetMicromegasWallThickness();}
140 Float_t GetMicro1ToLeadGap(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetMicro1ToLeadGap(); }
141 Float_t GetPCThickness(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetPCThickness(); }
142 Float_t GetPhiDisplacement(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetPhiDisplacement(); }
143 Float_t GetPPSDModuleSize(Int_t index) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetPPSDModuleSize(index); }
144 Float_t GetZDisplacement(void) const { return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetZDisplacement(); }
52a36ffd 145
146 // Return CPV geometrical parameters
147
eb92d866 148 Bool_t IsLeadConverterExists(void) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->IsLeadConverterExists(); }
149 Float_t GetCPVActiveSize(Int_t index) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVActiveSize(index); }
150 Int_t GetNumberOfCPVChipsPhi(void) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetNumberOfCPVChipsPhi(); }
151 Int_t GetNumberOfCPVChipsZ(void) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetNumberOfCPVChipsZ(); }
152 Float_t GetGassiplexChipSize(Int_t index) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetGassiplexChipSize(index); }
153 Float_t GetCPVGasThickness(void) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVGasThickness(); }
154 Float_t GetCPVTextoliteThickness(void) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVTextoliteThickness(); }
155 Float_t GetCPVCuNiFoilThickness(void) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVCuNiFoilThickness(); }
156 Float_t GetFTPosition(Int_t index) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetFTPosition(index); }
157 Float_t GetCPVFrameSize(Int_t index) const { return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVFrameSize(index); }
52a36ffd 158
159 // Common PPSD and CPV parameters
160
161 Int_t GetNumberOfCPVLayers(void) const {
162 if (strcmp(fName,"GPS2")==0) return 2;
eb92d866 163 else if (strcmp(fName,"IHEP")==0) return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetNumberOfCPVLayers();
52a36ffd 164 else return 0;
165 }
daa2ae2f 166
52a36ffd 167 Float_t GetCPVBoxSize(Int_t index) const {
eb92d866 168 if (strcmp(fName,"GPS2")==0) return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetCPVBoxSize(index);
169 else if (strcmp(fName,"IHEP")==0) return ((AliPHOSCPVGeometry* ) fGeometryCPV)->GetCPVBoxSize(index);
52a36ffd 170 else return 0;
171 }
172
173 Int_t GetNumberOfModulesPhi(void) const {
eb92d866 174 if (strcmp(fName,"GPS2")==0) return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetNumberOfModulesPhi();
52a36ffd 175 else if (strcmp(fName,"IHEP")==0) return 1;
176 else return 0;
177 }
178
179 Int_t GetNumberOfModulesZ(void) const {
eb92d866 180 if (strcmp(fName,"GPS2")==0) return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetNumberOfModulesZ();
52a36ffd 181 else if (strcmp(fName,"IHEP")==0) return 1;
182 else return 0;
183 }
184
185 Int_t GetNumberOfPadsPhi(void) const {
eb92d866 186 if (strcmp(fName,"GPS2")==0) return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetNumberOfPadsPhi();
187 else if (strcmp(fName,"IHEP")==0) return ((AliPHOSCPVGeometry* ) fGeometryCPV)->GetNumberOfCPVPadsPhi();
52a36ffd 188 else return 0;
189 }
190
191 Int_t GetNumberOfPadsZ(void) const {
eb92d866 192 if (strcmp(fName,"GPS2")==0) return ((AliPHOSPPSDGeometry*) fGeometryCPV)->GetNumberOfPadsZ();
193 else if (strcmp(fName,"IHEP")==0) return ((AliPHOSCPVGeometry* ) fGeometryCPV)->GetNumberOfCPVPadsZ();
52a36ffd 194 else return 0;
195 }
196
197 Float_t GetPadSizePhi(void) const {
198 if (strcmp(fName,"GPS2")==0) return GetPPSDModuleSize(0) / GetNumberOfPadsPhi();
eb92d866 199 else if (strcmp(fName,"IHEP")==0) return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVPadSizePhi();
52a36ffd 200 else return 0;
201 }
202
203 Float_t GetPadSizeZ(void) const {
204 if (strcmp(fName,"GPS2")==0) return GetPPSDModuleSize(2) / GetNumberOfPadsZ();
eb92d866 205 else if (strcmp(fName,"IHEP")==0) return ((AliPHOSCPVGeometry*) fGeometryCPV)->GetCPVPadSizeZ();
52a36ffd 206 else return 0;
207 }
208
209 // Mixed EMCA and PPSD parameters
210
211 Float_t GetIPtoPpsdUp(void) const {
212 return (GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) + GetPPSDModuleSize(1)/2 ); }
213 Float_t GetIPtoTopLidDistance(void) const {
214 return GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) - 1. ; }
215 Float_t GetIPtoPpsdLow(void) const {
216 return (GetIPtoOuterCoverDistance() - GetPPSDModuleSize(1)/2 ); }
217
218 // Mixed EMCA and CPV parameters
219
220 Float_t GetIPtoCPVDistance(void) const {
221 return GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) - 1.0; }
daa2ae2f 222
ed19b2e1 223 // Return PHOS' support geometrical parameters
224
225 Float_t GetRailOuterSize(Int_t index) const { return fGeometrySUPP->GetRailOuterSize(index); }
226 Float_t GetRailPart1 (Int_t index) const { return fGeometrySUPP->GetRailPart1 (index); }
227 Float_t GetRailPart2 (Int_t index) const { return fGeometrySUPP->GetRailPart2 (index); }
228 Float_t GetRailPart3 (Int_t index) const { return fGeometrySUPP->GetRailPart3 (index); }
229 Float_t GetRailPos (Int_t index) const { return fGeometrySUPP->GetRailPos (index); }
230 Float_t GetRailLength () const { return fGeometrySUPP->GetRailLength (); }
231 Float_t GetDistanceBetwRails() const { return fGeometrySUPP->GetDistanceBetwRails(); }
232 Float_t GetRailsDistanceFromIP() const { return fGeometrySUPP->GetRailsDistanceFromIP();}
233 Float_t GetRailRoadSize (Int_t index) const { return fGeometrySUPP->GetRailRoadSize (index); }
234 Float_t GetCradleWallThickness() const { return fGeometrySUPP->GetCradleWallThickness();}
235 Float_t GetCradleWall (Int_t index) const { return fGeometrySUPP->GetCradleWall (index); }
236 Float_t GetCradleWheel (Int_t index) const { return fGeometrySUPP->GetCradleWheel (index); }
daa2ae2f 237
6c370def 238protected:
239
aafe457d 240 AliPHOSGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) {
6c370def 241 // ctor only for internal usage (singleton)
242 Init() ;
52a36ffd 243 }
244 void Init(void) ; // steering method for PHOS and PPSD/CPV
6c370def 245
daa2ae2f 246private:
6c370def 247
eb92d866 248 Int_t fNModules ; // Number of modules constituing PHOS
249 Float_t *fPHOSAngle ; //[fNModules] Position angles of modules
250 TObjArray *fRotMatrixArray ; // Liste of rotation matrices (one per phos module)
251 AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter
252 AliPHOSCPVBaseGeometry *fGeometryCPV ; // Geometry object for CPV (either GPS2 or IHEP)
ed19b2e1 253 AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support
52a36ffd 254
255 void SetPHOSAngles(); // calculates the PHOS modules PHI angle
daa2ae2f 256
88714635 257 static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton
52a36ffd 258 static Bool_t fgInit ; // Tells if geometry has been succesfully set up
daa2ae2f 259
52a36ffd 260 ClassDef(AliPHOSGeometry,1) // PHOS geometry class
daa2ae2f 261
262} ;
263
264#endif // AliPHOSGEOMETRY_H