]>
Commit | Line | Data |
---|---|---|
18758be6 | 1 | #ifndef ALIL3_HISTOGRAM |
2 | #define ALIL3_HISTOGRAM | |
4de874d1 | 3 | |
4 | #include "AliL3RootTypes.h" | |
18758be6 | 5 | #include <TH2.h> |
4de874d1 | 6 | |
4cafa5fc | 7 | |
e1842819 | 8 | class AliL3Histogram { |
4de874d1 | 9 | |
10 | private: | |
18758be6 | 11 | |
12 | Double_t *fContent; //! | |
13 | Char_t fName[100]; | |
14 | Int_t fNxbins; | |
15 | Int_t fNybins; | |
16 | Int_t fNcells; | |
17 | Int_t fEntries; | |
4cafa5fc | 18 | Int_t fFirstXbin; |
19 | Int_t fFirstYbin; | |
20 | Int_t fLastXbin; | |
21 | Int_t fLastYbin; | |
e1842819 | 22 | Int_t fThreshold; |
4cafa5fc | 23 | |
18758be6 | 24 | Double_t fXmin; |
25 | Double_t fYmin; | |
26 | Double_t fXmax; | |
27 | Double_t fYmax; | |
36d25d02 | 28 | |
29 | #ifdef use_root | |
4cafa5fc | 30 | TH2F *fRootHisto; |
36d25d02 | 31 | #endif |
32 | ||
4de874d1 | 33 | public: |
34 | AliL3Histogram(); | |
18758be6 | 35 | AliL3Histogram(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin,Double_t xmax,Int_t nybin,Double_t ymin,Double_t ymax); |
36 | virtual ~AliL3Histogram(); | |
4de874d1 | 37 | |
18758be6 | 38 | void Reset(); |
e1842819 | 39 | void Fill(Double_t x,Double_t y,Int_t weight=1); |
18758be6 | 40 | Int_t FindBin(Double_t x,Double_t y); |
4cafa5fc | 41 | Int_t FindXbin(Double_t x); |
42 | Int_t FindYbin(Double_t y); | |
43 | Int_t GetBin(Int_t xbin,Int_t ybin); | |
44 | Double_t GetBinContent(Int_t bin); | |
7a21af2f | 45 | void SetBinContent(Int_t xbin,Int_t ybin,Int_t value); |
46 | void SetBinContent(Int_t bin,Int_t value); | |
18758be6 | 47 | void AddBinContent(Int_t xbin,Int_t ybin,Int_t weight); |
48 | void AddBinContent(Int_t bin,Int_t weight); | |
ca726183 | 49 | void Add(AliL3Histogram *h1,Double_t weight=1); |
e1842819 | 50 | void SetThreshold(Int_t i) {fThreshold = i;} |
4de874d1 | 51 | |
36d25d02 | 52 | #ifdef use_root |
53 | void Draw(Char_t *option="hist"); | |
4cafa5fc | 54 | TH2F *GetRootHisto() {return fRootHisto;} |
36d25d02 | 55 | #endif |
56 | ||
18758be6 | 57 | Double_t GetXmin() {return fXmin;} |
58 | Double_t GetXmax() {return fXmax;} | |
59 | Double_t GetYmin() {return fYmin;} | |
ca726183 | 60 | Double_t GetYmax() {return fYmax;} |
4cafa5fc | 61 | Double_t GetBinCenterX(Int_t xbin); |
62 | Double_t GetBinCenterY(Int_t ybin); | |
63 | Int_t GetFirstXbin() {return fFirstXbin;} | |
64 | Int_t GetLastXbin() {return fLastXbin;} | |
65 | Int_t GetFirstYbin() {return fFirstYbin;} | |
66 | Int_t GetLastYbin() {return fLastYbin;} | |
67 | Int_t GetNbinsX() {return fNxbins;} | |
68 | Int_t GetNbinsY() {return fNybins;} | |
18758be6 | 69 | Int_t GetNEntries() {return fEntries;} |
e1842819 | 70 | |
71 | ||
b1886074 | 72 | ClassDef(AliL3Histogram,1) //2D histogram class |
18758be6 | 73 | |
4de874d1 | 74 | }; |
75 | ||
76 | #endif |