Module to produce the subset of generator particles directly contained in top decay chains. More...
#include "TopQuarkAnalysis/TopEventProducers/interface/TopDecaySubset.h"
Public Types | |
enum | FillMode { kStable, kME } |
enum | RunMode { kRun1, kRun2 } |
supported modes to run the code More... | |
enum | ShowerModel { kStart = -1, kNone, kPythia, kHerwig, kPythia8, kSherpa } |
classification of potential shower types More... | |
Public Types inherited from edm::EDProducer | |
typedef EDProducer | ModuleType |
Public Types inherited from edm::ProducerBase | |
using | ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > > |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Private Member Functions | |
void | addDaughters (int &idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection &target, bool recursive=true) |
recursively fill vector for all further decay particles of a given particle More... | |
void | addRadiation (int &idx, const reco::GenParticle *part, reco::GenParticleCollection &target) |
void | addRadiation (int &idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection &target) |
fill vector including all radiations from quarks originating from W/top More... | |
ShowerModel | checkShowerModel (const std::vector< const reco::GenParticle * > &tops) const |
check the decay chain for the used shower model More... | |
ShowerModel | checkShowerModel (edm::Event &event) |
check the embedded MC information for the shower model More... | |
void | checkWBosons (std::vector< const reco::GenParticle * > &tops) const |
check whether W bosons are contained in the original gen particle listing More... | |
void | clearReferences () |
clear references More... | |
void | fillListing (const std::vector< const reco::GenParticle * > &primalTops, const std::vector< const reco::GenParticle * > &decayingTops, reco::GenParticleCollection &target) |
fill output vector for full decay chain More... | |
void | fillListing (const std::vector< const reco::GenParticle * > &tops, reco::GenParticleCollection &target) |
fill output vector for full decay chain More... | |
void | fillReferences (const reco::GenParticleRefProd &refProd, reco::GenParticleCollection &target) |
fill references for output vector More... | |
std::vector< const reco::GenParticle * > | findDecayingTops (const reco::GenParticleCollection &parts) |
const reco::GenParticle * | findLastParticleInChain (const reco::GenParticle *p) |
std::vector< const reco::GenParticle * > | findPrimalTops (const reco::GenParticleCollection &parts) |
const reco::GenParticle * | findPrimalW (const reco::GenParticle *top) |
std::vector< const reco::GenParticle * > | findTops (const reco::GenParticleCollection &parts) |
find top quarks in list of input particles More... | |
reco::Particle::LorentzVector | p4 (const reco::GenParticle::const_iterator part, int statusFlag) |
calculate lorentz vector from input More... | |
reco::Particle::LorentzVector | p4 (const std::vector< const reco::GenParticle * >::const_iterator top, int statusFlag) |
calculate lorentz vector from input (dedicated to top reconstruction) More... | |
Private Attributes | |
bool | addRadiation_ |
add radiation or not? More... | |
FillMode | fillMode_ |
edm::EDGetTokenT< GenEventInfoProduct > | genEventInfo_srcToken_ |
input tag for the genEventInfo source More... | |
int | motherPartIdx_ |
std::map< int, std::vector< int > > | refs_ |
management of daughter indices for fillRefs More... | |
RunMode | runMode_ |
run mode (Run1 || Run2) More... | |
ShowerModel | showerModel_ |
parton shower mode (filled in checkShowerModel) More... | |
edm::EDGetTokenT< reco::GenParticleCollection > | srcToken_ |
input tag for the genParticle source More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from edm::EDProducer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
static bool | wantsGlobalLuminosityBlocks () |
static bool | wantsGlobalRuns () |
static bool | wantsInputProcessBlocks () |
static bool | wantsProcessBlocks () |
static bool | wantsStreamLuminosityBlocks () |
static bool | wantsStreamRuns () |
Protected Member Functions inherited from edm::ProducerBase | |
template<class ProductType > | |
BranchAliasSetterT< ProductType > | produces () |
declare what type of product will make and with which optional label More... | |
template<typename ProductType , BranchType B> | |
BranchAliasSetterT< ProductType > | produces () |
template<typename ProductType , Transition B> | |
BranchAliasSetterT< ProductType > | produces () |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<BranchType B> | |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<Transition B> | |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<typename ProductType , Transition B> | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<class ProductType > | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<typename ProductType , BranchType B> | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
ProducesCollector | producesCollector () |
Protected Member Functions inherited from edm::EDConsumerBase | |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
template<BranchType B = InEvent> | |
EDConsumerBaseAdaptor< B > | consumes (edm::InputTag tag) noexcept |
template<BranchType B> | |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
ConsumesCollector | consumesCollector () |
Use a ConsumesCollector to gather consumes information from helper functions. More... | |
template<typename ProductType , BranchType B = InEvent> | |
void | consumesMany () |
void | consumesMany (const TypeToGet &id) |
template<BranchType B> | |
void | consumesMany (const TypeToGet &id) |
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes () |
template<Transition Tr = Transition::Event> | |
constexpr auto | esConsumes () noexcept |
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag const &tag) |
template<Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag tag) noexcept |
template<Transition Tr = Transition::Event> | |
ESGetTokenGeneric | esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey) |
Used with EventSetupRecord::doGet. More... | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
Module to produce the subset of generator particles directly contained in top decay chains.
The module produces the subset of generator particles directly contained in top decay chains. The particles are saved as a collection of reco::GenParticles. Depending on the configuration of the module, the 4-vector kinematics can be taken from the status-3 particles (ME before parton showering) or from the status-2 particles (after parton showering), additionally radiated gluons may be considered during the creation of the subset or not.
Definition at line 28 of file TopDecaySubset.h.
supported modes to fill the new vectors of gen particles
Enumerator | |
---|---|
kStable | |
kME |
Definition at line 32 of file TopDecaySubset.h.
supported modes to run the code
Enumerator | |
---|---|
kRun1 | |
kRun2 |
Definition at line 36 of file TopDecaySubset.h.
|
explicit |
default constructor
Definition at line 10 of file TopDecaySubset.cc.
References looper::cfg, Exception, fillMode_, kME, kRun1, kRun2, kStable, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, runMode_, and AlCaHLTBitMon_QueryRunRegistry::string.
|
override |
|
private |
recursively fill vector for all further decay particles of a given particle
Definition at line 631 of file TopDecaySubset.cc.
References BPhysicsValidation_cfi::daughters, heavyIonCSV_trainingSettings::idx, postprocess-scan-build::recursive, refs_, and filterCSVwithJSON::target.
Referenced by fillListing().
|
private |
Definition at line 612 of file TopDecaySubset.cc.
References BPhysicsValidation_cfi::daughters, heavyIonCSV_trainingSettings::idx, refs_, and filterCSVwithJSON::target.
|
private |
fill vector including all radiations from quarks originating from W/top
Definition at line 591 of file TopDecaySubset.cc.
References BPhysicsValidation_cfi::daughters, heavyIonCSV_trainingSettings::idx, refs_, TopDecayID::stable, and filterCSVwithJSON::target.
Referenced by fillListing().
|
private |
check the decay chain for the used shower model
check the decay chain for the exploited shower model
Definition at line 202 of file TopDecaySubset.cc.
References funct::abs(), reco::Candidate::begin(), reco::Candidate::end(), Exception, kHerwig, kNone, kPythia, edm::errors::LogicError, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::LeafCandidate::pdgId(), TopDecayID::stable, TopDecayID::tID, and TopDecayID::WID.
Referenced by produce().
|
private |
check the embedded MC information for the shower model
Definition at line 242 of file TopDecaySubset.cc.
References genEventInfo_srcToken_, edm::HandleBase::id(), edm::HandleBase::isValid(), kHerwig, kNone, kPythia, kPythia8, kSherpa, kStart, EcalCalibMonitorClient_cfi::moduleName, edm::moduleName(), and AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
check whether W bosons are contained in the original gen particle listing
check whether the W boson is contained in the original gen particle listing
Definition at line 269 of file TopDecaySubset.cc.
References funct::abs(), reco::Candidate::begin(), reco::Candidate::end(), kPythia, edm::errors::LogicError, showerModel_, TopDecayID::stable, TopDecayID::unfrag, and TopDecayID::WID.
Referenced by produce().
|
private |
clear references
Definition at line 654 of file TopDecaySubset.cc.
References motherPartIdx_, and refs_.
Referenced by produce().
|
private |
fill output vector for full decay chain
Definition at line 427 of file TopDecaySubset.cc.
References funct::abs(), addDaughters(), addRadiation(), addRadiation_, reco::Candidate::begin(), TopDecayID::bID, reco::Candidate::end(), fillMode_, findLastParticleInChain(), TopDecayID::glueID, kME, motherPartIdx_, refs_, submitPVValidationJobs::t, filterCSVwithJSON::target, TopDecayID::tauID, and TopDecayID::WID.
|
private |
fill output vector for full decay chain
Definition at line 308 of file TopDecaySubset.cc.
References funct::abs(), addDaughters(), addRadiation(), addRadiation_, TopDecayID::bID, edmScanValgrind::buffer, fillMode_, GenParticle::GenParticle, TopDecayID::glueID, kME, kPythia, edm::errors::LogicError, motherPartIdx_, p4(), refs_, showerModel_, TopDecayID::stable, submitPVValidationJobs::t, filterCSVwithJSON::target, TopDecayID::tauID, TopDecayID::tID, TopDecayID::unfrag, and TopDecayID::WID.
Referenced by produce().
|
private |
fill references for output vector
Definition at line 663 of file TopDecaySubset.cc.
References BPhysicsValidation_cfi::daughters, Exception, heavyIonCSV_trainingSettings::idx, edm::errors::InvalidReference, AlCaHLTBitMon_ParallelJobs::p, refs_, and EgammaValidation_Wenu_cff::sel.
Referenced by produce().
|
private |
find decaying top quarks (quarks that decay to qW) for Pythia6 this is identical to findPrimalTops
Definition at line 132 of file TopDecaySubset.cc.
References funct::abs(), heavyIonCSV_trainingSettings::idx, contentValuesFiles::parts, submitPVValidationJobs::t, and TopDecayID::tID.
Referenced by produce().
|
private |
find W bosons that come from top quark decays and decay themselves (end of the MC chain) for Pythia6 this is identical to findPrimalW find the last particle in a (potentially) long chain of state transitions e.g. top[status==22]-> top[status==44 -> top[status==44] -> top[status==44] -> top[status==62] this function would pick the top with status 62
Definition at line 177 of file TopDecaySubset.cc.
References funct::abs(), heavyIonCSV_trainingSettings::idx, kPythia, AlCaHLTBitMon_ParallelJobs::p, EgammaObjectsElectrons_cfi::particleID, and showerModel_.
Referenced by fillListing().
|
private |
find primal top quarks (top quarks from the hard interaction) for Pythia6 this is identical to findDecayingTops
Definition at line 110 of file TopDecaySubset.cc.
References funct::abs(), heavyIonCSV_trainingSettings::idx, contentValuesFiles::parts, submitPVValidationJobs::t, and TopDecayID::tID.
Referenced by produce().
|
private |
find W bosons that come from top quark decays for Pythia6 this is identical to findDecayingW
Definition at line 154 of file TopDecaySubset.cc.
References funct::abs(), reco::CompositeRefCandidateT< D >::daughter(), heavyIonCSV_trainingSettings::idx, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::Candidate::pdgId(), and TopDecayID::WID.
|
private |
find top quarks in list of input particles
Definition at line 99 of file TopDecaySubset.cc.
References funct::abs(), contentValuesFiles::parts, submitPVValidationJobs::t, TopDecayID::tID, and TopDecayID::unfrag.
Referenced by produce().
|
private |
calculate lorentz vector from input
calculate lorentz vector from input (dedicated to top reconstruction)
Definition at line 562 of file TopDecaySubset.cc.
References funct::abs(), AlCaHLTBitMon_ParallelJobs::p, p4(), TopDecayID::stable, TopDecayID::unfrag, and TopDecayID::WID.
Referenced by Tau.Tau::dxy_approx(), Tau.Tau::dz(), and Lepton.Lepton::p4WithFSR().
|
private |
calculate lorentz vector from input (dedicated to top reconstruction)
calculate lorentz vector from input
Definition at line 524 of file TopDecaySubset.cc.
References funct::abs(), AlCaHLTBitMon_ParallelJobs::p, TopDecayID::unfrag, and TopDecayID::WID.
Referenced by Tau.Tau::dxy_approx(), Tau.Tau::dz(), fillListing(), p4(), and Lepton.Lepton::p4WithFSR().
|
overridevirtual |
write output into the event
Implements edm::EDProducer.
Definition at line 44 of file TopDecaySubset.cc.
References checkShowerModel(), checkWBosons(), clearReferences(), fillListing(), fillReferences(), findDecayingTops(), findPrimalTops(), findTops(), kNone, kRun1, kRun2, kStart, eostools::move(), runMode_, showerModel_, TrackRefitter_38T_cff::src, srcToken_, and filterCSVwithJSON::target.
|
private |
|
private |
print the whole list of input particles or not? mode of decaySubset creation
Definition at line 103 of file TopDecaySubset.h.
Referenced by fillListing(), and TopDecaySubset().
|
private |
input tag for the genEventInfo source
Definition at line 98 of file TopDecaySubset.h.
Referenced by checkShowerModel().
|
private |
index in new evt listing of parts with daughters; has to be set to -1 in produce to deliver consistent results!
Definition at line 112 of file TopDecaySubset.h.
Referenced by clearReferences(), and fillListing().
|
private |
management of daughter indices for fillRefs
Definition at line 114 of file TopDecaySubset.h.
Referenced by addDaughters(), addRadiation(), clearReferences(), fillListing(), and fillReferences().
|
private |
run mode (Run1 || Run2)
Definition at line 107 of file TopDecaySubset.h.
Referenced by produce(), and TopDecaySubset().
|
private |
parton shower mode (filled in checkShowerModel)
Definition at line 105 of file TopDecaySubset.h.
Referenced by checkWBosons(), fillListing(), findLastParticleInChain(), and produce().
|
private |
input tag for the genParticle source
Definition at line 96 of file TopDecaySubset.h.
Referenced by produce().