Produces reco::GenParticle from SimTracks. More...
Classes | |
struct | LessById |
Public Member Functions | |
GenPlusSimParticleProducer (const edm::ParameterSet &) | |
~GenPlusSimParticleProducer () | |
Public Member Functions inherited from edm::EDProducer | |
EDProducer () | |
virtual | ~EDProducer () |
Public Member Functions inherited from edm::ProducerBase | |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
boost::function< void(const BranchDescription &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
virtual | ~ProducerBase () |
Private Types | |
typedef StringCutObjectSelector < reco::GenParticle > | StrFilter |
Private Member Functions | |
void | addGenParticle (const SimTrack &stMom, const SimTrack &stDau, unsigned int momidx, const edm::SimTrackContainer &simtks, const edm::SimVertexContainer &simvtxs, reco::GenParticleCollection &mergedGens, const reco::GenParticleRefProd ref, std::vector< int > &genBarcodes, bool &barcodesAreSorted) const |
Try to link the GEANT particle to the generator particle it came from. More... | |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
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... | |
std::set< int > | pdgIds_ |
std::vector< PdtEntry > | pdts_ |
int | setStatus_ |
edm::InputTag | src_ |
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 | |
template<class TProducer , class TMethod > | |
void | callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod) |
Produces reco::GenParticle from SimTracks.
The GenPlusSimParticleProducer produces GenParticles from SimTracks, so they can be used for MC matching. A copy of the original genParticle list is made and the genParticles created from the GEANT/FAMOS particles are added to the list including all ancestors and correct mother/daughter references
Sample useage in cfg.py file: process.genParticlePlusGEANT = cms.EDProducer("GenPlusSimParticleProducer", src = cms.InputTag("g4SimHits"), # use "famosSimHits" for FAMOS setStatus = cms.int32(8), # set status = 8 for GEANT GPs particleTypes = cms.vstring("pi+"), # also picks pi- (optional) filter = cms.vstring("pt > 0.0"), # just for testing genParticles = cms.InputTag("genParticles") # original genParticle list )
Definition at line 39 of file GenPlusSimParticleProducer.cc.
|
private |
Definition at line 54 of file GenPlusSimParticleProducer.cc.
|
explicit |
Definition at line 97 of file GenPlusSimParticleProducer.cc.
References edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), alcazmumu_cfi::filter, filter_, edm::ParameterSet::getParameter(), and pdts_.
|
inline |
Definition at line 42 of file GenPlusSimParticleProducer.cc.
|
private |
Try to link the GEANT particle to the generator particle it came from.
Arguments: – Specific – gp: GenParticle made from the GEANT particle st: The GEANT simTrack for which we create a genParticle
– GEANT related – simtks: A list of GEANT tracks, sorted by track id simvtxs: The list of GEANT vertices, in their natural order (skimtks have pointers into this vector!)
– GenParticle related – gens : Handle to the GenParticles, to make the ref to genBarcodes : Barcodes for each GenParticle, in a vector aligned to the GenParticleCollection. barcodesAreSorted: true if the barcodes are sorted (which means I can use binary_search on them)
Definition at line 119 of file GenPlusSimParticleProducer.cc.
References reco::CompositeRefCandidateT< D >::addDaughter(), DeDxDiscriminatorTools::charge(), CoreSimTrack::charge(), filter_, EgammaValidation_cff::genp, CoreSimTrack::momentum(), SimVertex::noParent(), SimTrack::noVertex(), p4, SimVertex::parentIndex(), setStatus_, CoreSimTrack::trackId(), CoreSimTrack::type(), and SimTrack::vertIndex().
Referenced by produce().
|
inlineprivatevirtual |
Reimplemented from edm::EDProducer.
Definition at line 46 of file GenPlusSimParticleProducer.cc.
|
privatevirtual |
Implements edm::EDProducer.
Definition at line 177 of file GenPlusSimParticleProducer.cc.
References abs, reco::CompositeRefCandidateT< D >::addDaughter(), addGenParticle(), reco::CompositeRefCandidateT< D >::addMother(), reco::CompositeRefCandidateT< D >::daughterRefVector(), spr::find(), firstEvent_, genParticles_, i, edm::RefProd< T >::id(), combine::key, m, reco::CompositeRefCandidateT< D >::motherRefVector(), SimVertex::noParent(), reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::CompositeRefCandidateT< D >::numberOfMothers(), SimVertex::parentIndex(), pdgIds_, pdts_, reco::CompositeRefCandidateT< D >::resetDaughters(), reco::CompositeRefCandidateT< D >::resetMothers(), python.multivaluedict::sort(), and src_.
|
private |
Definition at line 55 of file GenPlusSimParticleProducer.cc.
Referenced by addGenParticle(), and GenPlusSimParticleProducer().
|
private |
Definition at line 48 of file GenPlusSimParticleProducer.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 58 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 51 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 52 of file GenPlusSimParticleProducer.cc.
Referenced by GenPlusSimParticleProducer(), and produce().
|
private |
Definition at line 50 of file GenPlusSimParticleProducer.cc.
Referenced by addGenParticle().
|
private |
Definition at line 49 of file GenPlusSimParticleProducer.cc.
Referenced by produce().