]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/hough/AliL3Histogram1D.h
Added 1D histograms.
[u/mrichter/AliRoot.git] / HLT / hough / AliL3Histogram1D.h
1 #ifndef ALIL3_HISTOGRAM1D
2 #define ALIL3_HISTOGRAM1D
3
4 #include "AliL3RootTypes.h"
5 #include <TH1.h>
6
7
8 class AliL3Histogram1D {
9   
10  private:
11   
12   Double_t *fContent; //!
13   Char_t fName[100];
14   Int_t fNbins;
15   Int_t fNcells;
16   Int_t fEntries;
17
18   Int_t fThreshold;
19   Double_t fXmin;
20   Double_t fXmax;
21
22   
23 #ifdef use_root
24   TH1F *fRootHisto;
25 #endif  
26
27  public:
28   AliL3Histogram1D();
29   AliL3Histogram1D(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin,Double_t xmax);
30   virtual ~AliL3Histogram1D();
31   
32   void Reset();
33   void Fill(Double_t x,Int_t weight=1);
34   void AddBinContent(Int_t bin,Int_t weight);
35   Int_t FindBin(Double_t x);
36   Double_t GetBinContent(Int_t bin);
37   Double_t GetBinCenter(Int_t bin);
38   Int_t GetNEntries() {return fEntries;}
39   
40   void SetBinContent(Int_t bin,Int_t value);
41   void SetThreshold(Int_t i) {fThreshold = i;}
42   
43
44 #ifdef use_root
45   void Draw(Char_t *option="hist");
46   TH1F *GetRootHisto() {return fRootHisto;}
47 #endif
48   
49   ClassDef(AliL3Histogram1D,1)
50     
51 };
52
53 #endif