RAIDA  1.9.0
IHistogram3DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_IHISTOGRAM3DROOT_H
3 #define AIDA_IHISTOGRAM3DROOT_H 1
4 
5 #include <AIDA/IHistogram3D.h>
6 #include <AIDA/IAxis.h>
7 
8 #include <TH1D.h>
9 #include <TH2D.h>
10 #include <TH3D.h>
11 #include <vector>
12 
13 namespace AIDA {
14 
16 
25  friend class IHistogramFactoryROOT ;
26  friend class IHistogram2DROOT ;
27 
28 public:
30  virtual ~IHistogram3DROOT();
31 
34 
35  IHistogram3DROOT(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  int nBinsZ,
44  double lowerEdgeZ,
45  double upperEdgeZ,
46  const std::string & options = "") ;
47 
48  IHistogram3DROOT(const std::string & name,
49  const std::string & title,
50  const std::vector<double> & binEdgesX,
51  const std::vector<double> & binEdgesY,
52  const std::vector<double> & binEdgesZ,
53  const std::string & options = "") ;
54 
55  IHistogram3DROOT(const std::string & name,
56  const IHistogram3DROOT & hist) ;
57 
68  virtual bool fill(double x, double y, double z, double weight = 1.) ;
69 
78  virtual double binMeanX(int indexX, int indexY, int indexZ) const ;
79 
88  virtual double binMeanY(int indexX, int indexY, int indexZ) const ;
89 
98  virtual double binMeanZ(int indexX, int indexY, int indexZ) const ;
99 
108  virtual int binEntries(int indexX, int indexY, int indexZ) const ;
109 
117  virtual int binEntriesX(int index) const ;
118 
126  virtual int binEntriesY(int index) const ;
127 
135  virtual int binEntriesZ(int index) const ;
136 
145  virtual double binHeight(int indexX, int indexY, int indexZ) const ;
146 
154  virtual double binHeightX(int index) const ;
155 
163  virtual double binHeightY(int index) const ;
164 
172  virtual double binHeightZ(int index) const ;
173 
182  virtual double binError(int indexX, int indexY, int indexZ) const ;
183 
189  virtual double meanX() const ;
190 
196  virtual double meanY() const ;
197 
203  virtual double meanZ() const ;
204 
210  virtual double rmsX() const ;
211 
217  virtual double rmsY() const ;
218 
224  virtual double rmsZ() const ;
225 
231  virtual const IAxis & xAxis() const ;
232 
238  virtual const IAxis & yAxis() const ;
239 
245  virtual const IAxis & zAxis() const ;
246 
255  virtual int coordToIndexX(double coord) const ;
256 
265  virtual int coordToIndexY(double coord) const ;
266 
275  virtual int coordToIndexZ(double coord) const ;
276 
283  virtual bool add(const IHistogram3D & hist) ;
284  virtual bool subtract(const IHistogram3D & hist) ;
285  virtual bool multiply(const IHistogram3D & hist) ;
286  virtual bool divide(const IHistogram3D & hist) ;
287 
288 // ---------------------------------------------------------------------------
289 // Functions from IBaseHistogram.h
290 // ---------------------------------------------------------------------------
291 
297  virtual std::string title() const ;
298 
305  virtual bool setTitle(const std::string & title) ;
306  virtual bool setName(const std::string & name) ;
307 
313 
316 
322  virtual int dimension() const ;
323 
329  virtual bool reset() ;
330 
336  virtual int entries() const ;
337 
343 
345 // ---------------------------------------------------------------------------
346 // Functions from IHistogram.h
347 // ---------------------------------------------------------------------------
348 
357  virtual int allEntries() const ;
358 
364  virtual int extraEntries() const ;
365 
371 
379  virtual double sumBinHeights() const ;
380 
387  virtual double sumAllBinHeights() const ;
388 
394  virtual double sumExtraBinHeights() const ;
395 
402  virtual double minBinHeight() const ;
403 
410  virtual double maxBinHeight() const ;
411 
419  virtual bool scale(double scaleFactor) ;
420 
425  virtual void printContents() const ;
426 
427 protected:
428 
429 
430 private:
431 
432  TH3D *_histogram;
433  TH3D *_histogramAIDA;
434  TH3D *_histogramAIDABinMeanX;
435  TH3D *_histogramAIDABinMeanY;
436  TH3D *_histogramAIDABinMeanZ;
437 
438  IAxis *_xAxis;
439  IAxis *_yAxis;
440  IAxis *_zAxis;
441 
442 }; // class
443 } // namespace AIDA
444 #endif /* ifndef AIDA_IHISTOGRAM3DROOT_H */
virtual int coordToIndexY(double coord) const
Get the bin number corresponding to a given coordinate along the y axis.
Definition: IHistogram3DROOT.cc:458
virtual double sumBinHeights() const
Number of equivalent entries, i.e.
Definition: IHistogram3DROOT.cc:586
virtual double rmsZ() const
The RMS of the IHistogram3D along the z axis.
Definition: IHistogram3DROOT.cc:429
virtual double meanY() const
The mean of the IHistogram3D along the y axis.
Definition: IHistogram3DROOT.cc:409
virtual double sumAllBinHeights() const
Sum of the heights of all the IHistogram&#39;s bins, i.e in-range bins, UNDERFLOW and OVERFLOW...
Definition: IHistogram3DROOT.cc:602
virtual int allEntries() const
See IManagedObject for a description.
Definition: IHistogram3DROOT.cc:541
virtual double sumExtraBinHeights() const
Sum of heights in the UNDERFLOW and OVERFLOW bins.
Definition: IHistogram3DROOT.cc:618
virtual double binMeanX(int indexX, int indexY, int indexZ) const
The weighted mean along the x axis of a given bin.
Definition: IHistogram3DROOT.cc:248
virtual bool add(const IHistogram3D &hist)
Add to this IHistogram3D the contents of another IHistogram3D.
Definition: IHistogram3DROOT.cc:707
virtual int binEntriesY(int index) const
Sum of all the entries of the bins along a given y bin.
Definition: IHistogram3DROOT.cc:307
class IAxis;
Definition: IHistogram2DROOT.h:25
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: IHistogram3DROOT.cc:700
User level interface to 3D Histogram.
Definition: IHistogram3D.h:28
virtual double maxBinHeight() const
Maximum height of the in-range bins, i.e.
Definition: IHistogram3DROOT.cc:679
virtual double binMeanZ(int indexX, int indexY, int indexZ) const
The weighted mean the z axis of a given bin.
Definition: IHistogram3DROOT.cc:270
User level interface for factory classes of Histograms (binned, unbinned, and profile) The created ob...
Definition: IHistogramFactoryROOT.h:33
virtual int binEntries(int indexX, int indexY, int indexZ) const
Number of entries in the corresponding bin (ie the number of times fill was called for this bin)...
Definition: IHistogram3DROOT.cc:281
An IAxis represents a binned histogram axis.
Definition: IAxis.h:26
virtual double binHeightZ(int index) const
Sum of all the heights of the bins along a given z bin.
Definition: IHistogram3DROOT.cc:378
virtual double binError(int indexX, int indexY, int indexZ) const
The error of a given bin.
Definition: IHistogram3DROOT.cc:393
virtual double rmsY() const
The RMS of the IHistogram3D along the y axis.
Definition: IHistogram3DROOT.cc:424
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: IHistogram3DROOT.cc:521
virtual bool reset()
Reset the Histogram; as if just created.
Definition: IHistogram3DROOT.cc:511
virtual double binHeight(int indexX, int indexY, int indexZ) const
Total height of a give bin (ie the sum of the weights in this bin).
Definition: IHistogram3DROOT.cc:337
virtual ~IHistogram3DROOT()
Destructor.
Definition: IHistogram3DROOT.cc:17
IHistogram3DROOT()
Constructor.
Definition: IHistogram3DROOT.cc:41
virtual void printContents() const
Print out the contents of a histogram to the screen.
Definition: IHistogram3DROOT.cc:853
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: IHistogram3DROOT.cc:486
virtual const IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: IHistogram3DROOT.cc:439
virtual int coordToIndexZ(double coord) const
Get the bin number corresponding to a given coordinate along the z axis.
Definition: IHistogram3DROOT.cc:467
virtual double rmsX() const
The RMS of the IHistogram3D along the x axis.
Definition: IHistogram3DROOT.cc:419
virtual int coordToIndexX(double coord) const
Get the bin number corresponding to a given coordinate along the x axis.
Definition: IHistogram3DROOT.cc:449
virtual double binMeanY(int indexX, int indexY, int indexZ) const
The weighted mean the y axis of a given bin.
Definition: IHistogram3DROOT.cc:259
virtual double minBinHeight() const
Minimum height of the in-range bins, i.e.
Definition: IHistogram3DROOT.cc:658
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: IHistogram3DROOT.cc:506
class IAxis;
Definition: IHistogram3DROOT.h:24
virtual int binEntriesX(int index) const
Sum of all the entries of the bins along a given x bin.
Definition: IHistogram3DROOT.cc:292
virtual double binHeightX(int index) const
Sum of all the heights of the bins along a given x bin.
Definition: IHistogram3DROOT.cc:348
virtual bool fill(double x, double y, double z, double weight=1.)
Fill the IHistogram3D with a triplet of values and the corresponding weight.
Definition: IHistogram3DROOT.cc:223
virtual const IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: IHistogram3DROOT.cc:444
virtual int binEntriesZ(int index) const
Sum of all the entries of the bins along a given z bin.
Definition: IHistogram3DROOT.cc:322
virtual int extraEntries() const
Number of entries in the UNDERFLOW and OVERFLOW bins.
Definition: IHistogram3DROOT.cc:546
virtual double meanZ() const
The mean of the IHistogram3D along the z axis.
Definition: IHistogram3DROOT.cc:414
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: IHistogram3DROOT.cc:480
virtual double meanX() const
The mean of the IHistogram3D along the x axis.
Definition: IHistogram3DROOT.cc:404
virtual const IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: IHistogram3DROOT.cc:434
virtual double binHeightY(int index) const
Sum of all the heights of the bins along a given y bin.
Definition: IHistogram3DROOT.cc:363