#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::InputTag | beamSpotProducer_ |
double | egTrkIsoConeSize_ |
double | egTrkIsoPtMin_ |
double | egTrkIsoRSpan_ |
double | egTrkIsoStripBarrel_ |
double | egTrkIsoStripEndcap_ |
double | egTrkIsoVetoConeSizeBarrel_ |
double | egTrkIsoVetoConeSizeEndcap_ |
double | egTrkIsoZSpan_ |
edm::InputTag | electronProducer_ |
edm::InputTag | recoEcalCandidateProducer_ |
edm::InputTag | trackProducer_ |
bool | useGsfTrack_ |
bool | useSCRefs_ |
Definition at line 34 of file EgammaHLTElectronTrackIsolationProducers.h.
EgammaHLTElectronTrackIsolationProducers::EgammaHLTElectronTrackIsolationProducers | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 34 of file EgammaHLTElectronTrackIsolationProducers.cc.
References beamSpotProducer_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSizeBarrel_, egTrkIsoVetoConeSizeEndcap_, egTrkIsoZSpan_, electronProducer_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, trackProducer_, useGsfTrack_, and useSCRefs_.
{ electronProducer_ = config.getParameter<edm::InputTag>("electronProducer"); trackProducer_ = config.getParameter<edm::InputTag>("trackProducer"); recoEcalCandidateProducer_ = config.getParameter<edm::InputTag>("recoEcalCandidateProducer"); beamSpotProducer_ = config.getParameter<edm::InputTag>("beamSpotProducer"); useGsfTrack_ = config.getParameter<bool>("useGsfTrack"); useSCRefs_ = config.getParameter<bool>("useSCRefs"); egTrkIsoPtMin_ = config.getParameter<double>("egTrkIsoPtMin"); egTrkIsoConeSize_ = config.getParameter<double>("egTrkIsoConeSize"); egTrkIsoZSpan_ = config.getParameter<double>("egTrkIsoZSpan"); egTrkIsoRSpan_ = config.getParameter<double>("egTrkIsoRSpan"); egTrkIsoVetoConeSizeBarrel_ = config.getParameter<double>("egTrkIsoVetoConeSizeBarrel"); egTrkIsoVetoConeSizeEndcap_ = config.getParameter<double>("egTrkIsoVetoConeSizeEndcap"); // egCheckForOtherEleInCone_ = config.getUntrackedParameter<bool>("egCheckForOtherEleInCone",false); egTrkIsoStripBarrel_ = config.getParameter<double>("egTrkIsoStripBarrel"); egTrkIsoStripEndcap_ = config.getParameter<double>("egTrkIsoStripEndcap"); //register your products if(useSCRefs_) produces < reco::RecoEcalCandidateIsolationMap >(); else produces < reco::ElectronIsolationMap >(); }
EgammaHLTElectronTrackIsolationProducers::~EgammaHLTElectronTrackIsolationProducers | ( | ) |
Definition at line 64 of file EgammaHLTElectronTrackIsolationProducers.cc.
{}
void EgammaHLTElectronTrackIsolationProducers::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 73 of file EgammaHLTElectronTrackIsolationProducers.cc.
References beamSpotProducer_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSizeBarrel_, egTrkIsoVetoConeSizeEndcap_, egTrkIsoZSpan_, electronProducer_, edm::Event::getByLabel(), ElectronTkIsolation::getIso(), edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, trackProducer_, useGsfTrack_, and useSCRefs_.
{ 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 eleMap; reco::RecoEcalCandidateIsolationMap recoEcalCandMap; edm::Handle<reco::BeamSpot> recoBeamSpotHandle; iEvent.getByLabel(beamSpotProducer_,recoBeamSpotHandle); const reco::BeamSpot::Point& beamSpotPosition = recoBeamSpotHandle->position(); ElectronTkIsolation isoAlgo(egTrkIsoConeSize_,egTrkIsoVetoConeSizeBarrel_,egTrkIsoVetoConeSizeEndcap_,egTrkIsoStripBarrel_,egTrkIsoStripEndcap_,egTrkIsoPtMin_, egTrkIsoZSpan_ ,egTrkIsoRSpan_,trackCollection,beamSpotPosition); if(useSCRefs_){ edm::Handle<reco::RecoEcalCandidateCollection> recoEcalCandHandle; iEvent.getByLabel(recoEcalCandidateProducer_,recoEcalCandHandle); for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){ reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle,iRecoEcalCand-recoEcalCandHandle->begin()); reco::ElectronRef eleRef; for(reco::ElectronCollection::const_iterator eleIt = electronHandle->begin(); eleIt != electronHandle->end(); eleIt++){ if(eleIt->superCluster()==recoEcalCandRef->superCluster()){ eleRef = reco::ElectronRef(electronHandle,eleIt - electronHandle->begin()); break; } } float isol=999999; if(eleRef.isNonnull()){ const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track(); isol = isoAlgo.getIso(eleTrk).second; } recoEcalCandMap.insert(recoEcalCandRef,isol); }//end reco ecal candidate ref }else{ //we are going to loop over electron instead for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){ reco::ElectronRef eleRef(reco::ElectronRef(electronHandle,iElectron - electronHandle->begin())); const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track(); float isol = isoAlgo.getIso(eleTrk).second; eleMap.insert(eleRef, isol); } } if(useSCRefs_){ std::auto_ptr<reco::RecoEcalCandidateIsolationMap> mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap)); iEvent.put(mapForEvent); }else{ std::auto_ptr<reco::ElectronIsolationMap> mapForEvent(new reco::ElectronIsolationMap(eleMap)); iEvent.put(mapForEvent); } }
Definition at line 47 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoConeSize_ [private] |
Definition at line 53 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoPtMin_ [private] |
Definition at line 52 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoRSpan_ [private] |
Definition at line 55 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripBarrel_ [private] |
Definition at line 58 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripEndcap_ [private] |
Definition at line 59 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
Definition at line 56 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
Definition at line 57 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoZSpan_ [private] |
Definition at line 54 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
Definition at line 44 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
Definition at line 46 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
Definition at line 45 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
bool EgammaHLTElectronTrackIsolationProducers::useGsfTrack_ [private] |
Definition at line 49 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().
bool EgammaHLTElectronTrackIsolationProducers::useSCRefs_ [private] |
Definition at line 50 of file EgammaHLTElectronTrackIsolationProducers.h.
Referenced by EgammaHLTElectronTrackIsolationProducers(), and produce().