CMS 3D CMS Logo

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

#include <GEDGsfElectronCoreProducer.h>

Inheritance diagram for GEDGsfElectronCoreProducer:
GsfElectronCoreBaseProducer edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GEDGsfElectronCoreProducer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~GEDGsfElectronCoreProducer ()
 
- 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
 
 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- 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)
 

Private Member Functions

void produceElectronCore (const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection *electrons)
 

Private Attributes

edm::EDGetTokenT< reco::PFCandidateCollectiongedEMUnbiasedTag_
 

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

Constructor & Destructor Documentation

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

Definition at line 32 of file GEDGsfElectronCoreProducer.cc.

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

34 {
35  gedEMUnbiasedTag_ = consumes<reco::PFCandidateCollection>(config.getParameter<edm::InputTag>("GEDEMUnbiased")) ;
36 }
edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedTag_
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
Definition: config.py:1
GEDGsfElectronCoreProducer::~GEDGsfElectronCoreProducer ( )
virtual

Definition at line 93 of file GEDGsfElectronCoreProducer.cc.

94  {}

Member Function Documentation

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

Definition at line 23 of file GEDGsfElectronCoreProducer.cc.

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

24 {
27  desc.add<edm::InputTag>("GEDEMUnbiased",edm::InputTag("GEDPFCandidates")) ;
28 
29  descriptions.add("produceEcalDrivenGsfElectronCores",desc) ;
30 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GEDGsfElectronCoreProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
virtual

Definition at line 38 of file GEDGsfElectronCoreProducer.cc.

References genericTrackCleaner_cfi::electrons, gedEMUnbiasedTag_, mps_fire::i, GsfElectronCoreBaseProducer::initEvent(), eostools::move(), produceElectronCore(), and edm::Handle< T >::product().

39  {
40  // base input
42 
44  event.getByToken(gedEMUnbiasedTag_,gedEMUnbiasedH_);
45 
46  // output
47  auto electrons = std::make_unique<GsfElectronCoreCollection>();
48 
49  const PFCandidateCollection * pfCandidateCollection = gedEMUnbiasedH_.product();
50  for ( unsigned int i=0 ; i<pfCandidateCollection->size() ; ++i )
51  produceElectronCore((*pfCandidateCollection)[i],electrons.get()) ;
52 
53  event.put(std::move(electrons));
54  }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedTag_
void produceElectronCore(const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection *electrons)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
T const * product() const
Definition: Handle.h:81
def move(src, dest)
Definition: eostools.py:510
void GEDGsfElectronCoreProducer::produceElectronCore ( const reco::PFCandidate pfCandidate,
reco::GsfElectronCoreCollection electrons 
)
private

Definition at line 56 of file GEDGsfElectronCoreProducer.cc.

References reco::GsfElectronCore::addConversion(), reco::GsfElectronCore::addOneLegConversion(), reco::PFCandidate::egammaExtraRef(), GsfElectronCoreBaseProducer::fillElectronCore(), reco::PFCandidate::gsfTrackRef(), edm::Ref< C, T, F >::isNull(), reco::GsfElectronCore::setParentSuperCluster(), and reco::GsfElectronCore::setSuperCluster().

Referenced by produce().

57  {
58  const GsfTrackRef gsfTrackRef = pfCandidate.gsfTrackRef();
59  if(gsfTrackRef.isNull())
60  return;
61 
62  reco::PFCandidateEGammaExtraRef extraRef = pfCandidate.egammaExtraRef();
63  if(extraRef.isNull())
64  return;
65 
66  GsfElectronCore * eleCore = new GsfElectronCore(gsfTrackRef) ;
67 
69 
70  SuperClusterRef scRef = extraRef->superClusterRef();
71  SuperClusterRef scBoxRef = extraRef->superClusterPFECALRef();
72 
73  for(const auto &convref : extraRef->conversionRef()) {
74  eleCore->addConversion(convref);
75  }
76 
77  for(const auto &convref : extraRef->singleLegConversionRef()) {
78  eleCore->addOneLegConversion(convref);
79  }
80 
81  if (!scRef.isNull() || !scBoxRef.isNull())
82  {
83  eleCore->setSuperCluster(scRef) ;
84  eleCore->setParentSuperCluster(scBoxRef) ;
85  electrons->push_back(*eleCore) ;
86  }
87  else
88  { edm::LogWarning("GEDGsfElectronCoreProducer")<<"Both superClusterRef and superClusterBoxRef of pfCandidate.egammaExtraRef() are Null" ; }
89 
90  delete eleCore ;
91  }
void addOneLegConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
void setSuperCluster(const SuperClusterRef &scl)
void setParentSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:249
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:601
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:476
void addConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
void fillElectronCore(reco::GsfElectronCore *)

Member Data Documentation

edm::EDGetTokenT<reco::PFCandidateCollection> GEDGsfElectronCoreProducer::gedEMUnbiasedTag_
private

Definition at line 22 of file GEDGsfElectronCoreProducer.h.

Referenced by GEDGsfElectronCoreProducer(), and produce().