CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GEDGsfElectronCoreProducer Class Reference
Inheritance diagram for GEDGsfElectronCoreProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GEDGsfElectronCoreProducer (const edm::ParameterSet &conf)
 
void produce (edm::StreamID iStream, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produceElectronCore (const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection &electrons, edm::Handle< reco::TrackCollection > const &ctfTracksHandle) const
 

Private Attributes

const edm::EDGetTokenT< reco::TrackCollectionctfTracksToken_
 
const edm::EDGetTokenT< reco::PFCandidateCollectiongedEMUnbiasedToken_
 
const edm::EDPutTokenT< reco::GsfElectronCoreCollectionputToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 12 of file GEDGsfElectronCoreProducer.cc.

Constructor & Destructor Documentation

◆ GEDGsfElectronCoreProducer()

GEDGsfElectronCoreProducer::GEDGsfElectronCoreProducer ( const edm::ParameterSet conf)
explicit

Definition at line 38 of file GEDGsfElectronCoreProducer.cc.

39  : ctfTracksToken_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("ctfTracks"))),
40  gedEMUnbiasedToken_(consumes<reco::PFCandidateCollection>(config.getParameter<edm::InputTag>("GEDEMUnbiased"))),
41  putToken_(produces<reco::GsfElectronCoreCollection>()) {}

Member Function Documentation

◆ fillDescriptions()

void GEDGsfElectronCoreProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 31 of file GEDGsfElectronCoreProducer.cc.

31  {
33  desc.add<edm::InputTag>("ctfTracks", {"generalTracks"});
34  desc.add<edm::InputTag>("GEDEMUnbiased", {"particleFlowEGamma"});
35  descriptions.add("gedGsfElectronCores", desc);
36 }

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

◆ produce()

void GEDGsfElectronCoreProducer::produce ( edm::StreamID  iStream,
edm::Event event,
const edm::EventSetup setup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 43 of file GEDGsfElectronCoreProducer.cc.

43  {
44  auto ctfTracksHandle = event.getHandle(ctfTracksToken_);
45 
46  // output
48 
49  for (auto const &pfCand : event.get(gedEMUnbiasedToken_)) {
50  produceElectronCore(pfCand, electrons, ctfTracksHandle);
51  }
52 
53  event.emplace(putToken_, std::move(electrons));
54 }

References ctfTracksToken_, pwdgSkimBPark_cfi::electrons, gedEMUnbiasedToken_, eostools::move(), produceElectronCore(), and putToken_.

◆ produceElectronCore()

void GEDGsfElectronCoreProducer::produceElectronCore ( const reco::PFCandidate pfCandidate,
reco::GsfElectronCoreCollection electrons,
edm::Handle< reco::TrackCollection > const &  ctfTracksHandle 
) const
private

Definition at line 56 of file GEDGsfElectronCoreProducer.cc.

58  {
59  const GsfTrackRef gsfTrackRef = pfCandidate.gsfTrackRef();
60  if (gsfTrackRef.isNull())
61  return;
62 
63  reco::PFCandidateEGammaExtraRef extraRef = pfCandidate.egammaExtraRef();
64  if (extraRef.isNull())
65  return;
66 
67  electrons.emplace_back(gsfTrackRef);
68  auto &eleCore = electrons.back();
69 
70  auto ctfpair = egamma::getClosestCtfToGsf(eleCore.gsfTrack(), ctfTracksHandle);
71  eleCore.setCtfTrack(ctfpair.first, ctfpair.second);
72 
73  SuperClusterRef scRef = extraRef->superClusterRef();
74  SuperClusterRef scBoxRef = extraRef->superClusterPFECALRef();
75 
76  for (const auto &convref : extraRef->conversionRef()) {
77  eleCore.addConversion(convref);
78  }
79 
80  for (const auto &convref : extraRef->singleLegConversionRef()) {
81  eleCore.addOneLegConversion(convref);
82  }
83 
84  if (!scRef.isNull() || !scBoxRef.isNull()) {
85  eleCore.setSuperCluster(scRef);
86  eleCore.setParentSuperCluster(scBoxRef);
87  } else {
88  electrons.pop_back();
89  edm::LogWarning("GEDGsfElectronCoreProducer")
90  << "Both superClusterRef and superClusterBoxRef of pfCandidate.egammaExtraRef() are Null";
91  }
92 }

References reco::PFCandidate::egammaExtraRef(), pwdgSkimBPark_cfi::electrons, egamma::getClosestCtfToGsf(), reco::PFCandidate::gsfTrackRef(), and edm::Ref< C, T, F >::isNull().

Referenced by produce().

Member Data Documentation

◆ ctfTracksToken_

const edm::EDGetTokenT<reco::TrackCollection> GEDGsfElectronCoreProducer::ctfTracksToken_
private

Definition at line 24 of file GEDGsfElectronCoreProducer.cc.

Referenced by produce().

◆ gedEMUnbiasedToken_

const edm::EDGetTokenT<reco::PFCandidateCollection> GEDGsfElectronCoreProducer::gedEMUnbiasedToken_
private

Definition at line 25 of file GEDGsfElectronCoreProducer.cc.

Referenced by produce().

◆ putToken_

const edm::EDPutTokenT<reco::GsfElectronCoreCollection> GEDGsfElectronCoreProducer::putToken_
private

Definition at line 26 of file GEDGsfElectronCoreProducer.cc.

Referenced by produce().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
GEDGsfElectronCoreProducer::gedEMUnbiasedToken_
const edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedToken_
Definition: GEDGsfElectronCoreProducer.cc:25
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GEDGsfElectronCoreProducer::produceElectronCore
void produceElectronCore(const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection &electrons, edm::Handle< reco::TrackCollection > const &ctfTracksHandle) const
Definition: GEDGsfElectronCoreProducer.cc:56
edm::Ref< GsfTrackCollection >
reco::PFCandidate::egammaExtraRef
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:554
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::GsfElectronCoreCollection
std::vector< GsfElectronCore > GsfElectronCoreCollection
Definition: GsfElectronCoreFwd.h:12
edm::LogWarning
Definition: MessageLogger.h:141
reco::PFCandidate::gsfTrackRef
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:440
GEDGsfElectronCoreProducer::ctfTracksToken_
const edm::EDGetTokenT< reco::TrackCollection > ctfTracksToken_
Definition: GEDGsfElectronCoreProducer.cc:24
eostools.move
def move(src, dest)
Definition: eostools.py:511
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
GEDGsfElectronCoreProducer::putToken_
const edm::EDPutTokenT< reco::GsfElectronCoreCollection > putToken_
Definition: GEDGsfElectronCoreProducer.cc:26
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
egamma::getClosestCtfToGsf
std::pair< reco::TrackRef, float > getClosestCtfToGsf(reco::GsfTrackRef const &, edm::Handle< reco::TrackCollection > const &ctfTracksH)
Definition: GsfElectronTools.cc:17