RAIDA  1.9.0
ICloud3DROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_ICLOUD3DROOT_H
3 #define AIDA_ICLOUD3DROOT_H 1
4 
5 #include <vector>
6 
7 #include <TH3D.h>
8 #include <TTree.h>
9 #include "AIDA/ICloud.h"
10 #include "AIDA/ICloud3D.h"
11 #include <AIDA/ITree.h>
12 #include <RAIDA/PathName.h>
13 
14 namespace AIDA {
15 
16 class IHistogram3D;
17 
25 class ICloud3DROOT : public ICloud3D {
26 
27 public:
29  virtual ~ICloud3DROOT() { /* nop */; }
30 
32  ICloud3DROOT(const std::string & path,
33  const std::string & title,
34  int nMax,
35  ITree* usedTree,
36  const std::string & options = "");
37 
38  ICloud3DROOT(const std::string & path,
39  ITree* usedTree,
40  const ICloud3DROOT & cloud) ;
41 
52  virtual bool fill(double x, double y, double z, double weight = 1.) ;
53 
59  virtual double lowerEdgeX() const ;
60 
66  virtual double lowerEdgeY() const ;
67 
73  virtual double lowerEdgeZ() const ;
74 
80  virtual double upperEdgeX() const ;
81 
87  virtual double upperEdgeY() const ;
88 
94  virtual double upperEdgeZ() const ;
95 
103  virtual double valueX(int index) const ;
104 
112  virtual double valueY(int index) const ;
113 
121  virtual double valueZ(int index) const ;
122 
130  virtual double weight(int index) const ;
131 
137  virtual double meanX() const ;
138 
144  virtual double meanY() const ;
145 
151  virtual double meanZ() const ;
152 
158  virtual double rmsX() const ;
159 
165  virtual double rmsY() const ;
166 
172  virtual double rmsZ() const ;
173 
189  virtual bool convert(int nBinsX,
190  double lowerEdgeX,
191  double upperEdgeX,
192  int nBinsY,
193  double lowerEdgeY,
194  double upperEdgeY,
195  int nBinsZ,
196  double lowerEdgeZ,
197  double upperEdgeZ) ;
198 
199  virtual bool myConvert(int nBinsX,
200  double lowerEdgeX,
201  double upperEdgeX,
202  int nBinsY,
203  double lowerEdgeY,
204  double upperEdgeY,
205  int nBinsZ,
206  double lowerEdgeZ,
207  double upperEdgeZ) const ;
208 
209 
219 
227  virtual const IHistogram3D & histogram() const ;
228 
235  virtual bool fillHistogram(IHistogram3D & hist) const ;
236 
237 // ----------------------------------------------------------------------------
238 // Functions from ICloud
239 // ----------------------------------------------------------------------------
240 
246  virtual double sumOfWeights() const ;
247 
253  virtual bool convertToHistogram() ;
254  virtual bool myConvertToHistogram() const ;
255 
261  virtual bool isConverted() const ;
262 
268  virtual int maxEntries() const ;
269 
276  virtual bool scale(double scaleFactor) ;
277 
278 // ----------------------------------------------------------------------------
279 // Functions from IBaseHistogram
280 // ----------------------------------------------------------------------------
281 
287  virtual std::string title() const ;
288 
295  virtual bool setTitle(const std::string & title) ;
296 
302 
305 
311  virtual int dimension() const ;
312 
318  virtual bool reset() ;
319 
325  virtual int entries() const ;
326 
332 
334 private:
335 
336  PathName _path;
337  ITree* _usedTree;
338  mutable IHistogram3D *_AIDAHistogram;
339 
340  mutable bool _isConverted;
341  static const int _nBinsDefault = 20;
342  int _nMax;
343  mutable TTree *_ROOTTree;
344 
345  Double_t _xValue;
346  Double_t _yValue;
347  Double_t _zValue;
348  Double_t _wValue;
349 
350  mutable double _histoLowerEdgeX;
351  mutable double _histoUpperEdgeX;
352  mutable double _histoLowerEdgeY;
353  mutable double _histoUpperEdgeY;
354  mutable double _histoLowerEdgeZ;
355  mutable double _histoUpperEdgeZ;
356 
357 }; // class
358 } // namespace AIDA
359 #endif /* ifndef AIDA_ICLOUD3DROOT_H */
360 
virtual int entries() const
Get the number of in-range entries in the Histogram.
Definition: ICloud3DROOT.cc:640
virtual double upperEdgeY() const
Get the upper edge of the ICloud3D along the y axis.
Definition: ICloud3DROOT.cc:158
class IManagedObject;
Definition: ITree.h:37
virtual double meanX() const
Get the mean of the ICloud3D along the x axis.
Definition: ICloud3DROOT.cc:246
virtual bool isConverted() const
Check if the ICloud has been converted to an IHistogram.
Definition: ICloud3DROOT.cc:534
User level interface to a 3D Cloud.
Definition: ICloud3DROOT.h:25
virtual bool convertToHistogram()
Convert the ICloud to an IHistogram using the default number of bins.
Definition: ICloud3DROOT.cc:519
virtual bool reset()
Reset the Histogram; as if just created.
Definition: ICloud3DROOT.cc:627
virtual double lowerEdgeZ() const
Get the lower edge of the ICloud3D along the z axis.
Definition: ICloud3DROOT.cc:134
User level interface to 3D Histogram.
Definition: IHistogram3D.h:28
virtual double rmsY() const
Get the RMS of the ICloud3D along the y axis.
Definition: ICloud3DROOT.cc:344
virtual bool convert(int nBinsX, double lowerEdgeX, double upperEdgeX, int nBinsY, double lowerEdgeY, double upperEdgeY, int nBinsZ, double lowerEdgeZ, double upperEdgeZ)
Convert internally the ICloud3D to an IHistogram3D with given number of bins, upper edge and lower ed...
Definition: ICloud3DROOT.cc:396
virtual double weight(int index) const
Get the weight corresponding to a given entry.
Definition: ICloud3DROOT.cc:230
virtual bool scale(double scaleFactor)
Scale the weights by a given factor.
Definition: ICloud3DROOT.cc:544
virtual ~ICloud3DROOT()
Destructor.
Definition: ICloud3DROOT.h:29
virtual int maxEntries() const
Get the number of entries after which the cloud will be converted to an IHistogram.
Definition: ICloud3DROOT.cc:539
virtual int dimension() const
Get the IAnnotation associated with the Histogram.
Definition: ICloud3DROOT.cc:622
Definition: PathName.h:19
virtual double upperEdgeX() const
Get the upper edge of the ICloud3D along the x axis.
Definition: ICloud3DROOT.cc:146
virtual std::string title() const
Get the Histogram&#39;s title.
Definition: ICloud3DROOT.cc:595
virtual double valueX(int index) const
Get the x value corresponding to a given entry.
Definition: ICloud3DROOT.cc:182
virtual double lowerEdgeX() const
Get the lower edge of the ICloud3D along the x axis.
Definition: ICloud3DROOT.cc:110
virtual double meanZ() const
Get the mean of the ICloud3D along the z axis.
Definition: ICloud3DROOT.cc:294
virtual double rmsZ() const
Get the RMS of the ICloud3D along the z axis.
Definition: ICloud3DROOT.cc:370
virtual bool setTitle(const std::string &title)
Set the histogram title.
Definition: ICloud3DROOT.cc:608
virtual double valueY(int index) const
Get the y value corresponding to a given entry.
Definition: ICloud3DROOT.cc:198
ICloud3DROOT(const std::string &path, const std::string &title, int nMax, ITree *usedTree, const std::string &options="")
Constructor.
Definition: ICloud3DROOT.cc:22
virtual const IHistogram3D & histogram() const
Convert internally the ICloud3D to an IHistogram3D with given bin edges.
Definition: ICloud3DROOT.cc:469
virtual double lowerEdgeY() const
Get the lower edge of the ICloud3D along the y axis.
Definition: ICloud3DROOT.cc:122
virtual double rmsX() const
Get the RMS of the ICloud3D along the x axis.
Definition: ICloud3DROOT.cc:318
virtual double meanY() const
Get the mean of the ICloud3D along the y axis.
Definition: ICloud3DROOT.cc:270
virtual double valueZ(int index) const
Get the z value corresponding to a given entry.
Definition: ICloud3DROOT.cc:214
virtual double sumOfWeights() const
Get the sum of weights of all the entries.
Definition: ICloud3DROOT.cc:496
virtual bool fill(double x, double y, double z, double weight=1.)
Fill the ICloud3D with a triplet of values and a corresponding weight.
Definition: ICloud3DROOT.cc:80
virtual double upperEdgeZ() const
Get the upper edge of the ICloud3D along the z axis.
Definition: ICloud3DROOT.cc:170
virtual bool fillHistogram(IHistogram3D &hist) const
Project the ICloud3D on an IHistogram3D.
Definition: ICloud3DROOT.cc:479
User level interface to a 3D Cloud.
Definition: ICloud3D.h:30