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
 
 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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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 (reco::GsfTrackRef const &gsfTrackRef, reco::PFCandidateEGammaExtraRef const &extraRef, reco::GsfElectronCoreCollection &electrons, edm::Handle< reco::TrackCollection > const &ctfTracksHandle, edm::soa::EtaPhiTableView ctfTrackVariables) 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 13 of file GEDGsfElectronCoreProducer.cc.

Constructor & Destructor Documentation

◆ GEDGsfElectronCoreProducer()

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

Definition at line 41 of file GEDGsfElectronCoreProducer.cc.

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 34 of file GEDGsfElectronCoreProducer.cc.

34  {
36  desc.add<edm::InputTag>("ctfTracks", {"generalTracks"});
37  desc.add<edm::InputTag>("GEDEMUnbiased", {"particleFlowEGamma"});
38  descriptions.add("gedGsfElectronCores", desc);
39 }

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 46 of file GEDGsfElectronCoreProducer.cc.

46  {
47  auto ctfTracksHandle = event.getHandle(ctfTracksToken_);
48  auto ctfTrackVariables = makeLazy<edm::soa::EtaPhiTable>(*ctfTracksHandle);
49 
50  // output
52 
53  for (auto const &pfCand : event.get(gedEMUnbiasedToken_)) {
54  const GsfTrackRef gsfTrackRef = pfCand.gsfTrackRef();
55  if (gsfTrackRef.isNull())
56  continue;
57 
58  reco::PFCandidateEGammaExtraRef extraRef = pfCand.egammaExtraRef();
59  if (extraRef.isNull())
60  continue;
61  produceElectronCore(gsfTrackRef, extraRef, electrons, ctfTracksHandle, ctfTrackVariables.value());
62  }
63 
64  event.emplace(putToken_, std::move(electrons));
65 }

References ctfTracksToken_, pwdgSkimBPark_cfi::electrons, gedEMUnbiasedToken_, edm::Ref< C, T, F >::isNull(), eostools::move(), produceElectronCore(), and putToken_.

◆ produceElectronCore()

void GEDGsfElectronCoreProducer::produceElectronCore ( reco::GsfTrackRef const &  gsfTrackRef,
reco::PFCandidateEGammaExtraRef const &  extraRef,
reco::GsfElectronCoreCollection electrons,
edm::Handle< reco::TrackCollection > const &  ctfTracksHandle,
edm::soa::EtaPhiTableView  ctfTrackVariables 
) const
private

Definition at line 67 of file GEDGsfElectronCoreProducer.cc.

71  {
72  electrons.emplace_back(gsfTrackRef);
73  auto &eleCore = electrons.back();
74 
75  auto ctfpair = egamma::getClosestCtfToGsf(eleCore.gsfTrack(), ctfTracksHandle, ctfTrackVariables);
76  eleCore.setCtfTrack(ctfpair.first, ctfpair.second);
77 
78  SuperClusterRef scRef = extraRef->superClusterRef();
79  SuperClusterRef scBoxRef = extraRef->superClusterPFECALRef();
80 
81  for (const auto &convref : extraRef->conversionRef()) {
82  eleCore.addConversion(convref);
83  }
84 
85  for (const auto &convref : extraRef->singleLegConversionRef()) {
86  eleCore.addOneLegConversion(convref);
87  }
88 
89  if (!scRef.isNull() || !scBoxRef.isNull()) {
90  eleCore.setSuperCluster(scRef);
91  eleCore.setParentSuperCluster(scBoxRef);
92  } else {
93  electrons.pop_back();
94  edm::LogWarning("GEDGsfElectronCoreProducer")
95  << "Both superClusterRef and superClusterBoxRef of pfCandidate.egammaExtraRef() are Null";
96  }
97 }

References pwdgSkimBPark_cfi::electrons, egamma::getClosestCtfToGsf(), 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 27 of file GEDGsfElectronCoreProducer.cc.

Referenced by produce().

◆ gedEMUnbiasedToken_

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

Definition at line 28 of file GEDGsfElectronCoreProducer.cc.

Referenced by produce().

◆ putToken_

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

Definition at line 29 of file GEDGsfElectronCoreProducer.cc.

Referenced by produce().

edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
GEDGsfElectronCoreProducer::gedEMUnbiasedToken_
const edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedToken_
Definition: GEDGsfElectronCoreProducer.cc:28
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
edm::Ref< GsfTrackCollection >
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
GEDGsfElectronCoreProducer::produceElectronCore
void produceElectronCore(reco::GsfTrackRef const &gsfTrackRef, reco::PFCandidateEGammaExtraRef const &extraRef, reco::GsfElectronCoreCollection &electrons, edm::Handle< reco::TrackCollection > const &ctfTracksHandle, edm::soa::EtaPhiTableView ctfTrackVariables) const
Definition: GEDGsfElectronCoreProducer.cc:67
GEDGsfElectronCoreProducer::ctfTracksToken_
const edm::EDGetTokenT< reco::TrackCollection > ctfTracksToken_
Definition: GEDGsfElectronCoreProducer.cc:27
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
egamma::getClosestCtfToGsf
std::pair< reco::TrackRef, float > getClosestCtfToGsf(reco::GsfTrackRef const &, edm::Handle< reco::TrackCollection > const &ctfTracksH, edm::soa::EtaPhiTableView trackEtaPhiTable)
Definition: GsfElectronTools.cc:16
GEDGsfElectronCoreProducer::putToken_
const edm::EDPutTokenT< reco::GsfElectronCoreCollection > putToken_
Definition: GEDGsfElectronCoreProducer.cc:29
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15