Base class for an analysis that produces trees with per-event entries. More...
#include <EventTrees.h>
Public Member Functions | |
EventTrees (Options const &options, Dataset &dataset, std::string const treeName="Vars") | |
Contructor. | |
void | CreateWeightBranches () |
If the file is simulations, create the branch with weights. | |
void | PostProcessing () |
Writes the output file. | |
Protected Member Functions | |
template<typename... Args> | |
void | AddBranch (Args...args) |
Adds a new branch to the underlying tree. | |
void | FillTree () |
Fills the underlying tree. | |
Private Attributes | |
bool | storeWeightSyst_ |
Indicates whether variations in event weights should be stored. | |
TFile | outputFile_ |
Output file. | |
TTree * | tree_ |
Non-owning pointer to the output tree. | |
Float_t | weight_ |
Buffer to save the nominal event weight. | |
std::vector< Float_t > | systWeights_ |
Buffers to save alternative event weights. |
Base class for an analysis that produces trees with per-event entries.
Derived class must create branches in the output tree using method AddBranch. For each event the tree is filled by calling FillTree, which also sets event weights.
Normally only the default event weight is saved. If the command line option --syst=weights
is provided, nominal weight as well as weights for all registered weight-based systematic variations are stored. The latter ones are saved as full as opposed to relative weights.
EventTrees::EventTrees | ( | Options const & | options, | |
Dataset & | dataset, | |||
std::string const | treeName = "Vars" | |||
) |
Contructor.
Argument treeName
specifies the name for the tree that will be produced.
void EventTrees::FillTree | ( | ) | [protected] |
Fills the underlying tree.
Event weights are set automatically.
std::vector<Float_t> EventTrees::systWeights_ [private] |
Buffers to save alternative event weights.
These are full weights, i.e. they are not relative with respect to the nominal one.