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

Plugin that implements reweighting for additional pp interactions ("pile-up") More...

#include <PileUpWeight.hpp>

Inheritance diagram for PileUpWeight:
EventWeightPlugin AnalysisPlugin Plugin

Public Member Functions

 PileUpWeight (std::string const &name, std::string const &dataPUFileName, std::string const &mcPUFileName, double systError)
 Creates a plugin with the given name. More...
 
 PileUpWeight (std::string const &dataPUFileName, std::string const &mcPUFileName, double systError)
 A short-cut for the above version with a default name "PileUpWeight".
 
 PileUpWeight (PileUpWeight const &)=default
 Default copy constructor.
 
 PileUpWeight (PileUpWeight &&)=default
 Default move constructor.
 
PileUpWeightoperator= (PileUpWeight const &)=delete
 Assignment operator is deleted.
 
virtual ~PileUpWeight () noexcept
 Trivial destructor.
 
virtual void BeginRun (Dataset const &dataset) override
 Saves pointers to required plugins and loads simulated pile-up profile for the current dataset. 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

Plugin that implements reweighting for additional pp interactions ("pile-up")

This plugin performs reweighting on pile-up based on the expected number of pile-up interactions, or the "true" simulated pile-up. The idea follows the official recipe [1].

Inputs needed for the reweighting are the target (data) distribution of pile-up (normally it is constructed with the help of script pileupCalc.py [2]), the pile-up profile used in simulation, and the desired systematic variation as described in [3]. It is possible to provide individual simulated profile for every process, although usually a common one would suffice.

This plugin exploits a PileUpReader with the default name "PileUp".

[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupMCReweightingUtilities [2] https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupJSONFileforData?rev=22 [3] https://twiki.cern.ch/twiki/bin/view/CMS/PileupSystematicErrors

Constructor & Destructor Documentation

PileUpWeight::PileUpWeight ( std::string const &  name,
std::string const &  dataPUFileName,
std::string const &  mcPUFileName,
double  systError 
)

Creates a plugin with the given name.

Input arguments specify names of files containing distributions of "true" number of pile-up interactions in data and simulation. By default, provided file names are resolved with respect to directory data/PileUp/. The data file must contain a histogram named "pileup" that describes the distribution. The file with profiles in simulation may contain individual distributions for some or all processes (named according to labels returned by method Dataset::GetSourceDatasetID), and, in addition to them, it must include the default distribution named "nominal". Input histograms with arbitrary normalization and binning (including variable one) are supported.

The last argument sets desired systematical variation as defined in [1]. [1] https://twiki.cern.ch/twiki/bin/view/CMS/PileupSystematicErrors

Member Function Documentation

void PileUpWeight::BeginRun ( Dataset const &  dataset)
overridevirtual

Saves pointers to required plugins and loads simulated pile-up profile for the current dataset.

Reimplemented from Plugin.

Reimplemented from Plugin.

Plugin * PileUpWeight::Clone ( ) const
overridevirtual

Creates a newly configured clone.

Implemented from Plugin.

Implements Plugin.


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