RAIDA  1.9.0
IHistogram2DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_IHISTOGRAM2DROOT_H
3 #define AIDA_IHISTOGRAM2DROOT_H 1
4 
5 
6 #include <AIDA/IHistogram2D.h>
7 #include <AIDA/IAxis.h>
8 #include <RAIDA/IHistogram3DROOT.h>
9 
10 #include <TH1D.h>
11 #include <TH2D.h>
12 #include <vector>
13 
14 namespace AIDA {
15 
17 
26 friend class IHistogramFactoryROOT ;
27 friend class IHistogram1DROOT ;
28 public:
30  virtual ~IHistogram2DROOT();
31 
34 
35  IHistogram2DROOT(const std::string & name,
36  const std::string & title,
37  int nBinsX,
38  double lowerEdgeX,
39  double upperEdgeX,
40  int nBinsY,
41  double lowerEdgeY,
42  double upperEdgeY,
43  const std::string & options = "") ;
44 
45  IHistogram2DROOT(const std::string & name,
46  const std::string & title,
47  const std::vector<double> & binEdgesX,
48  const std::vector<double> & binEdgesY,
49  const std::string & options = "") ;
50 
51  IHistogram2DROOT(const std::string & name,
52  const IHistogram2DROOT & hist) ;
53  IHistogram2DROOT(const std::string & name,
54  const IHistogram3DROOT & hist,
55  std::string axis,
56  int lowerBin = -2,
57  int upperBin = -1) ;
58 
68  virtual bool fill(double x, double y, double weight = 1.) ;
69 
77  virtual double binMeanX(int indexX, int indexY) const ;
78 
86  virtual double binMeanY(int indexX, int indexY) const ;
87 
95  virtual int binEntries(int indexX, int indexY) const ;
96 
104  virtual int binEntriesX(int index) const ;
105 
113  virtual int binEntriesY(int index) const ;
114 
122  virtual double binHeight(int indexX, int indexY) const ;
123 
131  virtual double binHeightX(int index) const ;
132 
140  virtual double binHeightY(int index) const ;
141 
149  virtual double binError(int indexX, int indexY) const ;
150 
156  virtual double meanX() const ;
157 
163  virtual double meanY() const ;
164 
170  virtual double rmsX() const ;
171 
177  virtual double rmsY() const ;
178 
184  virtual const IAxis & xAxis() const ;
185 
191  virtual const IAxis & yAxis() const ;
192 
201  virtual int coordToIndexX(double coord) const ;
202 
211  virtual int coordToIndexY(double coord) const ;
212 
219  virtual bool add(const IHistogram2D & hist) ;
220  virtual bool subtract(const IHistogram2D & hist) ;
221  virtual bool multiply(const IHistogram2D & hist) ;
222  virtual bool divide(const IHistogram2D & hist) ;
223 
224 // ---------------------------------------------------------------------------
225 // Functions from IBaseHistogram.h
226 // ---------------------------------------------------------------------------
227 
233  virtual std::string title() const ;
234 
241  virtual bool setTitle(const std::string & title) ;
242  virtual bool setName(const std::string & name) ;
243 
249 
252 
258  virtual int dimension() const ;
259 
265  virtual bool reset() ;
266 
272  virtual int entries() const ;
273 
279 
281 // ---------------------------------------------------------------------------
282 // Functions from IHistogram.h
283 // ---------------------------------------------------------------------------
284 
293  virtual int allEntries() const ;
294 
300  virtual int extraEntries() const ;
301 
307 
315  virtual double sumBinHeights() const ;
316 
323  virtual double sumAllBinHeights() const ;
324 
330  virtual double sumExtraBinHeights() const ;
331 
338  virtual double minBinHeight() const ;
339 
346  virtual double maxBinHeight() const ;
347 
355  virtual bool scale(double scaleFactor) ;
356 
361  virtual void printContents() const ;
362 
363 protected:
364 
365 
366 private:
367 
368  TH2D *_histogram;
369  TH2D *_histogramAIDA;
370  TH2D *_histogramAIDABinMeanX;
371  TH2D *_histogramAIDABinMeanY;
372  IAxis *_xAxis;
373  IAxis *_yAxis;
374 }; // class
375 } // namespace AIDA
376 #endif /* ifndef AIDA_IHISTOGRAM2DROOT_H */
377 
virtual int extraEntries() const
Number of entries in the UNDERFLOW and OVERFLOW bins.
Definition: IHistogram2DROOT.cc:437
virtual bool reset()
Reset the Histogram; as if just created.
Definition: IHistogram2DROOT.cc:408
virtual bool add(const IHistogram2D &hist)
Add to this IHistogram2D the contents of another IHistogram2D.
Definition: IHistogram2DROOT.cc:778
virtual int coordToIndexX(double coord) const
Get the bin number corresponding to a given coordinate along the x axis.
Definition: IHistogram2DROOT.cc:757
virtual double sumBinHeights() const
Number of equivalent entries, i.e.
Definition: IHistogram2DROOT.cc:490
virtual double binError(int indexX, int indexY) const
The error of a given bin.
Definition: IHistogram2DROOT.cc:718
virtual ~IHistogram2DROOT()
Destructor.
Definition: IHistogram2DROOT.cc:16
virtual bool fill(double x, double y, double weight=1.)
Fill the IHistogram2D with a couple of values and the corresponding weight.
Definition: IHistogram2DROOT.cc:616
virtual int coordToIndexY(double coord) const
Get the bin number corresponding to a given coordinate along the y axis.
Definition: IHistogram2DROOT.cc:768
class IAxis;
Definition: IHistogram2DROOT.h:25
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: IHistogram2DROOT.cc:417
User level interface for factory classes of Histograms (binned, unbinned, and profile) The created ob...
Definition: IHistogramFactoryROOT.h:33
virtual double sumAllBinHeights() const
Sum of the heights of all the IHistogram&#39;s bins, i.e in-range bins, UNDERFLOW and OVERFLOW...
Definition: IHistogram2DROOT.cc:505
virtual double binMeanX(int indexX, int indexY) const
The weighted mean along the x axis of a given bin.
Definition: IHistogram2DROOT.cc:636
virtual double maxBinHeight() const
Maximum height of the in-range bins, i.e.
Definition: IHistogram2DROOT.cc:591
virtual const IAxis & yAxis() const
Get the y axis of the IHistogram2D.
Definition: IHistogram2DROOT.cc:752
An IAxis represents a binned histogram axis.
Definition: IAxis.h:26
virtual double binHeightX(int index) const
Sum of all the heights of the bins along a given x bin.
Definition: IHistogram2DROOT.cc:694
virtual int binEntriesY(int index) const
Sum of all the entries of the bins along a given y bin.
Definition: IHistogram2DROOT.cc:673
virtual double meanX() const
The mean of the IHistogram2D along the x axis.
Definition: IHistogram2DROOT.cc:727
virtual bool scale(double scaleFactor)
Scale the weights and the errors of all the IHistogram&#39;s bins (in-range and out-of-range ones) by a g...
Definition: IHistogram2DROOT.cc:609
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: IHistogram2DROOT.cc:385
virtual const IAxis & xAxis() const
Get the x axis of the IHistogram2D.
Definition: IHistogram2DROOT.cc:747
virtual double binMeanY(int indexX, int indexY) const
The weighted mean along the y axis of a given bin.
Definition: IHistogram2DROOT.cc:645
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: IHistogram2DROOT.cc:403
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: IHistogram2DROOT.cc:379
class IAxis;
Definition: IHistogram1DROOT.h:24
virtual int binEntries(int indexX, int indexY) const
Number of entries in the corresponding bin (ie the number of times fill was called for this bin)...
Definition: IHistogram2DROOT.cc:653
class IAxis;
Definition: IHistogram3DROOT.h:24
User level interface to 2D Histogram.
Definition: IHistogram2D.h:28
virtual double binHeight(int indexX, int indexY) const
Total height of a give bin (ie the sum of the weights in this bin).
Definition: IHistogram2DROOT.cc:685
virtual double rmsX() const
The RMS of the IHistogram2D along the x axis.
Definition: IHistogram2DROOT.cc:737
virtual int binEntriesX(int index) const
Sum of all the entries of the bins along a given x bin.
Definition: IHistogram2DROOT.cc:661
virtual void printContents() const
Print out the contents of a histogram to the screen.
Definition: IHistogram2DROOT.cc:897
virtual double rmsY() const
The RMS of the IHistogram2D along the y axis.
Definition: IHistogram2DROOT.cc:742
virtual double sumExtraBinHeights() const
Sum of heights in the UNDERFLOW and OVERFLOW bins.
Definition: IHistogram2DROOT.cc:520
virtual double minBinHeight() const
Minimum height of the in-range bins, i.e.
Definition: IHistogram2DROOT.cc:573
virtual double meanY() const
The mean of the IHistogram2D along the y axis.
Definition: IHistogram2DROOT.cc:732
IHistogram2DROOT()
Constructor.
Definition: IHistogram2DROOT.cc:36
virtual double binHeightY(int index) const
Sum of all the heights of the bins along a given y bin.
Definition: IHistogram2DROOT.cc:706
virtual int allEntries() const
See IManagedObject for a description.
Definition: IHistogram2DROOT.cc:432