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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 18 of file EcalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file EcalUncalibRecHitProducer.cc.

References EnergyCorrector::c, ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, eeHitCollection_, reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, worker_, and ~EcalUncalibRecHitProducer().

23 {
24  ebHitCollection_ = ps.getParameter<std::string>("EBhitCollection");
25  eeHitCollection_ = ps.getParameter<std::string>("EEhitCollection");
26  produces< EBUncalibratedRecHitCollection >(ebHitCollection_);
27  produces< EEUncalibratedRecHitCollection >(eeHitCollection_);
28 
29  ebDigiCollectionToken_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"));
30 
31  eeDigiCollectionToken_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"));
32 
33  std::string componentType = ps.getParameter<std::string>("algo");
34  edm::ParameterSet algoConf = ps.getParameter<edm::ParameterSet>("algoPSet");
35 
36  edm::ConsumesCollector c{consumesCollector()};
37  worker_ = std::unique_ptr<EcalUncalibRecHitWorkerBaseClass>{EcalUncalibRecHitWorkerFactory::get()->create(componentType, algoConf, c)};
38 }
std::unique_ptr< EcalUncalibRecHitWorkerBaseClass > worker_
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_
T get(const Candidate &c)
Definition: component.h:55
EcalUncalibRecHitProducer::~EcalUncalibRecHitProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 42 of file EcalUncalibRecHitProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), HIPAlignmentAlgorithm_cfi::algoName, beamerCreator::create(), reco::get(), edm::ParameterSetDescription::ifValue(), benchmark_cfg::infos, eostools::move(), or, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

42  {
43 
45  std::vector<edmplugin::PluginInfo> infos = factory->available();
46 
47  {
49  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis"));
50  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
51  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis"));
52  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
53 
54  auto itInfos = infos.begin();
55  assert(itInfos != infos.end());
56 
57  std::unique_ptr<edm::ParameterDescriptionCases<std::string>> s;
58  {
59  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> tmw(EcalUncalibRecHitFillDescriptionWorkerFactory::get()->create(itInfos->name_));
60  s = (itInfos->name_ >> edm::ParameterDescription<edm::ParameterSetDescription>("algoPSet", tmw->getAlgoDescription(), true));
61  }
62  for (++itInfos; itInfos != infos.end(); ++itInfos) {
63  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> tmw(EcalUncalibRecHitFillDescriptionWorkerFactory::get()->create(itInfos->name_));
64  s = (std::move(s) or itInfos->name_ >> edm::ParameterDescription<edm::ParameterSetDescription>("algoPSet", tmw->getAlgoDescription(), true));
65  }
66  desc.ifValue(edm::ParameterDescription<std::string>("algo", "EcalUncalibRecHitWorkerMultiFit", true), std::move(s));
67 
68  descriptions.addDefault(desc);
69  }
70 
71  for (std::vector<edmplugin::PluginInfo>::const_iterator itInfos = infos.begin(); itInfos != infos.end(); itInfos++) {
72  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> fdWorker(EcalUncalibRecHitFillDescriptionWorkerFactory::get()->create(itInfos->name_));
73 
75  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis"));
76  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
77  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis"));
78  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
79  desc.add<std::string>("algo", itInfos->name_);
80  desc.add<edm::ParameterSetDescription>("algoPSet", fdWorker->getAlgoDescription());
81 
82  std::string algoName = itInfos->name_.substr(itInfos->name_.find("Worker")+6, itInfos->name_.length());
83  descriptions.add("ecal"+algoName+"UncalibRecHit", desc);
84  }
85 }
def create(alignables, pedeDump, additionalData, outputFile, config)
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
#define end
Definition: vmac.h:39
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
#define begin
Definition: vmac.h:32
HLT enums.
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
void EcalUncalibRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 88 of file EcalUncalibRecHitProducer.cc.

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

88  {
89 
90  using namespace edm;
91 
94 
95  const EBDigiCollection* ebDigis =nullptr;
96  const EEDigiCollection* eeDigis =nullptr;
97 
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 
108  // tranparently get things from event setup
109  worker_->set(es);
110  worker_->set(evt);
111 
112  // prepare output
113  auto ebUncalibRechits = std::make_unique<EBUncalibratedRecHitCollection>();
114  auto eeUncalibRechits = std::make_unique<EEUncalibratedRecHitCollection>();
115 
116  // loop over EB digis
117  if (ebDigis)
118  worker_->run(evt, *ebDigis, *ebUncalibRechits);
119 
120  // loop over EB digis
121  if (eeDigis)
122  worker_->run(evt, *eeDigis, *eeUncalibRechits);
123 
124  // put the collection of recunstructed hits in the event
125  evt.put(std::move(ebUncalibRechits), ebHitCollection_);
126  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
127 }
std::unique_ptr< EcalUncalibRecHitWorkerBaseClass > worker_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
T const * product() const
Definition: Handle.h:74
HLT enums.
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 28 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

std::string EcalUncalibRecHitProducer::ebHitCollection_
private

Definition at line 31 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

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

Definition at line 29 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

std::string EcalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 32 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

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

Definition at line 34 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().