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
 
 ~LowPtGsfElectronCoreProducer () 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 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_.

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

Definition at line 16 of file LowPtGsfElectronCoreProducer.cc.

16 {}

Member Function Documentation

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

Definition at line 61 of file LowPtGsfElectronCoreProducer.cc.

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

62 {
65  desc.add<edm::InputTag>("superClusters",edm::InputTag("lowPtGsfElectronSuperClusters"));
66  descriptions.add("defaultLowPtGsfElectronCores",desc);
67 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void LowPtGsfElectronCoreProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 18 of file LowPtGsfElectronCoreProducer.cc.

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

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

Member Data Documentation

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

Definition at line 23 of file LowPtGsfElectronCoreProducer.h.

Referenced by LowPtGsfElectronCoreProducer(), and produce().