]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliJetGrid.h
New default values for baselines (F.Prino)
[u/mrichter/AliRoot.git] / JETAN / AliJetGrid.h
1 #ifndef ALIJETGRID_H
2 #define ALIJETGRID_H
3 /* Copyright(c) 2001-2002, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 // Class description :
7 //
8 // Author : Magali Estienne, IPHC Strasbourg - e-mail: magali.estienne@ires.in2p3.fr
9 //
10 // --- Standard library ---
11 #include <Riostream.h>
12 //-- Root headers ---
13 #include <TNamed.h>
14 #include <TMatrixD.h>
15 #include <TArrayD.h>
16 #include <TArrayI.h>
17 //-------------------
18
19 class AliJetGrid : public TNamed {
20
21  public:
22   
23   AliJetGrid();
24   AliJetGrid(Int_t nphi,Int_t neta,Double_t phiMin,Double_t etaMin,Double_t phiMax,Double_t etaMax);
25   AliJetGrid(const AliJetGrid& grid);
26   AliJetGrid& operator=(const AliJetGrid& other);
27   virtual ~AliJetGrid();
28
29   // Getter
30   TArrayD*  GetArrayEta();
31   TArrayD*  GetArrayPhi();
32   TMatrixD* GetIndexObject();
33   void      InitParams(Double_t phiMinCal,Double_t phiMaxCal,Double_t etaMinCal,Double_t etaMaxCal);
34   Int_t     GetIndexFromEtaPhi(Double_t phi,Double_t eta) const;
35   void      GetEtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi);
36   Int_t     GetBinsEta() const {return fNeta+1;}
37   Int_t     GetBinsPhi() const {return fNphi+1;}
38   Int_t     GetTotBins() const {return (fNeta+1)*(fNphi+1);}
39   Int_t     GetPointsEta() const {return fNeta;}
40   Int_t     GetPointsPhi() const {return fNphi;}
41   Int_t     GetTotPoints() const {return fNeta*fNphi;}
42   Int_t     GetMatrixIndex(Int_t iphi,Int_t ieta) {return static_cast<Int_t>((*fIndex)(iphi,ieta));}
43   Int_t     GetIndexIFromPhi(Double_t phi);
44   Int_t     GetIndexJFromEta(Double_t eta);
45   Int_t     GetIndex(Double_t phi,Double_t eta);
46   void      GetAccParam(Int_t &nphi, Int_t &neta, Float_t &minphi, 
47                         Float_t &maxphi, Float_t &mineta, Float_t &maxeta) const ;
48   void      GetBinParam(Int_t &phibintpc, Int_t &etabintpc, 
49                         Int_t &phibinemc, Int_t &etabinemc, Int_t &nbinphi) const;
50   void      GetIJFromIndex(Int_t index, Int_t i, Int_t j) const;
51   void      GetEtaPhiFromIndex2(Int_t index, Float_t &phi, Float_t &eta);
52   Int_t     GetNEntries();
53   Int_t     GetNEntries2();
54   Int_t     GetDeta() const {return static_cast<Int_t>((fEtaMax-fEtaMin)/fNeta); 
55     if(fDebug>21) cout << "static_cast<Int_t>((fEtaMax-fEtaMin)/fNeta) : " << 
56       static_cast<Int_t>((fEtaMax-fEtaMin)/fNeta);}
57   Int_t     GetDphi() const {return static_cast<Int_t>((fPhiMax-fPhiMin)/fNphi); 
58     if(fDebug>21) cout << "static_cast<Int_t>((fPhiMax-fPhiMin)/fNphi) : " << 
59       static_cast<Int_t>((fPhiMax-fPhiMin)/fNphi);}
60   Int_t     GetGridType() const {return fGrid;}
61
62   // Setter
63   void      SetEtaRange(Double_t etaMin, Double_t etaMax) {fEtaMin = etaMin; fEtaMax = etaMax;}
64   void      SetPhiRange(Double_t phiMin, Double_t phiMax) {fPhiMin = phiMin; fPhiMax = phiMax;}
65   void      SetNeta(Int_t neta) {fNeta = neta;}
66   void      SetNphi(Int_t nphi) {fNphi = nphi;}
67   void      SetMatrixIndexes();
68   void      SetMatrixIndex(Int_t i,Double_t par);
69   void      SetMatrixIndex(Int_t iphi,Int_t ieta,Double_t par) {
70                                  (*fIndex)(iphi,ieta)=par; return; }
71   void      SetGridType(Int_t type) {fGrid = type;}
72   void      SetIndexIJ();
73
74  private:
75   Int_t     fGrid;              // Close the type of grid you want to fill
76                                 // 0 = grid in tpc acceptance, 1 = grid in (tpc-emcal) acceptance  
77   Int_t     fNphi;              // number of points in the grid in phi
78   Int_t     fNeta;              //               "                 eta
79   TArrayD*  fPhi;               // grid points in phi
80   TArrayD*  fEta;               // grid points in eta
81   TMatrixD* fIndex;             // matrix of indexes in the grid points  
82   TArrayI*  fIndexI;            // grid points in phi
83   TArrayI*  fIndexJ;            // grid points in eta
84   Double_t  fPhiMin;            // phi acceptance min
85   Double_t  fPhiMax;            // phi acceptance max
86   Double_t  fEtaMin;            // eta acceptance min 
87   Double_t  fEtaMax;            // eta acceptance max
88   Int_t     fEtaBinInTPCAcc;    // number of points in TPC acceptance in eta
89   Int_t     fPhiBinInTPCAcc;    // number of points in TPC acceptance in phi
90   Int_t     fEtaBinInEMCalAcc;  // number of points in EMCal acceptance in eta
91   Int_t     fPhiBinInEMCalAcc;  // number of points in EMCal acceptance in phi
92   Int_t     fNbinEta;           // number of bins in eta
93   Int_t     fNbinPhi;           // number of bins in phi
94   Double_t  fMaxPhi;            // maximum phi
95   Double_t  fMinPhi;            // minimum phi
96   Double_t  fMaxEta;            // maximum eta
97   Double_t  fMinEta;            // minimum eta
98   Int_t     fDebug;             // debug flag
99
100   ClassDef(AliJetGrid,1) // Parameters used by AliTPCtrackerParam 
101 };
102
103
104 #endif
105
106
107
108