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 | 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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::PFCandidateCollection
gedEMUnbiasedTag_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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::TrackCollection
ctfTracksH_
 
edm::Handle
< reco::GsfPFRecTrackCollection
gsfPfRecTracksH_
 
edm::Handle
< reco::GsfTrackCollection
gsfTracksH_
 
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)
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(), GsfElectronCoreBaseProducer::fillDescription(), and HLT_25ns14e33_v1_cff::InputTag.

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

Implements edm::stream::EDProducerBase.

Definition at line 38 of file GEDGsfElectronCoreProducer.cc.

References HI_PhotonSkim_cff::electrons, gedEMUnbiasedTag_, i, GsfElectronCoreBaseProducer::initEvent(), produceElectronCore(), and edm::Handle< T >::product().

39  {
40  // base input
42 
44  event.getByToken(gedEMUnbiasedTag_,gedEMUnbiasedH_);
45 
46  // output
47  std::auto_ptr<GsfElectronCoreCollection> electrons(new 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(electrons) ;
54  }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< reco::PFCandidateCollection > gedEMUnbiasedTag_
void produceElectronCore(const reco::PFCandidate &pfCandidate, reco::GsfElectronCoreCollection *electrons)
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
T const * product() const
Definition: Handle.h:81
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:596
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:471
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().