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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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_
 
edm::EDGetTokenT< HGCalDigiCollectionhfnoseDigiCollection_
 
const std::string hfnoseHitCollection_
 
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 13 of file HGCalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

◆ HGCalUncalibRecHitProducer()

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

Definition at line 12 of file HGCalUncalibRecHitProducer.cc.

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  produces<HGCeeUncalibratedRecHitCollection>(eeHitCollection_);
23  produces<HGChefUncalibratedRecHitCollection>(hefHitCollection_);
24  produces<HGChebUncalibratedRecHitCollection>(hebHitCollection_);
25  produces<HGChfnoseUncalibratedRecHitCollection>(hfnoseHitCollection_);
26 }

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

◆ ~HGCalUncalibRecHitProducer()

HGCalUncalibRecHitProducer::~HGCalUncalibRecHitProducer ( )
override

Definition at line 28 of file HGCalUncalibRecHitProducer.cc.

28 {}

Member Function Documentation

◆ produce()

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

Definition at line 30 of file HGCalUncalibRecHitProducer.cc.

30  {
31  using namespace edm;
32 
33  // tranparently get things from event setup
34  worker_->set(es);
35 
36  // prepare output
37  auto eeUncalibRechits = std::make_unique<HGCeeUncalibratedRecHitCollection>();
38  auto hefUncalibRechits = std::make_unique<HGChefUncalibratedRecHitCollection>();
39  auto hebUncalibRechits = std::make_unique<HGChebUncalibratedRecHitCollection>();
40  auto hfnoseUncalibRechits = std::make_unique<HGChfnoseUncalibratedRecHitCollection>();
41 
42  // loop over HGCEE digis
44  evt.getByToken(eeDigiCollection_, pHGCEEDigis);
45  const HGCalDigiCollection* eeDigis = pHGCEEDigis.product();
46  eeUncalibRechits->reserve(eeDigis->size());
47  for (auto itdg = eeDigis->begin(); itdg != eeDigis->end(); ++itdg) {
48  worker_->runHGCEE(itdg, *eeUncalibRechits);
49  }
50 
51  // loop over HGCHEsil digis
53  evt.getByToken(hefDigiCollection_, pHGCHEFDigis);
54  const HGCalDigiCollection* hefDigis = pHGCHEFDigis.product();
55  hefUncalibRechits->reserve(hefDigis->size());
56  for (auto itdg = hefDigis->begin(); itdg != hefDigis->end(); ++itdg) {
57  worker_->runHGCHEsil(itdg, *hefUncalibRechits);
58  }
59 
60  // loop over HGCHEscint digis
62  evt.getByToken(hebDigiCollection_, pHGCHEBDigis);
63  const HGCalDigiCollection* hebDigis = pHGCHEBDigis.product();
64  hebUncalibRechits->reserve(hebDigis->size());
65  for (auto itdg = hebDigis->begin(); itdg != hebDigis->end(); ++itdg) {
66  worker_->runHGCHEscint(itdg, *hebUncalibRechits);
67  }
68 
69  // loop over HFNose digis
70  edm::Handle<HGCalDigiCollection> pHGCHFNoseDigis;
71  evt.getByToken(hfnoseDigiCollection_, pHGCHFNoseDigis);
72  if (pHGCHFNoseDigis.isValid()) {
73  const HGCalDigiCollection* hfnoseDigis = pHGCHFNoseDigis.product();
74  if (!(hfnoseDigis->empty())) {
75  hfnoseUncalibRechits->reserve(hfnoseDigis->size());
76  for (auto itdg = hfnoseDigis->begin(); itdg != hfnoseDigis->end(); ++itdg)
77  worker_->runHGCHFNose(itdg, *hfnoseUncalibRechits);
78  }
79  }
80 
81  // put the collection of recunstructed hits in the event
82  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
83  evt.put(std::move(hefUncalibRechits), hefHitCollection_);
84  evt.put(std::move(hebUncalibRechits), hebHitCollection_);
85  if (pHGCHFNoseDigis.isValid())
86  evt.put(std::move(hfnoseUncalibRechits), hfnoseHitCollection_);
87 }

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

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().

edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::SortedCollection
Definition: SortedCollection.h:49
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
edm::Handle
Definition: AssociativeIterator.h:50
HGCalUncalibRecHitProducer::hefHitCollection_
const std::string hefHitCollection_
Definition: HGCalUncalibRecHitProducer.h:26
HGCalUncalibRecHitProducer::hefDigiCollection_
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
Definition: HGCalUncalibRecHitProducer.h:21
HGCalUncalibRecHitProducer::hebDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
Definition: HGCalUncalibRecHitProducer.h:22
HGCalUncalibRecHitProducer::hfnoseHitCollection_
const std::string hfnoseHitCollection_
Definition: HGCalUncalibRecHitProducer.h:28
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
HGCalUncalibRecHitProducer::worker_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
Definition: HGCalUncalibRecHitProducer.h:30
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalRawToDigi_cfi.hfnoseDigis
hfnoseDigis
Definition: HGCalRawToDigi_cfi.py:8
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
HGCalUncalibRecHitProducer::hebHitCollection_
const std::string hebHitCollection_
Definition: HGCalUncalibRecHitProducer.h:27
HGCalUncalibRecHitProducer::hfnoseDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hfnoseDigiCollection_
Definition: HGCalUncalibRecHitProducer.h:23
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::SortedCollection::reserve
void reserve(size_type n)
Definition: SortedCollection.h:225
HGCalUncalibRecHitProducer::eeDigiCollection_
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
Definition: HGCalUncalibRecHitProducer.h:20
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
SimL1EmulatorDM_cff.eeDigis
eeDigis
Definition: SimL1EmulatorDM_cff.py:18
edm::InputTag
Definition: InputTag.h:15
HGCalUncalibRecHitProducer::eeHitCollection_
const std::string eeHitCollection_
Definition: HGCalUncalibRecHitProducer.h:25