]>
Commit | Line | Data |
---|---|---|
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 | |
19 | // --- ROOT system --- | |
20 | ||
d15a28e7 | 21 | // --- AliRoot header files --- |
22 | ||
daa2ae2f | 23 | #include "AliGeometry.h" |
eb92d866 | 24 | #include "AliPHOSEMCAGeometry.h" |
25 | #include "AliPHOSCPVGeometry.h" | |
ed19b2e1 | 26 | #include "AliPHOSSupportGeometry.h" |
05d33a3d | 27 | #include "AliPHOSAlignData.h" |
daa2ae2f | 28 | |
9f616d61 | 29 | |
daa2ae2f | 30 | class AliPHOSGeometry : public AliGeometry { |
31 | ||
32 | public: | |
33 | ||
e957fea8 | 34 | AliPHOSGeometry() ; |
52a36ffd | 35 | |
a8c47ab6 | 36 | AliPHOSGeometry(const AliPHOSGeometry & geom) : AliGeometry(geom) { |
e957fea8 | 37 | Fatal("cpy ctor", "not implemented") ; |
6c370def | 38 | } |
39 | ||
daa2ae2f | 40 | virtual ~AliPHOSGeometry(void) ; |
282c5906 | 41 | static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ; |
05d33a3d | 42 | static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title, |
43 | AliPHOSAlignData *alignda) ; | |
daa2ae2f | 44 | static AliPHOSGeometry * GetInstance() ; |
e8d02863 | 45 | virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrixF & gmat) const ; |
1c9d8212 | 46 | virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ; |
47 | virtual Bool_t Impact(const TParticle * particle) const ; | |
daa2ae2f | 48 | |
8c140292 | 49 | AliPHOSGeometry & operator = (const AliPHOSGeometry & /*rvalue*/) const { |
e957fea8 | 50 | Fatal("operator =", "nt implemented") ; return *(GetInstance()) ; } |
cf0c2bc1 | 51 | |
daa2ae2f | 52 | // General |
53 | ||
2725c395 | 54 | static TString Degre(void) { return TString("deg") ; } // a global for degree (deg) |
cf0c2bc1 | 55 | |
2725c395 | 56 | static TString Radian(void){ return TString("rad") ; } // a global for radian (rad) |
52a36ffd | 57 | |
fc7e2f43 | 58 | Bool_t AbsToRelNumbering(Int_t AbsId, Int_t * RelId) const ; |
710f859a | 59 | // converts the absolute PHOS numbering to a relative |
52a36ffd | 60 | |
fc7e2f43 | 61 | void EmcModuleCoverage(Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, |
710f859a | 62 | Double_t & pM, Option_t * opt = Radian() ) const ; |
63 | // calculates the angular coverage in theta and phi of a EMC module | |
7b7c1533 | 64 | void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) const ; |
710f859a | 65 | // calculates the angular coverage in theta and phi of a |
66 | // single crystal in a EMC module | |
fc7e2f43 | 67 | void ImpactOnEmc(Double_t theta, Double_t phi, Int_t & ModuleNumber, |
710f859a | 68 | Double_t & z, Double_t & x) const ; |
7b51037f | 69 | void ImpactOnEmc(const TVector3& vec, Int_t & ModuleNumber, |
aa35fc01 | 70 | Double_t & z, Double_t & x) const ; |
7b51037f | 71 | void ImpactOnEmc(const TParticle& p, Int_t & ModuleNumber, |
aa35fc01 | 72 | Double_t & z, Double_t & x) const ; |
73 | // calculates the impact coordinates of a neutral particle | |
710f859a | 74 | // emitted in direction theta and phi in ALICE |
fc7e2f43 | 75 | Bool_t IsInEMC(Int_t id) const { if (id > GetNModules() * GetNCristalsInModule() ) return kFALSE; return kTRUE; } |
710f859a | 76 | void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) const ; |
77 | // gets the position of element (pad or Xtal) relative to | |
78 | // center of PHOS module | |
fc7e2f43 | 79 | void RelPosInAlice(Int_t AbsId, TVector3 & pos) const ; |
710f859a | 80 | // gets the position of element (pad or Xtal) relative to Alice |
81 | Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ; | |
82 | // converts the absolute PHOS numbering to a relative | |
5d0435dd | 83 | void RelPosToAbsId(Int_t module, Double_t x, Double_t z, Int_t & AbsId) const; |
842988a5 | 84 | // converts local PHOS-module (x, z) coordinates to absId |
88cb7938 | 85 | |
710f859a | 86 | Bool_t IsInitialized(void) const { return fgInit ; } |
c198e326 | 87 | |
52a36ffd | 88 | // Return general PHOS parameters |
710f859a | 89 | Int_t GetNModules(void) const { return fNModules ; } |
90 | Float_t GetPHOSAngle(Int_t index) const { return fPHOSAngle[index-1] ; } | |
91 | Float_t* GetPHOSParams(void) { return fPHOSParams;} //Half-sizes of PHOS trapecoid | |
92 | Float_t GetIPtoUpperCPVsurface(void) const { return fIPtoUpperCPVsurface ; } | |
93 | Float_t GetOuterBoxSize(Int_t index) const { return 2.*fPHOSParams[index]; } | |
94 | Float_t GetCrystalSize(Int_t index) const { return fGeometryEMCA->GetCrystalSize(index) ; } | |
66c3e8ff | 95 | Float_t GetCellStep(void) const { return 2*(fGeometryEMCA->GetAirCellHalfSize()[0] + |
96 | fGeometryEMCA->GetStripWallWidthOut()) ;} | |
710f859a | 97 | |
05d33a3d | 98 | Float_t GetModuleCenter(Int_t module, Int_t axis) const { |
99 | return fModuleCenter[module][axis];} | |
100 | Float_t GetModuleAngle(Int_t module, Int_t axis, Int_t angle) const { | |
101 | return fModuleAngle[module][axis][angle];} | |
102 | ||
103 | ||
710f859a | 104 | // Return EMCA geometry parameters |
105 | ||
106 | AliPHOSEMCAGeometry * GetEMCAGeometry() const {return fGeometryEMCA ;} | |
107 | Float_t GetIPtoCrystalSurface(void) const { return fGeometryEMCA->GetIPtoCrystalSurface() ; } | |
108 | Float_t GetIPtoOuterCoverDistance(void) const { return fGeometryEMCA->GetIPtoOuterCoverDistance() ; } | |
109 | Int_t GetNPhi(void) const { return fGeometryEMCA->GetNPhi() ; } | |
110 | Int_t GetNZ(void) const { return fGeometryEMCA->GetNZ() ; } | |
111 | Int_t GetNCristalsInModule(void) const { return fGeometryEMCA->GetNPhi() * fGeometryEMCA->GetNZ() ; } | |
112 | ||
113 | // Return CPV geometry parameters | |
ed4205d8 | 114 | Int_t GetNumberOfCPVLayers(void) const { return fGeometryCPV ->GetNumberOfCPVLayers(); } |
ed4205d8 | 115 | Float_t GetCPVActiveSize(Int_t index) const { return fGeometryCPV->GetCPVActiveSize(index); } |
116 | Int_t GetNumberOfCPVChipsPhi(void) const { return fGeometryCPV->GetNumberOfCPVChipsPhi(); } | |
117 | Int_t GetNumberOfCPVChipsZ(void) const { return fGeometryCPV->GetNumberOfCPVChipsZ(); } | |
118 | Int_t GetNumberOfCPVPadsPhi(void) const { return fGeometryCPV->GetNumberOfCPVPadsPhi(); } | |
119 | Int_t GetNumberOfCPVPadsZ(void) const { return fGeometryCPV->GetNumberOfCPVPadsZ(); } | |
120 | Float_t GetPadSizePhi(void) const { return fGeometryCPV->GetCPVPadSizePhi(); } | |
121 | Float_t GetPadSizeZ(void) const { return fGeometryCPV->GetCPVPadSizeZ(); } | |
122 | Float_t GetGassiplexChipSize(Int_t index) const { return fGeometryCPV->GetGassiplexChipSize(index); } | |
123 | Float_t GetCPVGasThickness(void) const { return fGeometryCPV->GetCPVGasThickness(); } | |
124 | Float_t GetCPVTextoliteThickness(void) const { return fGeometryCPV->GetCPVTextoliteThickness(); } | |
125 | Float_t GetCPVCuNiFoilThickness(void) const { return fGeometryCPV->GetCPVCuNiFoilThickness(); } | |
126 | Float_t GetFTPosition(Int_t index) const { return fGeometryCPV->GetFTPosition(index); } | |
127 | Float_t GetCPVFrameSize(Int_t index) const { return fGeometryCPV->GetCPVFrameSize(index); } | |
710f859a | 128 | Float_t GetCPVBoxSize(Int_t index) const { return fGeometryCPV ->GetCPVBoxSize(index); } |
129 | Float_t GetIPtoCPVDistance(void) const { return GetIPtoOuterCoverDistance() - | |
130 | GetCPVBoxSize(1) - 1.0; } | |
7b51037f | 131 | void GetModuleCenter(TVector3& center, const char *det, Int_t module) const; |
132 | void Global2Local(TVector3& localPosition, | |
133 | const TVector3& globalPosition, | |
134 | Int_t module) const; | |
52a36ffd | 135 | |
710f859a | 136 | // Return PHOS' support geometry parameters |
ed19b2e1 | 137 | |
138 | Float_t GetRailOuterSize(Int_t index) const { return fGeometrySUPP->GetRailOuterSize(index); } | |
139 | Float_t GetRailPart1 (Int_t index) const { return fGeometrySUPP->GetRailPart1 (index); } | |
140 | Float_t GetRailPart2 (Int_t index) const { return fGeometrySUPP->GetRailPart2 (index); } | |
141 | Float_t GetRailPart3 (Int_t index) const { return fGeometrySUPP->GetRailPart3 (index); } | |
142 | Float_t GetRailPos (Int_t index) const { return fGeometrySUPP->GetRailPos (index); } | |
710f859a | 143 | Float_t GetRailLength (void) const { return fGeometrySUPP->GetRailLength (); } |
144 | Float_t GetDistanceBetwRails(void) const { return fGeometrySUPP->GetDistanceBetwRails(); } | |
145 | Float_t GetRailsDistanceFromIP(void) const { return fGeometrySUPP->GetRailsDistanceFromIP();} | |
ed19b2e1 | 146 | Float_t GetRailRoadSize (Int_t index) const { return fGeometrySUPP->GetRailRoadSize (index); } |
710f859a | 147 | Float_t GetCradleWallThickness(void) const { return fGeometrySUPP->GetCradleWallThickness();} |
ed19b2e1 | 148 | Float_t GetCradleWall (Int_t index) const { return fGeometrySUPP->GetCradleWall (index); } |
149 | Float_t GetCradleWheel (Int_t index) const { return fGeometrySUPP->GetCradleWheel (index); } | |
05d33a3d | 150 | void Init(void) ; // steering method for PHOS and PPSD/CPV |
151 | ||
152 | ||
153 | void SetAlignData(AliPHOSAlignData* alignda) { fgAlignData = alignda; } | |
154 | AliPHOSAlignData * AlignData() {return fgAlignData;} | |
daa2ae2f | 155 | |
6c370def | 156 | protected: |
157 | ||
aafe457d | 158 | AliPHOSGeometry(const Text_t* name, const Text_t* title="") : AliGeometry(name, title) { |
6c370def | 159 | // ctor only for internal usage (singleton) |
160 | Init() ; | |
52a36ffd | 161 | } |
daa2ae2f | 162 | private: |
6c370def | 163 | |
eb92d866 | 164 | Int_t fNModules ; // Number of modules constituing PHOS |
ed4205d8 | 165 | Float_t fAngle ; // Position angles between modules |
eb92d866 | 166 | Float_t *fPHOSAngle ; //[fNModules] Position angles of modules |
710f859a | 167 | Float_t fPHOSParams[4] ; // Half-sizes of PHOS trapecoid |
168 | Float_t fIPtoUpperCPVsurface; // Minimal distance from IP to PHOS | |
eb92d866 | 169 | TObjArray *fRotMatrixArray ; // Liste of rotation matrices (one per phos module) |
170 | AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter | |
ed4205d8 | 171 | AliPHOSCPVGeometry *fGeometryCPV ; // Geometry object for CPV (IHEP) |
ed19b2e1 | 172 | AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support |
05d33a3d | 173 | Float_t fModuleCenter[5][3]; // xyz-position of the module center |
174 | Float_t fModuleAngle[5][3][2]; // polar and azymuth angles for 3 axes of modules | |
52a36ffd | 175 | |
ed4205d8 | 176 | void SetPHOSAngles(); // calculates the PHOS modules PHI angle |
daa2ae2f | 177 | |
88714635 | 178 | static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton |
52a36ffd | 179 | static Bool_t fgInit ; // Tells if geometry has been succesfully set up |
05d33a3d | 180 | static AliPHOSAlignData * fgAlignData; // PHOS alignment data |
daa2ae2f | 181 | |
05d33a3d | 182 | ClassDef(AliPHOSGeometry,2) // PHOS geometry class |
daa2ae2f | 183 | |
184 | } ; | |
185 | ||
186 | #endif // AliPHOSGEOMETRY_H |