CMS 3D CMS Logo

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

#include <GEDGsfElectronCoreProducer.h>

Inheritance diagram for GEDGsfElectronCoreProducer:
GsfElectronCoreBaseProducer edm::stream::EDProducer<>

Public Member Functions

 GEDGsfElectronCoreProducer (const edm::ParameterSet &conf)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from GsfElectronCoreBaseProducer
 GsfElectronCoreBaseProducer (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from GsfElectronCoreBaseProducer
static void fillDescription (edm::ParameterSetDescription &, std::string const &gsfPfRecTracks="pfTrackElec", std::string const &gsfTracks="electronGsfTracks")
 

Private Member Functions

void produceElectronCore (const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection *electrons)
 

Private Attributes

edm::EDGetTokenT< reco::PFCandidateCollectiongedEMUnbiasedTag_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Protected Member Functions inherited from GsfElectronCoreBaseProducer
void fillElectronCore (reco::GsfElectronCore *)
 
void initEvent (edm::Event &event, const edm::EventSetup &setup)
 
- Protected Attributes inherited from GsfElectronCoreBaseProducer
edm::Handle< reco::TrackCollectionctfTracksH_
 
edm::Handle< reco::GsfPFRecTrackCollectiongsfPfRecTracksH_
 
edm::Handle< reco::GsfTrackCollectiongsfTracksH_
 
bool useGsfPfRecTracks_
 

Detailed Description

Definition at line 8 of file GEDGsfElectronCoreProducer.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file GEDGsfElectronCoreProducer.cc.

References gedEMUnbiasedTag_, and edm::ParameterSet::getParameter().

32  gedEMUnbiasedTag_ = consumes<reco::PFCandidateCollection>(config.getParameter<edm::InputTag>("GEDEMUnbiased"));
33 }
edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedTag_
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
Definition: config.py:1

Member Function Documentation

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

Definition at line 23 of file GEDGsfElectronCoreProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), GsfElectronCoreBaseProducer::fillDescription(), and HLT_2018_cff::InputTag.

23  {
26  desc.add<edm::InputTag>("GEDEMUnbiased", edm::InputTag("particleFlowEGamma"));
27  descriptions.add("gedGsfElectronCores", desc);
28 }
static void fillDescription(edm::ParameterSetDescription &, std::string const &gsfPfRecTracks="pfTrackElec", std::string const &gsfTracks="electronGsfTracks")
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GEDGsfElectronCoreProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 35 of file GEDGsfElectronCoreProducer.cc.

References pwdgSkimBPark_cfi::electrons, gedEMUnbiasedTag_, mps_fire::i, GsfElectronCoreBaseProducer::initEvent(), eostools::move(), HLT_2018_cff::pfCandidateCollection, produceElectronCore(), and edm::Handle< T >::product().

35  {
36  // base input
38 
40  event.getByToken(gedEMUnbiasedTag_, gedEMUnbiasedH_);
41 
42  // output
43  auto electrons = std::make_unique<GsfElectronCoreCollection>();
44 
45  const PFCandidateCollection *pfCandidateCollection = gedEMUnbiasedH_.product();
46  for (unsigned int i = 0; i < pfCandidateCollection->size(); ++i)
47  produceElectronCore((*pfCandidateCollection)[i], electrons.get());
48 
49  event.put(std::move(electrons));
50 }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedTag_
void produceElectronCore(const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection *electrons)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
T const * product() const
Definition: Handle.h:69
def move(src, dest)
Definition: eostools.py:511
void GEDGsfElectronCoreProducer::produceElectronCore ( const reco::PFCandidate pfCandidate,
reco::GsfElectronCoreCollection electrons 
)
private

Definition at line 52 of file GEDGsfElectronCoreProducer.cc.

References reco::GsfElectronCore::addConversion(), reco::GsfElectronCore::addOneLegConversion(), reco::PFCandidate::egammaExtraRef(), GsfElectronCoreBaseProducer::fillElectronCore(), reco::PFCandidate::gsfTrackRef(), edm::Ref< C, T, F >::isNull(), reco::GsfElectronCore::setParentSuperCluster(), and reco::GsfElectronCore::setSuperCluster().

Referenced by produce().

53  {
54  const GsfTrackRef gsfTrackRef = pfCandidate.gsfTrackRef();
55  if (gsfTrackRef.isNull())
56  return;
57 
58  reco::PFCandidateEGammaExtraRef extraRef = pfCandidate.egammaExtraRef();
59  if (extraRef.isNull())
60  return;
61 
62  GsfElectronCore *eleCore = new GsfElectronCore(gsfTrackRef);
63 
65 
66  SuperClusterRef scRef = extraRef->superClusterRef();
67  SuperClusterRef scBoxRef = extraRef->superClusterPFECALRef();
68 
69  for (const auto &convref : extraRef->conversionRef()) {
70  eleCore->addConversion(convref);
71  }
72 
73  for (const auto &convref : extraRef->singleLegConversionRef()) {
74  eleCore->addOneLegConversion(convref);
75  }
76 
77  if (!scRef.isNull() || !scBoxRef.isNull()) {
78  eleCore->setSuperCluster(scRef);
79  eleCore->setParentSuperCluster(scBoxRef);
80  electrons->push_back(*eleCore);
81  } else {
82  edm::LogWarning("GEDGsfElectronCoreProducer")
83  << "Both superClusterRef and superClusterBoxRef of pfCandidate.egammaExtraRef() are Null";
84  }
85 
86  delete eleCore;
87 }
void addOneLegConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
void setSuperCluster(const SuperClusterRef &scl)
void setParentSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:235
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:554
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:440
void addConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
void fillElectronCore(reco::GsfElectronCore *)

Member Data Documentation

edm::EDGetTokenT<reco::PFCandidateCollection> GEDGsfElectronCoreProducer::gedEMUnbiasedTag_
private

Definition at line 18 of file GEDGsfElectronCoreProducer.h.

Referenced by GEDGsfElectronCoreProducer(), and produce().