13 #include "w32pragma.h"
24 using namespace hippodraw;
31 : m_branch ( branch ),
32 m_vector_double_data ( 0 ),
33 m_vector_float_data ( 0 ),
34 m_vector_int_data ( 0 ),
35 m_vector_uint_data ( 0 ),
36 m_vector_ulong64_data ( 0 ),
37 m_releventIndex ( -1 ),
38 m_branch_set ( false ),
41 TObjArray * leaves = branch -> GetListOfLeaves ();
46 TObject *
object = leaves -> At ( 0 );
75 m_releventIndex ( -1 ),
76 m_branch_set ( false )
140 boost::char_separator< char > sep(
"][" );
143 typedef boost::tokenizer< boost::char_separator< char > > tokenizer;
144 tokenizer tok( s, sep );
147 for( tokenizer::iterator tok_iter = tok.begin();
148 tok_iter != tok.end();
150 if( tok_iter != tok.begin() ) {
151 unsigned int value = boost::lexical_cast<
unsigned int >( *tok_iter );
249 const vector < int > &
265 assert(
getRank () == index.size() );
269 for (
unsigned int d = 1; d <
getRank (); d++ ) {
270 m_releventIndex = m_releventIndex *
m_shape [ d ] + index[ d ];
~RootBranch()
The destructor.
Type
The type of data on the branch.
RootBranch()
The default constructor.
bool isMultiDimensional() const
Returns true if data sitting in the rows of this branch is and array.
UShort_t m_ushort_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
int m_number_elements
The number of elements in the Leaf array or 0 if not an array.
double * doubleArrayAt(unsigned int row)
Returns pointer to a double array in given row.
ULong64_t * m_vector_ulong64_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
Long64_t m_long64_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
unsigned int * uintArrayAt(unsigned int row)
Returns pointer to a unsigned int array type in given row.
Double_t m_double_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
void setReleventIndex(const std::vector< unsigned int > &index)
In case we are dealing with multidimensional data in rows of this branch we would like to deal with o...
int * intArrayAt(unsigned int row)
Returns pointer to a int array type in given row.
Float_t * m_vector_float_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
hippodraw::RootData::Type m_leaf_type
The ROOT type name for this branch if single TLeaf is on this branch.
hippodraw::RootData::Type getType() const
Returns the type of the data in this branch.
void setBranchAddress() const
Sets the address where the ROOT TBranch will put its data.
UShort_t * m_vector_ushort_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
unsigned int getRank() const
Gives the dimensionality of the data stored in each row of this branch.
Long64_t * m_vector_long64_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
bool m_useable
Set to false if the branch is not usable.
Short_t * m_vector_short_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
int m_number_leaves
The number of TLeaf objects on this TBranch.
unsigned int size() const
Returns the size of the slice for the next to last dimension.
std::vector< int > m_shape
In case the data quantity we are dealing with is a vector/matrix store its dimensions of each axis in...
PyArray_TYPES type(numeric::array arr)
int m_releventIndex
In case the data quantity is vector/matrix we would like just to take one element out of it...
bool empty() const
Returns true, if RootBranch is empty, i.e.
Short_t m_short_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
void initShape(const char *title)
From the root title, which is of format "name[x][y][z]", gets the sizes of various dimension...
int numberOfElements() const
Number of elements in this branch.
TLeaf * m_leaf
The ROOT TLeaf which described the data in this branch.
const std::vector< int > & getShape()
Vector of the number of entries in the multidimensional data.
hippodraw::RootBranch class interface.
UInt_t * m_vector_uint_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
ULong64_t m_ulong64_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
double valueAt(unsigned int row) const
Returns the value of the leaf at index row.
hippodraw::Range class interface
UInt_t m_uint_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
bool isUseable() const
Returns true if the branch is usable.
TBranch * getTBranch()
Returns the TBranch which was used to initialize this branch.
Int_t m_int_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
bool m_branch_set
Set true when branch address has been set.
float * floatArrayAt(unsigned int row)
Returns pointer to a float array type in given row.
Int_t * m_vector_int_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
TBranch * m_branch
The ROOT TBranch from which the data will be obtained.
Double_t * m_vector_double_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...
Float_t m_float_data
The address of the following variable is given to ROOT TTree as the branch address for this branch if...