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 
19 // system include files
20 #include <memory>
21 
22 // user include files
31 
32 //#define EDM_ML_DEBUG
33 
34 //
35 // class decleration
36 //
37 
39 
40 public:
42  ~HGCalGeometryESProducer() override ;
43 
44  using ReturnType = std::unique_ptr<HGCalGeometry>;
45 
47 
48 private:
49  // ----------member data ---------------------------
51 };
52 
53 
55 
56  auto name = iConfig.getUntrackedParameter<std::string>("Name");
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("HGCalGeom") << "Constructing HGCalGeometry for " << name;
59 #endif
60  auto cc = setWhatProduced(this, name);
61  topologyToken_ = cc.consumes<HGCalTopology>(edm::ESInputTag{"", name});
62 }
63 
64 
66 
67 
68 //
69 // member functions
70 //
71 
72 // ------------ method called to produce the data ------------
75 
76  const auto& topo = iRecord.get(topologyToken_);
77 #ifdef EDM_ML_DEBUG
78  edm::LogVerbatim("HGCalGeom") << "Create HGCalGeometry (*topo)";
79 #endif
80 
81  HGCalGeometryLoader builder;
82  return ReturnType(builder.build(topo));
83 }
84 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
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