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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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::ESRecHitProducer ( const edm::ParameterSet ps)
explicit

Definition at line 15 of file ESRecHitProducer.cc.

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  produces<ESRecHitCollection>(rechitCollection_);
20 }

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

◆ ~ESRecHitProducer()

ESRecHitProducer::~ESRecHitProducer ( )
overridedefault

Member Function Documentation

◆ produce()

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

Definition at line 24 of file ESRecHitProducer.cc.

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 
46  e.put(std::move(rec), rechitCollection_);
47 }

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_.

Member Data Documentation

◆ digiToken_

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

Definition at line 24 of file ESRecHitProducer.h.

Referenced by produce().

◆ rechitCollection_

const std::string ESRecHitProducer::rechitCollection_
private

Definition at line 25 of file ESRecHitProducer.h.

Referenced by produce().

◆ worker_

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

Definition at line 27 of file ESRecHitProducer.h.

Referenced by produce().

mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
edm::Handle
Definition: AssociativeIterator.h:50
ESDigiCollection
Definition: EcalDigiCollections.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ESRecHitProducer::worker_
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
Definition: ESRecHitProducer.h:27
ESRecHitProducer::rechitCollection_
const std::string rechitCollection_
Definition: ESRecHitProducer.h:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
ESRecHitProducer::digiToken_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
Definition: ESRecHitProducer.h:24
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37