#include <EgammaTowerIsolationProducer.h>
Public Member Functions | |
EgammaTowerIsolationProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaTowerIsolationProducer () | |
Private Attributes | |
edm::ParameterSet | conf_ |
signed int | egHcalDepth_ |
double | egHcalIsoConeSizeIn_ |
double | egHcalIsoConeSizeOut_ |
double | egHcalIsoPtMin_ |
edm::InputTag | emObjectProducer_ |
edm::InputTag | towerProducer_ |
Definition at line 34 of file EgammaTowerIsolationProducer.h.
EgammaTowerIsolationProducer::EgammaTowerIsolationProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 24 of file EgammaTowerIsolationProducer.cc.
References conf_, egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, edm::ParameterSet::getParameter(), and towerProducer_.
: conf_(config) { // use configuration file to setup input/output collection names emObjectProducer_ = conf_.getParameter<edm::InputTag>("emObjectProducer"); towerProducer_ = conf_.getParameter<edm::InputTag>("towerProducer"); egHcalIsoPtMin_ = conf_.getParameter<double>("etMin"); egHcalIsoConeSizeIn_ = conf_.getParameter<double>("intRadius"); egHcalIsoConeSizeOut_ = conf_.getParameter<double>("extRadius"); egHcalDepth_ = conf_.getParameter<int>("Depth"); //register your products produces < edm::ValueMap<double> >(); }
EgammaTowerIsolationProducer::~EgammaTowerIsolationProducer | ( | ) |
Definition at line 42 of file EgammaTowerIsolationProducer.cc.
{}
void EgammaTowerIsolationProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 51 of file EgammaTowerIsolationProducer.cc.
References egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), i, edm::helper::Filler< Map >::insert(), edm::Handle< T >::product(), edm::Event::put(), and towerProducer_.
{ // Get the filtered objects edm::Handle< edm::View<reco::Candidate> > emObjectHandle; iEvent.getByLabel(emObjectProducer_,emObjectHandle); // Get the barrel hcal hits edm::Handle<CaloTowerCollection> towerHandle; iEvent.getByLabel(towerProducer_, towerHandle); const CaloTowerCollection* towers = towerHandle.product(); std::auto_ptr<edm::ValueMap<double> > isoMap(new edm::ValueMap<double>()); edm::ValueMap<double>::Filler filler(*isoMap); std::vector<double> retV(emObjectHandle->size(),0); EgammaTowerIsolation myHadIsolation(egHcalIsoConeSizeOut_, egHcalIsoConeSizeIn_, egHcalIsoPtMin_, egHcalDepth_, towers) ; for( size_t i = 0 ; i < emObjectHandle->size(); ++i) { double isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(i))); retV[i]=isoValue; } filler.insert(emObjectHandle,retV.begin(),retV.end()); filler.fill(); iEvent.put(isoMap); }
Definition at line 52 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer().
signed int EgammaTowerIsolationProducer::egHcalDepth_ [private] |
Definition at line 50 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer(), and produce().
double EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_ [private] |
Definition at line 49 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer(), and produce().
double EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_ [private] |
Definition at line 48 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer(), and produce().
double EgammaTowerIsolationProducer::egHcalIsoPtMin_ [private] |
Definition at line 47 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer(), and produce().
Definition at line 44 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer(), and produce().
Definition at line 45 of file EgammaTowerIsolationProducer.h.
Referenced by EgammaTowerIsolationProducer(), and produce().