CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
pat::PATGenCandsFromSimTracksProducer Class Reference

Produces reco::GenParticle from SimTracks. More...

Inheritance diagram for pat::PATGenCandsFromSimTracksProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef
StringCutObjectSelector
< reco::GenParticle
StrFilter
 

Private Member Functions

const SimTrackfindGeantMother (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

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< PdtEntrymotherPdts_
 
std::set< int > pdgIds_
 
std::vector< PdtEntrypdts_
 
int setStatus_
 
edm::EDGetTokenT
< edm::SimTrackContainer
simTracksToken_
 
edm::EDGetTokenT
< edm::SimVertexContainer
simVertexToken_
 
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<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 

Detailed Description

Produces reco::GenParticle from SimTracks.

The PATGenCandsFromSimTracksProducer produces GenParticles from SimTracks, so they can be used for MC matching.

Author
Jordan Tucker (original module), Giovanni Petrucciani (PAT integration)
Version
Id:
PATGenCandsFromSimTracksProducer.cc,v 1.8 2010/10/20 23:09:25 wmtan Exp

Definition at line 29 of file PATGenCandsFromSimTracksProducer.cc.

Member Typedef Documentation

Definition at line 46 of file PATGenCandsFromSimTracksProducer.cc.

Constructor & Destructor Documentation

PATGenCandsFromSimTracksProducer::PATGenCandsFromSimTracksProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 116 of file PATGenCandsFromSimTracksProducer.cc.

pat::PATGenCandsFromSimTracksProducer::~PATGenCandsFromSimTracksProducer ( )
inline

Definition at line 32 of file PATGenCandsFromSimTracksProducer.cc.

Member Function Documentation

const SimTrack * PATGenCandsFromSimTracksProducer::findGeantMother ( const SimTrack tk,
const GlobalContext g 
) const
private

Find the mother of a given GEANT track (or NULL if it can't be found).

Definition at line 144 of file PATGenCandsFromSimTracksProducer.cc.

edm::Ref< reco::GenParticleCollection > PATGenCandsFromSimTracksProducer::findRef ( const SimTrack tk,
GlobalContext g 
) const
private

Find the GenParticle reference for a given GEANT or PYTHIA track.

  • if the track corresponds to a PYTHIA particle, return a ref to that particle
  • otherwise, if this simtrack has no mother simtrack, return a null ref
  • otherwise, if writeAncestors is true, make a GenParticle for it and return a ref to it
  • otherwise, if writeAncestors is false, return the ref to the GEANT mother of this track

Definition at line 160 of file PATGenCandsFromSimTracksProducer.cc.

edm::Ref< reco::GenParticleCollection > PATGenCandsFromSimTracksProducer::generatorRef_ ( const SimTrack tk,
const GlobalContext g 
) const
private

Used by findRef if the track is a PYTHIA particle.

Definition at line 189 of file PATGenCandsFromSimTracksProducer.cc.

reco::GenParticle PATGenCandsFromSimTracksProducer::makeGenParticle_ ( const SimTrack tk,
const edm::Ref< reco::GenParticleCollection > &  mother,
const GlobalContext g 
) const
private

Make a GenParticle for this SimTrack, with a given mother.

Definition at line 209 of file PATGenCandsFromSimTracksProducer.cc.

void PATGenCandsFromSimTracksProducer::produce ( edm::Event event,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 221 of file PATGenCandsFromSimTracksProducer.cc.

Member Data Documentation

const StrFilter pat::PATGenCandsFromSimTracksProducer::filter_
private

Definition at line 47 of file PATGenCandsFromSimTracksProducer.cc.

bool pat::PATGenCandsFromSimTracksProducer::firstEvent_
private

Definition at line 37 of file PATGenCandsFromSimTracksProducer.cc.

edm::EDGetTokenT<std::vector<int> > pat::PATGenCandsFromSimTracksProducer::genBarcodesToken_
private

Definition at line 56 of file PATGenCandsFromSimTracksProducer.cc.

edm::EDGetTokenT<reco::GenParticleCollection> pat::PATGenCandsFromSimTracksProducer::genParticlesToken_
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.

bool pat::PATGenCandsFromSimTracksProducer::makeMotherLink_
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.

std::set<int> pat::PATGenCandsFromSimTracksProducer::motherPdgIds_
private

Definition at line 43 of file PATGenCandsFromSimTracksProducer.cc.

std::vector<PdtEntry> pat::PATGenCandsFromSimTracksProducer::motherPdts_
private

Definition at line 44 of file PATGenCandsFromSimTracksProducer.cc.

std::set<int> pat::PATGenCandsFromSimTracksProducer::pdgIds_
private

Definition at line 41 of file PATGenCandsFromSimTracksProducer.cc.

std::vector<PdtEntry> pat::PATGenCandsFromSimTracksProducer::pdts_
private

Definition at line 42 of file PATGenCandsFromSimTracksProducer.cc.

int pat::PATGenCandsFromSimTracksProducer::setStatus_
private

Definition at line 40 of file PATGenCandsFromSimTracksProducer.cc.

edm::EDGetTokenT<edm::SimTrackContainer> pat::PATGenCandsFromSimTracksProducer::simTracksToken_
private

Definition at line 38 of file PATGenCandsFromSimTracksProducer.cc.

edm::EDGetTokenT<edm::SimVertexContainer> pat::PATGenCandsFromSimTracksProducer::simVertexToken_
private

Definition at line 39 of file PATGenCandsFromSimTracksProducer.cc.

bool pat::PATGenCandsFromSimTracksProducer::writeAncestors_
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.