Applies precomputed higher-order electroweak corrections in the form of event weights. More...
#include <EWCorrectionWeight.h>
Public Member Functions | |
EWCorrectionWeight (Dataset &dataset, Options const &options) | |
Constructor. | |
virtual double | NominalWeight () const override |
Returns the nominal weight for the current event. | |
virtual int | NumVariations () const override |
Returns the number of systematic variations. | |
virtual double | operator() () const override |
Returns weight for the systematic variation requested by command line options. | |
virtual double | RelWeight (int variation) const override |
Returns relative weight for requested systematic variation. | |
virtual std::string_view | VariationName (int variation) const override |
Returns the label of the systematic variation with the given index. | |
Private Types | |
enum | Type { None, ZZ, WZ } |
Supported types of EW corrections. | |
Private Member Functions | |
void | readFile_and_loadEwkTable () |
Reads correction table. | |
std::vector< float > | findCorrection (float sqrt_s_hat, float t_hat) const |
Finds the right correction in the file. | |
std::map< std::string, std::pair< TLorentzVector, TLorentzVector > > | reconstructGenLevelBosons () const |
double | getEwkCorrections (std::map< std::string, std::pair< TLorentzVector, TLorentzVector >> genLevelLeptons, double &error) const |
The main function, returns the kfactor. | |
void | Update () const |
Updates cached weightNominal_ and weightError_;. | |
Private Attributes | |
Type | correctionType_ |
Selected type of EW correction. | |
EventCache | cache_ |
double | weightNominal_ |
Cached nominal event weight. | |
double | weightError_ |
Cached absolute error of the weight. | |
int | systDirection_ |
Requested direction of systematic variation. | |
std::vector< std::vector< float > > | ewTable_ |
TTreeReaderArray< float > | genPartPt_ |
TTreeReaderArray< float > | genPartEta_ |
TTreeReaderArray< float > | genPartPhi_ |
TTreeReaderArray< float > | genPartMass_ |
TTreeReaderArray< int > | genPartPdgId_ |
TTreeReaderArray< int > | genPartIdxMother_ |
TTreeReaderValue< Float_t > | generatorX1_ |
TTreeReaderValue< Float_t > | generatorX2_ |
TTreeReaderValue< Int_t > | generatorId1_ |
TTreeReaderValue< Int_t > | generatorId2_ |
Applies precomputed higher-order electroweak corrections in the form of event weights.
The type of the applied correction is determined by parameter "ew_correction" in per-dataset configuration. If this parameter is not found, no correction is applied and a weight of 1 is returned for every event.
Constructor.
[in] | dataset | Dataset that will be processed. |
[in] | options | Configuration options. |
virtual double EWCorrectionWeight::NominalWeight | ( | ) | const [override, virtual] |
Returns the nominal weight for the current event.
The weight is 1. if the correction is disabled.
Implements WeightBase.
virtual int EWCorrectionWeight::NumVariations | ( | ) | const [override, virtual] |
Returns the number of systematic variations.
If the correction is disabled for the current dataset, the number of variations is 0.
Reimplemented from WeightBase.
virtual double EWCorrectionWeight::operator() | ( | ) | const [override, virtual] |
Returns weight for the systematic variation requested by command line options.
If the correction is disabled, the weight is 1.
Reimplemented from WeightBase.
virtual double EWCorrectionWeight::RelWeight | ( | int | ) | const [override, virtual] |
Returns relative weight for requested systematic variation.
The relative weight is computed with respect to the nominal weight. The argument must satisfy 0 <= variation < NumVariations()
.
Reimplemented from WeightBase.
virtual std::string_view EWCorrectionWeight::VariationName | ( | int | ) | const [override, virtual] |
Returns the label of the systematic variation with the given index.
If the variation has the meaning of an "up" or "down" one, the label must end with "_up" or "_down" respectively. The argument must satisfy 0 <= variation < NumVariations()
.
Reimplemented from WeightBase.
int EWCorrectionWeight::systDirection_ [private] |
Requested direction of systematic variation.
Allowed values are 0, +1, and -1.