#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTR9IDProducer.h>
Public Member Functions | |
EgammaHLTR9IDProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaHLTR9IDProducer () | |
Private Attributes | |
edm::ParameterSet | conf_ |
edm::InputTag | ecalRechitEBTag_ |
edm::InputTag | ecalRechitEETag_ |
edm::InputTag | recoEcalCandidateProducer_ |
Definition at line 33 of file EgammaHLTR9IDProducer.h.
EgammaHLTR9IDProducer::EgammaHLTR9IDProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 26 of file EgammaHLTR9IDProducer.cc.
References conf_, ecalRechitEBTag_, ecalRechitEETag_, edm::ParameterSet::getParameter(), and recoEcalCandidateProducer_.
: conf_(config) { // use configuration file to setup input/output collection names recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer"); ecalRechitEBTag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEB"); ecalRechitEETag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEE"); //register your products produces < reco::RecoEcalCandidateIsolationMap >(); }
EgammaHLTR9IDProducer::~EgammaHLTR9IDProducer | ( | ) |
Definition at line 37 of file EgammaHLTR9IDProducer.cc.
{}
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_.
{ // Get the HLT filtered objects edm::Handle<reco::RecoEcalCandidateCollection> recoecalcandHandle; iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle); EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag_, ecalRechitEETag_ ); reco::RecoEcalCandidateIsolationMap r9Map; for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){ reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand-recoecalcandHandle->begin()); float r9 = -1; float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) ); float eraw = recoecalcandref->superCluster()->rawEnergy(); if (eraw > 0. ) {r9 = e9/eraw;} r9Map.insert(recoecalcandref, r9); } std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map)); iEvent.put(R9Map); }
Definition at line 47 of file EgammaHLTR9IDProducer.h.
Referenced by EgammaHLTR9IDProducer().
Definition at line 44 of file EgammaHLTR9IDProducer.h.
Referenced by EgammaHLTR9IDProducer(), and produce().
Definition at line 45 of file EgammaHLTR9IDProducer.h.
Referenced by EgammaHLTR9IDProducer(), and produce().
Definition at line 43 of file EgammaHLTR9IDProducer.h.
Referenced by EgammaHLTR9IDProducer(), and produce().