CMS 3D CMS Logo

HGCalNumberingInitialization.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HGCalNumberingInitialization
4 // Class: HGCalNumberingInitialization
5 //
14 //
15 // Original Author: Sunanda Banerjee
16 // Created: Tue Mar 21 16:40:29 PDT 2013
17 //
18 
19 // user include files
24 
28 
29 //#define EDM_ML_DEBUG
30 
32  public:
35 
36  typedef std::unique_ptr<HGCalDDDConstants> ReturnType;
37 
38  ReturnType produce(const IdealGeometryRecord&);
39 
40  private:
43 };
44 
46  const edm::ParameterSet& iConfig) {
47  name_ = iConfig.getUntrackedParameter<std::string>("Name");
48 #ifdef EDM_ML_DEBUG
49  edm::LogVerbatim("HGCalGeom")
50  << "HGCalNumberingInitialization for " << name_;
51 #endif
52  auto cc = setWhatProduced(this, name_);
53  hgParToken_ = cc.consumes<HGCalParameters>(edm::ESInputTag{"", name_});
54 }
55 
57 
58 // ------------ method called to produce the data ------------
60  const IdealGeometryRecord& iRecord) {
61  edm::LogVerbatim("HGCalGeom") << "in HGCalNumberingInitialization::produce";
62  const auto& pHGpar = iRecord.get(hgParToken_);
63  return std::make_unique<HGCalDDDConstants>(&pHGpar, name_);
64 }
65 
66 // define this as a plug-in
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< HGCalDDDConstants > ReturnType
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnType produce(const IdealGeometryRecord &)
HGCalNumberingInitialization(const edm::ParameterSet &)
edm::ESGetToken< HGCalParameters, IdealGeometryRecord > hgParToken_