CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ESRecHitProducer Class Reference
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
 
- 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< ESDigiCollectiondigiToken_
 
const std::string rechitCollection_
 
std::unique_ptr< ESRecHitWorkerBaseClassworker_
 

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 16 of file ESRecHitProducer.cc.

Constructor & Destructor Documentation

◆ ESRecHitProducer()

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

Definition at line 28 of file ESRecHitProducer.cc.

References get, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

29  : digiToken_(consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection"))),
30  rechitCollection_(ps.getParameter<std::string>("ESrechitCollection")),
31  worker_{ESRecHitWorkerFactory::get()->create(ps.getParameter<std::string>("algo"), ps, consumesCollector())} {
32  produces<ESRecHitCollection>(rechitCollection_);
33 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
const std::string rechitCollection_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
#define get

Member Function Documentation

◆ produce()

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

Definition at line 35 of file ESRecHitProducer.cc.

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

35  {
37  const ESDigiCollection* digi = nullptr;
38  e.getByToken(digiToken_, digiHandle);
39 
40  digi = digiHandle.product();
41  LogDebug("ESRecHitInfo") << "total # ESdigis: " << digi->size();
42 
43  // Create empty output
44  auto rec = std::make_unique<ESRecHitCollection>();
45 
46  if (digi) {
47  rec->reserve(digi->size());
48 
49  worker_->set(es);
50 
51  // run the algorithm
52  for (ESDigiCollection::const_iterator i(digi->begin()); i != digi->end(); i++) {
53  worker_->run(i, *rec);
54  }
55  }
56 
57  e.put(std::move(rec), rechitCollection_);
58 }
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
T const * product() const
Definition: Handle.h:70
const std::string rechitCollection_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
const_iterator end() const
const_iterator begin() const
The iterator returned can not safely be used across threads.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ digiToken_

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

Definition at line 22 of file ESRecHitProducer.cc.

Referenced by produce().

◆ rechitCollection_

const std::string ESRecHitProducer::rechitCollection_
private

Definition at line 23 of file ESRecHitProducer.cc.

Referenced by produce().

◆ worker_

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

Definition at line 25 of file ESRecHitProducer.cc.

Referenced by produce().