Mēnsūra
|
An abstract base class for a plugin that calculates event weights. More...
#include <EventWeightPlugin.hpp>
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... | |
![]() | |
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 | BeginRun (Dataset const &dataset) |
Performs initialization needed when processing of a new dataset starts. More... | |
virtual Plugin * | Clone () 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 | |
![]() | |
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... | |
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.
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.
|
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.
|
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.