Mēnsūra
|
A service that computes jet energy and resolution corrections. More...
#include <JetCorrectorService.hpp>
Public Types | |
enum | SystType { None, JEC, JER } |
Supported types of systematic variations. | |
Public Member Functions | |
JetCorrectorService (std::string const name="JetCorrector") | |
Creates a service with the given name. | |
JetCorrectorService (JetCorrectorService const &src) | |
Copy constructor. | |
JetCorrectorService (JetCorrectorService &&)=default | |
Default move constructor. | |
virtual Service * | Clone () const override |
Creates a newly-initialized clone. More... | |
double | Eval (Jet const &jet, double rho, SystType syst=SystType::None, SystService::VarDirection direction=SystService::VarDirection::Undefined) const |
Computes full correction factor for requested effects. More... | |
double | EvalJECUnc (double const corrPt, double const eta) const |
Computes JEC uncertainty. More... | |
bool | IsSystEnabled (SystType syst) const |
Reports if requested systematic variation can be computed. | |
double | operator() (Jet const &jet, double rho, SystType syst=SystType::None, SystService::VarDirection direction=SystService::VarDirection::Undefined) const |
A short-cut for method Eval. | |
void | SetJEC (std::initializer_list< std::string > const &jecFiles) |
Specifies text files for JEC. More... | |
void | SetJECUncertainty (std::string const &jecUncFile, std::initializer_list< std::string > uncSources={}) |
Specifies text file for JEC uncertainties and desired uncertainty sources. More... | |
void | SetJER (std::string const &jerSFFile, std::string const &jerMCFile, unsigned long seed=0) |
![]() | |
Service (std::string const &name) | |
Constructor. More... | |
Service (Service const &)=default | |
Default copy constructor. | |
Service (Service &&)=default | |
Default move constructor. | |
Service & | operator= (Service const &)=default |
Default assignment operator. | |
virtual | ~Service ()=default |
Default destructor. | |
virtual void | BeginRun (Dataset const &dataset) |
Performs initialization needed when processing of a new dataset starts. 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. | |
void | SetMaster (Processor const *processor) |
Provides a pointer to an instance of Processor class that owns the service. More... | |
A service that computes jet energy and resolution corrections.
This class computes jet corrections to adjust energy scale and resolution. Inputs for the computation are provided in form of standard text files used by JetMET POG. The computed correction is returned as a factor to rescale jet four-momentum.
Any levels of the full correction can be omitted. If JEC text files are not provided, jet momentum is assumed to be corrected for the energy scale. Otherwise the corresponding correction is evaluated starting from raw jet momentum (which thus must have been set up properly). If one or more JEC uncertainties are specified by user and a JEC systematic variation is requested, the correction factor is adjusted accordingly. If JER data/MC scale factors have been specified, deterministic JER smearing is applied for jets that have matched generator-level jets. If pt resolution in simulation is specified in addition, jets that do not have generator-level matches are smeared stochastically using this resolution and the scale factors.
|
overridevirtual |
double JetCorrectorService::Eval | ( | Jet const & | jet, |
double | rho, | ||
SystType | syst = SystType::None , |
||
SystService::VarDirection | direction = SystService::VarDirection::Undefined |
||
) | const |
Computes full correction factor for requested effects.
Returned factor can include correction of the energy scale and resolution. As explained in documentation for the class, any part of the correction is optional.
double JetCorrectorService::EvalJECUnc | ( | double const | corrPt, |
double const | eta | ||
) | const |
Computes JEC uncertainty.
The arguments are the JES-corrected pt and pseudorapidity. The uncertainty is calculated as a sum in quadrature of uncertainties from all sources specified in a call to SetJECUncertainty.
void JetCorrectorService::SetJEC | ( | std::initializer_list< std::string > const & | jecFiles | ) |
Specifies text files for JEC.
Different levels of corrections are applied in the same order as specified here. Paths to the files are resolved using FileInPath, with a subdirectory "JERC".
void JetCorrectorService::SetJECUncertainty | ( | std::string const & | jecUncFile, |
std::initializer_list< std::string > | uncSources = {} |
||
) |
Specifies text file for JEC uncertainties and desired uncertainty sources.
There is no need to provide the name of an uncertainty source if the file defines only a single one. Path to the file is resolved using FileInPath, with a subdirectory "JERC".
void JetCorrectorService::SetJER | ( | std::string const & | jerSFFile, |
std::string const & | jerMCFile, | ||
unsigned long | seed = 0 |
||
) |
Specifies text files for data/MC JER scale factors and pt resolution in MC
Paths to the files are resolved using FileInPath, with a subdirectory "JERC". The file with pt resolution in simulation is optional. Only when it is specified, a random-number generator is created to perform stochastic JER smearing. The last argument defines the seed for the generator; 0 means that the seed will be chosen randomly.