CMS 3D CMS Logo

HGCalGeometryESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HGCalGeometry
4 // Class: HGCalGeometryESProducer
5 //
13 //
14 // Original Author: Sunanda Banerjee
15 //
16 //
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
30 
31 //#define EDM_ML_DEBUG
32 
33 //
34 // class decleration
35 //
36 
38 public:
40  ~HGCalGeometryESProducer() override;
41 
42  using ReturnType = std::unique_ptr<HGCalGeometry>;
43 
45 
46 private:
47  // ----------member data ---------------------------
49 };
50 
52  auto name = iConfig.getUntrackedParameter<std::string>("Name");
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("HGCalGeom") << "Constructing HGCalGeometry for " << name;
55 #endif
56  auto cc = setWhatProduced(this, name);
57  topologyToken_ = cc.consumes<HGCalTopology>(edm::ESInputTag{"", name});
58 }
59 
61 
62 //
63 // member functions
64 //
65 
66 // ------------ method called to produce the data ------------
68  const auto& topo = iRecord.get(topologyToken_);
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HGCalGeom") << "Create HGCalGeometry (*topo)";
71 #endif
72 
73  HGCalGeometryLoader builder;
74  return ReturnType(builder.build(topo));
75 }
76 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< HGCalTopology, IdealGeometryRecord > topologyToken_
HGCalGeometry * build(const HGCalTopology &)
HGCalGeometryESProducer(const edm::ParameterSet &iP)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
ReturnType produce(const IdealGeometryRecord &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< HGCalGeometry > ReturnType