RAIDA  1.9.0
IProfile2DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_IPROFILE2DROOT_H
3 #define AIDA_IPROFILE2DROOT_H 1
4 
5 
6 #include <AIDA/IProfile2D.h>
7 #include <AIDA/IAxis.h>
8 
9 #include <vector>
10 #include <TH2D.h>
11 #include <TProfile2D.h>
12 
13 namespace AIDA {
14 
15  // class IAxis;
16 
24 class IProfile2DROOT : public IProfile2D {
25 
26 public:
28  virtual ~IProfile2DROOT() { /* nop */; }
29 
31  IProfile2DROOT() { /* nop */; }
32 
33  IProfile2DROOT(const std::string & name,
34  const std::string & title,
35  int nBinsX,
36  double lowerEdgeX,
37  double upperEdgeX,
38  int nBinsY,
39  double lowerEdgeY,
40  double upperEdgeY,
41  const std::string & options = "");
42 
43  IProfile2DROOT(const std::string & name,
44  const std::string & title,
45  int nBinsX,
46  double lowerEdgeX,
47  double upperEdgeX,
48  int nBinsY,
49  double lowerEdgeY,
50  double upperEdgeY,
51  double lowerValue,
52  double upperValue,
53  const std::string & options = "");
54 
55  IProfile2DROOT(const std::string & name,
56  const std::string & title,
57  const std::vector<double> & binEdgesX,
58  const std::vector<double> & binEdgesY,
59  const std::string & options = "");
60 
61  IProfile2DROOT(const std::string & name,
62  const std::string & title,
63  const std::vector<double> & binEdgesX,
64  const std::vector<double> & binEdgesY,
65  double lowerValue,
66  double upperValue,
67  const std::string & options = "");
68 
69  IProfile2DROOT(const std::string & name,
70  const IProfile2DROOT & profile) ;
71 
76  virtual bool fill(double x, double y, double z, double weight = 1) ;
77 
85  virtual double binMeanX(int indexX, int indexY) const ;
86 
94  virtual double binMeanY(int indexX, int indexY) const ;
95 
102  virtual int binEntries(int indexX, int indexY) const ;
103 
108  virtual int binEntriesX(int indexX) const ;
109 
114  virtual int binEntriesY(int indexY) const ;
115 
122  virtual double binHeight(int indexX, int indexY) const ;
123 
128  virtual double binHeightX(int indexX) const ;
129 
134  virtual double binHeightY(int indexY) const ;
135 
142  virtual double binError(int indexX, int indexY) const ;
143 
150  virtual double binRms(int indexX, int indexY) const ;
151 
156  virtual double meanX() const ;
157 
162  virtual double meanY() const ;
163 
168  virtual double rmsX() const ;
169 
174  virtual double rmsY() const ;
175 
180  virtual const IAxis & xAxis() const ;
181 
186  virtual const IAxis & yAxis() const ;
187 
193  virtual int coordToIndexX(double coordX) const ;
194 
200  virtual int coordToIndexY(double coordY) const ;
201 
209 
211 // ----------------------------------------------------------------------------
212 // Functions from IProfile.h
213 // ----------------------------------------------------------------------------
214 
221  virtual int allEntries() const ;
222 
228  virtual int extraEntries() const ;
229 
235  virtual double sumBinHeights() const ;
236 
242  virtual double sumAllBinHeights() const ;
243 
249  virtual double sumExtraBinHeights() const ;
250 
256  virtual double minBinHeight() const ;
257 
263  virtual double maxBinHeight() const ;
264 
265 
266 // ----------------------------------------------------------------------------
267 // Functions from IBaseHistogram
268 // ----------------------------------------------------------------------------
269 
275  virtual std::string title() const ;
276 
283  virtual bool setTitle(const std::string & title) ;
284 
290 
293 
299  virtual int dimension() const ;
300 
306  virtual bool reset() ;
307 
313  virtual int entries() const ;
314 
320 
322 protected:
323 
324 
325 private:
326 
327  void Profile2DHistograms(const std::string & name,
328  const std::string & title,
329  int nBinsX,
330  double lowerEdgeX,
331  double upperEdgeX,
332  int nBinsY,
333  double lowerEdgeY,
334  double upperEdgeY);
335  void Profile2DHistograms(const std::string & name,
336  const std::string & title,
337  const std::vector<double> & binEdgesX,
338  const std::vector<double> & binEdgesY);
339 
340  TProfile2D* _profile;
341  TH2D* _histogram;
342  TH2D* _histogramAIDA;
343  TH2D* _histogramAIDABinMeanX;
344  TH2D* _histogramAIDABinMeanY;
345  IAxis *_xAxis;
346  IAxis *_yAxis;
347 
348 }; // class
349 } // namespace AIDA
350 #endif /* ifndef AIDA_IPROFILE2DROOT_H */
virtual double binError(int indexX, int indexY) const
The error on this bin.
Definition: IProfile2DROOT.cc:344
virtual double sumAllBinHeights() const
Get the sum of all the bins heights (including underflow and overflow bin).
Definition: IProfile2DROOT.cc:482
virtual double minBinHeight() const
Get the minimum height of the in-range bins.
Definition: IProfile2DROOT.cc:549
virtual double sumExtraBinHeights() const
Get the sum of the underflow and overflow bin height.
Definition: IProfile2DROOT.cc:496
virtual double binHeightY(int indexY) const
Equivalent to projectionY().binHeight(indexY).
Definition: IProfile2DROOT.cc:332
virtual double binHeight(int indexX, int indexY) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: IProfile2DROOT.cc:311
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: IProfile2DROOT.cc:591
virtual double maxBinHeight() const
Get the maximum height of the in-range bins.
Definition: IProfile2DROOT.cc:567
virtual int binEntriesX(int indexX) const
Equivalent to projectionX().binEntries(indexX).
Definition: IProfile2DROOT.cc:287
virtual double binMeanY(int indexX, int indexY) const
The weighted mean along y of a given bin.
Definition: IProfile2DROOT.cc:269
virtual double binRms(int indexX, int indexY) const
The spread (RMS) of this bin.
Definition: IProfile2DROOT.cc:353
virtual const IAxis & yAxis() const
Return the Y axis.
Definition: IProfile2DROOT.cc:387
virtual int binEntriesY(int indexY) const
Equivalent to projectionY().binEntries(indexY).
Definition: IProfile2DROOT.cc:299
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: IProfile2DROOT.cc:601
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: IProfile2DROOT.cc:616
virtual double meanX() const
Returns the mean of the profile, as calculated on filling-time projected on the X axis...
Definition: IProfile2DROOT.cc:362
IProfile2DROOT()
constructor
Definition: IProfile2DROOT.h:31
An IAxis represents a binned histogram axis.
Definition: IAxis.h:26
virtual bool fill(double x, double y, double z, double weight=1)
Fill the IProfile2D.
Definition: IProfile2DROOT.cc:239
virtual double binHeightX(int indexX) const
Equivalent to projectionX().binHeight(indexX).
Definition: IProfile2DROOT.cc:320
virtual int extraEntries() const
Get the number of entries in the underflow and overflow bins.
Definition: IProfile2DROOT.cc:415
virtual double meanY() const
Returns the mean of the profile, as calculated on filling-time projected on the Y axis...
Definition: IProfile2DROOT.cc:367
User level interface to a 2-dimensional profile histogram.
Definition: IProfile2DROOT.h:24
virtual double rmsX() const
Returns the rms of the profile as calculated on filling-time projected on the X axis.
Definition: IProfile2DROOT.cc:372
virtual bool reset()
Reset the Histogram; as if just created.
Definition: IProfile2DROOT.cc:606
virtual ~IProfile2DROOT()
Destructor.
Definition: IProfile2DROOT.h:28
virtual int allEntries() const
Modifies this profile by adding the contents of profile to it.
Definition: IProfile2DROOT.cc:410
User level interface to a 2-dimensional profile histogram.
Definition: IProfile2D.h:28
virtual int coordToIndexY(double coordY) const
Convenience method, equivalent to yAxis().coordToIndex(coord).
Definition: IProfile2DROOT.cc:401
virtual const IAxis & xAxis() const
Return the X axis.
Definition: IProfile2DROOT.cc:382
virtual double sumBinHeights() const
Get the sum of in range bin heights in the IProfile.
Definition: IProfile2DROOT.cc:468
virtual int binEntries(int indexX, int indexY) const
The number of entries (ie the number of times fill was called for this bin).
Definition: IProfile2DROOT.cc:278
virtual double rmsY() const
Returns the rms of the profile as calculated on filling-time projected on the Y axis.
Definition: IProfile2DROOT.cc:377
virtual double binMeanX(int indexX, int indexY) const
The weighted mean along x of a given bin.
Definition: IProfile2DROOT.cc:260
virtual int coordToIndexX(double coordX) const
Convenience method, equivalent to xAxis().coordToIndex(coord).
Definition: IProfile2DROOT.cc:392
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: IProfile2DROOT.cc:585