#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTElectronTrackIsolationProducers.h>
Public Member Functions | |
EgammaHLTElectronTrackIsolationProducers (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaHLTElectronTrackIsolationProducers () | |
Private Attributes | |
edm::ParameterSet | conf_ |
bool | egCheckForOtherEleInCone_ |
double | egTrkIsoConeSize_ |
double | egTrkIsoPtMin_ |
double | egTrkIsoRSpan_ |
double | egTrkIsoVetoConeSize_ |
double | egTrkIsoZSpan_ |
edm::InputTag | electronProducer_ |
EgammaHLTTrackIsolation * | test_ |
edm::InputTag | trackProducer_ |
Definition at line 34 of file EgammaHLTElectronTrackIsolationProducers.h.
EgammaHLTElectronTrackIsolationProducers::EgammaHLTElectronTrackIsolationProducers | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 33 of file EgammaHLTElectronTrackIsolationProducers.cc.
References conf_, egCheckForOtherEleInCone_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoVetoConeSize_, egTrkIsoZSpan_, electronProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), test_, and trackProducer_.
: conf_(config) { electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer"); trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer"); egTrkIsoPtMin_ = conf_.getParameter<double>("egTrkIsoPtMin"); egTrkIsoConeSize_ = conf_.getParameter<double>("egTrkIsoConeSize"); egTrkIsoZSpan_ = conf_.getParameter<double>("egTrkIsoZSpan"); egTrkIsoRSpan_ = conf_.getParameter<double>("egTrkIsoRSpan"); egTrkIsoVetoConeSize_ = conf_.getParameter<double>("egTrkIsoVetoConeSize"); egCheckForOtherEleInCone_ = conf_.getUntrackedParameter<bool>("egCheckForOtherEleInCone",false); double egTrkIsoStripBarrel = conf_.getParameter<double>("egTrkIsoStripBarrel"); double egTrkIsoStripEndcap = conf_.getParameter<double>("egTrkIsoStripEndcap"); test_ = new EgammaHLTTrackIsolation(egTrkIsoPtMin_,egTrkIsoConeSize_, egTrkIsoZSpan_,egTrkIsoRSpan_,egTrkIsoVetoConeSize_,egTrkIsoStripBarrel,egTrkIsoStripEndcap); //register your products produces < reco::ElectronIsolationMap >(); }
EgammaHLTElectronTrackIsolationProducers::~EgammaHLTElectronTrackIsolationProducers | ( | ) |
Definition at line 58 of file EgammaHLTElectronTrackIsolationProducers.cc.
References test_.
{delete test_;}
void EgammaHLTElectronTrackIsolationProducers::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 67 of file EgammaHLTElectronTrackIsolationProducers.cc.
References egCheckForOtherEleInCone_, electronProducer_, EgammaHLTTrackIsolation::electronPtSum(), edm::Event::getByLabel(), edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), edm::Event::put(), test_, and trackProducer_.
{ // Get the HLT filtered objects edm::Handle<reco::ElectronCollection> electronHandle; iEvent.getByLabel(electronProducer_,electronHandle); // Get the general tracks edm::Handle<reco::TrackCollection> trackHandle; iEvent.getByLabel(trackProducer_, trackHandle); const reco::TrackCollection* trackCollection = trackHandle.product(); reco::ElectronIsolationMap isoMap; for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){ reco::ElectronRef electronref(reco::ElectronRef(electronHandle,iElectron - electronHandle->begin())); reco::TrackRef electrontrackref = iElectron->track(); float isol; if (!egCheckForOtherEleInCone_) { isol = test_->electronPtSum(&(*electrontrackref),trackCollection); } else { isol = test_->electronPtSum(&(*electrontrackref),electronHandle.product(),trackCollection); } //if(electronref->pt() != 0. ) isol = isol/electronref->pt(); isoMap.insert(electronref, isol); } std::auto_ptr<reco::ElectronIsolationMap> isolMap(new reco::ElectronIsolationMap(isoMap)); iEvent.put(isolMap); }
Definition at line 47 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers().
Definition at line 54 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoConeSize_ [private] |
Definition at line 50 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoPtMin_ [private] |
Definition at line 49 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoRSpan_ [private] |
Definition at line 52 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSize_ [private] |
Definition at line 53 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoZSpan_ [private] |
Definition at line 51 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers().
Definition at line 44 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
Definition at line 56 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), produce(), and ~EgammaHLTElectronTrackIsolationProducers().
Definition at line 45 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().