CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const edm::EDGetTokenT
< ESDigiCollection
digiToken_
 
const std::string rechitCollection_
 
std::unique_ptr
< ESRecHitWorkerBaseClass
worker_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 get, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

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, consumesCollector())} {
19  produces<ESRecHitCollection>(rechitCollection_);
20 }
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
const std::string rechitCollection_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define get
ESRecHitProducer::~ESRecHitProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 24 of file ESRecHitProducer.cc.

References edm::DataFrameContainer::begin(), 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_.

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

Member Data Documentation

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

Definition at line 24 of file ESRecHitProducer.h.

Referenced by produce().

const std::string ESRecHitProducer::rechitCollection_
private

Definition at line 25 of file ESRecHitProducer.h.

Referenced by produce().

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

Definition at line 27 of file ESRecHitProducer.h.

Referenced by produce().