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 () | |
Public Member Functions inherited from edm::EDProducer | |
EDProducer () | |
virtual | ~EDProducer () |
Public Member Functions inherited from edm::ProducerBase | |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
std::function< void(BranchDescription const &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
virtual | ~ProducerBase () |
Public Member Functions inherited from edm::EDConsumerBase | |
EDConsumerBase () | |
ProductHolderIndex | indexFrom (EDGetToken, BranchType, TypeID const &) const |
void | itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const |
void | itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const |
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
void | updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &) |
virtual | ~EDConsumerBase () |
Private Types | |
typedef StringCutObjectSelector < reco::GenParticle > | StrFilter |
Private Member Functions | |
virtual void | endJob () |
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... | |
virtual void | produce (edm::Event &, const edm::EventSetup &) override |
Private Attributes | |
std::auto_ptr< StrFilter > | filter_ |
bool | firstEvent_ |
edm::InputTag | genParticles_ |
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::InputTag | src_ |
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::EDProducer | |
typedef EDProducer | ModuleType |
typedef WorkerT< EDProducer > | WorkerType |
Public Types inherited from edm::ProducerBase | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Static Public Member Functions inherited from edm::EDProducer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::EDProducer | |
CurrentProcessingContext const * | currentContext () const |
Protected Member Functions inherited from edm::ProducerBase | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
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 ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
Produces reco::GenParticle from SimTracks.
The PATGenCandsFromSimTracksProducer produces GenParticles from SimTracks, so they can be used for MC matching.
Definition at line 29 of file PATGenCandsFromSimTracksProducer.cc.
|
private |
Definition at line 46 of file PATGenCandsFromSimTracksProducer.cc.
|
explicit |
Definition at line 116 of file PATGenCandsFromSimTracksProducer.cc.
References edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), alcazmumu_cfi::filter, filter_, edm::ParameterSet::getParameter(), makeMotherLink_, motherPdts_, pdts_, and writeAncestors_.
|
inline |
Definition at line 32 of file PATGenCandsFromSimTracksProducer.cc.
|
inlineprivatevirtual |
Reimplemented from edm::EDProducer.
Definition at line 36 of file PATGenCandsFromSimTracksProducer.cc.
|
private |
Find the mother of a given GEANT track (or NULL if it can't be found).
Definition at line 149 of file PATGenCandsFromSimTracksProducer.cc.
References SimTrack::genpartIndex(), customizeTrackingMonitorSeedNumber::idx, SimVertex::noParent(), SimTrack::noVertex(), SimVertex::parentIndex(), pat::PATGenCandsFromSimTracksProducer::GlobalContext::simtks, pat::PATGenCandsFromSimTracksProducer::GlobalContext::simvtxs, and SimTrack::vertIndex().
Referenced by findRef(), and produce().
|
private |
Find the GenParticle reference for a given GEANT or PYTHIA track.
Definition at line 165 of file PATGenCandsFromSimTracksProducer.cc.
References findGeantMother(), generatorRef_(), SimTrack::genpartIndex(), makeGenParticle_(), makeMotherLink_, pat::PATGenCandsFromSimTracksProducer::GlobalContext::output, AlCaHLTBitMon_ParallelJobs::p, pat::PATGenCandsFromSimTracksProducer::GlobalContext::refprod, pat::PATGenCandsFromSimTracksProducer::GlobalContext::simTksProcessed, CoreSimTrack::trackId(), and writeAncestors_.
Referenced by produce().
|
private |
Used by findRef if the track is a PYTHIA particle.
Definition at line 194 of file PATGenCandsFromSimTracksProducer.cc.
References pat::PATGenCandsFromSimTracksProducer::GlobalContext::barcodesAreSorted, spr::find(), pat::PATGenCandsFromSimTracksProducer::GlobalContext::genBarcodes, SimTrack::genpartIndex(), and pat::PATGenCandsFromSimTracksProducer::GlobalContext::gens.
Referenced by findRef().
|
private |
Make a GenParticle for this SimTrack, with a given mother.
Definition at line 214 of file PATGenCandsFromSimTracksProducer.cc.
References reco::CompositeRefCandidateT< D >::addMother(), DeDxDiscriminatorTools::charge(), CoreSimTrack::charge(), edm::Ref< C, T, F >::isNonnull(), CoreSimTrack::momentum(), SimTrack::noVertex(), p4, setStatus_, pat::PATGenCandsFromSimTracksProducer::GlobalContext::simvtxs, CoreSimTrack::type(), and SimTrack::vertIndex().
Referenced by findRef(), and produce().
|
overrideprivatevirtual |
Implements edm::EDProducer.
Definition at line 226 of file PATGenCandsFromSimTracksProducer.cc.
References abs, reco::CompositeRefCandidateT< D >::addMother(), gather_cfg::cout, edm::hlt::Exception, filter_, findGeantMother(), findRef(), firstEvent_, EgammaValidation_cff::genp, genParticles_, i, edm::OrphanHandleBase::id(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), makeGenParticle_(), makeMotherLink_, motherPdgIds_, motherPdts_, pdgIds_, pdts_, python.multivaluedict::sort(), src_, CoreSimTrack::type(), and writeAncestors_.
|
private |
Definition at line 47 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by PATGenCandsFromSimTracksProducer(), and produce().
|
private |
Definition at line 38 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 55 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 50 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by findRef(), 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 41 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by produce().
|
private |
Definition at line 42 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by PATGenCandsFromSimTracksProducer(), and produce().
|
private |
Definition at line 40 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by makeGenParticle_().
|
private |
Definition at line 39 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 52 of file PATGenCandsFromSimTracksProducer.cc.
Referenced by findRef(), PATGenCandsFromSimTracksProducer(), and produce().