CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
LowPtGsfElectronCoreProducer Class Reference

#include <LowPtGsfElectronCoreProducer.h>

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

Public Member Functions

 LowPtGsfElectronCoreProducer (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 Attributes

edm::EDGetTokenT< edm::ValueMap< reco::SuperClusterRef > > superClusterRefs_
 

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 9 of file LowPtGsfElectronCoreProducer.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file LowPtGsfElectronCoreProducer.cc.

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

13  consumes<edm::ValueMap<reco::SuperClusterRef> >(config.getParameter<edm::InputTag>("superClusters"));
14 }
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
Definition: config.py:1
edm::EDGetTokenT< edm::ValueMap< reco::SuperClusterRef > > superClusterRefs_

Member Function Documentation

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

Definition at line 57 of file LowPtGsfElectronCoreProducer.cc.

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

57  {
59  GsfElectronCoreBaseProducer::fillDescription(desc, "lowPtGsfElePfGsfTracks", "lowPtGsfEleGsfTracks");
60  desc.add<edm::InputTag>("superClusters", edm::InputTag("lowPtGsfElectronSuperClusters"));
61  descriptions.add("lowPtGsfElectronCores", desc);
62 }
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 LowPtGsfElectronCoreProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 16 of file LowPtGsfElectronCoreProducer.cc.

References pwdgSkimBPark_cfi::electrons, GsfElectronCoreBaseProducer::fillElectronCore(), ntupleEnum::gsf, GsfElectronCoreBaseProducer::gsfPfRecTracksH_, GsfElectronCoreBaseProducer::initEvent(), eostools::move(), SimDataFormats::CaloAnalysis::sc, superClusterRefs_, and GsfElectronCoreBaseProducer::useGsfPfRecTracks_.

16  {
17  // Output collection
18  auto electrons = std::make_unique<reco::GsfElectronCoreCollection>();
19 
20  // Init
22  if (!useGsfPfRecTracks_) {
23  edm::LogError("useGsfPfRecTracks_ is (redundantly) set to False!");
24  }
25 
27  event.getByToken(superClusterRefs_, superClusterRefs);
28 
29  // Create ElectronCore objects
30  for (size_t ipfgsf = 0; ipfgsf < gsfPfRecTracksH_->size(); ++ipfgsf) {
31  // Refs to GSF(PF) objects and SC
33  reco::GsfTrackRef gsf = pfgsf->gsfTrackRef();
34  const reco::SuperClusterRef sc = (*superClusterRefs)[pfgsf];
35 
36  // Use GsfElectronCore(gsf) constructor and store object via emplace
37  electrons->emplace_back(gsf);
38 
39  // Do not consider ECAL-driven objects
40  if (electrons->back().ecalDrivenSeed()) {
41  electrons->pop_back();
42  continue;
43  }
44 
45  // Add GSF(PF) track information
47 
48  // Add super cluster information
49  electrons->back().setSuperCluster(sc);
50  }
51 
52  event.put(std::move(electrons));
53 }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracksH_
edm::EDGetTokenT< edm::ValueMap< reco::SuperClusterRef > > superClusterRefs_
void fillElectronCore(reco::GsfElectronCore *)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::EDGetTokenT<edm::ValueMap<reco::SuperClusterRef> > LowPtGsfElectronCoreProducer::superClusterRefs_
private

Definition at line 18 of file LowPtGsfElectronCoreProducer.h.

Referenced by LowPtGsfElectronCoreProducer(), and produce().