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  typedef std::shared_ptr< HGCalTopology > ReturnType;
49 
50  ReturnType produce(const IdealGeometryRecord&);
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  ReturnType ct ( new HGCalTopology(hgdc, det_) ) ;
86 #ifdef EDM_ML_DEBUG
87  edm::LogVerbatim("HGCalGeom") << "Create HGCalTopology(hgdc,det)";
88 #endif
89  return ct;
90 }
91 
T getParameter(std::string const &) const
ReturnType produce(const IdealGeometryRecord &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void get(HolderT &iHolder) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HGCalTopologyBuilder(const edm::ParameterSet &iP)
std::shared_ptr< HGCalTopology > ReturnType