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 */
8 //_________________________________________________________________________
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.
17 //*-- Author: Yves Schutz (SUBATECH)
21 // --- ROOT system ---
24 #include "TObjArray.h"
27 // --- AliRoot header files ---
29 #include "AliGeometry.h"
31 #include "AliPHOSEMCAGeometry.h"
32 #include "AliPHOSCPVGeometry.h"
33 #include "AliPHOSSupportGeometry.h"
36 class AliPHOSGeometry : public AliGeometry {
42 // must be kept public for root persistency purposes, but should never be called by the outside world
48 fRotMatrixArray = 0; }
50 AliPHOSGeometry(const AliPHOSGeometry & geom) {
51 // cpy ctor requested by Coding Convention but not yet needed
56 virtual ~AliPHOSGeometry(void) ;
57 static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ;
58 static AliPHOSGeometry * GetInstance() ;
59 virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat) const ;
60 virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ;
62 AliPHOSGeometry & operator = (const AliPHOSGeometry & rvalue) const {
63 // assignement operator requested by coding convention but not needed
65 return *(GetInstance()) ;
70 static TString Degre(void) { return TString("deg") ; } // a global for degree (deg)
72 static TString Radian(void){ return TString("rad") ; } // a global for radian (rad)
74 Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) const ;
75 // converts the absolute PHOS numbering to a relative
77 void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm,
78 Double_t & pM, Option_t * opt = Radian() ) const ;
79 // calculates the angular coverage in theta and phi of a EMC module
80 void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) const ;
81 // calculates the angular coverage in theta and phi of a
82 // single crystal in a EMC module
83 void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber,
84 Double_t & z, Double_t & x) const ;
85 // calculates the impact coordinates of a neutral particle
86 // emitted in direction theta and phi in ALICE
87 Bool_t IsInEMC(const Int_t id) const { if (id > GetNModules() * GetNCristalsInModule() ) return kFALSE; return kTRUE; }
88 void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) const ;
89 // gets the position of element (pad or Xtal) relative to
90 // center of PHOS module
91 void RelPosInAlice(const Int_t AbsId, TVector3 & pos) const ;
92 // gets the position of element (pad or Xtal) relative to Alice
93 Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ;
94 // converts the absolute PHOS numbering to a relative
96 Bool_t IsInitialized(void) const { return fgInit ; }
98 // Return general PHOS parameters
99 Int_t GetNModules(void) const { return fNModules ; }
100 Float_t GetPHOSAngle(Int_t index) const { return fPHOSAngle[index-1] ; }
101 Float_t* GetPHOSParams(void) { return fPHOSParams;} //Half-sizes of PHOS trapecoid
102 Float_t GetIPtoUpperCPVsurface(void) const { return fIPtoUpperCPVsurface ; }
103 Float_t GetOuterBoxSize(Int_t index) const { return 2.*fPHOSParams[index]; }
104 Float_t GetCrystalSize(Int_t index) const { return fGeometryEMCA->GetCrystalSize(index) ; }
106 // Return EMCA geometry parameters
108 AliPHOSEMCAGeometry * GetEMCAGeometry() const {return fGeometryEMCA ;}
109 Float_t GetIPtoCrystalSurface(void) const { return fGeometryEMCA->GetIPtoCrystalSurface() ; }
110 Float_t GetIPtoOuterCoverDistance(void) const { return fGeometryEMCA->GetIPtoOuterCoverDistance() ; }
111 Int_t GetNPhi(void) const { return fGeometryEMCA->GetNPhi() ; }
112 Int_t GetNZ(void) const { return fGeometryEMCA->GetNZ() ; }
113 Int_t GetNCristalsInModule(void) const { return fGeometryEMCA->GetNPhi() * fGeometryEMCA->GetNZ() ; }
115 // Return CPV geometry parameters
116 Int_t GetNumberOfCPVLayers(void) const { return fGeometryCPV ->GetNumberOfCPVLayers(); }
117 Float_t GetCPVActiveSize(Int_t index) const { return fGeometryCPV->GetCPVActiveSize(index); }
118 Int_t GetNumberOfCPVChipsPhi(void) const { return fGeometryCPV->GetNumberOfCPVChipsPhi(); }
119 Int_t GetNumberOfCPVChipsZ(void) const { return fGeometryCPV->GetNumberOfCPVChipsZ(); }
120 Int_t GetNumberOfCPVPadsPhi(void) const { return fGeometryCPV->GetNumberOfCPVPadsPhi(); }
121 Int_t GetNumberOfCPVPadsZ(void) const { return fGeometryCPV->GetNumberOfCPVPadsZ(); }
122 Float_t GetPadSizePhi(void) const { return fGeometryCPV->GetCPVPadSizePhi(); }
123 Float_t GetPadSizeZ(void) const { return fGeometryCPV->GetCPVPadSizeZ(); }
124 Float_t GetGassiplexChipSize(Int_t index) const { return fGeometryCPV->GetGassiplexChipSize(index); }
125 Float_t GetCPVGasThickness(void) const { return fGeometryCPV->GetCPVGasThickness(); }
126 Float_t GetCPVTextoliteThickness(void) const { return fGeometryCPV->GetCPVTextoliteThickness(); }
127 Float_t GetCPVCuNiFoilThickness(void) const { return fGeometryCPV->GetCPVCuNiFoilThickness(); }
128 Float_t GetFTPosition(Int_t index) const { return fGeometryCPV->GetFTPosition(index); }
129 Float_t GetCPVFrameSize(Int_t index) const { return fGeometryCPV->GetCPVFrameSize(index); }
130 Float_t GetCPVBoxSize(Int_t index) const { return fGeometryCPV ->GetCPVBoxSize(index); }
131 Float_t GetIPtoCPVDistance(void) const { return GetIPtoOuterCoverDistance() -
132 GetCPVBoxSize(1) - 1.0; }
134 // Return PHOS' support geometry parameters
136 Float_t GetRailOuterSize(Int_t index) const { return fGeometrySUPP->GetRailOuterSize(index); }
137 Float_t GetRailPart1 (Int_t index) const { return fGeometrySUPP->GetRailPart1 (index); }
138 Float_t GetRailPart2 (Int_t index) const { return fGeometrySUPP->GetRailPart2 (index); }
139 Float_t GetRailPart3 (Int_t index) const { return fGeometrySUPP->GetRailPart3 (index); }
140 Float_t GetRailPos (Int_t index) const { return fGeometrySUPP->GetRailPos (index); }
141 Float_t GetRailLength (void) const { return fGeometrySUPP->GetRailLength (); }
142 Float_t GetDistanceBetwRails(void) const { return fGeometrySUPP->GetDistanceBetwRails(); }
143 Float_t GetRailsDistanceFromIP(void) const { return fGeometrySUPP->GetRailsDistanceFromIP();}
144 Float_t GetRailRoadSize (Int_t index) const { return fGeometrySUPP->GetRailRoadSize (index); }
145 Float_t GetCradleWallThickness(void) const { return fGeometrySUPP->GetCradleWallThickness();}
146 Float_t GetCradleWall (Int_t index) const { return fGeometrySUPP->GetCradleWall (index); }
147 Float_t GetCradleWheel (Int_t index) const { return fGeometrySUPP->GetCradleWheel (index); }
151 AliPHOSGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) {
152 // ctor only for internal usage (singleton)
155 void Init(void) ; // steering method for PHOS and PPSD/CPV
159 Int_t fNModules ; // Number of modules constituing PHOS
160 Float_t fAngle ; // Position angles between modules
161 Float_t *fPHOSAngle ; //[fNModules] Position angles of modules
162 Float_t fPHOSParams[4] ; // Half-sizes of PHOS trapecoid
163 Float_t fIPtoUpperCPVsurface; // Minimal distance from IP to PHOS
164 TObjArray *fRotMatrixArray ; // Liste of rotation matrices (one per phos module)
165 AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter
166 AliPHOSCPVGeometry *fGeometryCPV ; // Geometry object for CPV (IHEP)
167 AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support
169 void SetPHOSAngles(); // calculates the PHOS modules PHI angle
171 static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton
172 static Bool_t fgInit ; // Tells if geometry has been succesfully set up
174 ClassDef(AliPHOSGeometry,1) // PHOS geometry class
178 #endif // AliPHOSGEOMETRY_H