RAIDA  1.9.0
ITupleROOT.h
1 // -*- C++ -*-
2 #ifndef AIDA_ITUPLEROOT_H
3 #define AIDA_ITUPLEROOT_H 1
4 
5 #include <AIDA/ITuple.h>
6 #include <TTree.h>
7 #include <string>
8 #include <vector>
9 #include <RAIDA/LeafPoint.h>
10 
11 namespace AIDA {
12 
13 class IAnnotation;
14 class ICloud1D;
15 class ICloud2D;
16 class ICloud3D;
17 class IEvaluator;
18 class IFilter;
19 class IHistogram1D;
20 class IHistogram2D;
21 class IHistogram3D;
22 class IProfile1D;
23 class IProfile2D;
24 class ITupleEntry;
25 
33 class ITupleROOT : public ITuple {
34 
35 public:
37  ITupleROOT(const std::string & name,
38  const std::string & title,
39  const std::vector<std::string> & columnNames,
40  const std::vector<std::string> & columnType,
41  const std::string & options = "") ;
42 
43  ITupleROOT() ;
44 
46  virtual ~ITupleROOT() { /* nop */; }
47 
53  virtual std::string title() const ;
54 
61  virtual bool setTitle(const std::string & title) ;
62 
68 
71 
79  virtual bool fill(int column, double value) ;
80 
88  virtual bool fill(int column, float value) ;
89 
97  virtual bool fill(int column, int value) ;
98 
106  virtual bool fill(int column, short value) ;
107 
115  virtual bool fill(int column, long value) ;
116 
124  virtual bool fill(int column, char value) ;
125 
133  virtual bool fill(int column, bool value) ;
134 
142 
151 
160  virtual bool fill(const std::vector<double> & values) ;
161 
169  virtual bool fill(const std::vector<float> & values) ;
170 
178  virtual bool addRow() ;
179 
184  virtual void resetRow() ;
185 
191  virtual void reset() ;
192 
198  virtual int rows() const ;
199 
204  virtual void start() ;
205 
213  virtual bool skip(int rows) ;
214 
220  virtual bool next() ;
221 
229  virtual bool setRow(int rowIndex) ;
230  virtual bool mySetRow(int rowIndex) const ;
231 
238  virtual int findColumn(const std::string & name) const ;
239 
246  virtual double getDouble(int column) const ;
247 
254  virtual float getFloat(int column) const ;
255 
262  virtual int getInt(int column) const ;
263 
270  virtual short getShort(int column) const ;
271 
278  virtual long getLong(int column) const ;
279 
286  virtual char getChar(int column) const ;
287 
294  virtual bool getBoolean(int column) const ;
295 
302 
310 
319 
322 
328  virtual int columns() const ;
329 
336  virtual std::string columnName(int column) const ;
337 
343  virtual std::vector<std::string> columnNames() const ;
344 
351  virtual std::string columnType(int column) const ;
352 
358  virtual std::vector<std::string> columnTypes() const ;
359 
366  virtual double columnMin(int column) const ;
367 
374  virtual double columnMax(int column) const ;
375 
382  virtual double columnMean(int column) const ;
383 
390  virtual double columnRms(int column) const ;
391 
401  virtual bool project(IHistogram1D & histogram, IEvaluator & evaluatorX) ;
402 
414  virtual bool project(IHistogram1D & histogram, IEvaluator & evaluatorX, IFilter & filter) ;
415 
426  virtual bool project(IHistogram1D & histogram, IEvaluator & evaluatorX, IEvaluator & weight) ;
427 
440  virtual bool project(IHistogram1D & histogram, IEvaluator & evaluatorX, IFilter & filter, IEvaluator & weight) ;
441 
454  virtual bool project(IHistogram2D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY) ;
455 
470  virtual bool project(IHistogram2D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IFilter & filter) ;
471 
485  virtual bool project(IHistogram2D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & weight) ;
486 
502  virtual bool project(IHistogram2D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IFilter & filter, IEvaluator & weight) ;
503 
519  virtual bool project(IHistogram3D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ) ;
520 
538  virtual bool project(IHistogram3D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IFilter & filter) ;
539 
556  virtual bool project(IHistogram3D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IEvaluator & weight) ;
557 
576  virtual bool project(IHistogram3D & histogram, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IFilter & filter, IEvaluator & weight) ;
577 
587  virtual bool project(ICloud1D & cloud, IEvaluator & evaluatorX) ;
588 
600  virtual bool project(ICloud1D & cloud, IEvaluator & evaluatorX, IFilter & filter) ;
601 
612  virtual bool project(ICloud1D & cloud, IEvaluator & evaluatorX, IEvaluator & weight) ;
613 
626  virtual bool project(ICloud1D & cloud, IEvaluator & evaluatorX, IFilter & filter, IEvaluator & weight) ;
627 
640  virtual bool project(ICloud2D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY) ;
641 
656  virtual bool project(ICloud2D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IFilter & filter) ;
657 
671  virtual bool project(ICloud2D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & weight) ;
672 
688  virtual bool project(ICloud2D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IFilter & filter, IEvaluator & weight) ;
689 
705  virtual bool project(ICloud3D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ) ;
706 
724  virtual bool project(ICloud3D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IFilter & filter) ;
725 
742  virtual bool project(ICloud3D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IEvaluator & weight) ;
743 
762  virtual bool project(ICloud3D & cloud, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IFilter & filter, IEvaluator & weight) ;
763 
776  virtual bool project(IProfile1D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY) ;
777 
792  virtual bool project(IProfile1D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IFilter & filter) ;
793 
807  virtual bool project(IProfile1D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & weight) ;
808 
824  virtual bool project(IProfile1D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IFilter & filter, IEvaluator & weight) ;
825 
841  virtual bool project(IProfile2D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ) ;
842 
860  virtual bool project(IProfile2D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IFilter & filter) ;
861 
878  virtual bool project(IProfile2D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IEvaluator & weight) ;
879 
898  virtual bool project(IProfile2D & profile, IEvaluator & evaluatorX, IEvaluator & evaluatorY, IEvaluator & evaluatorZ, IFilter & filter, IEvaluator & weight) ;
899 
905 
907 protected:
908 
909  // std::vector<std::string> _columnType;
910  // std::vector<std::string> _columnNames;
911  TTree *_theTree;
912  std::vector<LeafPoint> _pointVec;
913  mutable std::vector<LeafPoint> _readPointVec;
914  mutable int _readCursor;
915 }; // class
916 } // namespace AIDA
917 #endif /* ifndef AIDA_ITUPLEROOT_H */
virtual bool setTitle(const std::string &title)
Set the title of the ITuple.
Definition: ITupleROOT.cc:127
virtual void resetRow()
Clear the current(not yet added) row.
Definition: ITupleROOT.cc:288
virtual int rows() const
Get the number of rows currently filled in the ITuple.
Definition: ITupleROOT.cc:299
virtual double columnMax(int column) const
Get the maximum value of a given column (if it can be converted to a double).
Definition: ITupleROOT.cc:715
User level interface to a 1D Cloud.
Definition: ICloud1D.h:30
User level interface to a 1-dimensional profile histogram.
Definition: IProfile1D.h:28
virtual int columns() const
Get the string stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:669
User&#39;s level interface of an IEvaluator.
Definition: IEvaluator.h:28
User level interface to a Tuple.
Definition: ITuple.h:40
virtual double columnMin(int column) const
Get the minimum value of a given column (if it can be converted to a double).
Definition: ITupleROOT.cc:708
virtual bool next()
Positions the cursor at the next row.
Definition: ITupleROOT.cc:318
virtual bool setRow(int rowIndex)
Position the cursor at a give row.
Definition: ITupleROOT.cc:327
User level interface to 1D Histogram.
Definition: IHistogram1D.h:28
virtual long getLong(int column) const
Get the long stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:561
User level interface to 3D Histogram.
Definition: IHistogram3D.h:28
virtual bool skip(int rows)
Skips a given number of rows.
Definition: ITupleROOT.cc:309
virtual ~ITupleROOT()
Destructor.
Definition: ITupleROOT.h:46
virtual std::string columnType(int column) const
Get the type of a give column.
Definition: ITupleROOT.cc:691
virtual bool addRow()
Add the current row to the ITuple.
Definition: ITupleROOT.cc:258
virtual int getInt(int column) const
Get the integer stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:477
virtual float getFloat(int column) const
Get the float stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:417
User level interface to a 2D Cloud.
Definition: ICloud2D.h:30
virtual int findColumn(const std::string &name) const
Get the index within the ITuple of a given column.
Definition: ITupleROOT.cc:339
User level interface to a Tuple.
Definition: ITupleROOT.h:33
virtual std::vector< std::string > columnNames() const
Get the names of all the columns.
Definition: ITupleROOT.cc:680
TTree * _theTree
See IManagedObject for a description.
Definition: ITupleROOT.h:911
virtual std::string columnName(int column) const
Get the name of a column from its index.
Definition: ITupleROOT.cc:674
virtual void start()
Positions the read cursor immediately before the first row.
Definition: ITupleROOT.cc:304
User level interface to a 2-dimensional profile histogram.
Definition: IProfile2D.h:28
virtual short getShort(int column) const
Get the short stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:528
virtual bool fill(int column, double value)
Get the IAnnotation corresponding to this ITuple.
Definition: ITupleROOT.cc:133
User level interface to 2D Histogram.
Definition: IHistogram2D.h:28
virtual void reset()
Reset the ITuple.
Definition: ITupleROOT.cc:294
virtual std::string title() const
Get the title of this ITuple.
Definition: ITupleROOT.cc:121
virtual bool project(IHistogram1D &histogram, IEvaluator &evaluatorX)
Fill an IHistogram1D from the tuple.
Definition: ITupleROOT.cc:755
virtual double columnMean(int column) const
Get the mean value of a given column (if it can be converted to a double).
Definition: ITupleROOT.cc:722
virtual bool getBoolean(int column) const
Get the boolean stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:636
virtual std::vector< std::string > columnTypes() const
Get the types of all the columns.
Definition: ITupleROOT.cc:697
User&#39;s level interface of an IFilter.
Definition: IFilter.h:28
virtual double columnRms(int column) const
Get the RMS of a given column (if it can be converted to a double).
Definition: ITupleROOT.cc:737
virtual double getDouble(int column) const
Get the double stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:348
virtual char getChar(int column) const
Get the character stored in a given column at the current cursor&#39;s position.
Definition: ITupleROOT.cc:603
User level interface to a 3D Cloud.
Definition: ICloud3D.h:30