CMS 3D CMS Logo

HGCalTopologyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloEventSetup
4 // Class: HGCalTopologyBuilder
5 //
13 //
14 // Original Author: Sunanda Banerjee
15 //
16 //
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
24 
28 
35 
36 //#define EDM_ML_DEBUG
37 
38 //
39 // class decleration
40 //
41 
43 public:
45  ~HGCalTopologyBuilder() override;
46 
47  using ReturnType = std::unique_ptr<HGCalTopology>;
48 
50 
51 private:
52  // ----------member data ---------------------------
54  int det_;
55 };
56 
58  auto name = iConfig.getParameter<std::string>("Name");
59  det_ = iConfig.getParameter<int>("Type");
60 #ifdef EDM_ML_DEBUG
61  edm::LogVerbatim("HGCalGeom") << "constructing HGCalTopology for " << name << " and det " << det_;
62 #endif
64 }
65 
67 
68 //
69 // member functions
70 //
71 
72 // ------------ method called to produce the data ------------
74  const HGCalDDDConstants& hgdc = iRecord.get(hgcToken_);
75 
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HGCalGeom") << "Create HGCalTopology(hgdc,det)";
78 #endif
79  return std::make_unique<HGCalTopology>(hgdc, det_);
80 }
81 
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
std::unique_ptr< HGCalTopology > ReturnType
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ReturnType produce(const IdealGeometryRecord &)
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcToken_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
HGCalTopologyBuilder(const edm::ParameterSet &iP)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const