Reads flat TTree and allows user to create new variables in the TTree.
More...
#include <MutableTTree.h>
|
| | MutableTTree (TFile *infile, std::string tree_name) |
| |
| int | GetEntries () |
| | return number of entries in tree
|
| |
| void | GetEntry (int entry) |
| | get tree entry
|
| |
| void | Fill () |
| | Fill ttree with new variables included.
|
| |
| void | shiftVariable (std::string variable, double shift) |
| | Apply any corrections to specified variable.
|
| |
| double | getValue (std::string branch_name) |
| | Get the value of a flat tuple variable.
|
| |
| void | printEvent () |
| | Print TTree Event.
|
| |
| void | setBranchValue (std::string branch_name, double value) |
| | Set branch value.
|
| |
| void | addNewBranch (std::string branch) |
| | Add new branch to ttree.
|
| |
| void | defineMassWindow (double lowMass, double highMass) |
| | Set the mass window within which to read the input ttree.
|
| |
| std::vector< std::string > | getAllVariables () |
| | Get list of all variables defined in ttree.
|
| |
| bool | variableExists (std::string variable) |
| | Check if a variable exists in the ttree.
|
| |
| virtual void | addVariable (std::string variableName, double param)=0 |
| |
| void | addVariableToTBranch (const std::string &variableName) |
| |
| | ~MutableTTree () |
| |
|
| TTree * | tree_ {nullptr} |
| | flat ttree
|
| |
| TTree * | newtree_ {nullptr} |
| | temporary ttree used to create and fill new branches
|
| |
| std::map< std::string, double * > | tuple_ |
| | holds all variables and values
|
| |
| std::map< std::string, TBranch * > | new_branches |
| | list of new branches added to ttree
|
| |
| std::map< std::string, double * > | new_variables_ |
| | list of new variables
|
| |
| std::map< std::string, std::function< double()> > | functions_ |
| | functions that calculate new variables
|
| |
| std::map< std::string, std::function< double()> > | variable_shifts_ |
| | variable corrections
|
| |
|
| void | initializeFlatTuple (TTree *tree, std::map< std::string, double * > &tuple_map) |
| | read in the initial flat TTree
|
| |
| void | copyTTree () |
| | copy the TTree
|
| |
Reads flat TTree and allows user to create new variables in the TTree.
Definition at line 16 of file MutableTTree.h.
◆ MutableTTree()
◆ ~MutableTTree()
◆ addNewBranch()
| void addNewBranch |
( |
std::string |
branch | ) |
|
◆ addVariable()
| virtual void addVariable |
( |
std::string |
variableName, |
|
|
double |
param |
|
) |
| |
|
pure virtual |
◆ addVariableToTBranch()
| void addVariableToTBranch |
( |
const std::string & |
variableName | ) |
|
◆ copyTTree()
◆ defineMassWindow()
| void defineMassWindow |
( |
double |
lowMass, |
|
|
double |
highMass |
|
) |
| |
Set the mass window within which to read the input ttree.
- Parameters
-
Definition at line 31 of file MutableTTree.cxx.
◆ Fill()
◆ getAllVariables()
| std::vector< std::string > getAllVariables |
( |
| ) |
|
Get list of all variables defined in ttree.
Definition at line 43 of file MutableTTree.cxx.
◆ GetEntries()
◆ GetEntry()
| void GetEntry |
( |
int |
entry | ) |
|
|
inline |
◆ getValue()
| double getValue |
( |
std::string |
branch_name | ) |
|
Get the value of a flat tuple variable.
- Parameters
-
- Returns
- value
Definition at line 13 of file MutableTTree.cxx.
◆ initializeFlatTuple()
| void initializeFlatTuple |
( |
TTree * |
tree, |
|
|
std::map< std::string, double * > & |
tuple_map |
|
) |
| |
|
private |
◆ printEvent()
◆ setBranchValue()
| void setBranchValue |
( |
std::string |
branch_name, |
|
|
double |
value |
|
) |
| |
|
inline |
◆ shiftVariable()
| void shiftVariable |
( |
std::string |
variable, |
|
|
double |
shift |
|
) |
| |
Apply any corrections to specified variable.
- Parameters
-
| variable | |
| correction/shift | |
Definition at line 81 of file MutableTTree.cxx.
◆ variableExists()
| bool variableExists |
( |
std::string |
variable | ) |
|
Check if a variable exists in the ttree.
- Parameters
-
- Returns
- true
-
false
Definition at line 36 of file MutableTTree.cxx.
◆ functions_
| std::map<std::string,std::function<double()> > functions_ |
|
protected |
functions that calculate new variables
Definition at line 102 of file MutableTTree.h.
◆ highMass_
| double highMass_ {-999.9} |
|
private |
◆ lowMass_
◆ new_branches
| std::map<std::string,TBranch*> new_branches |
|
protected |
◆ new_variables_
| std::map<std::string, double*> new_variables_ |
|
protected |
◆ newtree_
| TTree* newtree_ {nullptr} |
|
protected |
temporary ttree used to create and fill new branches
Definition at line 98 of file MutableTTree.h.
◆ tree_
◆ tuple_
| std::map<std::string,double*> tuple_ |
|
protected |
◆ variable_shifts_
| std::map<std::string,std::function<double()> > variable_shifts_ |
|
protected |
The documentation for this class was generated from the following files: