CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EgammaHLTR9IDProducer Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTR9IDProducer.h>

Inheritance diagram for EgammaHLTR9IDProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTR9IDProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTR9IDProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::ParameterSet conf_
 
edm::InputTag ecalRechitEBTag_
 
edm::InputTag ecalRechitEETag_
 
edm::InputTag recoEcalCandidateProducer_
 

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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Author
Roberto Covarelli (CERN) modified by Chris Tully (Princeton) $Id:

Definition at line 33 of file EgammaHLTR9IDProducer.h.

Constructor & Destructor Documentation

EgammaHLTR9IDProducer::EgammaHLTR9IDProducer ( const edm::ParameterSet config)
explicit

Definition at line 26 of file EgammaHLTR9IDProducer.cc.

References conf_, ecalRechitEBTag_, ecalRechitEETag_, edm::ParameterSet::getParameter(), and recoEcalCandidateProducer_.

26  : conf_(config)
27 {
28  // use configuration file to setup input/output collection names
29  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
30  ecalRechitEBTag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEB");
31  ecalRechitEETag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEE");
32  //register your products
33  produces < reco::RecoEcalCandidateIsolationMap >();
34 }
T getParameter(std::string const &) const
edm::InputTag recoEcalCandidateProducer_
EgammaHLTR9IDProducer::~EgammaHLTR9IDProducer ( )

Definition at line 37 of file EgammaHLTR9IDProducer.cc.

37 {}

Member Function Documentation

void EgammaHLTR9IDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 46 of file EgammaHLTR9IDProducer.cc.

References EcalClusterLazyTools::e3x3(), ecalRechitEBTag_, ecalRechitEETag_, edm::Event::getByLabel(), edm::AssociationMap< Tag >::insert(), edm::Event::put(), and recoEcalCandidateProducer_.

47 {
48 
49  // Get the HLT filtered objects
51  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
52 
53  EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag_, ecalRechitEETag_ );
54 
56 
57  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
58 
59  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand-recoecalcandHandle->begin());
60 
61  float r9 = -1;
62 
63  float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) );
64  float eraw = recoecalcandref->superCluster()->rawEnergy();
65  if (eraw > 0. ) {r9 = e9/eraw;}
66 
67  r9Map.insert(recoecalcandref, r9);
68 
69  }
70 
71  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map));
72  iEvent.put(R9Map);
73 
74 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
edm::InputTag recoEcalCandidateProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
void insert(const key_type &k, const data_type &v)
insert an association

Member Data Documentation

edm::ParameterSet EgammaHLTR9IDProducer::conf_
private

Definition at line 47 of file EgammaHLTR9IDProducer.h.

Referenced by EgammaHLTR9IDProducer().

edm::InputTag EgammaHLTR9IDProducer::ecalRechitEBTag_
private

Definition at line 44 of file EgammaHLTR9IDProducer.h.

Referenced by EgammaHLTR9IDProducer(), and produce().

edm::InputTag EgammaHLTR9IDProducer::ecalRechitEETag_
private

Definition at line 45 of file EgammaHLTR9IDProducer.h.

Referenced by EgammaHLTR9IDProducer(), and produce().

edm::InputTag EgammaHLTR9IDProducer::recoEcalCandidateProducer_
private

Definition at line 43 of file EgammaHLTR9IDProducer.h.

Referenced by EgammaHLTR9IDProducer(), and produce().