Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RootBranch Class Reference

#include <LdfColumn.h>

Collaboration diagram for RootBranch:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class to read data from a ROOT TBranch.

Author:
Kaustuv <kaustuv@stanford.edu>

Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 37 of file LdfColumn.h.

Public Member Functions

double * doubleArrayAt (unsigned int row)
 Returns pointer to a double array type in given row.
double * doubleArrayAt (unsigned int row)
 Returns pointer to a double array type in given row.
virtual bool empty () const
 Returns true, if RootBranch is empty, i.e.
virtual bool empty () const
 Returns true, if RootBranch is empty, i.e.
float * floatArrayAt (unsigned int row)
 Returns pointer to a float array type in given row.
float * floatArrayAt (unsigned int row)
 Returns pointer to a float array type in given row.
TBranchgetTBranch ()
 Returns the TBranch which was used to initialize this branch.
TBranchgetTBranch ()
 Returns the TBranch which was used to initialize this branch.
hippodraw::RootData::Type getType () const
 Returns the type of the data in this branch.
hippodraw::RootData::Type getType () const
 Returns the type of the data in this branch.
int * intArrayAt (unsigned int row)
 Returns pointer to a int array type in given row.
int * intArrayAt (unsigned int row)
 Returns pointer to a int array type in given row.
virtual bool isFilled () const
virtual bool isFilled () const
bool isMultiDimensional () const
 Returns true if data sitting in the rows of this branch is and array.
bool isMultiDimensional () const
 Returns true if data sitting in the rows of this branch is and array.
int numberOfElements () const
 Number of elements in this branch.
int numberOfElements () const
 Number of elements in this branch.
 RootBranch ()
 The default constructor.
 RootBranch (TBranch *)
 The constructor.
 RootBranch ()
 The default constructor.
 RootBranch (TBranch *)
 The constructor.
virtual unsigned int rowDataDimension () const
 Gives the dimensionality of the data stored in each row of this branch.
virtual unsigned int rowDataDimension () const
 Gives the dimensionality of the data stored in each row of this branch.
const std::vector< int > & rowDataDimSize ()
 Vector of the number of entries in the multidimensional data.
const std::vector< int > & rowDataDimSize ()
 Vector of the number of entries in the multidimensional data.
virtual 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 on one entry of this multidimensional data.
virtual 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 on one entry of this multidimensional data.
virtual unsigned int size () const
 Returns the size of the slice for the next to last dimension.
virtual unsigned int size () const
 Returns the size of the slice for the next to last dimension.
double valueAt (unsigned int row) const
 Returns the value of the leaf at index row.
double valueAt (unsigned int row) const
 Returns the value of the leaf at index row.
virtual ~RootBranch ()
 The destructor.
virtual ~RootBranch ()
 The destructor.

Private Member Functions

int getDimSize (const char *title)
 Gets from the root title which is of format "dataname[x][y][z]" the sizes of various dimension.
int getDimSize (const char *title)
 Gets from the root title which is of format "dataname[x][y][z]" the sizes of various dimension.
void setBranchAddress () const
 Sets the address where the ROOT TBranch will put its data.
void setBranchAddress () const
 Sets the address where the ROOT TBranch will put its data.

Private Attributes

TBranchm_branch
 The ROOT TBranch from which the data will be obtained.
TBranchm_branch
 The ROOT TBranch from which the data will be obtained.
bool m_branch_set
 Set true when branch address has been set.
std::vector< int > m_dims
 In case the data quantity we are dealing with is a vector/matrix store its dimensions of each axis in this vector.
Double_t m_double_data
 The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Double_t.
Float_t m_float_data
 The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Float_t.
Int_t m_int_data
 The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Int_t.
TLeafm_leaf
 The ROOT TLeaf which described the data in this branch.
TLeafm_leaf
 The ROOT TLeaf which described the data in this branch.
hippodraw::RootData::Type m_leaf_type
 The ROOT type name for this branch if single TLeaf is on this branch.
int m_number_elements
 The number of elements in the Leaf array.
int m_number_leaves
 The number of TLeaf objects on this TBranch.
int m_releventIndex
 In case the data quantity is vector/matrix we would like just to take one element out of it.
UInt_t m_uint_data
 The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT UInt_t.
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 the type is ROOT Double_t.
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 the type is ROOT Double_t.
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 the type is ROOT Float_t.
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 the type is ROOT Float_t.
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 the type is ROOT Int_t.
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 the type is ROOT Int_t.
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 the type is ROOT UInt_t.
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 the type is ROOT UInt_t.


Constructor & Destructor Documentation

RootBranch::RootBranch TBranch  ) 
 

The constructor.

Definition at line 31 of file LdfColumn.cxx.

References hippodraw::RootData::Double, hippodraw::RootData::Float, getDimSize(), hippodraw::RootData::Int, m_leaf, m_leaf_type, m_number_elements, m_number_leaves, num_util::type(), and hippodraw::RootData::UInt.

RootBranch::RootBranch  ) 
 

The default constructor.

Definition at line 60 of file LdfColumn.cxx.

RootBranch::~RootBranch  )  [virtual]
 

The destructor.

Definition at line 68 of file LdfColumn.cxx.

RootBranch::RootBranch TBranch  ) 
 

The constructor.

RootBranch::RootBranch  ) 
 

The default constructor.

virtual RootBranch::~RootBranch  )  [virtual]
 

The destructor.


Member Function Documentation

double* RootBranch::doubleArrayAt unsigned int  row  ) 
 

Returns pointer to a double array type in given row.

double * RootBranch::doubleArrayAt unsigned int  row  ) 
 

Returns pointer to a double array type in given row.

Definition at line 300 of file LdfColumn.cxx.

References m_branch, m_branch_set, m_vector_double_data, and setBranchAddress().

virtual bool RootBranch::empty  )  const [virtual]
 

Returns true, if RootBranch is empty, i.e.

has no data.

bool RootBranch::empty  )  const [virtual]
 

Returns true, if RootBranch is empty, i.e.

has no data.

Definition at line 84 of file LdfColumn.cxx.

float* RootBranch::floatArrayAt unsigned int  row  ) 
 

Returns pointer to a float array type in given row.

float * RootBranch::floatArrayAt unsigned int  row  ) 
 

Returns pointer to a float array type in given row.

Definition at line 312 of file LdfColumn.cxx.

References m_branch, m_branch_set, m_vector_float_data, and setBranchAddress().

int RootBranch::getDimSize const char *  title  )  [private]
 

Gets from the root title which is of format "dataname[x][y][z]" the sizes of various dimension.

int RootBranch::getDimSize const char *  title  )  [private]
 

Gets from the root title which is of format "dataname[x][y][z]" the sizes of various dimension.

Definition at line 120 of file LdfColumn.cxx.

References m_dims.

Referenced by RootBranch().

TBranch* RootBranch::getTBranch  ) 
 

Returns the TBranch which was used to initialize this branch.

TBranch * RootBranch::getTBranch  ) 
 

Returns the TBranch which was used to initialize this branch.

Definition at line 113 of file LdfColumn.cxx.

References m_branch.

hippodraw::RootData::Type RootBranch::getType  )  const
 

Returns the type of the data in this branch.

RootData::Type RootBranch::getType  )  const
 

Returns the type of the data in this branch.

Definition at line 338 of file LdfColumn.cxx.

References m_leaf_type.

int* RootBranch::intArrayAt unsigned int  row  ) 
 

Returns pointer to a int array type in given row.

int * RootBranch::intArrayAt unsigned int  row  ) 
 

Returns pointer to a int array type in given row.

Definition at line 324 of file LdfColumn.cxx.

References m_branch, m_branch_set, m_vector_int_data, and setBranchAddress().

virtual bool RootBranch::isFilled  )  const [virtual]
 

bool RootBranch::isFilled  )  const [virtual]
 

Definition at line 91 of file LdfColumn.cxx.

bool RootBranch::isMultiDimensional  )  const
 

Returns true if data sitting in the rows of this branch is and array.

bool RootBranch::isMultiDimensional  )  const
 

Returns true if data sitting in the rows of this branch is and array.

Definition at line 98 of file LdfColumn.cxx.

References m_number_elements.

int RootBranch::numberOfElements  )  const
 

Number of elements in this branch.

Since we are just dealing with the single leaf branches this entry in case of array shows total number of elements in that array.

int RootBranch::numberOfElements  )  const
 

Number of elements in this branch.

Since we are just dealing with the single leaf branches this entry in case of array shows total number of elements in that array.

Definition at line 106 of file LdfColumn.cxx.

References m_number_elements.

virtual unsigned int RootBranch::rowDataDimension  )  const [virtual]
 

Gives the dimensionality of the data stored in each row of this branch.

A scalar entry in each row means we're dealing with a 0 dimensional data, A Vector entry in each row means we're dealing with a 1 dimensional data, A Matrix entry in each row means we're dealing with a 2 dimensional data, so on and so forth.

unsigned int RootBranch::rowDataDimension  )  const [virtual]
 

Gives the dimensionality of the data stored in each row of this branch.

A scalar entry in each row means we're dealing with a 0 dimensional data, A Vector entry in each row means we're dealing with a 1 dimensional data, A Matrix entry in each row means we're dealing with a 2 dimensional data, so on and so forth.

Definition at line 199 of file LdfColumn.cxx.

References m_dims, m_number_elements, and size().

Referenced by setReleventIndex().

const std::vector< int >& RootBranch::rowDataDimSize  ) 
 

Vector of the number of entries in the multidimensional data.

Note:
Chose vector of int to be compatible num_util.

const vector< int > & RootBranch::rowDataDimSize  ) 
 

Vector of the number of entries in the multidimensional data.

Note:
Chose vector of int to be compatible num_util.

Definition at line 210 of file LdfColumn.cxx.

References m_dims.

void RootBranch::setBranchAddress  )  const [private]
 

Sets the address where the ROOT TBranch will put its data.

void RootBranch::setBranchAddress  )  const [private]
 

Sets the address where the ROOT TBranch will put its data.

Definition at line 143 of file LdfColumn.cxx.

References hippodraw::RootData::Double, hippodraw::RootData::Float, hippodraw::RootData::Int, m_branch, m_branch_set, m_double_data, m_float_data, m_int_data, m_leaf_type, m_number_elements, m_uint_data, m_vector_double_data, m_vector_float_data, m_vector_int_data, m_vector_uint_data, and hippodraw::RootData::UInt.

Referenced by doubleArrayAt(), floatArrayAt(), intArrayAt(), and valueAt().

virtual void RootBranch::setReleventIndex const std::vector< unsigned int > &  index  )  [virtual]
 

In case we are dealing with multidimensional data in rows of this branch we would like to deal with on one entry of this multidimensional data.

So here we set this relevant entry

void RootBranch::setReleventIndex const std::vector< unsigned int > &  index  )  [virtual]
 

In case we are dealing with multidimensional data in rows of this branch we would like to deal with on one entry of this multidimensional data.

So here we set this relevant entry

Definition at line 217 of file LdfColumn.cxx.

References m_dims, m_releventIndex, and rowDataDimension().

virtual unsigned int RootBranch::size  )  const [virtual]
 

Returns the size of the slice for the next to last dimension.

unsigned int RootBranch::size  )  const [virtual]
 

Returns the size of the slice for the next to last dimension.

Definition at line 74 of file LdfColumn.cxx.

Referenced by rowDataDimension().

double RootBranch::valueAt unsigned int  row  )  const
 

Returns the value of the leaf at index row.

double RootBranch::valueAt unsigned int  row  )  const
 

Returns the value of the leaf at index row.

Definition at line 235 of file LdfColumn.cxx.

References hippodraw::RootData::Double, hippodraw::RootData::Float, hippodraw::RootData::Int, m_branch, m_branch_set, m_double_data, m_float_data, m_int_data, m_leaf, m_leaf_type, m_number_elements, m_releventIndex, m_uint_data, m_vector_double_data, m_vector_float_data, m_vector_int_data, m_vector_uint_data, setBranchAddress(), and hippodraw::RootData::UInt.


Member Data Documentation

TBranch* RootBranch::m_branch [mutable, private]
 

The ROOT TBranch from which the data will be obtained.

Definition at line 44 of file RootBranch.h.

TBranch* RootBranch::m_branch [mutable, private]
 

The ROOT TBranch from which the data will be obtained.

Definition at line 44 of file LdfColumn.h.

Referenced by doubleArrayAt(), floatArrayAt(), getTBranch(), intArrayAt(), setBranchAddress(), and valueAt().

bool RootBranch::m_branch_set [mutable, private]
 

Set true when branch address has been set.

Definition at line 127 of file RootBranch.h.

Referenced by doubleArrayAt(), floatArrayAt(), intArrayAt(), setBranchAddress(), and valueAt().

std::vector< int > RootBranch::m_dims [private]
 

In case the data quantity we are dealing with is a vector/matrix store its dimensions of each axis in this vector.

Definition at line 117 of file RootBranch.h.

Referenced by getDimSize(), rowDataDimension(), rowDataDimSize(), and setReleventIndex().

Double_t RootBranch::m_double_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Double_t.

So root finally stores the double data in this variable.

Definition at line 66 of file RootBranch.h.

Referenced by setBranchAddress(), and valueAt().

Float_t RootBranch::m_float_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Float_t.

So root finally stores the float data in this variable.

Definition at line 72 of file RootBranch.h.

Referenced by setBranchAddress(), and valueAt().

Int_t RootBranch::m_int_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Int_t.

So root finally stores the integer data in this variable.

Definition at line 78 of file RootBranch.h.

Referenced by setBranchAddress(), and valueAt().

TLeaf* RootBranch::m_leaf [private]
 

The ROOT TLeaf which described the data in this branch.

Definition at line 48 of file RootBranch.h.

TLeaf* RootBranch::m_leaf [private]
 

The ROOT TLeaf which described the data in this branch.

Definition at line 48 of file LdfColumn.h.

Referenced by RootBranch(), and valueAt().

hippodraw::RootData::Type RootBranch::m_leaf_type [private]
 

The ROOT type name for this branch if single TLeaf is on this branch.

Definition at line 53 of file RootBranch.h.

Referenced by getType(), RootBranch(), setBranchAddress(), and valueAt().

int RootBranch::m_number_elements [private]
 

The number of elements in the Leaf array.

Definition at line 60 of file RootBranch.h.

Referenced by isMultiDimensional(), numberOfElements(), RootBranch(), rowDataDimension(), setBranchAddress(), and valueAt().

int RootBranch::m_number_leaves [private]
 

The number of TLeaf objects on this TBranch.

Definition at line 57 of file RootBranch.h.

Referenced by RootBranch().

int RootBranch::m_releventIndex [private]
 

In case the data quantity is vector/matrix we would like just to take one element out of it.

This index represents that particular relevant entry of the vector/matrix when flattened out as a 1-d vector.

Definition at line 123 of file RootBranch.h.

Referenced by setReleventIndex(), and valueAt().

UInt_t RootBranch::m_uint_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT UInt_t.

So root finally stores the integer data in this variable.

Definition at line 84 of file RootBranch.h.

Referenced by setBranchAddress(), and valueAt().

Double_t* RootBranch::m_vector_double_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Double_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 91 of file RootBranch.h.

Double_t* RootBranch::m_vector_double_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Double_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 91 of file LdfColumn.h.

Referenced by doubleArrayAt(), setBranchAddress(), and valueAt().

Float_t* RootBranch::m_vector_float_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Float_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 98 of file RootBranch.h.

Float_t* RootBranch::m_vector_float_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Float_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 98 of file LdfColumn.h.

Referenced by floatArrayAt(), setBranchAddress(), and valueAt().

Int_t* RootBranch::m_vector_int_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Int_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 105 of file RootBranch.h.

Int_t* RootBranch::m_vector_int_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT Int_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 105 of file LdfColumn.h.

Referenced by intArrayAt(), setBranchAddress(), and valueAt().

UInt_t* RootBranch::m_vector_uint_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT UInt_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 112 of file RootBranch.h.

UInt_t* RootBranch::m_vector_uint_data [mutable, private]
 

The address of the following variable is given to ROOT TTree as the branch address for this branch if the type is ROOT UInt_t.

So root finally stores the data in this address pointed by this variable.

Definition at line 112 of file LdfColumn.h.

Referenced by setBranchAddress(), and valueAt().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3