CMS 3D CMS Logo

List of all members | 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
 
 ~GsfElectronCoreEcalDrivenProducer () 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
 

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
 
- Static Public Member Functions inherited from GsfElectronCoreBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
- 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 27 of file GsfElectronCoreEcalDrivenProducer.cc.

29  {}
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
Definition: config.py:1
GsfElectronCoreEcalDrivenProducer::~GsfElectronCoreEcalDrivenProducer ( )
override

Definition at line 89 of file GsfElectronCoreEcalDrivenProducer.cc.

90  {}

Member Function Documentation

void GsfElectronCoreEcalDrivenProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 31 of file GsfElectronCoreEcalDrivenProducer.cc.

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

32  {
33  // base input
35 
36  // output
37  auto electrons = std::make_unique<GsfElectronCoreCollection>();
38 
39  // loop on ecal driven tracks
41  {
42  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = gsfPfRecTracksH_.product() ;
43  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
44  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
45  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
46  ++gsfPfRecTrack )
47  {
48  const GsfTrackRef gsfTrackRef = gsfPfRecTrack->gsfTrackRef() ;
49  produceEcalDrivenCore(gsfTrackRef,electrons.get()) ;
50  }
51  }
52  else
53  {
54  const GsfTrackCollection * gsfTrackCollection = gsfTracksH_.product() ;
55  for ( unsigned int i=0 ; i<gsfTrackCollection->size() ; ++i )
56  {
58  produceEcalDrivenCore(gsfTrackRef,electrons.get()) ;
59  }
60  }
61 
62  event.put(std::move(electrons));
63  }
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:74
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 65 of file GsfElectronCoreEcalDrivenProducer.cc.

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

Referenced by produce().

66  {
67  GsfElectronCore * eleCore = new GsfElectronCore(gsfTrackRef) ;
68 
69  if (!eleCore->ecalDrivenSeed())
70  { delete eleCore ; return ; }
71 
73 
74  edm::RefToBase<TrajectorySeed> seed = gsfTrackRef->extra()->seedRef() ;
75  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
76  edm::RefToBase<CaloCluster> caloCluster = elseed->caloCluster() ;
77  SuperClusterRef scRef = caloCluster.castTo<SuperClusterRef>() ;
78  if (!scRef.isNull())
79  {
80  eleCore->setSuperCluster(scRef) ;
81  electrons->push_back(*eleCore) ;
82  }
83  else
84  { edm::LogWarning("GsfElectronCoreEcalDrivenProducer")<<"Seed CaloCluster is not a SuperCluster, unexpected..." ; }
85 
86  delete eleCore ;
87  }
bool ecalDrivenSeed() const
return((rh^lh)&mask)
void setSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:248
REF castTo() const
Definition: RefToBase.h:289
void fillElectronCore(reco::GsfElectronCore *)