RDFAnalysis
0.1.1
Physics analysis with ROOT::RDataFrame
|
Abstract base class that describes how a Node should name its branches internally. More...
#include <IBranchNamer.h>
Public Member Functions | |
virtual | ~IBranchNamer () |
virtual std::string | nameBranch (const std::string &branch, const std::string &systName="") const =0 |
Get the full name of a branch. More... | |
virtual std::vector< std::string > | nameBranches (const std::vector< std::string > &branches, const std::string &systName="") const |
Get the full names of a list of branches. More... | |
virtual std::string | createBranch (const std::string &branch, const std::string &systName="")=0 |
Create a new branch. More... | |
virtual bool | exists (const std::string &branch, const std::string &systName="") const =0 |
Test if a specific variation of a specific branch exists. More... | |
virtual const std::string & | nominalName () const =0 |
Get the name of the nominal variation. More... | |
virtual std::vector< std::string > | systematics () const =0 |
Get all systematics. More... | |
virtual std::set< std::string > | systematicsAffecting (const std::string &branch) const =0 |
Get all systematics affecting a base branch name. More... | |
virtual std::set< std::string > | systematicsAffecting (const std::vector< std::string > &branches) const |
Get all the systematics affecting a set of columns. More... | |
virtual std::vector< std::string > | branches () const =0 |
Get all branch base names. More... | |
virtual void | readBranchList (const std::map< std::string, ROOT::RDF::RNode > &rnodes)=0 |
Read branch lists from a set of rnodes. More... | |
virtual std::unique_ptr< IBranchNamer > | copy () const =0 |
Make a copy of this class. More... | |
virtual std::pair< std::string, std::vector< std::string > > | expandExpression (const std::string &expression) const |
Expand a C++ expression into a pseudo-functional form. More... | |
virtual std::string | interpretExpression (const std::string &expression, const std::vector< std::string > &branches, const std::string &systematic) |
Interpret an expression for a given systematic variation. More... | |
Abstract base class that describes how a Node should name its branches internally.
The Node classes enforce a relationship between ROOT::RNode columns, potentially having multiple variations (corresponding to different systematics) of the same variable. These are stored as different columns in the underlying ROOT:RNodes. Therefore the Node objects need to know how to go from a variable name and a systematic name to the name of the ROOT::RNode column.
That mapping is provided by this class, along with other useful information such as the full list of systematics, the name of the nominal systematic and a list of all defined variables.
|
inlinevirtual |
|
pure virtual |
Get all branch base names.
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
pure virtual |
Make a copy of this class.
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
pure virtual |
Create a new branch.
branch | The base name of the branch |
systName | The name of the variation |
Create a new variation systName of branch branch. If this already exists then a std::runtime_error will be thrown.
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
pure virtual |
Test if a specific variation of a specific branch exists.
branch | The base name of the branch |
systName | The name of the variation |
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
virtual |
Expand a C++ expression into a pseudo-functional form.
expression | The expression to expand. |
This function receives an expression that may contain variable names and then expands it into a form that can be varied for different systematics. For instance a function 'jet_pt * cos(jet_phi)' (where jet_pt and jet_phi are variables) would be expanded to '{0} * cos({1})', {'jet_pt', 'jet_phi'}.
|
virtual |
Interpret an expression for a given systematic variation.
expression | The pseudo-functional expression to use |
branches | The input variables to the expression |
systematic | The systematic variation to use |
Reinterpret a pseudo-functional form produced by expandExpression for a specific systematic. For an expression '{0} * cos({1})' with inputs {'jet_pt', 'jet_phi'} and systematic 'KIN_A' only affecting jet_pt (and making hopefully obvious assumptions about the nominal name and the column naming pattern) this function would return 'KIN_A_jet_pt * cos(NOSYS_jet_phi)'
|
pure virtual |
Get the full name of a branch.
branch | The base name of the branch |
systName | The name of the variation |
Search for a variation systName on a branch branch. If one doesn't exist then it will return the nominal branch. If that doesn't exist it will throw a std::out_of_range exception.
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
virtual |
Get the full names of a list of branches.
branches | The base name of the branches |
systName | The name of the variation |
Search for a variation systName on a branch branch. If one doesn't exist then it will return the nominal branch. If that doesn't exist it will throw a std::out_of_range exception.
|
pure virtual |
Get the name of the nominal variation.
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
pure virtual |
Read branch lists from a set of rnodes.
rnodes | The input rnodes |
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
pure virtual |
Get all systematics.
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
pure virtual |
Get all systematics affecting a base branch name.
branch | The name of the branch to test |
Implemented in DefaultBranchNamer, and ScheduleNamer.
|
virtual |
Get all the systematics affecting a set of columns.
branches | The names of the branches to test |