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