RAIDA  1.9.0
IProfile1DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_IPROFILE1DROOT_H
3 #define AIDA_IPROFILE1DROOT_H 1
4 
5 #include <AIDA/IProfile1D.h>
6 #include <AIDA/IAxis.h>
7 
8 #include <vector>
9 #include <TH1D.h>
10 #include <TProfile.h>
11 
12 namespace AIDA {
13 
14  // class IAxis;
15 
23 class IProfile1DROOT : public IProfile1D {
24 
25 public:
27  virtual ~IProfile1DROOT() { /* nop */; }
28 
30  IProfile1DROOT() { /* nop */; }
31 
32  IProfile1DROOT(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  IProfile1DROOT(const std::string & name,
40  const std::string & title,
41  int nBins,
42  double lowerEdge,
43  double upperEdge,
44  double lowerValue,
45  double upperValue,
46  const std::string & options = "");
47 
48  IProfile1DROOT(const std::string & name,
49  const std::string & title,
50  const std::vector<double> & binEdges,
51  const std::string & options = "");
52 
53  IProfile1DROOT(const std::string & name,
54  const std::string & title,
55  const std::vector<double> & binEdges,
56  double lowerValue,
57  double upperValue,
58  const std::string & options = "");
59 
60  IProfile1DROOT(const std::string & name,
61  const IProfile1DROOT & profile) ;
62 
67  virtual bool fill(double x, double y, double weight = 1) ;
68 
75  virtual double binMean(int index) const ;
76 
81  virtual int binEntries(int index) const ;
82 
87  virtual double binHeight(int index) const ;
88 
93  virtual double binError(int index) const ;
94 
100  virtual double binRms(int index) const ;
101 
105  virtual double mean() const ;
106 
110  virtual double rms() const ;
111 
115  virtual const IAxis & axis() const ;
116 
121  virtual int coordToIndex(double coord) const ;
122 
129 
131 // ----------------------------------------------------------------------------
132 // Functions from IHistogram.h
133 // ----------------------------------------------------------------------------
134 
141  virtual int allEntries() const ;
142 
148  virtual int extraEntries() const ;
149 
155  virtual double sumBinHeights() const ;
156 
162  virtual double sumAllBinHeights() const ;
163 
169  virtual double sumExtraBinHeights() const ;
170 
176  virtual double minBinHeight() const ;
177 
183  virtual double maxBinHeight() const ;
184 // ----------------------------------------------------------------------------
185 // Functions from IBaseHistogram
186 // ----------------------------------------------------------------------------
187 
193  virtual std::string title() const ;
194 
201  virtual bool setTitle(const std::string & title) ;
202 
208 
211 
217  virtual int dimension() const ;
218 
224  virtual bool reset() ;
225 
231  virtual int entries() const ;
232 
238 
240 protected:
241 
242 
243 private:
244 
245  void Profile1DHistograms(const std::string & name,
246  const std::string & title,
247  int nBins,
248  double lowerEdge,
249  double upperEdge);
250  void Profile1DHistograms(const std::string & name,
251  const std::string & title,
252  const std::vector<double> & binEdges);
253 
254  TProfile* _profile;
255  TH1D* _histogram;
256  TH1D* _histogramAIDA;
257  TH1D* _histogramAIDABinMeanX;
258  IAxis *_xAxis;
259 
260 }; // class
261 } // namespace AIDA
262 #endif /* ifndef AIDA_IPROFILE1DROOT_H */
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: IProfile1DROOT.cc:328
virtual double sumBinHeights() const
Get the sum of in range bin heights in the IProfile.
Definition: IProfile1DROOT.cc:248
virtual double sumAllBinHeights() const
Get the sum of all the bins heights (including underflow and overflow bin).
Definition: IProfile1DROOT.cc:259
virtual bool reset()
Reset the Histogram; as if just created.
Definition: IProfile1DROOT.cc:333
User level interface to a 1-dimensional profile histogram.
Definition: IProfile1D.h:28
User level interface to a 1-dimensional profile histogram.
Definition: IProfile1DROOT.h:23
virtual double rms() const
Returns the rms of the whole profile as calculated on filling-time.
Definition: IProfile1DROOT.cc:218
virtual double mean() const
Returns the mean of the whole profile as calculated on filling-time.
Definition: IProfile1DROOT.cc:213
IProfile1DROOT()
constructor
Definition: IProfile1DROOT.h:30
virtual double maxBinHeight() const
Get the maximum height of the in-range bins.
Definition: IProfile1DROOT.cc:296
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: IProfile1DROOT.cc:313
virtual int binEntries(int index) const
Number of entries in the corresponding bin (ie the number of times fill was called for this bin)...
Definition: IProfile1DROOT.cc:188
An IAxis represents a binned histogram axis.
Definition: IAxis.h:26
virtual const IAxis & axis() const
Returns the X axis.
Definition: IProfile1DROOT.cc:223
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: IProfile1DROOT.cc:342
virtual double binMean(int index) const
The weighted mean of the corresponding bin.
Definition: IProfile1DROOT.cc:182
virtual int allEntries() const
Modifies this IProfile1D by adding the contents of profile to it.
Definition: IProfile1DROOT.cc:235
virtual int extraEntries() const
Get the number of entries in the underflow and overflow bins.
Definition: IProfile1DROOT.cc:240
virtual double binError(int index) const
The error on this bin.
Definition: IProfile1DROOT.cc:201
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: IProfile1DROOT.cc:319
virtual double binRms(int index) const
The spread (RMS) of a bin.
Definition: IProfile1DROOT.cc:207
virtual double binHeight(int index) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: IProfile1DROOT.cc:194
virtual double minBinHeight() const
Get the minimum height of the in-range bins.
Definition: IProfile1DROOT.cc:279
virtual int coordToIndex(double coord) const
Convenience method, equivalent to axis().coordToIndex(coord).
Definition: IProfile1DROOT.cc:228
virtual ~IProfile1DROOT()
Destructor.
Definition: IProfile1DROOT.h:27
virtual double sumExtraBinHeights() const
Get the sum of the underflow and overflow bin height.
Definition: IProfile1DROOT.cc:268
virtual bool fill(double x, double y, double weight=1)
Fill the IProfile1D.
Definition: IProfile1DROOT.cc:164