RAIDA  1.9.0
ICloud2DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_ICLOUD2DROOT_H
3 #define AIDA_ICLOUD2DROOT_H 1
4 
5 #include <vector>
6 #include <TH2D.h>
7 #include <TTree.h>
8 #include "AIDA/ICloud.h"
9 #include "AIDA/ICloud2D.h"
10 #include <AIDA/ITree.h>
11 #include <RAIDA/PathName.h>
12 
13 namespace AIDA {
14 
15 class IHistogram2D;
16 
24 class ICloud2DROOT : public ICloud2D {
25 
26 public:
28  virtual ~ICloud2DROOT() { /* nop */; }
29 
31  ICloud2DROOT(const std::string & path,
32  const std::string & title,
33  int nMax,
34  ITree* usedTree,
35  const std::string & options = "");
36 
37  ICloud2DROOT(const std::string & path,
38  ITree* usedTree,
39  const ICloud2DROOT & cloud) ;
40 
41 
51  virtual bool fill(double x, double y, double weight = 1.) ;
52 
58  virtual double lowerEdgeX() const ;
59 
65  virtual double lowerEdgeY() const ;
66 
72  virtual double upperEdgeX() const ;
73 
79  virtual double upperEdgeY() const ;
80 
88  virtual double valueX(int index) const ;
89 
97  virtual double valueY(int index) const ;
98 
106  virtual double weight(int index) const ;
107 
113  virtual double meanX() const ;
114 
120  virtual double meanY() const ;
121 
127  virtual double rmsX() const ;
128 
134  virtual double rmsY() const ;
135 
148  virtual bool convert(int nBinsX,
149  double lowerEdgeX,
150  double upperEdgeX,
151  int nBinsY,
152  double lowerEdgeY,
153  double upperEdgeY) ;
154 
155  virtual bool myConvert(int nBinsX,
156  double lowerEdgeX,
157  double upperEdgeX,
158  int nBinsY,
159  double lowerEdgeY,
160  double upperEdgeY) const ;
161 
170 
178  virtual const IHistogram2D & histogram() const ;
179 
186  virtual bool fillHistogram(IHistogram2D & hist) const ;
187 
188 // ----------------------------------------------------------------------------
189 // Functions from ICloud
190 // ----------------------------------------------------------------------------
191 
197  virtual double sumOfWeights() const ;
198 
204  virtual bool convertToHistogram() ;
205  virtual bool myConvertToHistogram() const ;
206 
212  virtual bool isConverted() const ;
213 
219  virtual int maxEntries() const ;
220 
227  virtual bool scale(double scaleFactor) ;
228 
229 // ----------------------------------------------------------------------------
230 // Functions from IBaseHistogram
231 // ----------------------------------------------------------------------------
232 
238  virtual std::string title() const ;
239 
246  virtual bool setTitle(const std::string & title) ;
247 
253 
256 
262  virtual int dimension() const ;
263 
269  virtual bool reset() ;
270 
276  virtual int entries() const ;
277 
283 
285 private:
286 
287  PathName _path;
288  ITree* _usedTree;
289  mutable IHistogram2D *_AIDAHistogram;
290 
291  mutable bool _isConverted;
292  static const int _nBinsDefault = 100;
293  int _nMax;
294  mutable TTree *_ROOTTree;
295 
296  Double_t _xValue;
297  Double_t _yValue;
298  Double_t _zValue;
299 
300  mutable double _histoLowerEdgeX;
301  mutable double _histoUpperEdgeX;
302  mutable double _histoLowerEdgeY;
303  mutable double _histoUpperEdgeY;
304 
305 }; // class
306 } // namespace AIDA
307 #endif /* ifndef AIDA_ICLOUD2DROOT_H */
class IManagedObject;
Definition: ITree.h:37
virtual double valueX(int index) const
Get the x value corresponding to a given entry.
Definition: ICloud2DROOT.cc:147
virtual ~ICloud2DROOT()
Destructor.
Definition: ICloud2DROOT.h:28
virtual int maxEntries() const
Get the number of entries after which the cloud will be converted to an IHistogram.
Definition: ICloud2DROOT.cc:414
virtual double weight(int index) const
Get the weight corresponding to a given entry.
Definition: ICloud2DROOT.cc:177
virtual bool isConverted() const
Check if the ICloud has been converted to an IHistogram.
Definition: ICloud2DROOT.cc:409
ICloud2DROOT(const std::string &path, const std::string &title, int nMax, ITree *usedTree, const std::string &options="")
Constructor.
Definition: ICloud2DROOT.cc:20
virtual double rmsX() const
Get the RMS of the ICloud2D along the x axis.
Definition: ICloud2DROOT.cc:238
virtual bool fill(double x, double y, double weight=1.)
Fill the ICloud2D with a couple of values and a corresponding weight.
Definition: ICloud2DROOT.cc:73
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: ICloud2DROOT.cc:480
virtual double sumOfWeights() const
Get the sum of weights of all the entries.
Definition: ICloud2DROOT.cc:374
Definition: PathName.h:19
User level interface to a 2D Cloud.
Definition: ICloud2D.h:30
virtual double lowerEdgeX() const
Get the lower edge of the ICloud2D along the x axis.
Definition: ICloud2DROOT.cc:99
virtual double upperEdgeY() const
Get the upper edge of the ICloud2D along the y axis.
Definition: ICloud2DROOT.cc:135
virtual double meanY() const
Get the mean of the ICloud2D along the y axis.
Definition: ICloud2DROOT.cc:215
virtual double lowerEdgeY() const
Get the lower edge of the ICloud2D along the y axis.
Definition: ICloud2DROOT.cc:111
virtual bool scale(double scaleFactor)
Scale the weights by a given factor.
Definition: ICloud2DROOT.cc:419
virtual double valueY(int index) const
Get the y value corresponding to a given entry.
Definition: ICloud2DROOT.cc:162
User level interface to a 2D Cloud.
Definition: ICloud2DROOT.h:24
virtual bool convert(int nBinsX, double lowerEdgeX, double upperEdgeX, int nBinsY, double lowerEdgeY, double upperEdgeY)
Convert internally the ICloud2D to an IHistogram2D with given number of bins, upper edge and lower ed...
Definition: ICloud2DROOT.cc:288
User level interface to 2D Histogram.
Definition: IHistogram2D.h:28
virtual bool reset()
Reset the Histogram; as if just created.
Definition: ICloud2DROOT.cc:499
virtual double upperEdgeX() const
Get the upper edge of the ICloud2D along the x axis.
Definition: ICloud2DROOT.cc:123
virtual double meanX() const
Get the mean of the ICloud2D along the x axis.
Definition: ICloud2DROOT.cc:192
virtual double rmsY() const
Get the RMS of the ICloud2D along the y axis.
Definition: ICloud2DROOT.cc:263
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: ICloud2DROOT.cc:494
virtual const IHistogram2D & histogram() const
Convert internally the ICloud2D to an IHistogram2D with given bin edges.
Definition: ICloud2DROOT.cc:348
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: ICloud2DROOT.cc:512
virtual bool fillHistogram(IHistogram2D &hist) const
Project the ICloud2D on an IHistogram2D.
Definition: ICloud2DROOT.cc:358
virtual bool convertToHistogram()
Convert the ICloud to an IHistogram using the default number of bins.
Definition: ICloud2DROOT.cc:396
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: ICloud2DROOT.cc:467