#include <EgammaElectronTkNumIsolationProducer.h>
Public Member Functions | |
EgammaElectronTkNumIsolationProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaElectronTkNumIsolationProducer () | |
Private Attributes | |
edm::InputTag | beamspotProducer_ |
edm::ParameterSet | conf_ |
double | drb_ |
edm::InputTag | electronProducer_ |
double | extRadius_ |
double | intRadiusBarrel_ |
double | intRadiusEndcap_ |
double | maxVtxDist_ |
double | ptMin_ |
double | stripBarrel_ |
double | stripEndcap_ |
edm::InputTag | trackProducer_ |
Definition at line 23 of file EgammaElectronTkNumIsolationProducer.h.
EgammaElectronTkNumIsolationProducer::EgammaElectronTkNumIsolationProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 27 of file EgammaElectronTkNumIsolationProducer.cc.
References beamspotProducer_, conf_, drb_, electronProducer_, extRadius_, edm::ParameterSet::getParameter(), intRadiusBarrel_, intRadiusEndcap_, maxVtxDist_, ptMin_, stripBarrel_, stripEndcap_, and trackProducer_.
: conf_(config) { // use configuration file to setup input/output collection names electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer"); trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer"); beamspotProducer_ = conf_.getParameter<edm::InputTag>("BeamspotProducer"); ptMin_ = conf_.getParameter<double>("ptMin"); intRadiusBarrel_ = conf_.getParameter<double>("intRadiusBarrel"); intRadiusEndcap_ = conf_.getParameter<double>("intRadiusEndcap"); stripBarrel_ = conf_.getParameter<double>("stripBarrel"); stripEndcap_ = conf_.getParameter<double>("stripEndcap"); extRadius_ = conf_.getParameter<double>("extRadius"); maxVtxDist_ = conf_.getParameter<double>("maxVtxDist"); drb_ = conf_.getParameter<double>("maxVtxDistXY"); //register your products produces < edm::ValueMap<int> >(); }
EgammaElectronTkNumIsolationProducer::~EgammaElectronTkNumIsolationProducer | ( | ) |
Definition at line 49 of file EgammaElectronTkNumIsolationProducer.cc.
{}
void EgammaElectronTkNumIsolationProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 53 of file EgammaElectronTkNumIsolationProducer.cc.
References ExpressReco_HICollisions_FallBack::beamspot, beamspotProducer_, drb_, electronProducer_, extRadius_, edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), ElectronTkIsolation::getNumberTracks(), i, edm::helper::Filler< Map >::insert(), intRadiusBarrel_, intRadiusEndcap_, maxVtxDist_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), stripBarrel_, stripEndcap_, ExpressReco_HICollisions_FallBack::trackCollection, trackProducer_, and testEve_cfg::tracks.
{ // Get the filtered objects edm::Handle< reco::GsfElectronCollection> electronHandle; iEvent.getByLabel(electronProducer_,electronHandle); //get the tracks edm::Handle<reco::TrackCollection> tracks; iEvent.getByLabel(trackProducer_,tracks); const reco::TrackCollection* trackCollection = tracks.product(); //prepare product std::auto_ptr<edm::ValueMap<int> > isoMap(new edm::ValueMap<int>()); edm::ValueMap<int>::Filler filler(*isoMap); std::vector<int> retV(electronHandle->size(),0); //get beamspot edm::Handle<reco::BeamSpot> beamSpotH; iEvent.getByLabel(beamspotProducer_,beamSpotH); reco::TrackBase::Point beamspot = beamSpotH->position(); ElectronTkIsolation myTkIsolation (extRadius_,intRadiusBarrel_,intRadiusEndcap_,stripBarrel_,stripEndcap_,ptMin_,maxVtxDist_,drb_,trackCollection,beamspot) ; for(unsigned int i = 0 ; i < electronHandle->size(); ++i ){ int isoValue = myTkIsolation.getNumberTracks(&(electronHandle->at(i))); retV[i] = isoValue; } //fill and insert valuemap filler.insert(electronHandle,retV.begin(),retV.end()); filler.fill(); iEvent.put(isoMap); }
Definition at line 34 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
Definition at line 45 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer().
double EgammaElectronTkNumIsolationProducer::drb_ [private] |
Definition at line 43 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
Definition at line 32 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::extRadius_ [private] |
Definition at line 41 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::intRadiusBarrel_ [private] |
Definition at line 37 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::intRadiusEndcap_ [private] |
Definition at line 38 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::maxVtxDist_ [private] |
Definition at line 42 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::ptMin_ [private] |
Definition at line 36 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::stripBarrel_ [private] |
Definition at line 39 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
double EgammaElectronTkNumIsolationProducer::stripEndcap_ [private] |
Definition at line 40 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().
Definition at line 33 of file EgammaElectronTkNumIsolationProducer.h.
Referenced by EgammaElectronTkNumIsolationProducer(), and produce().