Mēnsūra
Public Member Functions | Protected Attributes | List of all members
EventWeightPlugin Class Reference

An abstract base class for a plugin that calculates event weights. More...

#include <EventWeightPlugin.hpp>

Inheritance diagram for EventWeightPlugin:
AnalysisPlugin Plugin BTagWeight BTagWeightCSVShape GenWeightSyst LeptonSFWeight PileUpWeight

Public Member Functions

 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 BeginRun (Dataset const &dataset)
 Performs initialization needed when processing of a new dataset starts. More...
 
virtual PluginClone () const =0
 Clones the object. More...
 
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...
 

Protected Attributes

std::vector< double > weights
 Weights assigned to the current event. 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...
 

Detailed Description

An abstract base class for a plugin that calculates event weights.

This class defines an interface to access event weight and its systematic variations. A derived class must provide an implementation for method ProcessEvent that fills the collection of weights in a way that complies with the specification provided in the documentation for method GetWeights.

Member Function Documentation

double EventWeightPlugin::GetWeightDown ( unsigned  iSource) const

Returns a "down" systematic variation with the given index.

The indices start from zero. If the given index is larger than the total number of variations, an exception is thrown.

std::vector< double > const & EventWeightPlugin::GetWeights ( ) const
noexcept

Returns a vector with nominal weight and all systematic variations.

The vector is always non-empty and contains an odd number of elements. The first element is the nominal weight, it is followed by an "up" variation for the first source of systematic uncertainty, a "down" variation for this source, and so on.

double EventWeightPlugin::GetWeightUp ( unsigned  iSource) const

Returns an "up" systematic variation with the given index.

The indices start from zero. If the given index is larger than the total number of variations, an exception is thrown.

Member Data Documentation

std::vector<double> EventWeightPlugin::weights
protected

Weights assigned to the current event.

The first weight is the nominal one, and it is followed by (optional) systematic variations. Consult documentation for method GetWeights for details.


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