Produces reco::GenParticle from SimTracks. More...
Classes | |
struct | LessById |
Public Member Functions | |
GenPlusSimParticleProducer (const edm::ParameterSet &) | |
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 | |
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... | |
void | produce (edm::Event &, const edm::EventSetup &) override |
Private Attributes | |
std::unique_ptr< StrFilter > | filter_ |
bool | firstEvent_ |
edm::EDGetTokenT< std::vector< int > > | genBarcodesToken_ |
edm::EDGetTokenT< reco::GenParticleCollection > | gensToken_ |
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::EDGetTokenT< edm::SimTrackContainer > | simtracksToken_ |
edm::EDGetTokenT< edm::SimVertexContainer > | simverticesToken_ |
edm::ESGetToken< HepPDT::ParticleDataTable, edm::DefaultRecord > | tableToken_ |
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 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 "fastSimProducer" for FastSim 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 42 of file GenPlusSimParticleProducer.cc.
|
private |
Definition at line 56 of file GenPlusSimParticleProducer.cc.
|
explicit |
Definition at line 100 of file GenPlusSimParticleProducer.cc.
References looper::cfg, deDxTools::esConsumes(), ALCARECOTkAlBeamHalo_cff::filter, filter_, pdts_, and tableToken_.
|
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 130 of file GenPlusSimParticleProducer.cc.
References CoreSimTrack::charge(), ALCARECOTkAlJpsiMuMu_cff::charge, filter_, EgammaValidation_cff::genp, heavyIonCSV_trainingSettings::idx, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, CoreSimTrack::momentum(), SimTrack::noVertex(), setStatus_, CoreSimTrack::trackId(), CoreSimTrack::type(), SimTrack::vertIndex(), and L1BJetProducer_cff::vtx.
Referenced by produce().
|
overrideprivate |
Definition at line 190 of file GenPlusSimParticleProducer.cc.
References funct::abs(), addGenParticle(), HLT_2023v12_cff::cands, ztail::d, spr::find(), firstEvent_, genBarcodesToken_, gensToken_, edm::EventSetup::getData(), mps_fire::i, edm::RefProd< C >::id(), heavyIonCSV_trainingSettings::idx, submitPVResolutionJobs::key, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, visualization-live-secondInstance_cfg::m, eostools::move(), pdgIds_, pdts_, simtracksToken_, simverticesToken_, jetUpdater_cfi::sort, tableToken_, and L1BJetProducer_cff::vtx.
|
private |
Definition at line 57 of file GenPlusSimParticleProducer.cc.
Referenced by addGenParticle(), and GenPlusSimParticleProducer().
|
private |
Definition at line 49 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 61 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 60 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 53 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 54 of file GenPlusSimParticleProducer.cc.
Referenced by GenPlusSimParticleProducer(), and produce().
|
private |
Definition at line 52 of file GenPlusSimParticleProducer.cc.
Referenced by addGenParticle().
|
private |
Definition at line 50 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 51 of file GenPlusSimParticleProducer.cc.
Referenced by produce().
|
private |
Definition at line 63 of file GenPlusSimParticleProducer.cc.
Referenced by GenPlusSimParticleProducer(), and produce().