CMS 3D CMS Logo

ESRecHitProducer Class Reference

#include <RecoLocalCalo/EcalRecProducers/interface/ESRecHitProducer.h>

Inheritance diagram for ESRecHitProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 ESRecHitProducer (const edm::ParameterSet &ps)
virtual void produce (edm::Event &e, const edm::EventSetup &es)
virtual ~ESRecHitProducer ()

Private Attributes

ESRecHitSimAlgoalgo_
edm::InputTag digiCollection_
std::string rechitCollection_


Detailed Description

Definition at line 14 of file ESRecHitProducer.h.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


Member Data Documentation

ESRecHitSimAlgo* ESRecHitProducer::algo_ [private]

Definition at line 27 of file ESRecHitProducer.h.

Referenced by ESRecHitProducer(), produce(), and ~ESRecHitProducer().

edm::InputTag ESRecHitProducer::digiCollection_ [private]

Definition at line 24 of file ESRecHitProducer.h.

Referenced by ESRecHitProducer(), and produce().

std::string ESRecHitProducer::rechitCollection_ [private]

Definition at line 25 of file ESRecHitProducer.h.

Referenced by ESRecHitProducer(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:25 2009 for CMSSW by  doxygen 1.5.4