Mēnsūra
|
A plugin to reweight events to account for lepton scale factors. More...
#include <LeptonSFWeight.hpp>
Public Member Functions | |
LeptonSFWeight (std::string const &name, Lepton::Flavour targetFlavour, std::string const &srcFileName, std::list< std::string > const &histogramNames) | |
Creates a reweighting plugin targeting leptons of given flavour. More... | |
LeptonSFWeight (Lepton::Flavour targetFlavour, std::string const &srcFileName, std::list< std::string > const &histogramNames) | |
A short-cut for the above version with a default name "LeptonSFWeight". | |
LeptonSFWeight (LeptonSFWeight const &)=default | |
Default copy constructor. | |
LeptonSFWeight (LeptonSFWeight &&)=default | |
Default move constructor. | |
LeptonSFWeight & | operator= (LeptonSFWeight const &)=delete |
Assignment operator is deleted. | |
virtual | ~LeptonSFWeight () noexcept |
Trivial destructor. | |
virtual void | BeginRun (Dataset const &) override |
Saves pointers to utilized plugins. More... | |
virtual Plugin * | Clone () const override |
Creates a newly configured clone. More... | |
![]() | |
EventWeightPlugin (std::string const &name) | |
Constructs an instance with the given name. | |
double | GetWeight () const |
Returns the nominal weight. | |
unsigned | GetNumVariations () const noexcept |
Returns the number of systematic variations. | |
double | GetWeightUp (unsigned iSource) const |
Returns an "up" systematic variation with the given index. More... | |
double | GetWeightDown (unsigned iSource) const |
Returns a "down" systematic variation with the given index. More... | |
std::vector< double > const & | GetWeights () const noexcept |
Returns a vector with nominal weight and all systematic variations. More... | |
![]() | |
AnalysisPlugin (std::string const &name) | |
Constructor. | |
AnalysisPlugin (AnalysisPlugin const &)=default | |
Default copy constructor. | |
AnalysisPlugin (AnalysisPlugin &&)=default | |
Default move constructor. | |
AnalysisPlugin & | operator= (AnalysisPlugin const &)=default |
Default assignment operator. | |
virtual | ~AnalysisPlugin () |
Trivial destructor. | |
![]() | |
Plugin (std::string const &name) | |
Constructor. | |
Plugin (Plugin const &)=default | |
Default copy constructor. | |
Plugin (Plugin &&)=default | |
Default move constructor. | |
Plugin & | operator= (Plugin const &)=default |
Default assignment operator. | |
virtual | ~Plugin () |
Trivial destructor. | |
virtual void | EndRun () |
Performs necessary actions needed after processing of a dataset is finished. More... | |
Processor const & | GetMaster () const |
Returns a reference to the master. More... | |
std::string const & | GetName () const |
Returns name of the plugin. | |
EventOutcome | ProcessEventToOutcome () |
Processes a new event from the current dataset. More... | |
void | SetMaster (Processor const *processor) |
Provides a pointer to an instance of Processor class that owns the plugin. More... | |
Additional Inherited Members | |
![]() | |
enum | EventOutcome { EventOutcome::Ok, EventOutcome::FilterFailed, EventOutcome::NoEvents } |
Outcome of processing of an event. More... | |
![]() | |
Plugin const * | GetDependencyPlugin (std::string const &name) const |
Returns a pointer to a precedent plugin in the path with the given name. More... | |
![]() | |
std::vector< double > | weights |
Weights assigned to the current event. More... | |
A plugin to reweight events to account for lepton scale factors.
Only leptons of one selected flavour are considered in the computation. If more than one lepton of that flavour are found, their scale factors are multiplied together.
Scale factors are stored in a ROOT file in the form of one or more two-dimensional histograms. Meaning of x and y parameters of each histogram can be specified with a TObjString written in the file. It must have the same name as the histogram, with a postfix "__params" added. The parameter string must be composed of labels defining x and y parameters, separated by a semicolon, for instance "pt;absEta". Following labels are supported: "pt", "eta", "etaSC", "absEta", "absEtaSC". It no parameter string is found, transverse momentum and (signed) pseudorapidity of the lepton are taken parameters of the histogram.
Errors of provided scale factors are summed up in quadrature, producing a single systematic variation.
LeptonSFWeight::LeptonSFWeight | ( | std::string const & | name, |
Lepton::Flavour | targetFlavour, | ||
std::string const & | srcFileName, | ||
std::list< std::string > const & | histogramNames | ||
) |
Creates a reweighting plugin targeting leptons of given flavour.
Name of the ROOT file with scale factors is resolved using FileInPath with respect to directory data/LeptonSF/. When multiple histograms are specified, corresponding scale factors are multiplied together. If some of the histograms are not found, an exception is thrown.
|
overridevirtual |
|
overridevirtual |