#include <EgammaAnalysis/EgammaIsolationProducers/interface/EgammaElectronTkIsolationProducer.h>
Public Member Functions | |
EgammaElectronTkIsolationProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaElectronTkIsolationProducer () | |
Private Attributes | |
bool | absolut_ |
edm::ParameterSet | conf_ |
edm::InputTag | electronProducer_ |
double | extRadius_ |
double | intRadius_ |
double | maxVtxDist_ |
double | ptMin_ |
edm::InputTag | trackProducer_ |
Definition at line 20 of file EgammaElectronTkIsolationProducer.h.
EgammaElectronTkIsolationProducer::EgammaElectronTkIsolationProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 25 of file EgammaElectronTkIsolationProducer.cc.
References absolut_, 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 absolut_ = conf_.getParameter<bool>("absolut"); 00038 00039 //register your products 00040 produces < reco::CandViewDoubleAssociations>(); 00041 00042 }
EgammaElectronTkIsolationProducer::~EgammaElectronTkIsolationProducer | ( | ) |
void EgammaElectronTkIsolationProducer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 48 of file EgammaElectronTkIsolationProducer.cc.
References absolut_, electronProducer_, funct::exp(), extRadius_, edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), ElectronTkIsolation::getPtTracks(), i, intRadius_, maxVtxDist_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), trackProducer_, and tracks.
00049 { 00050 // Get the filtered objects 00051 edm::Handle< reco::PixelMatchGsfElectronCollection> electronHandle; 00052 iEvent.getByLabel(electronProducer_,electronHandle); 00053 00054 //get the tracks 00055 edm::Handle<reco::TrackCollection> tracks; 00056 iEvent.getByLabel(trackProducer_,tracks); 00057 const reco::TrackCollection* trackCollection = tracks.product(); 00058 00059 reco::CandViewDoubleAssociations* isoMap = new reco::CandViewDoubleAssociations(reco::PixelMatchGsfElectronRefProd( electronHandle )); 00060 00061 ElectronTkIsolation myTkIsolation (extRadius_,intRadius_,ptMin_,maxVtxDist_,trackCollection) ; 00062 00063 for(unsigned int i = 0 ; i < electronHandle->size(); ++i ){ 00064 double isoValue = myTkIsolation.getPtTracks(&(electronHandle->at(i))); 00065 if(absolut_==true){ 00066 isoMap->setValue(i,isoValue); 00067 } 00068 else{ 00069 reco::SuperClusterRef sc = (electronHandle->at(i)).superCluster(); 00070 double et = sc.get()->energy()*sin(2*atan(exp(-sc.get()->eta()))); 00071 isoMap->setValue(i,isoValue/et); 00072 } 00073 } 00074 00075 std::auto_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap); 00076 iEvent.put(isolMap); 00077 }
Definition at line 36 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().
Definition at line 38 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer().
Definition at line 28 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().
double EgammaElectronTkIsolationProducer::extRadius_ [private] |
Definition at line 33 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().
double EgammaElectronTkIsolationProducer::intRadius_ [private] |
Definition at line 32 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().
double EgammaElectronTkIsolationProducer::maxVtxDist_ [private] |
Definition at line 34 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().
double EgammaElectronTkIsolationProducer::ptMin_ [private] |
Definition at line 31 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().
Definition at line 29 of file EgammaElectronTkIsolationProducer.h.
Referenced by EgammaElectronTkIsolationProducer(), and produce().