|
Crombie Tools
|
Class that holds a loaded tree from a file. More...
#include <LoadTree.h>
Public Member Functions | |
| template<typename... Args> | |
| Tree (const std::string &infile, Args... args) | |
| Constructor of a loaded tree. More... | |
| ~Tree () | |
| template<typename C > | |
| C * | get (const std::string &name) |
| Get a bare pointer to a TObject inside of this file. More... | |
| bool | next () |
| Loads the next event into memory and evaluates all of the formulas. More... | |
| double & | result (const std::string &expr) |
| Get a reference to the result for a given formula. More... | |
Private Attributes | |
| TFile * | file |
| The TFile that is being read. More... | |
| Formulas | forms |
| Holds formulas initialized with. More... | |
| long long | ientry {0} |
| Which entry are we on. More... | |
| long long | nentries |
| Total number of events in the tree. More... | |
| TTree * | tree |
| Holds the pointer to the tree. More... | |
Class that holds a loaded tree from a file.
The tree name is given in the environment variable tree, and defaults to "events".
Definition at line 71 of file LoadTree.h.
| crombie::LoadTree::Tree::Tree | ( | const std::string & | infile, |
| Args... | args | ||
| ) |
Constructor of a loaded tree.
Note that copy and move constructors won't work because of the TFile member.
| infile | is the name of the input file to read |
| args | is a variable number of arguments that can be of type std::string or crombie::Types::strings>. |
Definition at line 137 of file LoadTree.h.
References crombie::LoadTree::Formulas::add(), crombie::Misc::env(), file, forms, nentries, crombie::LoadTree::rootlock, and tree.
|
inline |
Definition at line 79 of file LoadTree.h.
References sushi::file.
| C * crombie::LoadTree::Tree::get | ( | const std::string & | name | ) |
Get a bare pointer to a TObject inside of this file.
| C | is the type of pointer you would like to get |
| name | is the name of the object, searched for with TFile::Get |
Definition at line 164 of file LoadTree.h.
References file.
| bool crombie::LoadTree::Tree::next | ( | ) |
Loads the next event into memory and evaluates all of the formulas.
Definition at line 156 of file LoadTree.h.
References crombie::LoadTree::Formulas::eval(), forms, ientry, nentries, and tree.
|
inline |
Get a reference to the result for a given formula.
Definition at line 85 of file LoadTree.h.
References crombie::LoadTree::Formulas::forms.
Referenced by crombie::EventDump::SingleFile().
|
private |
The TFile that is being read.
Definition at line 95 of file LoadTree.h.
|
private |
Holds formulas initialized with.
Definition at line 99 of file LoadTree.h.
|
private |
|
private |
Total number of events in the tree.
Definition at line 97 of file LoadTree.h.
|
private |
Holds the pointer to the tree.
Definition at line 96 of file LoadTree.h.