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
 
 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< HGCalDigiCollectioneeDigiCollection_
 
const std::string eeHitCollection_
 
edm::EDGetTokenT< HGCalDigiCollectionhebDigiCollection_
 
const std::string hebHitCollection_
 
const edm::EDGetTokenT< HGCalDigiCollectionhefDigiCollection_
 
const std::string hefHitCollection_
 
edm::EDGetTokenT< HGCalDigiCollectionhfnoseDigiCollection_
 
const std::string hfnoseHitCollection_
 
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClassworker_
 

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

Constructor & Destructor Documentation

◆ HGCalUncalibRecHitProducer()

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

Definition at line 12 of file HGCalUncalibRecHitProducer.cc.

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

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  hfnoseDigiCollection_(consumes<HGCalDigiCollection>(ps.getParameter<edm::InputTag>("HGCHFNosedigiCollection"))),
17  eeHitCollection_(ps.getParameter<std::string>("HGCEEhitCollection")),
18  hefHitCollection_(ps.getParameter<std::string>("HGCHEFhitCollection")),
19  hebHitCollection_(ps.getParameter<std::string>("HGCHEBhitCollection")),
20  hfnoseHitCollection_(ps.getParameter<std::string>("HGCHFNosehitCollection")),
22  ps.getParameter<std::string>("algo"), ps, consumesCollector())} {
23  produces<HGCeeUncalibratedRecHitCollection>(eeHitCollection_);
24  produces<HGChefUncalibratedRecHitCollection>(hefHitCollection_);
25  produces<HGChebUncalibratedRecHitCollection>(hebHitCollection_);
26  produces<HGChfnoseUncalibratedRecHitCollection>(hfnoseHitCollection_);
27 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hfnoseDigiCollection_
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
#define get

◆ ~HGCalUncalibRecHitProducer()

HGCalUncalibRecHitProducer::~HGCalUncalibRecHitProducer ( )
override

Definition at line 29 of file HGCalUncalibRecHitProducer.cc.

29 {}

Member Function Documentation

◆ produce()

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

Definition at line 31 of file HGCalUncalibRecHitProducer.cc.

References edm::SortedCollection< T, SORT >::begin(), eeDigiCollection_, SimL1EmulatorDM_cff::eeDigis, eeHitCollection_, edm::SortedCollection< T, SORT >::end(), edm::Event::getByToken(), hebDigiCollection_, hebHitCollection_, hefDigiCollection_, hefHitCollection_, hfnoseDigiCollection_, HGCalRawToDigi_cfi::hfnoseDigis, hfnoseHitCollection_, edm::HandleBase::isValid(), eostools::move(), edm::Handle< T >::product(), edm::Event::put(), edm::SortedCollection< T, SORT >::reserve(), edm::SortedCollection< T, SORT >::size(), and worker_.

31  {
32  using namespace edm;
33 
34  // tranparently get things from event setup
35  worker_->set(es);
36 
37  // prepare output
38  auto eeUncalibRechits = std::make_unique<HGCeeUncalibratedRecHitCollection>();
39  auto hefUncalibRechits = std::make_unique<HGChefUncalibratedRecHitCollection>();
40  auto hebUncalibRechits = std::make_unique<HGChebUncalibratedRecHitCollection>();
41  auto hfnoseUncalibRechits = std::make_unique<HGChfnoseUncalibratedRecHitCollection>();
42 
43  // loop over HGCEE digis
45  evt.getByToken(eeDigiCollection_, pHGCEEDigis);
46  const HGCalDigiCollection* eeDigis = pHGCEEDigis.product();
47  eeUncalibRechits->reserve(eeDigis->size());
48  for (auto itdg = eeDigis->begin(); itdg != eeDigis->end(); ++itdg) {
49  worker_->runHGCEE(itdg, *eeUncalibRechits);
50  }
51 
52  // loop over HGCHEsil digis
54  evt.getByToken(hefDigiCollection_, pHGCHEFDigis);
55  const HGCalDigiCollection* hefDigis = pHGCHEFDigis.product();
56  hefUncalibRechits->reserve(hefDigis->size());
57  for (auto itdg = hefDigis->begin(); itdg != hefDigis->end(); ++itdg) {
58  worker_->runHGCHEsil(itdg, *hefUncalibRechits);
59  }
60 
61  // loop over HGCHEscint digis
63  evt.getByToken(hebDigiCollection_, pHGCHEBDigis);
64  const HGCalDigiCollection* hebDigis = pHGCHEBDigis.product();
65  hebUncalibRechits->reserve(hebDigis->size());
66  for (auto itdg = hebDigis->begin(); itdg != hebDigis->end(); ++itdg) {
67  worker_->runHGCHEscint(itdg, *hebUncalibRechits);
68  }
69 
70  // loop over HFNose digis
71  edm::Handle<HGCalDigiCollection> pHGCHFNoseDigis;
72  evt.getByToken(hfnoseDigiCollection_, pHGCHFNoseDigis);
73  if (pHGCHFNoseDigis.isValid()) {
74  const HGCalDigiCollection* hfnoseDigis = pHGCHFNoseDigis.product();
75  if (!(hfnoseDigis->empty())) {
76  hfnoseUncalibRechits->reserve(hfnoseDigis->size());
77  for (auto itdg = hfnoseDigis->begin(); itdg != hfnoseDigis->end(); ++itdg)
78  worker_->runHGCHFNose(itdg, *hfnoseUncalibRechits);
79  }
80  }
81 
82  // put the collection of recunstructed hits in the event
83  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
84  evt.put(std::move(hefUncalibRechits), hefHitCollection_);
85  evt.put(std::move(hebUncalibRechits), hebHitCollection_);
86  if (pHGCHFNoseDigis.isValid())
87  evt.put(std::move(hfnoseUncalibRechits), hfnoseHitCollection_);
88 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
size_type size() const
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const_iterator begin() const
edm::EDGetTokenT< HGCalDigiCollection > hfnoseDigiCollection_
const_iterator end() const
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
void reserve(size_type n)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ eeDigiCollection_

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

Definition at line 20 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ eeHitCollection_

const std::string HGCalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 25 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ hebDigiCollection_

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

Definition at line 22 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ hebHitCollection_

const std::string HGCalUncalibRecHitProducer::hebHitCollection_
private

Definition at line 27 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ hefDigiCollection_

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

Definition at line 21 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ hefHitCollection_

const std::string HGCalUncalibRecHitProducer::hefHitCollection_
private

Definition at line 26 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ hfnoseDigiCollection_

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

Definition at line 23 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ hfnoseHitCollection_

const std::string HGCalUncalibRecHitProducer::hfnoseHitCollection_
private

Definition at line 28 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

◆ worker_

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

Definition at line 30 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().