CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ESRecHitProducer Class Reference

#include <ESRecHitProducer.h>

Inheritance diagram for ESRecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 ESRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
 ~ESRecHitProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

const edm::EDGetTokenT< ESDigiCollectiondigiToken_
 
const std::string rechitCollection_
 
std::unique_ptr< ESRecHitWorkerBaseClassworker_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 17 of file ESRecHitProducer.h.

Constructor & Destructor Documentation

ESRecHitProducer::ESRecHitProducer ( const edm::ParameterSet ps)
explicit

Definition at line 15 of file ESRecHitProducer.cc.

References reco::get(), edm::ParameterSet::getParameter(), rechitCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and ~ESRecHitProducer().

15  :
16  digiToken_( consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection")) ),
17  rechitCollection_( ps.getParameter<std::string>("ESrechitCollection") ),
18  worker_{ESRecHitWorkerFactory::get()->create(ps.getParameter<std::string>("algo"), ps )}
19 {
20  produces<ESRecHitCollection>(rechitCollection_);
21 }
T getParameter(std::string const &) const
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
const std::string rechitCollection_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T get(const Candidate &c)
Definition: component.h:55
ESRecHitProducer::~ESRecHitProducer ( )
overridedefault

Referenced by ESRecHitProducer().

Member Function Documentation

void ESRecHitProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 25 of file ESRecHitProducer.cc.

References edm::DataFrameContainer::begin(), DEFINE_FWK_MODULE, digiToken_, edm::DataFrameContainer::end(), edm::Event::getByToken(), mps_fire::i, LogDebug, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), rechitCollection_, edm::DataFrameContainer::size(), and worker_.

25  {
26 
28  const ESDigiCollection* digi=nullptr;
29  e.getByToken( digiToken_, digiHandle);
30 
31  digi = digiHandle.product();
32  LogDebug("ESRecHitInfo") << "total # ESdigis: " << digi->size();
33 
34  // Create empty output
35  auto rec = std::make_unique<ESRecHitCollection>();
36 
37  if ( digi ) {
38  rec->reserve(digi->size());
39 
40  worker_->set( es );
41 
42  // run the algorithm
44  i!=digi->end(); i++) {
45  worker_->run( i, *rec );
46  }
47  }
48 
50 }
#define LogDebug(id)
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const_iterator begin() const
const std::string rechitCollection_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T const * product() const
Definition: Handle.h:74
const_iterator end() const
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const edm::EDGetTokenT<ESDigiCollection> ESRecHitProducer::digiToken_
private

Definition at line 27 of file ESRecHitProducer.h.

Referenced by produce().

const std::string ESRecHitProducer::rechitCollection_
private

Definition at line 28 of file ESRecHitProducer.h.

Referenced by ESRecHitProducer(), and produce().

std::unique_ptr<ESRecHitWorkerBaseClass> ESRecHitProducer::worker_
private

Definition at line 30 of file ESRecHitProducer.h.

Referenced by produce().