]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALGeometry.h
Removed a mem leak by deleting curSDigit in Exec()
[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 {
ca8f5bd0 28 public:
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 {}
48d44618 48 virtual Bool_t Impact(const TParticle * particle) const {return kTRUE;}
ca8f5bd0 49 // General
50 Bool_t IsInitialized(void) const { return fgInit ; }
51 // Return EMCA geometrical parameters
52 // geometry
53 const Float_t GetAirGap() const { return fAirGap ; }
e908f07f 54 const Float_t GetAlFrontThickness() const { return fAlFrontThick;}
ca8f5bd0 55 const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
56 const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
e908f07f 57 const Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
58 const Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
ca8f5bd0 59 const Float_t GetIPDistance() const { return fIPDistance ; }
60 const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }
61 const Float_t GetShellThickness() const { return fShellThickness ; }
62 const Float_t GetZLength() const { return fZLength ; }
63 const Float_t GetGap2Active() const {return fGap2Active ; }
e908f07f 64 const Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/
65 ((Float_t)fNZ);}
66 const Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
67 ((Float_t)fNPhi);}
ca8f5bd0 68 const Int_t GetNLayers() const {return fNLayers ;}
69 const Int_t GetNZ() const {return fNZ ;}
e908f07f 70 const Int_t GetNEta() const {return fNZ ;}
ca8f5bd0 71 const Int_t GetNPhi() const {return fNPhi ;}
6119e5db 72 const Int_t GetNTowers() const {return fNPhi * fNZ ;}
e908f07f 73 const Float_t GetPbRadThick(){ // returns Pb radiator thickness in cm.
74 return fPbRadThickness;
75 }
76 const Float_t GetFullSintThick(){ // returns Full tower sintilator
77 // thickness in cm.
78 return fFullShowerSintThick;
79 }
80 const Float_t GetPreSintThick(){ // returns PreShower tower sintilator
81 // thickness in cm.
82 return fPreShowerSintThick;
83 }
84 Float_t AngleFromEta(Float_t eta){ // returns angle in radians for a given
85 // pseudorapidity.
86 return 2.0*TMath::ATan(TMath::Exp(-eta));
87 }
88 Float_t ZFromEtaR(Float_t r,Float_t eta){ // returns z in for a given
89 // pseudorapidity and r=sqrt(x*x+y*y).
90 return r/TMath::Tan(AngleFromEta(eta));
91 }
da98933e 92 Int_t TowerIndex(Int_t iz,Int_t iphi,Int_t ipre) const; // returns tower index
ca8f5bd0 93 // returns tower indexs iz, iphi.
da98933e 94 void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi,Int_t &ipre) const;
ca8f5bd0 95 // for a given tower index it returns eta and phi of center of that tower.
da98933e 96 void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const;
6119e5db 97 // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid.
98 void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const;
ca8f5bd0 99 // for a given eta and phi in the EMCAL it returns the tower index.
da98933e 100 Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
ca8f5bd0 101 // for a given eta and phi in the EMCAL it returns the pretower index.
da98933e 102 Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
ca8f5bd0 103 // Returns theta and phi (degree) for a given EMCAL cell indecated by relid
a34b7b9f 104 void PosInAlice(const Int_t *relid,Float_t &theta,Float_t &phi) const ;
ca8f5bd0 105 // Returns an array indicating the Tower/preshower, iz, and iphi for a
106 // specific EMCAL indes.
da98933e 107 Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const;
ca8f5bd0 108 /*
109 // Returns kTRUE if the two indexs are neighboring towers or preshowers.
da98933e 110 Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const;
ca8f5bd0 111 */
112
113 protected:
114 AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
e908f07f 115 AliGeometry(name, title) {// ctor only for internal usage (singleton)
116 Init();
ca8f5bd0 117 };
118 void Init(void) ; // initializes the parameters of EMCAL
e908f07f 119
ca8f5bd0 120 private:
121 static AliEMCALGeometry * fgGeom ; // pointer to the unique instance
122 // of the singleton
e908f07f 123 static Bool_t fgInit;// Tells if geometry has been succesfully set up.
124 Float_t fAirGap; // Distance between envelop and active material
125 Float_t fAlFrontThick; // Thickness of the front Al face of the support box
126 Float_t fPreShowerSintThick; // Thickness of the sintilator for the
127 // preshower part of the calorimeter
128 Float_t fFullShowerSintThick;// Thickness of the sintilaor for the full
129 // shower part of the calorimeter
130 Float_t fPbRadThickness; // Thickness of Pb radiators cm.
131 Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
132 Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
133 Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
134 Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta
ca8f5bd0 135
136 // It is assumed that Arm1 and Arm2 have the same following parameters
e908f07f 137 Float_t fEnvelop[3]; // the GEANT TUB for the detector
138 Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
139 Float_t fShellThickness; // Total thickness in (x,y) direction
140 Float_t fZLength; // Total length in z direction
141 Float_t fGap2Active; // Gap between the envelop and the active material
142 Int_t fNLayers; // Number of layers of material in the R direction
143 Int_t fNZ; // Number of Towers in the Z direction
144 Int_t fNPhi; //Number of Towers in the Phi Direction
2012850d 145
e908f07f 146 ClassDef(AliEMCALGeometry,3) // EMCAL geometry class
2012850d 147
e908f07f 148};
2012850d 149
150#endif // AliEMCALGEOMETRY_H