#include <RecoLocalCalo/EcalRecProducers/interface/ESRecHitProducer.h>
Public Member Functions | |
ESRecHitProducer (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &es) |
virtual | ~ESRecHitProducer () |
Private Attributes | |
ESRecHitSimAlgo * | algo_ |
edm::InputTag | digiCollection_ |
std::string | rechitCollection_ |
Definition at line 14 of file ESRecHitProducer.h.
ESRecHitProducer::ESRecHitProducer | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 14 of file ESRecHitProducer.cc.
References algo_, digiCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and rechitCollection_.
00015 { 00016 digiCollection_ = ps.getParameter<edm::InputTag>("ESdigiCollection"); 00017 rechitCollection_ = ps.getParameter<std::string>("ESrechitCollection"); 00018 produces<ESRecHitCollection>(rechitCollection_); 00019 00020 //These should be taken from a DB 00021 int ESGain = ps.getUntrackedParameter<int>("ESGain", 1); 00022 int ESBaseline = ps.getUntrackedParameter<int>("ESBaseline", 1000); 00023 double ESMIPADC = ps.getUntrackedParameter<double>("ESMIPADC", 9); 00024 double ESMIPkeV = ps.getUntrackedParameter<double>("ESMIPkeV", 81.08); 00025 00026 algo_ = new ESRecHitSimAlgo(ESGain, ESBaseline, ESMIPADC, ESMIPkeV); 00027 }
ESRecHitProducer::~ESRecHitProducer | ( | ) | [virtual] |
Definition at line 29 of file ESRecHitProducer.cc.
References algo_.
00029 { 00030 delete algo_; 00031 }
void ESRecHitProducer::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | es | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 33 of file ESRecHitProducer.cc.
References algo_, edm::SortedCollection< T, SORT >::begin(), digiCollection_, edm::SortedCollection< T, SORT >::end(), edm::Event::getByLabel(), i, edm::Handle< T >::product(), edm::Event::put(), rechitCollection_, ESRecHitSimAlgo::reconstruct(), and edm::SortedCollection< T, SORT >::size().
00034 { 00035 // Get input 00036 edm::Handle<ESDigiCollection> digiHandle; 00037 const ESDigiCollection* digi=0; 00038 //evt.getByLabel( digiProducer_, digiCollection_, pDigis); 00039 e.getByLabel( digiCollection_, digiHandle); 00040 digi=digiHandle.product(); 00041 00042 edm::LogInfo("ESRecHitInfo") << "total # ESdigis: " << digi->size() ; 00043 // Create empty output 00044 std::auto_ptr<ESRecHitCollection> rec(new EcalRecHitCollection()); 00045 00046 // run the algorithm 00047 ESDigiCollection::const_iterator i; 00048 for (i=digi->begin(); i!=digi->end(); i++) { 00049 rec->push_back(algo_->reconstruct(*i)); 00050 } 00051 00052 e.put(rec,rechitCollection_); 00053 }
ESRecHitSimAlgo* ESRecHitProducer::algo_ [private] |
Definition at line 27 of file ESRecHitProducer.h.
Referenced by ESRecHitProducer(), produce(), and ~ESRecHitProducer().
std::string ESRecHitProducer::rechitCollection_ [private] |