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