DESY Hbb Analysis Framework
Public Member Functions | Protected Attributes | List of all members
analysis::tools::TreeBase Class Reference

#include <TreeBase.h>

Inheritance diagram for analysis::tools::TreeBase:
analysis::tools::PhysicsObjectTreeBase< Object > analysis::tools::PhysicsObjectTreeBase< Vertex > analysis::tools::PhysicsObjectTreeBase< Candidate > analysis::tools::PhysicsObjectTreeBase< GenJet > analysis::tools::PhysicsObjectTreeBase< GenParticle > analysis::tools::PhysicsObjectTreeBase< Jet > analysis::tools::PhysicsObjectTreeBase< JetTag > analysis::tools::PhysicsObjectTreeBase< L1TJet > analysis::tools::PhysicsObjectTreeBase< L1TMuon > analysis::tools::PhysicsObjectTreeBase< MET > analysis::tools::PhysicsObjectTreeBase< Muon > analysis::tools::PhysicsObjectTreeBase< RecoMuon > analysis::tools::PhysicsObjectTreeBase< RecoTrack > analysis::tools::PhysicsObjectTreeBase< TriggerObject >

Public Member Functions

void event (const int &event)
 
TChain * tree ()
 
 TreeBase ()
 
 TreeBase (TChain *tree, const std::string &name)
 
 ~TreeBase ()
 

Protected Attributes

std::vector< std::string > branches_
 
std::string className_
 
std::string inputTag_
 
std::string name_
 
TChain * tree_
 

Detailed Description

Definition at line 43 of file TreeBase.h.

Constructor & Destructor Documentation

TreeBase::TreeBase ( )

Definition at line 21 of file TreeBase.cc.

Referenced by analysis::tools::PhysicsObjectTreeBase< Object >::~PhysicsObjectTreeBase().

21  : TChain()
22 {
23 }
TreeBase::TreeBase ( TChain *  tree,
const std::string &  name 
)

Definition at line 25 of file TreeBase.cc.

References branches_, className_, inputTag_, nano_94X_2017_rereco31Mar18-v1::name, name_, tree(), and tree_.

25  : TChain()
26 {
27  tree_ = tree;
28  name_ = name;
29 
30  std::string treeTitle = std::string(tree_->GetTitle());
31  treeTitle.erase(std::remove(treeTitle.begin(),treeTitle.end(),' '),treeTitle.end());
32  className_ = treeTitle.substr(0,treeTitle.find_first_of("|"));
33  inputTag_ = treeTitle.substr(treeTitle.find_first_of("|")+1);
34 
35  TObjArray * treeBranches = tree_->GetListOfBranches();
36  for ( int i = 0 ; i < treeBranches->GetEntries() ; ++i )
37  branches_.push_back(treeBranches->At(i)->GetName());
38 
39 }
std::string className_
Definition: TreeBase.h:55
std::vector< std::string > branches_
Definition: TreeBase.h:58
std::string inputTag_
Definition: TreeBase.h:56
TreeBase::~TreeBase ( )

Definition at line 42 of file TreeBase.cc.

43 {
44 }

Member Function Documentation

void TreeBase::event ( const int &  event)

Definition at line 51 of file TreeBase.cc.

References tree_.

51 { tree_ -> GetEntry(event); }
void event(const int &event)
Definition: TreeBase.cc:51
TChain * TreeBase::tree ( )

Member Data Documentation

std::vector<std::string> analysis::tools::TreeBase::branches_
protected
std::string analysis::tools::TreeBase::className_
protected

Definition at line 55 of file TreeBase.h.

Referenced by TreeBase().

std::string analysis::tools::TreeBase::inputTag_
protected

Definition at line 56 of file TreeBase.h.

Referenced by TreeBase().

std::string analysis::tools::TreeBase::name_
protected
TChain* analysis::tools::TreeBase::tree_
protected

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