CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< HGCalDigiCollection
eeDigiCollection_
 
const std::string eeHitCollection_
 
edm::EDGetTokenT
< HGCalDigiCollection
hebDigiCollection_
 
const std::string hebHitCollection_
 
const edm::EDGetTokenT
< HGCalDigiCollection
hefDigiCollection_
 
const std::string hefHitCollection_
 
edm::EDGetTokenT
< HGCalDigiCollection
hfnoseDigiCollection_
 
const std::string hfnoseHitCollection_
 
std::unique_ptr
< HGCalUncalibRecHitWorkerBaseClass
worker_
 

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 ( 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 }
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
edm::EDGetTokenT< HGCalDigiCollection > hfnoseDigiCollection_
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define get
HGCalUncalibRecHitProducer::~HGCalUncalibRecHitProducer ( )
override

Definition at line 29 of file HGCalUncalibRecHitProducer.cc.

29 {}

Member Function Documentation

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_, HGCalRawToDigi_cfi::eeDigis, eeHitCollection_, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::Event::getByToken(), hebDigiCollection_, hebHitCollection_, hefDigiCollection_, hefHitCollection_, hfnoseDigiCollection_, HGCalRawToDigi_cfi::hfnoseDigis, hfnoseHitCollection_, eostools::move(), 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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
def move
Definition: eostools.py:511
edm::EDGetTokenT< HGCalDigiCollection > hfnoseDigiCollection_
const_iterator end() const
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
size_type size() const
void reserve(size_type n)
const_iterator begin() const

Member Data Documentation

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

Definition at line 20 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 25 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

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

Definition at line 22 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hebHitCollection_
private

Definition at line 27 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

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

Definition at line 21 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hefHitCollection_
private

Definition at line 26 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

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

Definition at line 23 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hfnoseHitCollection_
private

Definition at line 28 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

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

Definition at line 30 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().