QtRootNTuple.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _QtRootNTuple_H_
15 #define _QtRootNTuple_H_
16 
17 #include "RootNTuple.h"
18 
19 namespace boost {
20  namespace python {
21  namespace numeric {
22  class array;
23  }
24  }
25 }
26 
27 namespace hippodraw {
28 
37 class QtRootNTuple : public RootNTuple
38 {
39 private:
40 
46  QtRootNTuple ( );
47 
50  static void sliceRowDimension ( std::vector < int > & shape );
51 
52 public:
53 
56  QtRootNTuple ( TTree * tree );
57 
60  unsigned int columns () const;
61 
64  unsigned int rows () const;
65 
68  const std::vector < double > & getColumn ( const std::string & name ) const;
69 
72  const std::vector < double > &
73  getColumn ( const std::string & name,
74  const std::vector < int> & indexes ) const;
75 
78  const std::vector < double > & getColumn ( unsigned int index ) const;
79 
82  const std::vector < double > & getRow ( unsigned int index ) const;
83 
87  int addColumn ( const std::string &, const std::vector < double > & );
88 
90  const std::vector < std::string > & getLabels () const;
91 
95  bool isMultiDimensional ( const std::string & column ) const;
96 
101  const std::vector < int > getColumnShape ( const std::string & column );
102 
103 
109  boost::python::numeric::array
110  valueAt ( unsigned int row, const std::string & variable );
111 
117  boost::python::numeric::array
118  getColumnAsArray ( const std::string & variable );
119 
120 
121  void expandIfNeeded ( const std::vector < std::string > & labels ) const;
122 
123  std::string
124  createBinding ( const std::string & name,
125  const std::vector < int > & indices ) const;
126 };
127 
128 } // namespace hippodraw
129 
130 #endif // _QtRootNTuple_H_
const std::vector< std::string > & getLabels() const
Returns the labels of the column, i.e.
boost::python::numeric::array valueAt(unsigned int row, const std::string &variable)
Returns a numarray for variable in row of NTuple.
The ROOT TTree class.
const std::vector< int > getColumnShape(const std::string &column)
Returns the shape of multidimensional array excluding row dimension.
hippodraw::RootNTuple class interface.
unsigned int rows() const
Returns the number of rows.
A DataSource class implemented with a ROOT TBranch objects from a ROOT TTree to store the column data...
Definition: RootNTuple.h:37
void expandIfNeeded(const std::vector< std::string > &labels) const
Expand the multidimension column if needed.
column
The column indices for 2 dimension data point tuple.
std::vector< intptr_t > shape(numeric::array arr)
Definition: num_util.cpp:317
QtRootNTuple()
The default constructor.
A wrapper for RootNTuple, so that when RootNTuple is used in Qt based application, the application object can be locked and unlocked before calling any ROOT functions.
Definition: QtRootNTuple.h:37
std::string createBinding(const std::string &name, const std::vector< int > &indices) const
unsigned int columns() const
Returns the number of columns.
static void sliceRowDimension(std::vector< int > &shape)
Removes the row dimension, i.e.
const std::vector< double > & getColumn(const std::string &name) const
Returns copy of TBranch data by name.
boost::python::numeric::array getColumnAsArray(const std::string &variable)
Returns a numarray for variable.
int addColumn(const std::string &, const std::vector< double > &)
Adds a column to the object.
return index
Definition: PickTable.cxx:182
bool isMultiDimensional(const std::string &column) const
Returns true if the column named column, is an array, rather then simple type.
const std::vector< double > & getRow(unsigned int index) const
Returns the row indexed by index.

Generated for HippoDraw Class Library by doxygen