RAIDA  1.9.0
ICloud1DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_ICLOUD1DROOT_H
3 #define AIDA_ICLOUD1DROOT_H 1
4 
5 #include <vector>
6 #include <TH1D.h>
7 #include <TTree.h>
8 #include "AIDA/ICloud.h"
9 #include "AIDA/ICloud1D.h"
10 #include <AIDA/ITree.h>
11 #include <RAIDA/PathName.h>
12 namespace AIDA {
13 
14 class IHistogram1D;
15 
23 class ICloud1DROOT : public ICloud1D {
24 
25 public:
27  virtual ~ICloud1DROOT() { /* nop */; }
28 
30  ICloud1DROOT(const std::string & path,
31  const std::string & title,
32  int nMax,
33  ITree* usedTree,
34  const std::string & options = "");
35 
36  ICloud1DROOT(const std::string & path,
37  ITree* usedTree,
38  const ICloud1DROOT & cloud) ;
39 
48  virtual bool fill(double x, double weight = 1.) ;
49 
55  virtual double lowerEdge() const ;
56 
62  virtual double upperEdge() const ;
63 
71  virtual double value(int index) const ;
72 
80  virtual double weight(int index) const ;
81 
87  virtual double mean() const ;
88 
94  virtual double rms() const ;
95 
105  virtual bool myConvert(int nBins, double lowerEdge, double upperEdge) const ;
106  virtual bool convert(int nBins, double lowerEdge, double upperEdge) ;
107 
115 
123  virtual const IHistogram1D & histogram() const ;
124 
131  virtual bool fillHistogram(IHistogram1D & hist) const ;
132 
133 // ----------------------------------------------------------------------------
134 // Functions from ICloud
135 // ----------------------------------------------------------------------------
136 
142  virtual double sumOfWeights() const ;
143 
149  virtual bool myConvertToHistogram() const;
150  virtual bool convertToHistogram() ;
151 
157  virtual bool isConverted() const ;
158 
164  virtual int maxEntries() const ;
165 
172  virtual bool scale(double scaleFactor) ;
173 
174 // ----------------------------------------------------------------------------
175 // Functions from IBaseHistogram
176 // ----------------------------------------------------------------------------
177 
183  virtual std::string title() const ;
184 
191  virtual bool setTitle(const std::string & title) ;
192 
198 
201 
207  virtual int dimension() const ;
208 
214  virtual bool reset() ;
215 
221  virtual int entries() const ;
222 
228 
230 private:
231 
232  PathName _path;
233  ITree* _usedTree;
234  mutable IHistogram1D *_AIDAHistogram;
235 
236  mutable bool _isConverted;
237  static const int _nBinsDefault = 100;
238  int _nMax;
239  mutable TTree *_ROOTTree;
240 
241  Double_t _xValue;
242  Double_t _yValue;
243 
244  mutable double _histoLowerEdge;
245  mutable double _histoUpperEdge;
246 }; // class
247 } // namespace AIDA
248 #endif /* ifndef AIDA_ICLOUD1DROOT_H */
virtual double upperEdge() const
Get the upper edge of the ICloud1D.
Definition: ICloud1DROOT.cc:100
virtual bool fillHistogram(IHistogram1D &hist) const
Project the ICloud1D on an IHistogram1D.
Definition: ICloud1DROOT.cc:243
class IManagedObject;
Definition: ITree.h:37
User level interface to a 1D Cloud.
Definition: ICloud1D.h:30
virtual double mean() const
Get the mean of the ICloud1D.
Definition: ICloud1DROOT.cc:140
virtual double value(int index) const
Get the value corresponding to a given entry.
Definition: ICloud1DROOT.cc:112
virtual bool myConvert(int nBins, double lowerEdge, double upperEdge) const
Convert internally the ICloud1D to an IHistogram1D with given number of bins, upper edge and lower ed...
Definition: ICloud1DROOT.cc:191
User level interface to 1D Histogram.
Definition: IHistogram1D.h:28
User level interface to a 1D Cloud.
Definition: ICloud1DROOT.h:23
ICloud1DROOT(const std::string &path, const std::string &title, int nMax, ITree *usedTree, const std::string &options="")
Constructor.
Definition: ICloud1DROOT.cc:18
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: ICloud1DROOT.cc:345
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: ICloud1DROOT.cc:358
Definition: PathName.h:19
virtual double lowerEdge() const
Get the lower edge of the ICloud1D.
Definition: ICloud1DROOT.cc:88
virtual double sumOfWeights() const
Get the sum of weights of all the entries.
Definition: ICloud1DROOT.cc:258
virtual bool scale(double scaleFactor)
Scale the weights by a given factor.
Definition: ICloud1DROOT.cc:300
virtual bool fill(double x, double weight=1.)
Fill the ICloud1D with a value and a corresponding weight.
Definition: ICloud1DROOT.cc:66
virtual ~ICloud1DROOT()
Destructor.
Definition: ICloud1DROOT.h:27
virtual bool convert(int nBins, double lowerEdge, double upperEdge)
Convert internally the ICloud1D to an IHistogram1D with given number of bins, upper edge and lower ed...
Definition: ICloud1DROOT.cc:186
virtual double rms() const
Get the RMS of the ICloud1D.
Definition: ICloud1DROOT.cc:162
virtual bool reset()
Reset the Histogram; as if just created.
Definition: ICloud1DROOT.cc:377
virtual double weight(int index) const
Get the weight corresponding to a given entry.
Definition: ICloud1DROOT.cc:126
virtual const IHistogram1D & histogram() const
Convert internally the ICloud1D to an IHistogram1D with given bin edges.
Definition: ICloud1DROOT.cc:233
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: ICloud1DROOT.cc:391
virtual bool convertToHistogram()
Convert the ICloud to an IHistogram using the default number of bins.
Definition: ICloud1DROOT.cc:279
virtual bool myConvertToHistogram() const
Convert the ICloud to an IHistogram using the default number of bins.
Definition: ICloud1DROOT.cc:284
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: ICloud1DROOT.cc:372
virtual int maxEntries() const
Get the number of entries after which the cloud will be converted to an IHistogram.
Definition: ICloud1DROOT.cc:295
virtual bool isConverted() const
Check if the ICloud has been converted to an IHistogram.
Definition: ICloud1DROOT.cc:290