RAIDA  1.9.0
IHistogram1DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_IHISTOGRAM1DROOT_H
3 #define AIDA_IHISTOGRAM1DROOT_H 1
4 
5 #include <AIDA/IHistogram1D.h>
6 #include <RAIDA/IHistogram2DROOT.h>
7 #include <RAIDA/IHistogram3DROOT.h>
8 
9 #include <vector>
10 #include <TH1D.h>
11 #include <AIDA/IAxis.h>
12 
13 namespace AIDA {
14 
16 
25 friend class IHistogramFactoryROOT ;
26 public:
28  virtual ~IHistogram1DROOT();
29 
31 
32  IHistogram1DROOT(const std::string & name,
33  const std::string & title,
34  int nBins,
35  double lowerEdge,
36  double upperEdge,
37  const std::string & options = "") ;
38 
39  IHistogram1DROOT(const std::string & name,
40  const std::string & title,
41  const std::vector<double> & binEdges,
42  const std::string & options = "") ;
43 
44  IHistogram1DROOT(const std::string & name,
45  const IHistogram1DROOT & hist) ;
46  IHistogram1DROOT(const std::string & name,
47  const IHistogram2DROOT & hist,
48  char axis,
49  int lowerBin = -2,
50  int upperBin = -1) ;
51 
60  virtual bool fill(double x, double weight = 1.) ;
61 
68  virtual double binMean(int index) const ;
69  // +
70 // ---------------------------------------------------------------------------
71 // Functions from IBaseHistogram.h
72 // ---------------------------------------------------------------------------
73 
79  virtual std::string title() const;
80 
87  virtual bool setTitle(const std::string & title) ;
88  virtual bool setName(const std::string & name) ;
89 
95  virtual int dimension() const ;
96 
102  virtual bool reset();
103 
109  virtual int entries() const ;
110 
111 // ---------------------------------------------------------------------------
112 // Functions from IHistogram.h
113 // ---------------------------------------------------------------------------
114 
123  virtual int allEntries() const ;
124 
130  virtual int extraEntries() const ;
131 
132 
139  virtual double sumBinHeights() const ;
140 
147  virtual double sumAllBinHeights() const ;
148 
154  virtual double sumExtraBinHeights() const ;
155 
162  virtual double minBinHeight() const ;
163 
170  virtual double maxBinHeight() const ;
171 
179  virtual bool scale(double scaleFactor) ;
180 
181 // ---------------------------------------------------------------------------
182 // Functions from IHistogram1D.h
183 // ---------------------------------------------------------------------------
184 
191 
200  virtual int binEntries(int index) const ;
201  // +
209  virtual double binHeight(int index) const ;
210  // +
217  virtual double binError(int index) const ;
218  // +
224  virtual double mean() const ;
225 
231  virtual double rms() const ;
232 
238  virtual const IAxis & axis() const ;
239 
249  virtual int coordToIndex(double coord) const ;
250  // +
251  virtual bool add(const IHistogram1D & hist) ;
252  virtual bool subtract(const IHistogram1D & hist) ;
253  virtual bool multiply(const IHistogram1D & hist) ;
254  virtual bool divide(const IHistogram1D & hist) ;
255 
260  virtual void printContents() const ;
261 
262 protected:
263 
264 
265 private:
266 
267  TH1D *_histogram;
268  TH1D *_histogramAIDA;
269  TH1D *_histogramAIDABinMean;
270  IAxis *_xAxis;
271 }; // class
272 } // namespace AIDA
273 #endif /* ifndef AIDA_IHISTOGRAM1DROOT_H */
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: IHistogram1DROOT.cc:343
virtual double sumAllBinHeights() const
Sum of the heights of all the IHistogram&#39;s bins, i.e in-range bins, UNDERFLOW and OVERFLOW...
Definition: IHistogram1DROOT.cc:289
virtual double sumBinHeights() const
Sum of in-range bin heights in the IHistogram, UNDERFLOW and OVERFLOW bins are excluded.
Definition: IHistogram1DROOT.cc:277
virtual double binError(int index) const
The error of a given bin.
Definition: IHistogram1DROOT.cc:372
virtual double rms() const
The RMS of the whole IHistogram1D.
Definition: IHistogram1DROOT.cc:383
User level interface to 1D Histogram.
Definition: IHistogram1D.h:28
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: IHistogram1DROOT.cc:252
virtual double mean() const
The mean of the whole IHistogram1D.
Definition: IHistogram1DROOT.cc:378
class IAxis;
Definition: IHistogram2DROOT.h:25
virtual double binMean(int index) const
The weighted mean of a bin.
Definition: IHistogram1DROOT.cc:354
User level interface for factory classes of Histograms (binned, unbinned, and profile) The created ob...
Definition: IHistogramFactoryROOT.h:33
virtual int coordToIndex(double coord) const
Get the bin number corresponding to a given coordinate along the x axis.
Definition: IHistogram1DROOT.cc:393
virtual double minBinHeight() const
Minimum height of the in-range bins, i.e.
Definition: IHistogram1DROOT.cc:309
An IAxis represents a binned histogram axis.
Definition: IAxis.h:26
virtual int allEntries() const
Sum of the entries in all the IHistogram&#39;s bins, i.e in-range bins, UNDERFLOW and OVERFLOW...
Definition: IHistogram1DROOT.cc:264
virtual int dimension() const
Get the Histogram&#39;s dimension.
Definition: IHistogram1DROOT.cc:239
class IAxis;
Definition: IHistogram1DROOT.h:24
virtual double sumExtraBinHeights() const
Sum of heights in the UNDERFLOW and OVERFLOW bins.
Definition: IHistogram1DROOT.cc:298
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: IHistogram1DROOT.cc:217
virtual bool reset()
Reset the Histogram; as if just created.
Definition: IHistogram1DROOT.cc:244
virtual int binEntries(int index) const
The weighted mean of a bin.
Definition: IHistogram1DROOT.cc:360
virtual double binHeight(int index) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: IHistogram1DROOT.cc:366
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: IHistogram1DROOT.cc:223
virtual void printContents() const
Print out the contents of a histogram to the screen.
Definition: IHistogram1DROOT.cc:485
virtual bool fill(double x, double weight=1.)
Fill the IHistogram1D with a value and the corresponding weight.
Definition: IHistogram1DROOT.cc:196
virtual const IAxis & axis() const
Get the x axis of the IHistogram1D.
Definition: IHistogram1DROOT.cc:388
virtual int extraEntries() const
Number of entries in the UNDERFLOW and OVERFLOW bins.
Definition: IHistogram1DROOT.cc:269
virtual bool add(const IHistogram1D &hist)
Add to this IHistogram1D the contents of another IHistogram1D.
Definition: IHistogram1DROOT.cc:399
virtual ~IHistogram1DROOT()
Destructor.
Definition: IHistogram1DROOT.cc:18
virtual double maxBinHeight() const
Maximum height of the in-range bins, i.e.
Definition: IHistogram1DROOT.cc:326