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< HGCEEDigiCollectioneeDigiCollection_
 
const std::string eeHitCollection_
 
const edm::EDGetTokenT< HGCBHDigiCollectionhebDigiCollection_
 
const std::string hebHitCollection_
 
const edm::EDGetTokenT< HGCHEDigiCollectionhefDigiCollection_
 
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 beamerCreator::create(), eeHitCollection_, reco::get(), edm::ParameterSet::getParameter(), hebHitCollection_, hefHitCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

12  :
13  eeDigiCollection_( consumes<HGCEEDigiCollection>( ps.getParameter<edm::InputTag>("HGCEEdigiCollection") ) ),
14  hefDigiCollection_( consumes<HGCHEDigiCollection>( ps.getParameter<edm::InputTag>("HGCHEFdigiCollection") ) ),
15  hebDigiCollection_( consumes<HGCBHDigiCollection>( 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") ) {
19 
20  produces< HGCeeUncalibratedRecHitCollection >(eeHitCollection_);
21  produces< HGChefUncalibratedRecHitCollection >(hefHitCollection_);
22  produces< HGChebUncalibratedRecHitCollection >(hebHitCollection_);
23 
24  const std::string& componentType = ps.getParameter<std::string>("algo");
25  worker_.reset( HGCalUncalibRecHitWorkerFactory::get()->create(componentType, ps) );
26 
27 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
const edm::EDGetTokenT< HGCHEDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
const edm::EDGetTokenT< HGCBHDigiCollection > hebDigiCollection_
T get(const Candidate &c)
Definition: component.h:55
const edm::EDGetTokenT< HGCEEDigiCollection > eeDigiCollection_
HGCalUncalibRecHitProducer::~HGCalUncalibRecHitProducer ( )
override

Definition at line 29 of file HGCalUncalibRecHitProducer.cc.

29  {
30 }

Member Function Documentation

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

Definition at line 33 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_.

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

Member Data Documentation

const edm::EDGetTokenT<HGCEEDigiCollection> 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().

const edm::EDGetTokenT<HGCBHDigiCollection> 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<HGCHEDigiCollection> 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 HGCalUncalibRecHitProducer(), and produce().