]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIEMCALGEOMETRY_H | |
2 | #define ALIEMCALGEOMETRY_H | |
3 | /* Copyright(c) 1998-2004, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //_________________________________________________________________________ | |
9 | // Geometry class for EMCAL : singleton | |
10 | // EMCAL consists of a layers of scintillator, and lead. | |
11 | // | |
12 | //*-- Author: Sahal Yacoob (LBL / UCT) | |
13 | //*-- and : Yves Schutz (Subatech) | |
14 | //*-- and : Aleksei Pavlinov (WSU) - shashlyk staff | |
15 | ||
16 | // --- ROOT system --- | |
17 | class TString ; | |
18 | class TObjArray; | |
19 | class TVector3 ; | |
20 | class TParticle ; | |
21 | ||
22 | // --- AliRoot header files --- | |
23 | #include "AliGeometry.h" | |
24 | ||
25 | class AliEMCALGeometry : public AliGeometry { | |
26 | public: | |
27 | AliEMCALGeometry(const AliEMCALGeometry& geom):AliGeometry(geom) { | |
28 | // cpy ctor requested by Coding Convention but not yet needed | |
29 | Fatal("Cpy ctor", "Not implemented"); | |
30 | }; | |
31 | virtual ~AliEMCALGeometry(void) ; | |
32 | static AliEMCALGeometry * GetInstance(const Text_t* name, | |
33 | const Text_t* title="") ; | |
34 | static AliEMCALGeometry * GetInstance() ; | |
35 | AliEMCALGeometry & operator = (const AliEMCALGeometry & /*rvalue*/) const { | |
36 | // assignement operator requested by coding convention but not needed | |
37 | Fatal("operator =", "not implemented"); | |
38 | return *(GetInstance()) ; | |
39 | }; | |
40 | ||
41 | Bool_t AreInSameTower(Int_t id1, Int_t id2) const ; | |
42 | virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrixF &) const {} | |
43 | virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {} | |
44 | virtual Bool_t Impact(const TParticle *) const {return kTRUE;} | |
45 | ||
46 | Bool_t IsInEMCAL(Double_t x, Double_t y, Double_t z) const; | |
47 | // General | |
48 | Bool_t IsInitialized(void) const { return fgInit ; } | |
49 | // Return EMCAL geometrical parameters | |
50 | // geometry | |
51 | Float_t GetAlFrontThickness() const { return fAlFrontThick;} | |
52 | Float_t GetArm1PhiMin() const { return fArm1PhiMin ; } | |
53 | Float_t GetArm1PhiMax() const { return fArm1PhiMax ; } | |
54 | Float_t GetArm1EtaMin() const { return fArm1EtaMin;} | |
55 | Float_t GetArm1EtaMax() const { return fArm1EtaMax;} | |
56 | Float_t GetIPDistance() const { return fIPDistance;} | |
57 | Float_t GetIP2ECASection() const { return ( GetIPDistance() + GetAlFrontThickness() + GetGap2Active() ) ; } | |
58 | Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; } | |
59 | Float_t GetShellThickness() const { return fShellThickness ; } | |
60 | Float_t GetZLength() const { return fZLength ; } | |
61 | Float_t GetGap2Active() const {return fGap2Active ;} | |
62 | Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/ | |
63 | ((Float_t)fNZ);} | |
64 | Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/ | |
65 | ((Float_t)fNPhi);} | |
66 | Int_t GetNECLayers() const {return fNECLayers ;} | |
67 | Int_t GetNZ() const {return fNZ ;} | |
68 | Int_t GetNEta() const {return fNZ ;} | |
69 | Int_t GetNPhi() const {return fNPhi ;} | |
70 | Int_t GetNTowers() const {return fNPhi * fNZ ;} | |
71 | Float_t GetECPbRadThick()const {return fECPbRadThickness;} | |
72 | Float_t GetECScintThick() const {return fECScintThick;} | |
73 | Float_t GetSampling() const {return fSampling ; } | |
74 | Bool_t IsInECA(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;} | |
75 | ||
76 | Int_t GetNumberOfSuperModules() {return fNumberOfSuperModules;} | |
77 | Float_t GetfPhiGapForSuperModules() {return fPhiGapForSM;} | |
78 | Float_t GetPhiModuleSize() const {return fPhiModuleSize;} | |
79 | Float_t GetEtaModuleSize() const {return fEtaModuleSize;} | |
80 | Float_t GetFrontSteelStrip() const {return fFrontSteelStrip;} | |
81 | Float_t GetLateralSteelStrip() const {return fLateralSteelStrip;} | |
82 | Float_t GetPassiveScintThick() const {return fPassiveScintThick;} | |
83 | Float_t GetPhiTileSize() const {return fPhiTileSize;} | |
84 | Float_t GetEtaTileSize() const {return fEtaTileSize;} | |
85 | Int_t GetNPhiSuperModule() const {return fNPhiSuperModule;} | |
86 | Int_t GetNPHIdiv() const {return fNPHIdiv ;} | |
87 | Int_t GetNETAdiv() const {return fNETAdiv ;} | |
88 | Int_t GetNCells() const {return fNCells;} | |
89 | Float_t GetSteelFrontThickness() const { return fSteelFrontThick;} | |
90 | Float_t GetLongModuleSize() const {return fLongModuleSize;} | |
91 | ||
92 | Float_t GetTrd1Angle() const {return fTrd1Angle;} | |
93 | Float_t Get2Trd1Dx2() const {return f2Trd1Dx2;} | |
94 | Float_t GetTrd2AngleY()const {return fTrd2AngleY;} | |
95 | Float_t Get2Trd2Dy2() const {return f2Trd2Dy2;} | |
96 | Float_t GetTubsR() const {return fTubsR;} | |
97 | Float_t GetTubsTurnAngle() const {return fTubsTurnAngle;} | |
98 | // Dabs id <-> indexes; Shish-kebab case | |
99 | Int_t GetAbsCellId(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta); | |
100 | Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nTower, Int_t &nIphi, Int_t &nIeta); | |
101 | void GetTowerPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t &iphit, Int_t &ietat); | |
102 | void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta, | |
103 | Int_t &iphi, Int_t &ieta); | |
104 | Bool_t CheckAbsCellId(Int_t ind); // replace the IsInECA | |
105 | // --- | |
106 | Float_t AngleFromEta(Float_t eta){ // returns theta in radians for a given pseudorapidity | |
107 | return 2.0*TMath::ATan(TMath::Exp(-eta)); | |
108 | } | |
109 | Float_t ZFromEtaR(Float_t r,Float_t eta){ // returns z in for a given | |
110 | // pseudorapidity and r=sqrt(x*x+y*y). | |
111 | return r/TMath::Tan(AngleFromEta(eta)); | |
112 | } | |
113 | // These methods are obsolete but use in AliEMCALRecPoint - keep it now | |
114 | Int_t TowerIndex(Int_t iz,Int_t iphi) const; // returns tower index | |
115 | // returns tower indexs iz, iphi. | |
116 | void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi) const; | |
117 | // for a given tower index it returns eta and phi of center of that tower. | |
118 | void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const; | |
119 | // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid. | |
120 | void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const; | |
121 | void XYZFromIndex(Int_t absid, TVector3 &v) const; | |
122 | // for a given eta and phi in the EMCAL it returns the tower index. | |
123 | Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const; | |
124 | // for a given eta and phi in the EMCAL it returns the pretower index. | |
125 | void PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const ; | |
126 | void PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const ; | |
127 | Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const; | |
128 | // -- | |
129 | void SetNZ(Int_t nz) { fNZ= nz ; printf("SetNZ: Number of modules in Z set to %d", fNZ) ; } | |
130 | void SetNPhi(Int_t nphi) { fNPhi= nphi ; printf("SetNPhi: Number of modules in Phi set to %d", fNPhi) ; } | |
131 | void SetSampling(Float_t samp) { fSampling = samp; printf("SetSampling: Sampling factor set to %f", fSampling) ; } | |
132 | ||
133 | protected: | |
134 | AliEMCALGeometry(const Text_t* name, const Text_t* title="") : | |
135 | AliGeometry(name, title) {// ctor only for internal usage (singleton) | |
136 | Init(); | |
137 | }; | |
138 | AliEMCALGeometry() : | |
139 | AliGeometry() {// ctor only for internal usage (singleton) | |
140 | Init(); | |
141 | }; | |
142 | void Init(void); // initializes the parameters of EMCAL | |
143 | void CheckAditionalOptions(); // | |
144 | ||
145 | private: | |
146 | static AliEMCALGeometry * fgGeom; // pointer to the unique instance of the singleton | |
147 | static Bool_t fgInit; // Tells if geometry has been succesfully set up. | |
148 | TObjArray *fArrayOpts; //! array of geometry options | |
149 | ||
150 | Float_t fAlFrontThick; // Thickness of the front Al face of the support box | |
151 | Float_t fECPbRadThickness; // cm, Thickness of the Pb radiators | |
152 | Float_t fECScintThick; // cm, Thickness of the scintillators | |
153 | Int_t fNECLayers; // number of scintillator layers | |
154 | ||
155 | Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees) | |
156 | Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees) | |
157 | Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta | |
158 | Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta | |
159 | ||
160 | // Geometry Parameters | |
161 | Float_t fEnvelop[3]; // the GEANT TUB for the detector | |
162 | Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL | |
163 | Float_t fShellThickness; // Total thickness in (x,y) direction | |
164 | Float_t fZLength; // Total length in z direction | |
165 | Float_t fGap2Active; // Gap between the envelop and the active material | |
166 | Int_t fNZ; // Number of Towers in the Z direction | |
167 | Int_t fNPhi; // Number of Towers in the PHI direction | |
168 | Float_t fSampling; // Sampling factor | |
169 | ||
170 | // Shish-kebab option - 23-aug-04 by PAI; COMPACT, TWIST, TRD1 and TRD2 | |
171 | Int_t fNumberOfSuperModules; // default is 12 = 6 * 2 | |
172 | Float_t fSteelFrontThick; // Thickness of the front stell face of the support box - 9-sep-04 | |
173 | Float_t fFrontSteelStrip; // 13-may-05 | |
174 | Float_t fLateralSteelStrip; // 13-may-05 | |
175 | Float_t fPassiveScintThick; // 13-may-05 | |
176 | Float_t fPhiModuleSize; // Phi -> X | |
177 | Float_t fEtaModuleSize; // Eta -> Y | |
178 | Float_t fPhiTileSize; // | |
179 | Float_t fEtaTileSize; // | |
180 | Float_t fLongModuleSize; // | |
181 | Int_t fNPhiSuperModule; // 6 - number supermodule in phi direction | |
182 | Int_t fNPHIdiv; // number phi divizion of module | |
183 | Int_t fNETAdiv; // number eta divizion of module | |
184 | // | |
185 | Int_t fNCells; // number of cells in calo | |
186 | Int_t fNCellsInSupMod; // number cell in super module | |
187 | Int_t fNCellsInTower; // number cell in tower(or module) | |
188 | // TRD1 options - 30-sep-04 | |
189 | Float_t fTrd1Angle; // angle in x-z plane (in degree) | |
190 | Float_t f2Trd1Dx2; // 2*dx2 for TRD1 | |
191 | Float_t fPhiGapForSM; // Gap betweeen supermodules in phi direction | |
192 | Int_t fKey110DEG; // for calculation abs cell id; 19-oct-05 | |
193 | // TRD2 options - 27-jan-07 | |
194 | Float_t fTrd2AngleY; // angle in y-z plane (in degree) | |
195 | Float_t f2Trd2Dy2; // 2*dy2 for TRD2 | |
196 | Float_t fEmptySpace; // 2mm om fred drawing | |
197 | // Super module as TUBS | |
198 | Float_t fTubsR; // radius of tubs | |
199 | Float_t fTubsTurnAngle; // turn angle of tubs in degree | |
200 | // Service routine | |
201 | static int ParseString(const TString &topt, TObjArray &Opt); | |
202 | ||
203 | ClassDef(AliEMCALGeometry,10) // EMCAL geometry class | |
204 | }; | |
205 | ||
206 | #endif // AliEMCALGEOMETRY_H |