#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTR9Producer.h>
Public Member Functions | |
EgammaHLTR9Producer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaHLTR9Producer () | |
Private Attributes | |
edm::ParameterSet | conf_ |
edm::InputTag | ecalRechitEBTag_ |
edm::InputTag | ecalRechitEETag_ |
edm::InputTag | recoEcalCandidateProducer_ |
bool | useSwissCross_ |
$Id:
Definition at line 32 of file EgammaHLTR9Producer.h.
EgammaHLTR9Producer::EgammaHLTR9Producer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 26 of file EgammaHLTR9Producer.cc.
References conf_, ecalRechitEBTag_, ecalRechitEETag_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, and useSwissCross_.
: 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"); useSwissCross_ = conf_.getParameter< bool > ("useSwissCross"); //register your products produces < reco::RecoEcalCandidateIsolationMap >(); }
EgammaHLTR9Producer::~EgammaHLTR9Producer | ( | ) |
Definition at line 38 of file EgammaHLTR9Producer.cc.
{}
void EgammaHLTR9Producer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 47 of file EgammaHLTR9Producer.cc.
References EcalClusterLazyTools::e3x3(), ecalRechitEBTag_, ecalRechitEETag_, EcalClusterLazyTools::eMax(), first, edm::Event::getByLabel(), EcalClusterLazyTools::getMaximum(), edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, EcalSeverityLevelAlgo::swissCross(), and useSwissCross_.
{ // 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; if (useSwissCross_){ DetId maxEId = (lazyTools.getMaximum(*(recoecalcandref->superCluster()->seed()) )).first; //float EcalSeverityLevelAlgo::swissCross( const DetId id, const EcalRecHitCollection & recHits, float recHitEtThreshold ) edm::Handle< EcalRecHitCollection > pEBRecHits; iEvent.getByLabel( ecalRechitEBTag_, pEBRecHits ); r9 = EcalSeverityLevelAlgo::swissCross( maxEId, *(pEBRecHits.product()), 0. ); } else{ float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) ); if (e9 != 0 ) {r9 = lazyTools.eMax(*(recoecalcandref->superCluster()->seed()) )/e9;} } r9Map.insert(recoecalcandref, r9); } std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map)); iEvent.put(R9Map); }
edm::ParameterSet EgammaHLTR9Producer::conf_ [private] |
Definition at line 47 of file EgammaHLTR9Producer.h.
Referenced by EgammaHLTR9Producer().
Definition at line 43 of file EgammaHLTR9Producer.h.
Referenced by EgammaHLTR9Producer(), and produce().
Definition at line 44 of file EgammaHLTR9Producer.h.
Referenced by EgammaHLTR9Producer(), and produce().
Definition at line 42 of file EgammaHLTR9Producer.h.
Referenced by EgammaHLTR9Producer(), and produce().
bool EgammaHLTR9Producer::useSwissCross_ [private] |
Definition at line 45 of file EgammaHLTR9Producer.h.
Referenced by EgammaHLTR9Producer(), and produce().