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 
19 // system include files
20 #include <memory>
21 
22 // user include files
25 
35 
36 //#define EDM_ML_DEBUG
37 
38 //
39 // class decleration
40 //
41 
43 
44 public:
46  ~HGCalTopologyBuilder() override ;
47 
48  using ReturnType = std::unique_ptr<HGCalTopology>;
49 
51 
52 private:
53  // ----------member data ---------------------------
55  int det_;
56 };
57 
58 
60 
61  name_ = iConfig.getParameter<std::string>("Name");
62  det_ = iConfig.getParameter<int>("Type");
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HGCalGeom") << "constructing HGCalTopology for " << name_
65  << " and det " << det_;
66 #endif
67  setWhatProduced(this, name_);
68 }
69 
70 
72 
73 //
74 // member functions
75 //
76 
77 // ------------ method called to produce the data ------------
80 
82  iRecord.get(name_, pHGDC);
83  const HGCalDDDConstants & hgdc = (*pHGDC);
84 
85 #ifdef EDM_ML_DEBUG
86  edm::LogVerbatim("HGCalGeom") << "Create HGCalTopology(hgdc,det)";
87 #endif
88  return std::make_unique<HGCalTopology>(hgdc, det_);
89 }
90 
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
std::unique_ptr< HGCalTopology > ReturnType
ReturnType produce(const IdealGeometryRecord &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HGCalTopologyBuilder(const edm::ParameterSet &iP)
bool get(HolderT &iHolder) const