CMS 3D CMS Logo

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
 
 ~GEDGsfElectronCoreProducer () override
 
- Public Member Functions inherited from GsfElectronCoreBaseProducer
 GsfElectronCoreBaseProducer (const edm::ParameterSet &conf)
 
 ~GsfElectronCoreBaseProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from GsfElectronCoreBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 

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 32 of file GEDGsfElectronCoreProducer.cc.

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

34 {
35  gedEMUnbiasedTag_ = consumes<reco::PFCandidateCollection>(config.getParameter<edm::InputTag>("GEDEMUnbiased")) ;
36 }
edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedTag_
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
Definition: config.py:1
GEDGsfElectronCoreProducer::~GEDGsfElectronCoreProducer ( )
override

Definition at line 93 of file GEDGsfElectronCoreProducer.cc.

94  {}

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(), and GsfElectronCoreBaseProducer::fillDescription().

24 {
27  desc.add<edm::InputTag>("GEDEMUnbiased",edm::InputTag("GEDPFCandidates")) ;
28 
29  descriptions.add("produceEcalDrivenGsfElectronCores",desc) ;
30 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GEDGsfElectronCoreProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 38 of file GEDGsfElectronCoreProducer.cc.

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

39  {
40  // base input
42 
44  event.getByToken(gedEMUnbiasedTag_,gedEMUnbiasedH_);
45 
46  // output
47  auto electrons = std::make_unique<GsfElectronCoreCollection>();
48 
49  const PFCandidateCollection * pfCandidateCollection = gedEMUnbiasedH_.product();
50  for ( unsigned int i=0 ; i<pfCandidateCollection->size() ; ++i )
51  produceElectronCore((*pfCandidateCollection)[i],electrons.get()) ;
52 
53  event.put(std::move(electrons));
54  }
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:74
def move(src, dest)
Definition: eostools.py:511
void GEDGsfElectronCoreProducer::produceElectronCore ( const reco::PFCandidate pfCandidate,
reco::GsfElectronCoreCollection electrons 
)
private

Definition at line 56 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().

57  {
58  const GsfTrackRef gsfTrackRef = pfCandidate.gsfTrackRef();
59  if(gsfTrackRef.isNull())
60  return;
61 
62  reco::PFCandidateEGammaExtraRef extraRef = pfCandidate.egammaExtraRef();
63  if(extraRef.isNull())
64  return;
65 
66  GsfElectronCore * eleCore = new GsfElectronCore(gsfTrackRef) ;
67 
69 
70  SuperClusterRef scRef = extraRef->superClusterRef();
71  SuperClusterRef scBoxRef = extraRef->superClusterPFECALRef();
72 
73  for(const auto &convref : extraRef->conversionRef()) {
74  eleCore->addConversion(convref);
75  }
76 
77  for(const auto &convref : extraRef->singleLegConversionRef()) {
78  eleCore->addOneLegConversion(convref);
79  }
80 
81  if (!scRef.isNull() || !scBoxRef.isNull())
82  {
83  eleCore->setSuperCluster(scRef) ;
84  eleCore->setParentSuperCluster(scBoxRef) ;
85  electrons->push_back(*eleCore) ;
86  }
87  else
88  { edm::LogWarning("GEDGsfElectronCoreProducer")<<"Both superClusterRef and superClusterBoxRef of pfCandidate.egammaExtraRef() are Null" ; }
89 
90  delete eleCore ;
91  }
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:248
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:605
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:480
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 22 of file GEDGsfElectronCoreProducer.h.

Referenced by GEDGsfElectronCoreProducer(), and produce().