Public Member Functions | Private Attributes | List of all members
scalarFromTree< T > Class Template Reference

#include <treeReader.h>

Public Member Functions

 scalarFromTree (TTree *whichTree, string varname, Long64_t *iEntry_in)
 
 scalarFromTree ()
 
operator() ()
 
getData ()
 

Private Attributes

TTree * thisTree
 
string thisVarname
 
Long64_t * iEntry_local
 
sData
 
Long64_t lastEntry
 

Detailed Description

template<typename T>
class scalarFromTree< T >

Definition at line 60 of file treeReader.h.

Constructor & Destructor Documentation

template<typename T>
scalarFromTree< T >::scalarFromTree ( TTree *  whichTree,
string  varname,
Long64_t *  iEntry_in 
)
inline

Definition at line 65 of file treeReader.h.

65  :
66  thisTree(whichTree),thisVarname(varname),iEntry_local(iEntry_in) {
67  lastEntry = -1;
68  }
Long64_t lastEntry
Definition: treeReader.h:102
Long64_t * iEntry_local
Definition: treeReader.h:100
string thisVarname
Definition: treeReader.h:99
TTree * thisTree
Definition: treeReader.h:98
template<typename T>
scalarFromTree< T >::scalarFromTree ( )
inline

Definition at line 71 of file treeReader.h.

71  {
72  thisTree = NULL; iEntry_local = NULL; thisVarname = "";
73  lastEntry = -2;
74  }
Long64_t lastEntry
Definition: treeReader.h:102
Long64_t * iEntry_local
Definition: treeReader.h:100
string thisVarname
Definition: treeReader.h:99
TTree * thisTree
Definition: treeReader.h:98

Member Function Documentation

template<typename T>
T scalarFromTree< T >::getData ( )
inline

Definition at line 82 of file treeReader.h.

82  {
83  if (*iEntry_local != lastEntry) {
85  try {
86  thisTree->GetEntry(*iEntry_local);
87  sData = thisTree->GetLeaf(thisVarname.c_str())->GetValue(0);
88  } catch (...) {
89  throw std::runtime_error("Can not GetLeaf in scalarFromTree.getData()");
90  }
91  }
92  return sData;
93  }
Long64_t lastEntry
Definition: treeReader.h:102
Long64_t * iEntry_local
Definition: treeReader.h:100
string thisVarname
Definition: treeReader.h:99
TTree * thisTree
Definition: treeReader.h:98
template<typename T>
T scalarFromTree< T >::operator() ( )
inline

Definition at line 79 of file treeReader.h.

79 {return getData();};

Member Data Documentation

template<typename T>
Long64_t* scalarFromTree< T >::iEntry_local
private

Definition at line 100 of file treeReader.h.

template<typename T>
Long64_t scalarFromTree< T >::lastEntry
private

Definition at line 102 of file treeReader.h.

template<typename T>
T scalarFromTree< T >::sData
private

Definition at line 101 of file treeReader.h.

template<typename T>
TTree* scalarFromTree< T >::thisTree
private

Definition at line 98 of file treeReader.h.

template<typename T>
string scalarFromTree< T >::thisVarname
private

Definition at line 99 of file treeReader.h.


The documentation for this class was generated from the following file: