JetBuilder Class Reference

Lazily builds collection of reconstructed jets that pass analysis selection. More...

#include <JetBuilder.h>

Collaboration diagram for JetBuilder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 JetBuilder (Dataset &dataset, Options const &options, TabulatedRngEngine &rngEngine, PileUpIdFilter const *pileUpIdFilter=nullptr)
std::vector< Jet > const & Get () const override
 Returns collection of jets.
std::vector< Jet > const & GetRejected () const
 Returns collection of jets that have been rejected by pileup ID but satisfy other requirements.
void SetGenJetBuilder (GenJetBuilder const *genJetBuilder)
 Specifies an object that provides generator-level jets.

Private Member Functions

void AddType1Correction (TLorentzVector const &rawP4, double area, double jecOrig, double jecNew, double jerFactor, double emFraction, double muonFraction) const
 Adds a contribution to the type 1 correction of missing pt.
void Build () const override
 Constructs jets in the current event.
GenJet const * FindGenMatch (TLorentzVector const &p4, double ptResolution) const
 Finds matching generator-level jet using JERC definition.
double GetJerFactor (TLorentzVector const &corrP4, int rngChannel) const
 Computes momentum scale factor that accounts for JER smearing.
void ProcessJets () const
 Constructs collection of jets in the current event.
void ProcessSoftJets () const
 Processes soft jets in the corrent event.
bool SetPileUpInfo (Jet &jet, int index) const
 Deals with pileup ID for given jet.

Private Attributes

GenJetBuilder const * genJetBuilder_
 Non-owning pointer to an object that produces generator-level jets.
PileUpIdFilter const * pileUpIdFilter_
 Non-owning pointer to an object that implements jet filtering based on pileup ID.
double minPt_
 Minimal pt for jets, GeV.
double maxAbsEta_
 Maximal |eta| for jets.
double minPtType1Corr_
 Minimal (corrected) pt for jets to be used in type 1 correction of missing pt.
bool ptMissEeNoise_
 Whether to apply the EE noise mitigation in missing pt.
bool ptMissJer_
 Whether to propagate JER smearing into missing pt.
bool ptMissPogJets_
 Whether to compute the type 1 correction for missing pt skipping jets with a high EM energy fraction and removing leptons from them.
double pileUpIdMinPt_
 Range of pt, in GeV, where pileup ID is applicable.
double pileUpIdMaxPt_
std::vector< Jetjets_
 Collection of jets.
std::vector< JetrejectedJets_
 Collection of jets rejected by pileup ID.
bool isSim_
 Indicates whether running on simulation or data.
int jetIdBit_
 Index of the bit with jet ID decision.
JetCorrector jetCorrector_
 Object that computes JEC.
TTreeReaderArray< float > srcPt_
TTreeReaderArray< float > srcEta_
TTreeReaderArray< float > srcPhi_
TTreeReaderArray< float > srcMass_
TTreeReaderArray< float > srcArea_
TTreeReaderArray< float > srcRawFactor_
TTreeReaderArray< float > srcChEmEF_
TTreeReaderArray< float > srcNeEmEF_
TTreeReaderArray< float > srcMuonFraction_
TTreeReaderArray< float > srcBTag_
TTreeReaderArray< int > srcId_
TTreeReaderArray< int > srcPileUpId_
TTreeReaderValue< float > puRho_
std::optional
< TTreeReaderArray< int > > 
srcHadronFlavour_
std::optional
< TTreeReaderArray< int > > 
srcPartonFlavour_
std::optional
< TTreeReaderArray< int > > 
srcGenJetIdx_
TTreeReaderArray< float > softRawPt_
TTreeReaderArray< float > softEta_
TTreeReaderArray< float > softPhi_
TTreeReaderArray< float > softArea_
TTreeReaderArray< float > softMuonFraction_

Detailed Description

Lazily builds collection of reconstructed jets that pass analysis selection.

Reads parameters from sections jets and ptmiss of the master configuration. The latter specify how jets contribute to the type 1 correction of missing pt.

Jets are checked against the kinematical selection specified in the configuration, as well as jet ID. Selection on pileup ID is applied if the corresponding filter object is provided to the constructor.

Systematic variations in jets are implemented with the help of JetCorrector, which also applies JER smearing. To follow the standard smearing algorithm, this builder needs to be made aware of generator-level jets via method SetGenJetBuilder.

Jet with corrected pt > 15 GeV (the exact meaning depends on the configuration) are aggregated for GetSumMomentumShift to be used for the type 1 correction of missing pt. The details are controlled by section ptmiss of the master configuration. The following fields are supported:


Member Function Documentation

void JetBuilder::AddType1Correction ( TLorentzVector const &  rawP4,
double  area,
double  jecOrig,
double  jecNew,
double  jerFactor,
double  emFraction,
double  muonFraction 
) const [private]

Adds a contribution to the type 1 correction of missing pt.

Parameters:
[in] rawP4 Raw four-momentum of the jet.
[in] area Area of the jet.
[in] jecOrig The full JEC applied during production of NanoAOD.
[in] jecNew The full JEC applied in the analysis, including the JEC systematic variation.
[in] jerFactor Scale factor representing JER smearing on top of the full JEC.
[in] emFraction Total (neutral and charged) electromagnetic energy fraction in a jet. A non-positive value disables the corresponding cut.
[in] muonFraction Fraction of (raw) jet energy carried by muons.

Implements the type 1 correction according to the full - L1 scheme. The full correction includes JEC systematic variations (so that they are propagated into missing pt) and, depending on the value of ptMissJer_, JER smearing.

If ptMissPogJets_ is true, jets with a high EM energy fraction are skipped and constituent muons are removed. This mimics the standard procedure to compute the type 1 correction.

If the EE noise mitigation is enabled, soft jets in the EE are excluded from this procedure. At the same time these jets are used to undo some of the contributions in the starting ptmiss.

void JetBuilder::Build (  )  const [override, private]

Constructs jets in the current event.

Actual work is delegated to ProcessJets and ProcessSoftJets.

GenJet const* JetBuilder::FindGenMatch ( TLorentzVector const &  p4,
double  ptResolution 
) const [private]

Finds matching generator-level jet using JERC definition.

Returns a nullptr if no match is found within the allowed cone.

double JetBuilder::GetJerFactor ( TLorentzVector const &  corrP4,
int  rngChannel 
) const [private]

Computes momentum scale factor that accounts for JER smearing.

Parameters:
[in] corrP4 Corrected four-momentum of the jet.
[in] rngChannel Channel for the random number generator. Should be set to the index of the jet in the current event.
std::vector<Jet> const& JetBuilder::GetRejected (  )  const

Returns collection of jets that have been rejected by pileup ID but satisfy other requirements.

Filled only if a PileUpIdFilter has been provided.

void JetBuilder::ProcessSoftJets (  )  const [private]

Processes soft jets in the corrent event.

These are jets from branches CorrT1METJet_*.

void JetBuilder::SetGenJetBuilder ( GenJetBuilder const *  genJetBuilder  ) 

Specifies an object that provides generator-level jets.

Generator-level jets are used for JER smearing. However, if no such object is given, stochastic version of the smearing will be performed. When given, the object must have an approriate life time.

bool JetBuilder::SetPileUpInfo ( Jet jet,
int  index 
) const [private]

Deals with pileup ID for given jet.

Sets data members in jet related to pileup ID and applies the filtering on pileup ID if it is enabled.

Parameters:
[in,out] jet Jet to be checked and updated.
[in] index Index of the jet in the source branches.
Returns:
Boolean indicating of the jet passes the filtering on pileup ID. If the filtering is disabled, always returns true.

Member Data Documentation

Non-owning pointer to an object that produces generator-level jets.

May be nullptr.

Non-owning pointer to an object that implements jet filtering based on pileup ID.

May be nullptr.

Whether to compute the type 1 correction for missing pt skipping jets with a high EM energy fraction and removing leptons from them.

This is how the standard type 1 correction is computed.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator

Generated on 30 Oct 2020 for H→ZZ→2ℓ2ν analysis by  doxygen 1.6.1