Produces reco::GenParticle from SimTracks. More...
Classes | |
struct | GlobalContext |
Global context for all recursive methods. More... | |
struct | LessById |
Public Member Functions | |
PATGenCandsFromSimTracksProducer (const edm::ParameterSet &) | |
~PATGenCandsFromSimTracksProducer () override | |
Public Member Functions inherited from edm::stream::EDProducer<> | |
EDProducer ()=default | |
EDProducer (const EDProducer &)=delete | |
bool | hasAbilityToProduceInBeginLumis () const final |
bool | hasAbilityToProduceInBeginProcessBlocks () const final |
bool | hasAbilityToProduceInBeginRuns () const final |
bool | hasAbilityToProduceInEndLumis () const final |
bool | hasAbilityToProduceInEndProcessBlocks () const final |
bool | hasAbilityToProduceInEndRuns () const final |
const EDProducer & | operator= (const EDProducer &)=delete |
Private Types | |
typedef StringCutObjectSelector< reco::GenParticle > | StrFilter |
Private Member Functions | |
const SimTrack * | findGeantMother (const SimTrack &tk, const GlobalContext &g) const |
Find the mother of a given GEANT track (or NULL if it can't be found). More... | |
edm::Ref< reco::GenParticleCollection > | findRef (const SimTrack &tk, GlobalContext &g) const |
edm::Ref< reco::GenParticleCollection > | generatorRef_ (const SimTrack &tk, const GlobalContext &g) const |
Used by findRef if the track is a PYTHIA particle. More... | |
reco::GenParticle | makeGenParticle_ (const SimTrack &tk, const edm::Ref< reco::GenParticleCollection > &mother, const GlobalContext &g) const |
Make a GenParticle for this SimTrack, with a given mother. More... | |
void | produce (edm::Event &, const edm::EventSetup &) override |
Private Attributes | |
const StrFilter | filter_ |
bool | firstEvent_ |
edm::EDGetTokenT< std::vector< int > > | genBarcodesToken_ |
edm::EDGetTokenT< reco::GenParticleCollection > | genParticlesToken_ |
Collection of GenParticles I need to make refs to. It must also have its associated vector<int> of barcodes, aligned with them. More... | |
bool | makeMotherLink_ |
If true, I'll try to make a link from the GEANT particle to a GenParticle. More... | |
std::set< int > | motherPdgIds_ |
std::vector< PdtEntry > | motherPdts_ |
std::set< int > | pdgIds_ |
std::vector< PdtEntry > | pdts_ |
int | setStatus_ |
edm::EDGetTokenT< edm::SimTrackContainer > | simTracksToken_ |
edm::EDGetTokenT< edm::SimVertexContainer > | simVertexToken_ |
edm::ESGetToken< HepPDT::ParticleDataTable, edm::DefaultRecord > | tableToken_ |
bool | writeAncestors_ |
If true, I'll save GenParticles corresponding to the ancestors of this GEANT particle. Common ancestors are only written once. More... | |
Additional Inherited Members | |
Public Types inherited from edm::stream::EDProducer<> | |
using | CacheTypes = CacheContexts< T... > |
using | GlobalCache = typename CacheTypes::GlobalCache |
using | HasAbility = AbilityChecker< T... > |
using | InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache |
using | LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache |
using | LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > |
using | LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache |
using | RunCache = typename CacheTypes::RunCache |
using | RunContext = RunContextT< RunCache, GlobalCache > |
using | RunSummaryCache = typename CacheTypes::RunSummaryCache |
Produces reco::GenParticle from SimTracks.
The PATGenCandsFromSimTracksProducer produces GenParticles from SimTracks, so they can be used for MC matching.
Definition at line 31 of file PATGenCandsFromSimTracksProducer.cc.
|
private |
Definition at line 48 of file PATGenCandsFromSimTracksProducer.cc.
|
explicit |
Definition at line 124 of file PATGenCandsFromSimTracksProducer.cc.
References looper::cfg, makeMotherLink_, motherPdts_, pdts_, and writeAncestors_.
|
inlineoverride |
Definition at line 34 of file PATGenCandsFromSimTracksProducer.cc.
|
private |
Find the mother of a given GEANT track (or NULL if it can't be found).
Definition at line 152 of file PATGenCandsFromSimTracksProducer.cc.
References cms::cuda::assert(), g, SimTrack::genpartIndex(), heavyIonCSV_trainingSettings::idx, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, SimTrack::noVertex(), SimTrack::vertIndex(), and L1BJetProducer_cff::vtx.
Referenced by findRef(), and produce().
|
private |
Find the GenParticle reference for a given GEANT or PYTHIA track.
Definition at line 167 of file PATGenCandsFromSimTracksProducer.cc.
References cms::cuda::assert(), findGeantMother(), g, generatorRef_(), SimTrack::genpartIndex(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, makeGenParticle_(), makeMotherLink_, AlCaHLTBitMon_ParallelJobs::p, CoreSimTrack::trackId(), and writeAncestors_.
Referenced by produce().
|
private |
Used by findRef if the track is a PYTHIA particle.
Definition at line 198 of file PATGenCandsFromSimTracksProducer.cc.
References cms::cuda::assert(), spr::find(), g, SimTrack::genpartIndex(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and pfDeepBoostedJetPreprocessParams_cfi::lower_bound.
Referenced by findRef().
|
private |
Make a GenParticle for this SimTrack, with a given mother.
Definition at line 218 of file PATGenCandsFromSimTracksProducer.cc.
References CoreSimTrack::charge(), ALCARECOTkAlJpsiMuMu_cff::charge, g, edm::Ref< C, T, F >::isNonnull(), CoreSimTrack::momentum(), SimTrack::noVertex(), setStatus_, CoreSimTrack::type(), SimTrack::vertIndex(), and L1BJetProducer_cff::vtx.
Referenced by findRef(), and produce().
|
overrideprivate |
Definition at line 232 of file PATGenCandsFromSimTracksProducer.cc.
References funct::abs(), HLT_2024v12_cff::cands, gather_cfg::cout, hcalRecHitTable_cff::depth, Exception, filter_, findGeantMother(), findRef(), firstEvent_, genBarcodesToken_, EgammaValidation_cff::genp, genParticlesToken_, edm::EventSetup::getData(), mps_fire::i, edm::OrphanHandleBase::id(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::isNonnull(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, edm::Ref< C, T, F >::key(), makeGenParticle_(), makeMotherLink_, motherPdgIds_, motherPdts_, eostools::move(), pdgIds_, pdts_, simTracksToken_, simVertexToken_, jetUpdater_cfi::sort, tableToken_, CoreSimTrack::type(), and writeAncestors_.
|
private |
Definition at line 49 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 39 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 58 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Collection of GenParticles I need to make refs to. It must also have its associated vector<int> of barcodes, aligned with them.
Definition at line 57 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
If true, I'll try to make a link from the GEANT particle to a GenParticle.
Definition at line 52 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by findRef(), PATGenCandsFromSimTracksProducer(), and produce().
|
private |
Definition at line 45 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 46 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by PATGenCandsFromSimTracksProducer(), and produce().
|
private |
Definition at line 43 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 44 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by PATGenCandsFromSimTracksProducer(), and produce().
|
private |
Definition at line 42 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by makeGenParticle_().
|
private |
Definition at line 40 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 41 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 60 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
If true, I'll save GenParticles corresponding to the ancestors of this GEANT particle. Common ancestors are only written once.
Definition at line 54 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by findRef(), PATGenCandsFromSimTracksProducer(), and produce().