#include <EgammaAnalysis/EgammaIsolationProducers/interface/EgammaElectronTkNumIsolationProducer.h>
Public Member Functions | |
EgammaElectronTkNumIsolationProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaElectronTkNumIsolationProducer () | |
Private Attributes | |
edm::ParameterSet | conf_ |
edm::InputTag | electronProducer_ |
double | extRadius_ |
double | intRadius_ |
double | maxVtxDist_ |
double | ptMin_ |
edm::InputTag | trackProducer_ |
Definition at line 23 of file EgammaElectronTkNumIsolationProducer.h.
EgammaElectronTkNumIsolationProducer::EgammaElectronTkNumIsolationProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 25 of file EgammaElectronTkNumIsolationProducer.cc.
References conf_, electronProducer_, extRadius_, edm::ParameterSet::getParameter(), intRadius_, maxVtxDist_, ptMin_, and trackProducer_.
00025 : conf_(config) 00026 { 00027 // use configuration file to setup input/output collection names 00028 electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer"); 00029 00030 trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer"); 00031 00032 ptMin_ = conf_.getParameter<double>("ptMin"); 00033 intRadius_ = conf_.getParameter<double>("intRadius"); 00034 extRadius_ = conf_.getParameter<double>("extRadius"); 00035 maxVtxDist_ = conf_.getParameter<double>("maxVtxDist"); 00036 00037 //register your products 00038 produces < reco::CandViewDoubleAssociations>(); 00039 00040 }
EgammaElectronTkNumIsolationProducer::~EgammaElectronTkNumIsolationProducer | ( | ) |
void EgammaElectronTkNumIsolationProducer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 46 of file EgammaElectronTkNumIsolationProducer.cc.
References electronProducer_, extRadius_, edm::Event::getByLabel(), ElectronTkIsolation::getNumberTracks(), i, intRadius_, maxVtxDist_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), trackProducer_, and tracks.
00047 { 00048 // Get the filtered objects 00049 edm::Handle< reco::PixelMatchGsfElectronCollection> electronHandle; 00050 iEvent.getByLabel(electronProducer_,electronHandle); 00051 00052 //get the tracks 00053 edm::Handle<reco::TrackCollection> tracks; 00054 iEvent.getByLabel(trackProducer_,tracks); 00055 const reco::TrackCollection* trackCollection = tracks.product(); 00056 00057 reco::CandViewDoubleAssociations* isoMap = new reco::CandViewDoubleAssociations(reco::PixelMatchGsfElectronRefProd( electronHandle )); 00058 00059 ElectronTkIsolation myTkIsolation (extRadius_,intRadius_,ptMin_,maxVtxDist_,trackCollection) ; 00060 00061 for(unsigned int i = 0 ; i < electronHandle->size(); ++i ){ 00062 int isoValue = myTkIsolation.getNumberTracks(&(electronHandle->at(i))); 00063 isoMap->setValue(i,isoValue); 00064 } 00065 00066 std::auto_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap); 00067 iEvent.put(isolMap); 00068 }
Definition at line 40 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer().
Definition at line 32 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::extRadius_ [private] |
Definition at line 37 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::intRadius_ [private] |
Definition at line 36 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::maxVtxDist_ [private] |
Definition at line 38 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::ptMin_ [private] |
Definition at line 35 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
Definition at line 33 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().