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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GsfElectronCoreEcalDrivenProducer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~GsfElectronCoreEcalDrivenProducer ()
 
- Public Member Functions inherited from GsfElectronCoreBaseProducer
 GsfElectronCoreBaseProducer (const edm::ParameterSet &conf)
 
virtual ~GsfElectronCoreBaseProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from GsfElectronCoreBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from GsfElectronCoreBaseProducer
void fillElectronCore (reco::GsfElectronCore *)
 
void initEvent (edm::Event &event, const edm::EventSetup &setup)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- 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 ( )
virtual

Definition at line 89 of file GsfElectronCoreEcalDrivenProducer.cc.

90  {}

Member Function Documentation

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

Definition at line 31 of file GsfElectronCoreEcalDrivenProducer.cc.

References genericTrackCleaner_cfi::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:81
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracksH_
def move(src, dest)
Definition: eostools.py:510
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(), reco::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
void setSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:250
REF castTo() const
Definition: RefToBase.h:286
return(e1-e2)*(e1-e2)+dp *dp
void fillElectronCore(reco::GsfElectronCore *)