CMS 3D CMS Logo

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

#include <HGCalUncalibRecHitProducer.h>

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

Public Member Functions

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

Private Attributes

const edm::EDGetTokenT< HGCalDigiCollectioneeDigiCollection_
 
const std::string eeHitCollection_
 
edm::EDGetTokenT< HGCalDigiCollectionhebDigiCollection_
 
const std::string hebHitCollection_
 
const edm::EDGetTokenT< HGCalDigiCollectionhefDigiCollection_
 
const std::string hefHitCollection_
 
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClassworker_
 

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 14 of file HGCalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file HGCalUncalibRecHitProducer.cc.

References eeHitCollection_, reco::get(), edm::ParameterSet::getParameter(), hebHitCollection_, hefHitCollection_, and AlCaHLTBitMon_QueryRunRegistry::string.

12  :
13  eeDigiCollection_( consumes<HGCalDigiCollection>( ps.getParameter<edm::InputTag>("HGCEEdigiCollection") ) ),
14  hefDigiCollection_( consumes<HGCalDigiCollection>( ps.getParameter<edm::InputTag>("HGCHEFdigiCollection") ) ),
15  hebDigiCollection_( consumes<HGCalDigiCollection>( ps.getParameter<edm::InputTag>("HGCHEBdigiCollection") ) ),
16  eeHitCollection_( ps.getParameter<std::string>("HGCEEhitCollection") ),
17  hefHitCollection_( ps.getParameter<std::string>("HGCHEFhitCollection") ),
18  hebHitCollection_( ps.getParameter<std::string>("HGCHEBhitCollection") ),
20 {
21 
22  produces< HGCeeUncalibratedRecHitCollection >(eeHitCollection_);
23  produces< HGChefUncalibratedRecHitCollection >(hefHitCollection_);
24  produces< HGChebUncalibratedRecHitCollection >(hebHitCollection_);
25 
26 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
T get(const Candidate &c)
Definition: component.h:55
HGCalUncalibRecHitProducer::~HGCalUncalibRecHitProducer ( )
override

Definition at line 28 of file HGCalUncalibRecHitProducer.cc.

28  {
29 }

Member Function Documentation

void HGCalUncalibRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 32 of file HGCalUncalibRecHitProducer.cc.

References edm::SortedCollection< T, SORT >::begin(), DEFINE_FWK_MODULE, eeDigiCollection_, eeHitCollection_, edm::SortedCollection< T, SORT >::end(), edm::Event::getByToken(), hebDigiCollection_, hebHitCollection_, hefDigiCollection_, hefHitCollection_, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), edm::SortedCollection< T, SORT >::reserve(), edm::SortedCollection< T, SORT >::size(), and worker_.

32  {
33  using namespace edm;
34 
35 
36 
37  // tranparently get things from event setup
38  worker_->set(es);
39 
40  // prepare output
41  auto eeUncalibRechits = std::make_unique<HGCeeUncalibratedRecHitCollection>();
42  auto hefUncalibRechits = std::make_unique<HGChefUncalibratedRecHitCollection>();
43  auto hebUncalibRechits = std::make_unique<HGChebUncalibratedRecHitCollection>();
44 
45  // loop over HGCEE digis
47  evt.getByToken( eeDigiCollection_, pHGCEEDigis);
48  const HGCalDigiCollection* eeDigis =
49  pHGCEEDigis.product(); // get a ptr to the product
50  eeUncalibRechits->reserve(eeDigis->size());
51  for(auto itdg = eeDigis->begin(); itdg != eeDigis->end(); ++itdg) {
52  worker_->run1(evt, itdg, *eeUncalibRechits);
53  }
54 
56  evt.getByToken( hefDigiCollection_, pHGCHEFDigis);
57  const HGCalDigiCollection* hefDigis =
58  pHGCHEFDigis.product(); // get a ptr to the product
59  hefUncalibRechits->reserve(hefDigis->size());
60  for(auto itdg = hefDigis->begin(); itdg != hefDigis->end(); ++itdg) {
61  worker_->run2(evt, itdg, *hefUncalibRechits);
62  }
63 
65  evt.getByToken( hebDigiCollection_, pHGCHEBDigis);
66  const HGCalDigiCollection* hebDigis =
67  pHGCHEBDigis.product(); // get a ptr to the product
68  hebUncalibRechits->reserve(hebDigis->size());
69  for(auto itdg = hebDigis->begin(); itdg != hebDigis->end(); ++itdg) {
70  worker_->run3(evt, itdg, *hebUncalibRechits);
71  }
72 
73  // put the collection of recunstructed hits in the event
74  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
75  evt.put(std::move(hefUncalibRechits), hefHitCollection_);
76  evt.put(std::move(hebUncalibRechits), hebHitCollection_);
77 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
const_iterator end() const
T const * product() const
Definition: Handle.h:74
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
HLT enums.
size_type size() const
void reserve(size_type n)
def move(src, dest)
Definition: eostools.py:511
const_iterator begin() const

Member Data Documentation

const edm::EDGetTokenT<HGCalDigiCollection> HGCalUncalibRecHitProducer::eeDigiCollection_
private

Definition at line 23 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 27 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().

edm::EDGetTokenT<HGCalDigiCollection> HGCalUncalibRecHitProducer::hebDigiCollection_
private

Definition at line 25 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hebHitCollection_
private

Definition at line 29 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().

const edm::EDGetTokenT<HGCalDigiCollection> HGCalUncalibRecHitProducer::hefDigiCollection_
private

Definition at line 24 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hefHitCollection_
private

Definition at line 28 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().

std::unique_ptr<HGCalUncalibRecHitWorkerBaseClass> HGCalUncalibRecHitProducer::worker_
private

Definition at line 31 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().