CMS 3D CMS Logo

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

#include <EcalUncalibRecHitProducer.h>

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

Public Member Functions

 EcalUncalibRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~EcalUncalibRecHitProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< EBDigiCollectionebDigiCollectionToken_
 
std::string ebHitCollection_
 
edm::EDGetTokenT< EEDigiCollectioneeDigiCollectionToken_
 
std::string eeHitCollection_
 
std::unique_ptr< EcalUncalibRecHitWorkerBaseClassworker_
 

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 17 of file EcalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

◆ EcalUncalibRecHitProducer()

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

Definition at line 22 of file EcalUncalibRecHitProducer.cc.

22  {
23  ebHitCollection_ = ps.getParameter<std::string>("EBhitCollection");
24  eeHitCollection_ = ps.getParameter<std::string>("EEhitCollection");
25  produces<EBUncalibratedRecHitCollection>(ebHitCollection_);
26  produces<EEUncalibratedRecHitCollection>(eeHitCollection_);
27 
28  ebDigiCollectionToken_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"));
29 
30  eeDigiCollectionToken_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"));
31 
32  std::string componentType = ps.getParameter<std::string>("algo");
33  edm::ParameterSet algoConf = ps.getParameter<edm::ParameterSet>("algoPSet");
34 
35  edm::ConsumesCollector c{consumesCollector()};
36  worker_ = EcalUncalibRecHitWorkerFactory::get()->create(componentType, algoConf, c);
37 }

References HltBtagPostValidation_cff::c, ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, eeHitCollection_, get, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

◆ ~EcalUncalibRecHitProducer()

EcalUncalibRecHitProducer::~EcalUncalibRecHitProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void EcalUncalibRecHitProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 41 of file EcalUncalibRecHitProducer.cc.

41  {
43  std::vector<edmplugin::PluginInfo> infos = factory->available();
44 
45  {
47  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis", "ebDigis"));
48  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
49  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis", "eeDigis"));
50  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
51 
52  auto itInfos = infos.begin();
53  assert(itInfos != infos.end());
54 
55  std::unique_ptr<edm::ParameterDescriptionCases<std::string>> s;
56  {
57  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> tmw(
59  s = (itInfos->name_ >>
60  edm::ParameterDescription<edm::ParameterSetDescription>("algoPSet", tmw->getAlgoDescription(), true));
61  }
62  for (++itInfos; itInfos != infos.end(); ++itInfos) {
63  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> tmw(
66  "algoPSet", tmw->getAlgoDescription(), true));
67  }
68  desc.ifValue(edm::ParameterDescription<std::string>("algo", "EcalUncalibRecHitWorkerMultiFit", true), std::move(s));
69 
70  descriptions.addDefault(desc);
71  }
72 
73  for (std::vector<edmplugin::PluginInfo>::const_iterator itInfos = infos.begin(); itInfos != infos.end(); itInfos++) {
74  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> fdWorker(
76 
78  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis", "ebDigis"));
79  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
80  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis", "eeDigis"));
81  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
82  desc.add<std::string>("algo", itInfos->name_);
83  desc.add<edm::ParameterSetDescription>("algoPSet", fdWorker->getAlgoDescription());
84 
85  std::string algoName = itInfos->name_.substr(itInfos->name_.find("Worker") + 6, itInfos->name_.length());
86  descriptions.add("ecal" + algoName + "UncalibRecHit", desc);
87  }
88 }

References edm::ConfigurationDescriptions::add(), edm::ConfigurationDescriptions::addDefault(), HIPAlignmentAlgorithm_cfi::algoName, cms::cuda::assert(), beamerCreator::create(), submitPVResolutionJobs::desc, get, submitPVValidationJobs::infos, HLT_FULL_cff::InputTag, eostools::move(), or, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

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

Definition at line 90 of file EcalUncalibRecHitProducer.cc.

90  {
91  using namespace edm;
92 
93  Handle<EBDigiCollection> pEBDigis;
94  Handle<EEDigiCollection> pEEDigis;
95 
96  const EBDigiCollection* ebDigis = nullptr;
97  const EEDigiCollection* eeDigis = nullptr;
98 
99  evt.getByToken(ebDigiCollectionToken_, pEBDigis);
100  ebDigis = pEBDigis.product(); // get a ptr to the produc
101  edm::LogInfo("EcalUncalibRecHitInfo") << "total # ebDigis: " << ebDigis->size();
102 
103  evt.getByToken(eeDigiCollectionToken_, pEEDigis);
104  eeDigis = pEEDigis.product(); // get a ptr to the product
105  edm::LogInfo("EcalUncalibRecHitInfo") << "total # eeDigis: " << eeDigis->size();
106 
107  // tranparently get things from event setup
108  worker_->set(es);
109  worker_->set(evt);
110 
111  // prepare output
112  auto ebUncalibRechits = std::make_unique<EBUncalibratedRecHitCollection>();
113  auto eeUncalibRechits = std::make_unique<EEUncalibratedRecHitCollection>();
114 
115  // loop over EB digis
116  if (ebDigis)
117  worker_->run(evt, *ebDigis, *ebUncalibRechits);
118 
119  // loop over EB digis
120  if (eeDigis)
121  worker_->run(evt, *eeDigis, *eeUncalibRechits);
122 
123  // put the collection of recunstructed hits in the event
124  evt.put(std::move(ebUncalibRechits), ebHitCollection_);
125  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
126 }

References ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, SimL1EmulatorDM_cff::eeDigis, eeHitCollection_, edm::Event::getByToken(), eostools::move(), edm::Handle< T >::product(), edm::Event::put(), edm::DataFrameContainer::size(), and worker_.

Member Data Documentation

◆ ebDigiCollectionToken_

edm::EDGetTokenT<EBDigiCollection> EcalUncalibRecHitProducer::ebDigiCollectionToken_
private

Definition at line 25 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ ebHitCollection_

std::string EcalUncalibRecHitProducer::ebHitCollection_
private

Definition at line 28 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ eeDigiCollectionToken_

edm::EDGetTokenT<EEDigiCollection> EcalUncalibRecHitProducer::eeDigiCollectionToken_
private

Definition at line 26 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ eeHitCollection_

std::string EcalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 29 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ worker_

std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> EcalUncalibRecHitProducer::worker_
private

Definition at line 31 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
HIPAlignmentAlgorithm_cfi.algoName
algoName
Definition: HIPAlignmentAlgorithm_cfi.py:5
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
edm::Handle< EBDigiCollection >
EcalUncalibRecHitProducer::ebHitCollection_
std::string ebHitCollection_
Definition: EcalUncalibRecHitProducer.h:28
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
EcalUncalibRecHitProducer::eeDigiCollectionToken_
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
Definition: EcalUncalibRecHitProducer.h:26
EBDigiCollection
Definition: EcalDigiCollections.h:56
edmplugin::PluginFactory
Definition: PluginFactory.h:34
EEDigiCollection
Definition: EcalDigiCollections.h:69
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
EcalUncalibRecHitProducer::ebDigiCollectionToken_
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_
Definition: EcalUncalibRecHitProducer.h:25
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
EcalUncalibRecHitProducer::worker_
std::unique_ptr< EcalUncalibRecHitWorkerBaseClass > worker_
Definition: EcalUncalibRecHitProducer.h:31
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalUncalibRecHitProducer::eeHitCollection_
std::string eeHitCollection_
Definition: EcalUncalibRecHitProducer.h:29
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::ParameterDescription
Definition: ParameterDescription.h:110
SimL1EmulatorDM_cff.eeDigis
eeDigis
Definition: SimL1EmulatorDM_cff.py:18
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
submitPVValidationJobs.infos
dictionary infos
Definition: submitPVValidationJobs.py:221
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162