TIMBER  beta
Tree Interface for Making Binned Events with RDataFrame
Public Member Functions | List of all members
JetSmearer Class Reference

C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively. More...

Public Member Functions

TFile * GetPuppiJMRFile ()
 Get the file for mass resolution smearing. More...
 
TF1 * GetPuppiSDResolutionCentral ()
 Get the function for the mass resolution for the central portion of the detector. More...
 
TF1 * GetPuppiSDResolutionForward ()
 Get the function for the mass resolution for the forward portion of the detector. More...
 
std::vector< float > GetSmearValsM (LorentzV jet, RVec< LorentzV > genJets)
 Smear jet mass to account for measured difference in JMR between data and simulation. The function computes the nominal smeared jet mass simultaneously with the JMR up and down shifts, in order to use the same random number to smear all three (for consistency reasons). More...
 
std::vector< float > GetSmearValsPt (LorentzV jet, RVec< LorentzV > genJets, float fixedGridRhoFastjetAll)
 Smear jet pT to account for measured difference in JER between data and simulation. The function computes the nominal smeared jet pT simultaneously with the JER up and down shifts, in order to use the same random number to smear all three (for consistency reasons). More...
 
 JetSmearer (std::string jerTag, std::string jetType)
 Construct a new Jet Smearer object for jet energy smearing. More...
 
 JetSmearer (std::vector< float > jmrVals)
 Construct a new Jet Smearer object for jet mass smearing. More...
 

Detailed Description

C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively.

Constructor & Destructor Documentation

◆ JetSmearer() [1/2]

JetSmearer ( std::string  jerTag,
std::string  jetType 
)

Construct a new Jet Smearer object for jet energy smearing.

Parameters
jerTagThe JER tag to identify the JER files to load.
jetTypeThe type of jet - ex. AK8PFPuppi

◆ JetSmearer() [2/2]

JetSmearer ( std::vector< float >  jmrVals)

Construct a new Jet Smearer object for jet mass smearing.

Parameters
jmrValsThe JMR values stored as a vector ordered as nominal, up, down.

Member Function Documentation

◆ GetPuppiJMRFile()

TFile * GetPuppiJMRFile ( )

Get the file for mass resolution smearing.

Returns
TFile*

◆ GetPuppiSDResolutionCentral()

TF1 * GetPuppiSDResolutionCentral ( )

Get the function for the mass resolution for the central portion of the detector.

Returns
TF1*

◆ GetPuppiSDResolutionForward()

TF1 * GetPuppiSDResolutionForward ( )

Get the function for the mass resolution for the forward portion of the detector.

Returns
TF1*

◆ GetSmearValsM()

std::vector< float > GetSmearValsM ( LorentzV  jet,
RVec< LorentzV >  genJets 
)

Smear jet mass to account for measured difference in JMR between data and simulation. The function computes the nominal smeared jet mass simultaneously with the JMR up and down shifts, in order to use the same random number to smear all three (for consistency reasons).

Consider three cases: Case 1: we have a "good" generator level jet matched to the reconstructed jet, Case 2: we don't have a generator level jet so we smear jet mass using a random Gaussian variation, Case 3: we cannot smear this jet, as we don't have a generator level jet and the resolution in data is better than the resolution in the simulation, so we would need to randomly "unsmear" the jet, which is impossible.

The implementation of this function follows: PhysicsTools/PatUtils/interface/SmearedJetProducerT.h Procedure outline in: https://twiki.cern.ch/twiki/bin/view/Sandbox/PUPPIJetMassScaleAndResolution

Parameters
jetJet Lorentz vector
genJetsVector of possible matching GenJet Lorentz vectors
Returns
std::vector<float> {nominal,up,down}

◆ GetSmearValsPt()

std::vector< float > GetSmearValsPt ( LorentzV  jet,
RVec< LorentzV >  genJets,
float  fixedGridRhoFastjetAll 
)

Smear jet pT to account for measured difference in JER between data and simulation. The function computes the nominal smeared jet pT simultaneously with the JER up and down shifts, in order to use the same random number to smear all three (for consistency reasons).

The implementation of this function follows PhysicsTools/PatUtils/interface/SmearedJetProducerT.h

The function considers three cases: Case 1: we have a "good" generator level jet matched to the reconstructed jet, Case 2: we don't have a generator level jet so we smear jet pT using a random Gaussian variation, Case 3: we cannot smear this jet, as we don't have a generator level jet and the resolution in data is better than the resolution in the simulation, so we would need to randomly "unsmear" the jet, which is impossible.

Parameters
jetJet Lorentz vector
genJetsVector of possible matching GenJet Lorentz vectors
fixedGridRhoFastjetAllStored in the NanoAOD with this name as the branch name.
Returns
std::vector<float> {nominal,up,down}

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