]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
2 | ||
bd2f8772 | 3 | #ifndef ALIL3HISTOGRAM1D_H |
4 | #define ALIL3HISTOGRAM1D_H | |
f7473b79 | 5 | |
6 | #include "AliL3RootTypes.h" | |
f7473b79 | 7 | |
95a00d93 | 8 | #ifdef use_root |
bd2f8772 | 9 | class TH1F; |
95a00d93 | 10 | #endif |
f7473b79 | 11 | |
12 | class AliL3Histogram1D { | |
13 | ||
f7473b79 | 14 | public: |
15 | AliL3Histogram1D(); | |
16 | AliL3Histogram1D(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin,Double_t xmax); | |
17 | virtual ~AliL3Histogram1D(); | |
18 | ||
19 | void Reset(); | |
20 | void Fill(Double_t x,Int_t weight=1); | |
21 | void AddBinContent(Int_t bin,Int_t weight); | |
bd2f8772 | 22 | Int_t GetMaximumBin() const; |
23 | Int_t FindBin(Double_t x) const; | |
24 | Double_t GetBinContent(Int_t bin) const; | |
25 | Double_t GetBinCenter(Int_t bin) const; | |
26 | Int_t GetNEntries() const {return fEntries;} | |
f7473b79 | 27 | |
28 | void SetBinContent(Int_t bin,Int_t value); | |
29 | void SetThreshold(Int_t i) {fThreshold = i;} | |
30 | ||
31 | ||
32 | #ifdef use_root | |
33 | void Draw(Char_t *option="hist"); | |
34 | TH1F *GetRootHisto() {return fRootHisto;} | |
35 | #endif | |
36 | ||
bd2f8772 | 37 | private: |
38 | ||
39 | Double_t *fContent; //! | |
40 | Char_t fName[100];//Histogram title | |
41 | Int_t fNbins;//Number of bins | |
42 | Int_t fNcells;//Number of cells | |
43 | Int_t fEntries;//Number of entries | |
44 | ||
45 | Int_t fThreshold;//Bin content threshold | |
46 | Double_t fXmin;//Lower limit in X | |
47 | Double_t fXmax;//Upper limit in X | |
48 | ||
49 | ||
50 | #ifdef use_root | |
51 | TH1F *fRootHisto;//The corresponding ROOT histogram | |
52 | #endif | |
53 | ||
b1886074 | 54 | ClassDef(AliL3Histogram1D,1) //1D histogram class |
f7473b79 | 55 | |
56 | }; | |
57 | ||
58 | #endif |