CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EcalUncalibRecHitProducer Class Reference
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
 
- 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
 

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<>
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 21 of file EcalUncalibRecHitProducer.cc.

Constructor & Destructor Documentation

◆ EcalUncalibRecHitProducer()

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

Definition at line 37 of file EcalUncalibRecHitProducer.cc.

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

37  {
38  ebHitCollection_ = ps.getParameter<std::string>("EBhitCollection");
39  eeHitCollection_ = ps.getParameter<std::string>("EEhitCollection");
40  produces<EBUncalibratedRecHitCollection>(ebHitCollection_);
41  produces<EEUncalibratedRecHitCollection>(eeHitCollection_);
42 
43  ebDigiCollectionToken_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"));
44 
45  eeDigiCollectionToken_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"));
46 
47  std::string componentType = ps.getParameter<std::string>("algo");
48  edm::ParameterSet algoConf = ps.getParameter<edm::ParameterSet>("algoPSet");
49 
50  edm::ConsumesCollector c{consumesCollector()};
51  worker_ = EcalUncalibRecHitWorkerFactory::get()->create(componentType, algoConf, c);
52 }
std::unique_ptr< EcalUncalibRecHitWorkerBaseClass > worker_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
#define get
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 54 of file EcalUncalibRecHitProducer.cc.

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

54  {
56  std::vector<edmplugin::PluginInfo> infos = factory->available();
57 
58  {
60  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis", "ebDigis"));
61  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
62  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis", "eeDigis"));
63  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
64 
65  auto itInfos = infos.begin();
66  assert(itInfos != infos.end());
67 
68  std::unique_ptr<edm::ParameterDescriptionCases<std::string>> s;
69  {
70  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> tmw(
72  s = (itInfos->name_ >>
73  edm::ParameterDescription<edm::ParameterSetDescription>("algoPSet", tmw->getAlgoDescription(), true));
74  }
75  for (++itInfos; itInfos != infos.end(); ++itInfos) {
76  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> tmw(
79  "algoPSet", tmw->getAlgoDescription(), true));
80  }
81  desc.ifValue(edm::ParameterDescription<std::string>("algo", "EcalUncalibRecHitWorkerMultiFit", true), std::move(s));
82 
83  descriptions.addDefault(desc);
84  }
85 
86  for (std::vector<edmplugin::PluginInfo>::const_iterator itInfos = infos.begin(); itInfos != infos.end(); itInfos++) {
87  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> fdWorker(
89 
91  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis", "ebDigis"));
92  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
93  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis", "eeDigis"));
94  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
95  desc.add<std::string>("algo", itInfos->name_);
96  desc.add<edm::ParameterSetDescription>("algoPSet", fdWorker->getAlgoDescription());
97 
98  std::string algoName = itInfos->name_.substr(itInfos->name_.find("Worker") + 6, itInfos->name_.length());
99  descriptions.add("ecal" + algoName + "UncalibRecHitProducer", desc);
100  }
101 }
def create(alignables, pedeDump, additionalData, outputFile, config)
assert(be >=bs)
void addDefault(ParameterSetDescription const &psetDescription)
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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
#define get
def move(src, dest)
Definition: eostools.py:511

◆ produce()

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

Definition at line 103 of file EcalUncalibRecHitProducer.cc.

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

103  {
104  using namespace edm;
105 
106  Handle<EBDigiCollection> pEBDigis;
107  Handle<EEDigiCollection> pEEDigis;
108 
109  const EBDigiCollection* ebDigis = nullptr;
110  const EEDigiCollection* eeDigis = nullptr;
111 
112  evt.getByToken(ebDigiCollectionToken_, pEBDigis);
113  ebDigis = pEBDigis.product(); // get a ptr to the produc
114  edm::LogInfo("EcalUncalibRecHitInfo") << "total # ebDigis: " << ebDigis->size();
115 
116  evt.getByToken(eeDigiCollectionToken_, pEEDigis);
117  eeDigis = pEEDigis.product(); // get a ptr to the product
118  edm::LogInfo("EcalUncalibRecHitInfo") << "total # eeDigis: " << eeDigis->size();
119 
120  // tranparently get things from event setup
121  worker_->set(es);
122  worker_->set(evt);
123 
124  // prepare output
125  auto ebUncalibRechits = std::make_unique<EBUncalibratedRecHitCollection>();
126  auto eeUncalibRechits = std::make_unique<EEUncalibratedRecHitCollection>();
127 
128  // loop over EB digis
129  if (ebDigis)
130  worker_->run(evt, *ebDigis, *ebUncalibRechits);
131 
132  // loop over EB digis
133  if (eeDigis)
134  worker_->run(evt, *eeDigis, *eeUncalibRechits);
135 
136  // put the collection of recunstructed hits in the event
137  evt.put(std::move(ebUncalibRechits), ebHitCollection_);
138  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
139 }
std::unique_ptr< EcalUncalibRecHitWorkerBaseClass > worker_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
T const * product() const
Definition: Handle.h:70
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
Log< level::Info, false > LogInfo
HLT enums.
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ ebDigiCollectionToken_

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

Definition at line 28 of file EcalUncalibRecHitProducer.cc.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ ebHitCollection_

std::string EcalUncalibRecHitProducer::ebHitCollection_
private

Definition at line 31 of file EcalUncalibRecHitProducer.cc.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ eeDigiCollectionToken_

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

Definition at line 29 of file EcalUncalibRecHitProducer.cc.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ eeHitCollection_

std::string EcalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 32 of file EcalUncalibRecHitProducer.cc.

Referenced by EcalUncalibRecHitProducer(), and produce().

◆ worker_

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

Definition at line 34 of file EcalUncalibRecHitProducer.cc.

Referenced by EcalUncalibRecHitProducer(), and produce().