]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALGeometry.h
Initialize fFirstEvent and fLastEvent
[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
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;}
a97849a9 51 // General
52 Bool_t IsInitialized(void) const { return fgInit ; }
fdebddeb 53 // Return EMCA geometrical parameters
a97849a9 54 // geometry
09884213 55 Float_t GetAlFrontThickness() const { return fAlFrontThick;}
56 Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
57 Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
58 Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
59 Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
60 Float_t GetIPDistance() const { return fIPDistance;}
61 Float_t GetIP2ECASection() const { return ( GetIPDistance() + GetAlFrontThickness() + GetGap2Active() ) ; }
62 Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }
63 Float_t GetShellThickness() const { return fShellThickness ; }
64 Float_t GetZLength() const { return fZLength ; }
65 Float_t GetGap2Active() const {return fGap2Active ; }
66 Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/
a97849a9 67 ((Float_t)fNZ);}
09884213 68 Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
a97849a9 69 ((Float_t)fNPhi);}
09884213 70 Int_t GetNECLayers() const {return fNECLayers ;}
71 Int_t GetNZ() const {return fNZ ;}
72 Int_t GetNEta() const {return fNZ ;}
73 Int_t GetNPhi() const {return fNPhi ;}
74 Int_t GetNTowers() const {return fNPhi * fNZ ;}
75 Float_t GetECPbRadThick()const {return fECPbRadThickness;}
76 Float_t GetECScintThick() const {return fECScintThick;}
77 Float_t GetSampling() const {return fSampling ; }
78 Bool_t IsInECA(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;}
fdebddeb 79
80 Float_t AngleFromEta(Float_t eta){ // returns theta in radians for a given pseudorapidity
a97849a9 81 return 2.0*TMath::ATan(TMath::Exp(-eta));
82 }
83 Float_t ZFromEtaR(Float_t r,Float_t eta){ // returns z in for a given
84 // pseudorapidity and r=sqrt(x*x+y*y).
85 return r/TMath::Tan(AngleFromEta(eta));
86 }
395c7ba2 87 Int_t TowerIndex(Int_t iz,Int_t iphi) const; // returns tower index
fdebddeb 88 // returns tower indexs iz, iphi.
89 void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi) const;
90 // for a given tower index it returns eta and phi of center of that tower.
a97849a9 91 void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const;
fdebddeb 92 // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid.
a97849a9 93 void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const;
09884213 94 void XYZFromIndex(Int_t absid, TVector3 &v) const;
fdebddeb 95 // for a given eta and phi in the EMCAL it returns the tower index.
a97849a9 96 Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
fdebddeb 97 // for a given eta and phi in the EMCAL it returns the pretower index.
a97849a9 98 Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
fdebddeb 99 // Returns theta and phi (degree) for a given EMCAL cell indicated by relid or absid
395c7ba2 100 void PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const ;
09884213 101 void PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const ;
a97849a9 102 Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const;
fdebddeb 103 void SetNZ(Int_t nz) { fNZ= nz ; printf("SetNZ: Number of modules in Z set to %d", fNZ) ; }
104 void SetNPhi(Int_t nphi) { fNPhi= nphi ; printf("SetNPhi: Number of modules in Phi set to %d", fNPhi) ; }
105 void SetSampling(Float_t samp) { fSampling = samp; printf("SetSampling: Sampling factor set to %f", fSampling) ; }
395c7ba2 106
a97849a9 107protected:
108 AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
109 AliGeometry(name, title) {// ctor only for internal usage (singleton)
110 Init();
111 };
fdebddeb 112 void Init(void); // initializes the parameters of EMCAL
a97849a9 113
114private:
fdebddeb 115 static AliEMCALGeometry * fgGeom; // pointer to the unique instance of the singleton
116 static Bool_t fgInit; // Tells if geometry has been succesfully set up.
117 Float_t fAlFrontThick; // Thickness of the front Al face of the support box
395c7ba2 118
fdebddeb 119 Float_t fECPbRadThickness; // cm, Thickness of the Pb radiators
120 Float_t fECScintThick; // cm, Thickness of the scintillators
121 Int_t fNECLayers; // number of scintillator layers
395c7ba2 122
fdebddeb 123 Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
124 Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
125 Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
126 Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta
a97849a9 127
fdebddeb 128 // Geometry Parameters
129 Float_t fEnvelop[3]; // the GEANT TUB for the detector
130 Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
131 Float_t fShellThickness; // Total thickness in (x,y) direction
132 Float_t fZLength; // Total length in z direction
133 Float_t fGap2Active; // Gap between the envelop and the active material
134 Int_t fNZ; // Number of Towers in the Z direction
135 Int_t fNPhi; // Number of Towers in the Phi Direction
136 Float_t fSampling; // Sampling factor
a97849a9 137
fdebddeb 138 ClassDef(AliEMCALGeometry,7) // EMCAL geometry class
a97849a9 139
ca8f5bd0 140 };
2012850d 141
142#endif // AliEMCALGEOMETRY_H