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