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
GsfElectronCoreEcalDrivenProducer Class Reference

#include <GsfElectronCoreEcalDrivenProducer.h>

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

Public Member Functions

 GsfElectronCoreEcalDrivenProducer (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 produceEcalDrivenCore (const reco::GsfTrackRef &gsfTrackRef, reco::GsfElectronCoreCollection *electrons)
 

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

Constructor & Destructor Documentation

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

Definition at line 26 of file GsfElectronCoreEcalDrivenProducer.cc.

GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
Definition: config.py:1

Member Function Documentation

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

Definition at line 20 of file GsfElectronCoreEcalDrivenProducer.cc.

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

20  {
23  descriptions.add("ecalDrivenGsfElectronCores", desc);
24 }
static void fillDescription(edm::ParameterSetDescription &, std::string const &gsfPfRecTracks="pfTrackElec", std::string const &gsfTracks="electronGsfTracks")
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GsfElectronCoreEcalDrivenProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 29 of file GsfElectronCoreEcalDrivenProducer.cc.

References pwdgSkimBPark_cfi::electrons, GsfElectronCoreBaseProducer::gsfPfRecTracksH_, GsfElectronCoreBaseProducer::gsfTracksH_, mps_fire::i, GsfElectronCoreBaseProducer::initEvent(), eostools::move(), produceEcalDrivenCore(), edm::Handle< T >::product(), and GsfElectronCoreBaseProducer::useGsfPfRecTracks_.

29  {
30  // base input
32 
33  // output
34  auto electrons = std::make_unique<GsfElectronCoreCollection>();
35 
36  // loop on ecal driven tracks
37  if (useGsfPfRecTracks_) {
38  const GsfPFRecTrackCollection* gsfPfRecTrackCollection = gsfPfRecTracksH_.product();
39  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack;
40  for (gsfPfRecTrack = gsfPfRecTrackCollection->begin(); gsfPfRecTrack != gsfPfRecTrackCollection->end();
41  ++gsfPfRecTrack) {
42  const GsfTrackRef gsfTrackRef = gsfPfRecTrack->gsfTrackRef();
43  produceEcalDrivenCore(gsfTrackRef, electrons.get());
44  }
45  } else {
46  const GsfTrackCollection* gsfTrackCollection = gsfTracksH_.product();
47  for (unsigned int i = 0; i < gsfTrackCollection->size(); ++i) {
49  produceEcalDrivenCore(gsfTrackRef, electrons.get());
50  }
51  }
52 
53  event.put(std::move(electrons));
54 }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
void produceEcalDrivenCore(const reco::GsfTrackRef &gsfTrackRef, reco::GsfElectronCoreCollection *electrons)
edm::Handle< reco::GsfTrackCollection > gsfTracksH_
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
T const * product() const
Definition: Handle.h:69
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracksH_
def move(src, dest)
Definition: eostools.py:511
void GsfElectronCoreEcalDrivenProducer::produceEcalDrivenCore ( const reco::GsfTrackRef gsfTrackRef,
reco::GsfElectronCoreCollection electrons 
)
private

Definition at line 56 of file GsfElectronCoreEcalDrivenProducer.cc.

References edm::RefToBase< T >::castTo(), reco::GsfElectronCore::ecalDrivenSeed(), GsfElectronCoreBaseProducer::fillElectronCore(), edm::Ref< C, T, F >::isNull(), SurveyInfoScenario_cff::seed, and reco::GsfElectronCore::setSuperCluster().

Referenced by produce().

57  {
58  GsfElectronCore* eleCore = new GsfElectronCore(gsfTrackRef);
59 
60  if (!eleCore->ecalDrivenSeed()) {
61  delete eleCore;
62  return;
63  }
64 
66 
67  edm::RefToBase<TrajectorySeed> seed = gsfTrackRef->extra()->seedRef();
68  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
69  edm::RefToBase<CaloCluster> caloCluster = elseed->caloCluster();
70  SuperClusterRef scRef = caloCluster.castTo<SuperClusterRef>();
71  if (!scRef.isNull()) {
72  eleCore->setSuperCluster(scRef);
73  electrons->push_back(*eleCore);
74  } else {
75  edm::LogWarning("GsfElectronCoreEcalDrivenProducer") << "Seed CaloCluster is not a SuperCluster, unexpected...";
76  }
77 
78  delete eleCore;
79 }
bool ecalDrivenSeed() const
void setSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:235
REF castTo() const
Definition: RefToBase.h:257
void fillElectronCore(reco::GsfElectronCore *)