]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/hough/AliL3Histogram1D.h
Introduction of the online monitoring code into the alimdc package. Fixed some memory...
[u/mrichter/AliRoot.git] / HLT / hough / AliL3Histogram1D.h
1 // @(#) $Id$
2
3 #ifndef ALIL3HISTOGRAM1D_H
4 #define ALIL3HISTOGRAM1D_H
5
6 #include "AliL3RootTypes.h"
7
8 #ifdef use_root
9 class TH1F;
10 #endif
11
12 class AliL3Histogram1D {
13   
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);
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;}
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   
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
54   ClassDef(AliL3Histogram1D,1) //1D histogram class
55     
56 };
57
58 #endif