]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALGeometry.h
Added methods to retrieve various parameters
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALGeometry.h
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
10 // EMCAL consists of a layers of scintillator, and lead.
11 //                  
12 //*-- Author: Sahal Yacoob (LBL / UCT)
13 //*--   and : Yves Schutz (Subatech)
14
15 #include <assert.h> 
16
17 // --- ROOT system ---
18 #include "TString.h"
19 #include "TObjArray.h"
20 #include "TVector3.h"
21
22 // --- AliRoot header files ---
23
24 #include "AliGeometry.h"
25
26
27 class AliEMCALGeometry : public AliGeometry {
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 {}
48     // General
49     Bool_t  IsInitialized(void) const { return fgInit ; }
50     // Return EMCA geometrical parameters
51     // geometry
52     const Float_t GetAirGap() const { return fAirGap ; }
53     const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
54     const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
55     const Float_t GetIPDistance()   const { return  fIPDistance  ; } 
56     const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }  
57     const Float_t GetShellThickness() const { return fShellThickness ; }
58     const Float_t GetZLength() const { return fZLength ; } 
59     const Float_t GetGap2Active() const {return  fGap2Active ; }
60     const Int_t   GetNLayers() const {return fNLayers ;}
61     const Int_t   GetNZ() const {return fNZ ;}
62     const Int_t   GetNPhi() const {return fNPhi ;}
63     Int_t TowerIndex(Int_t iz,Int_t iphi,Int_t ipre); // returns tower index
64     // returns tower indexs iz, iphi.
65     void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi,Int_t &ipre);
66     // for a given tower index it returns eta and phi of center of that tower.
67     void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi);
68     // for a given eta and phi in the EMCAL it returns the tower index.
69     Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi);
70     // for a given eta and phi in the EMCAL it returns the pretower index.
71     Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi);
72     // Returns theta and phi (degree) for a given EMCAL cell indecated by relid
73     void RelPosInModule(const Int_t *relid,Float_t &theta,Float_t &phi);
74     // Returns an array indicating the Tower/preshower, iz, and iphi for a
75     // specific EMCAL indes.
76     Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid);
77     /*
78     // Returns kTRUE if the two indexs are neighboring towers or preshowers.
79     Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2);
80  */
81
82  protected:
83     AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
84         AliGeometry(name, title) { 
85         // ctor only for internal usage (singleton)
86         Init() ; 
87     };
88     void Init(void) ;            // initializes the parameters of EMCAL
89  private:
90     static AliEMCALGeometry * fgGeom ; // pointer to the unique instance
91                                        // of the singleton 
92     static Bool_t fgInit ;// Tells if geometry has been succesfully set up
93                           // geometry
94     Float_t fAirGap ; // Distance between envelop and active material 
95     Float_t fArm1PhiMin ; // Minimum angular position of EMCAL in Phi (degrees)
96     Float_t fArm1PhiMax ; // Maximum angular position of EMCAL in Phi (degrees)
97
98     // It is assumed that Arm1 and Arm2 have the same following parameters
99     Float_t fEnvelop[3] ;              // the GEANT TUB for the detector 
100     Float_t fIPDistance ; // Distance of the inner surface to the
101                           // interaction point
102     Float_t fShellThickness ;          // Total thickness in (x,y) direction
103     Float_t fZLength ;                 // Total length in z direction
104     Float_t fGap2Active ; // Gap between the envelop and the active material
105     Int_t fNLayers ; // Number of layers of material in the R direction
106     Int_t fNZ ;                      // Number of Towers in the Z direction
107     Int_t fNPhi ;                    //Number of Towers in the Phi Direction
108  
109     ClassDef(AliEMCALGeometry,2)       // EMCAL geometry class 
110
111 } ;
112
113 #endif // AliEMCALGEOMETRY_H
114
115