File indexing completed on 2024-04-06 12:15:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "FWCore/Framework/interface/ESProducer.h"
0021 #include "FWCore/Framework/interface/ModuleFactory.h"
0022 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024
0025 #include "Geometry/HGCalTBCommonData/interface/HGCalTBDDDConstants.h"
0026 #include "Geometry/HGCalTBCommonData/interface/HGCalTBParameters.h"
0027 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0028
0029
0030
0031 class HGCalTBNumberingInitialization : public edm::ESProducer {
0032 public:
0033 HGCalTBNumberingInitialization(const edm::ParameterSet&);
0034 ~HGCalTBNumberingInitialization() override = default;
0035
0036 typedef std::unique_ptr<HGCalTBDDDConstants> ReturnType;
0037
0038 ReturnType produce(const IdealGeometryRecord&);
0039
0040 private:
0041 edm::ESGetToken<HGCalTBParameters, IdealGeometryRecord> hgParToken_;
0042 std::string name_;
0043 };
0044
0045 HGCalTBNumberingInitialization::HGCalTBNumberingInitialization(const edm::ParameterSet& iConfig) {
0046 name_ = iConfig.getUntrackedParameter<std::string>("name");
0047 edm::LogVerbatim("HGCalGeom") << "HGCalTBNumberingInitialization for " << name_;
0048 auto cc = setWhatProduced(this, name_);
0049 hgParToken_ = cc.consumes<HGCalTBParameters>(edm::ESInputTag{"", name_});
0050 }
0051
0052
0053 HGCalTBNumberingInitialization::ReturnType HGCalTBNumberingInitialization::produce(const IdealGeometryRecord& iRecord) {
0054 edm::LogVerbatim("HGCalGeom") << "in HGCalTBNumberingInitialization::produce for " << name_;
0055 const auto& pHGpar = iRecord.get(hgParToken_);
0056 return std::make_unique<HGCalTBDDDConstants>(&pHGpar, name_);
0057 }
0058
0059
0060 DEFINE_FWK_EVENTSETUP_MODULE(HGCalTBNumberingInitialization);