#include <ElectronSqPtTkIsolationProducer.h>
Public Member Functions | |
ElectronSqPtTkIsolationProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~ElectronSqPtTkIsolationProducer () | |
Private Attributes | |
bool | absolut_ |
edm::ParameterSet | conf_ |
edm::InputTag | electronProducer_ |
double | extRadius_ |
double | intRadius_ |
double | maxVtxDist_ |
double | ptMin_ |
edm::InputTag | trackProducer_ |
Definition at line 14 of file ElectronSqPtTkIsolationProducer.h.
ElectronSqPtTkIsolationProducer::ElectronSqPtTkIsolationProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 15 of file ElectronSqPtTkIsolationProducer.cc.
References absolut_, conf_, electronProducer_, extRadius_, edm::ParameterSet::getParameter(), intRadius_, maxVtxDist_, ptMin_, 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"); ptMin_ = conf_.getParameter<double>("ptMin"); intRadius_ = conf_.getParameter<double>("intRadius"); extRadius_ = conf_.getParameter<double>("extRadius"); maxVtxDist_ = conf_.getParameter<double>("maxVtxDist"); absolut_ = conf_.getParameter<bool>("absolut"); //register your products produces < reco::CandViewDoubleAssociations>(); }
ElectronSqPtTkIsolationProducer::~ElectronSqPtTkIsolationProducer | ( | ) |
Definition at line 34 of file ElectronSqPtTkIsolationProducer.cc.
{}
void ElectronSqPtTkIsolationProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 38 of file ElectronSqPtTkIsolationProducer.cc.
References absolut_, electronProducer_, funct::exp(), extRadius_, edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), ElectronSqPtTkIsolation::getPtTracks(), i, intRadius_, maxVtxDist_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), 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(); reco::CandViewDoubleAssociations* isoMap = new reco::CandViewDoubleAssociations(reco::GsfElectronRefProd( electronHandle )); ElectronSqPtTkIsolation myTkIsolation (extRadius_,intRadius_,ptMin_,maxVtxDist_,trackCollection) ; for(unsigned int i = 0 ; i < electronHandle->size(); ++i ){ double isoValue = myTkIsolation.getPtTracks(&(electronHandle->at(i))); if(absolut_==true){ isoMap->setValue(i,isoValue); } else{ reco::SuperClusterRef sc = (electronHandle->at(i)).superCluster(); double et = sc.get()->energy()*sin(2*atan(exp(-sc.get()->eta()))); isoMap->setValue(i,isoValue/et); } } std::auto_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap); iEvent.put(isolMap); }
bool ElectronSqPtTkIsolationProducer::absolut_ [private] |
Definition at line 30 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().
Definition at line 32 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer().
Definition at line 22 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().
double ElectronSqPtTkIsolationProducer::extRadius_ [private] |
Definition at line 27 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().
double ElectronSqPtTkIsolationProducer::intRadius_ [private] |
Definition at line 26 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().
double ElectronSqPtTkIsolationProducer::maxVtxDist_ [private] |
Definition at line 28 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().
double ElectronSqPtTkIsolationProducer::ptMin_ [private] |
Definition at line 25 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().
Definition at line 23 of file ElectronSqPtTkIsolationProducer.h.
Referenced by ElectronSqPtTkIsolationProducer(), and produce().