added the HCAL section. Revised the way fluctiations and noise are added
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALGeometry.h
CommitLineData
2012850d 1#ifndef ALIEMCALGEOMETRY_H
2#define ALIEMCALGEOMETRY_H
3/* Copyright(c) 1998-1999, 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
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
2012850d 15#include <assert.h>
16
17// --- ROOT system ---
b13bbe81 18#include "TString.h"
19#include "TObjArray.h"
20#include "TVector3.h"
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 };
33 AliEMCALGeometry(const AliEMCALGeometry & geom) {
34 // cpy ctor requested by Coding Convention but not yet needed
35 assert(0==1);
36 };
37 virtual ~AliEMCALGeometry(void) ;
38 static AliEMCALGeometry * GetInstance(const Text_t* name,
39 const Text_t* title="") ;
40 static AliEMCALGeometry * GetInstance() ;
41 AliEMCALGeometry & operator = (const AliEMCALGeometry & rvalue) const {
42 // assignement operator requested by coding convention but not needed
43 assert(0==1) ;
44 return *(GetInstance()) ;
45 };
46 virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrix &) const {}
47 virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {}
48 virtual Bool_t Impact(const TParticle * particle) const {return kTRUE;}
49 // General
50 Bool_t IsInitialized(void) const { return fgInit ; }
51 // Return EMCA geometrical parameters
52 // geometry
53 const Float_t GetAlFrontThickness() const { return fAlFrontThick;}
54 const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
55 const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
56 const Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
57 const Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
58 const Float_t GetIPDistance() const { return fIPDistance ; }
59 const Float_t GetIP2PreShower() const { return (GetIPDistance() + GetAlFrontThickness() + GetGap2Active() ) ;}
60 const Float_t GetIP2Tower() const { return ( GetIP2PreShower() + 2 * ( GetPreSintThick() + GetPbRadThick() ) ) ; }
61 const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }
62 const Float_t GetShellThickness() const { return fShellThickness ; }
63 const Float_t GetZLength() const { return fZLength ; }
64 const Float_t GetGap2Active() const {return fGap2Active ; }
65 const Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/
66 ((Float_t)fNZ);}
67 const Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
68 ((Float_t)fNPhi);}
a63e0d5e 69 const Int_t GetNECLayers() const {return fNECLayers ;}
70 const Int_t GetNHCLayers() const {return fNHCLayers ;}
71 const Int_t GetNPRLayers() const {return fNPRLayers;}
a97849a9 72 const Int_t GetNZ() const {return fNZ ;}
73 const Int_t GetNEta() const {return fNZ ;}
74 const Int_t GetNPhi() const {return fNPhi ;}
75 const Int_t GetNTowers() const {return fNPhi * fNZ ;}
a63e0d5e 76 const Float_t GetPbRadThick()const {return fPbRadThickness;}
77 const Float_t GetCuRadThick()const {return fCuRadThickness;}
a97849a9 78 const Float_t GetFullSintThick() const { // returns Full tower sintilator
79 // thickness in cm.
80 return fFullShowerSintThick;
81 }
82 const Float_t GetPreSintThick() const { // returns PreShower tower sintilator
83 // thickness in cm.
84 return fPreShowerSintThick;
85 }
86 Float_t AngleFromEta(Float_t eta){ // returns angle in radians for a given
87 // pseudorapidity.
88 return 2.0*TMath::ATan(TMath::Exp(-eta));
89 }
90 Float_t ZFromEtaR(Float_t r,Float_t eta){ // returns z in for a given
91 // pseudorapidity and r=sqrt(x*x+y*y).
92 return r/TMath::Tan(AngleFromEta(eta));
93 }
94 Int_t TowerIndex(Int_t iz,Int_t iphi,Int_t ipre) const; // returns tower index
95 // returns tower indexs iz, iphi.
96 void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi,Int_t &ipre) const;
97 // for a given tower index it returns eta and phi of center of that tower.
98 void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const;
99 // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid.
100 void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const;
101 // for a given eta and phi in the EMCAL it returns the tower index.
102 Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
103 // for a given eta and phi in the EMCAL it returns the pretower index.
104 Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
105 // Returns theta and phi (degree) for a given EMCAL cell indecated by relid
106 void PosInAlice(const Int_t *relid,Float_t &theta,Float_t &phi) const ;
107 // Returns an array indicating the Tower/preshower, iz, and iphi for a
108 // specific EMCAL indes.
109 Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const;
110 /*
111 // Returns kTRUE if the two indexs are neighboring towers or preshowers.
112 Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const;
113 */
114
115 void SetNZ(Int_t nz) { fNZ= nz ; Info("SetNZ", "Number of modules in Z set to %d", fNZ) ; }
116 void SetNPhi(Int_t nphi) { fNPhi= nphi ; Info("SetNPhi", "Number of modules in Phi set to %d", fNPhi) ; }
117
118protected:
119 AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
120 AliGeometry(name, title) {// ctor only for internal usage (singleton)
121 Init();
122 };
123 void Init(void) ; // initializes the parameters of EMCAL
124
125private:
126 static AliEMCALGeometry * fgGeom ; // pointer to the unique instance
127 // of the singleton
128 static Bool_t fgInit;// Tells if geometry has been succesfully set up.
129 Float_t fAlFrontThick; // Thickness of the front Al face of the support box
130 Float_t fPreShowerSintThick; // Thickness of the sintilator for the
131 // preshower part of the calorimeter
132 Float_t fFullShowerSintThick;// Thickness of the sintilaor for the full
133 // shower part of the calorimeter
134 Float_t fPbRadThickness; // Thickness of Pb radiators cm.
a63e0d5e 135 Float_t fCuRadThickness; // Thickness of Cu radiators cm.
a97849a9 136 Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
137 Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
138 Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
139 Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta
140
141 // It is assumed that Arm1 and Arm2 have the same following parameters
a63e0d5e 142 Float_t fEnvelop[3]; // the GEANT TUB for the detector
143 Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
a97849a9 144 Float_t fShellThickness; // Total thickness in (x,y) direction
145 Float_t fZLength; // Total length in z direction
146 Float_t fGap2Active; // Gap between the envelop and the active material
a63e0d5e 147 Int_t fNECLayers; // Number of layers of material in the R direction for the electromagnetic calorimeter
148 Int_t fNPRLayers; // Number of layers of material in the R direction for the preshower
149 Int_t fNHCLayers; // Number of layers of material in the R direction for the hadron calorimeter
a97849a9 150 Int_t fNZ; // Number of Towers in the Z direction
a63e0d5e 151 Int_t fNPhi; // Number of Towers in the Phi Direction
a97849a9 152
a63e0d5e 153 ClassDef(AliEMCALGeometry,5) // EMCAL geometry class
a97849a9 154
ca8f5bd0 155 };
2012850d 156
157#endif // AliEMCALGEOMETRY_H