Mēnsūra
Classes | Public Member Functions | List of all members
LeptonSFWeight Class Reference

A plugin to reweight events to account for lepton scale factors. More...

#include <LeptonSFWeight.hpp>

Inheritance diagram for LeptonSFWeight:
EventWeightPlugin AnalysisPlugin Plugin

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.
 
LeptonSFWeightoperator= (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 PluginClone () const override
 Creates a newly configured clone. More...
 
- Public Member Functions inherited from EventWeightPlugin
 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...
 
- Public Member Functions inherited from AnalysisPlugin
 AnalysisPlugin (std::string const &name)
 Constructor.
 
 AnalysisPlugin (AnalysisPlugin const &)=default
 Default copy constructor.
 
 AnalysisPlugin (AnalysisPlugin &&)=default
 Default move constructor.
 
AnalysisPluginoperator= (AnalysisPlugin const &)=default
 Default assignment operator.
 
virtual ~AnalysisPlugin ()
 Trivial destructor.
 
- Public Member Functions inherited from Plugin
 Plugin (std::string const &name)
 Constructor.
 
 Plugin (Plugin const &)=default
 Default copy constructor.
 
 Plugin (Plugin &&)=default
 Default move constructor.
 
Pluginoperator= (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

- Public Types inherited from Plugin
enum  EventOutcome { EventOutcome::Ok, EventOutcome::FilterFailed, EventOutcome::NoEvents }
 Outcome of processing of an event. More...
 
- Protected Member Functions inherited from Plugin
Plugin const * GetDependencyPlugin (std::string const &name) const
 Returns a pointer to a precedent plugin in the path with the given name. More...
 
- Protected Attributes inherited from EventWeightPlugin
std::vector< double > weights
 Weights assigned to the current event. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

void LeptonSFWeight::BeginRun ( Dataset const &  )
overridevirtual

Saves pointers to utilized plugins.

Reimplemented from Plugin.

Reimplemented from Plugin.

Plugin * LeptonSFWeight::Clone ( ) const
overridevirtual

Creates a newly configured clone.

Implemented from Plugin.

Implements Plugin.


The documentation for this class was generated from the following files: