3 #ifndef ALIL3HISTOGRAM_H
4 #define ALIL3HISTOGRAM_H
6 #include "AliHLTStandardIncludes.h"
7 #include "AliHLTRootTypes.h"
8 #include "AliHLTStandardIncludes.h"
14 class AliHLTHistogram {
18 AliHLTHistogram(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin,Double_t xmax,Int_t nybin,Double_t ymin,Double_t ymax);
19 virtual ~AliHLTHistogram();
22 virtual void Fill(Double_t x,Double_t y,Int_t weight=1);
23 virtual void Fill(Double_t x,Int_t ybin,Int_t weight=1);
24 virtual void Fill(Int_t xbin,Double_t y,Int_t weight=1);
25 virtual void Fill(Int_t xbin,Int_t ybin,Int_t weight=1);
26 virtual Int_t FindBin(Double_t x,Double_t y) const;
27 virtual Int_t FindLabelBin(Double_t x,Double_t y) const;
28 virtual Int_t FindXbin(Double_t x) const;
29 virtual Int_t FindYbin(Double_t y) const;
30 Int_t GetBin(Int_t xbin,Int_t ybin) const;
31 Int_t GetLabelBin(Int_t xbin,Int_t ybin) const;
32 Int_t GetBinContent(Int_t bin) const;
33 void SetBinContent(Int_t xbin,Int_t ybin,Int_t value);
34 void SetBinContent(Int_t bin,Int_t value);
35 void AddBinContent(Int_t xbin,Int_t ybin,Int_t weight);
36 void AddBinContent(Int_t bin,Int_t weight);
37 void Add(AliHLTHistogram *h1,Double_t weight=1);
38 void SetThreshold(Int_t i) {fThreshold = i;}
39 void CreateRootHisto();
40 virtual void Draw(Char_t *option="hist");
41 virtual void Print() const {};
43 friend ofstream& operator<< (ofstream &o, const AliHLTHistogram &h);
51 Double_t GetXmin() const {return fXmin;}
52 Double_t GetXmax() const {return fXmax;}
53 Double_t GetYmin() const {return fYmin;}
54 Double_t GetYmax() const {return fYmax;}
55 virtual Double_t GetBinCenterX(Int_t xbin) const;
56 virtual Double_t GetBinCenterY(Int_t ybin) const;
57 Double_t GetPreciseBinCenterX(Float_t xbin) const;
58 Double_t GetPreciseBinCenterY(Float_t ybin) const;
59 Double_t GetBinWidthX() const {return fBinwidthX;}
60 Double_t GetBinWidthY() const {return fBinwidthY;}
61 Int_t GetFirstXbin() const {return fFirstXbin;}
62 Int_t GetLastXbin() const {return fLastXbin;}
63 Int_t GetFirstYbin() const {return fFirstYbin;}
64 Int_t GetLastYbin() const {return fLastYbin;}
65 Int_t GetNbinsX() const {return fNxbins;}
66 Int_t GetNbinsY() const {return fNybins;}
67 Int_t GetNEntries() const {return fEntries;}
70 Int_t *GetContentArray() const {return fContent;}
73 Char_t fName[100]; // Name of the histogram
74 Int_t fNxbins; // Number of bins in the histogram
75 Int_t fNybins; // Number of bins in the histogram
76 Int_t fNcells; // Overall number of bins in the histogram
77 Int_t fEntries; // Number of entries in the histogram
78 Int_t fFirstXbin; // First active bin
79 Int_t fFirstYbin; // First active bin
80 Int_t fLastXbin; // Last active bin
81 Int_t fLastYbin; // Last active bin
82 Int_t fThreshold; // Bin content threshold
84 Double_t fXmin; // Lower limit in X
85 Double_t fYmin; // Lower limit in Y
86 Double_t fXmax; // Upper limit in X
87 Double_t fYmax; // Upper limit in Y
90 TH2F *fRootHisto; // Corresponding ROOT histogram
94 Double_t fBinwidthX; // Bin width of the Hough space
95 Double_t fBinwidthY; // Bin width of the Hough space
97 ClassDef(AliHLTHistogram,1) //2D histogram class
101 typedef AliHLTHistogram AliL3Histogram; // for backward comaptibility
104 inline TH2F *AliHLTHistogram::GetRootHisto()
108 STDCERR<<"AliHLTHistogram::GetRootHisto() : You must first Draw histogram before accessing it"<<STDENDL;
115 inline void *AliHLTHistogram::GetRootHisto()
117 STDCERR<<"AliHLTHistogram::GetRootHisto() : You must compile with ROOT in order to interface the ROOT histogram"<<STDENDL;