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::EDProducer 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::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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::EDProducer
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::Handle
< reco::PFCandidateCollection
gedEMUnbiasedH_
 
edm::InputTag gedEMUnbiasedTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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_ = config.getParameter<edm::InputTag>("GEDEMUnbiased") ;
36 }
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
GEDGsfElectronCoreProducer::~GEDGsfElectronCoreProducer ( )
virtual

Definition at line 84 of file GEDGsfElectronCoreProducer.cc.

85  {}

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

Implements edm::EDProducer.

Definition at line 38 of file GEDGsfElectronCoreProducer.cc.

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

39  {
40  // base input
42 
43  event.getByLabel(gedEMUnbiasedTag_,gedEMUnbiasedH_);
44 
45  // output
46  std::auto_ptr<GsfElectronCoreCollection> electrons(new GsfElectronCoreCollection) ;
47 
48  const PFCandidateCollection * pfCandidateCollection = gedEMUnbiasedH_.product();
49  for ( unsigned int i=0 ; i<pfCandidateCollection->size() ; ++i )
50  produceElectronCore((*pfCandidateCollection)[i],electrons.get()) ;
51 
52  event.put(electrons) ;
53  }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
int i
Definition: DBlmapReader.cc:9
edm::Handle< reco::PFCandidateCollection > gedEMUnbiasedH_
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:74
void GEDGsfElectronCoreProducer::produceElectronCore ( const reco::PFCandidate pfCandidate,
reco::GsfElectronCoreCollection electrons 
)
private

Definition at line 55 of file GEDGsfElectronCoreProducer.cc.

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

Referenced by produce().

56  {
57  const GsfTrackRef gsfTrackRef = pfCandidate.gsfTrackRef();
58  if(gsfTrackRef.isNull())
59  return;
60 
61  reco::PFCandidateEGammaExtraRef extraRef = pfCandidate.egammaExtraRef();
62  if(extraRef.isNull())
63  return;
64 
65  GsfElectronCore * eleCore = new GsfElectronCore(gsfTrackRef) ;
66 
68 
69  SuperClusterRef scRef = extraRef->superClusterRef();
70  SuperClusterRef scBoxRef = extraRef->superClusterBoxRef();
71 
72  if (!scRef.isNull() || !scBoxRef.isNull())
73  {
74  eleCore->setSuperCluster(scRef) ;
75  eleCore->setPflowSuperCluster(scBoxRef) ;
76  electrons->push_back(*eleCore) ;
77  }
78  else
79  { edm::LogWarning("GEDGsfElectronCoreProducer")<<"Both superClusterRef and superClusterBoxRef of pfCandidate.egammaExtraRef() are Null" ; }
80 
81  delete eleCore ;
82  }
void setPflowSuperCluster(const SuperClusterRef &scl)
void setSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:247
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:512
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:387
void fillElectronCore(reco::GsfElectronCore *)

Member Data Documentation

edm::Handle<reco::PFCandidateCollection> GEDGsfElectronCoreProducer::gedEMUnbiasedH_
private

Definition at line 22 of file GEDGsfElectronCoreProducer.h.

Referenced by produce().

edm::InputTag GEDGsfElectronCoreProducer::gedEMUnbiasedTag_
private

Definition at line 24 of file GEDGsfElectronCoreProducer.h.

Referenced by GEDGsfElectronCoreProducer(), and produce().