File indexing completed on 2024-04-06 12:15:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <memory>
0020
0021 #include "FWCore/Framework/interface/ModuleFactory.h"
0022 #include "FWCore/Framework/interface/ESProducer.h"
0023 #include "FWCore/Framework/interface/ESTransientHandle.h"
0024
0025 #include "Geometry/MuonNumbering/interface/MuonDDDConstants.h"
0026 #include "Geometry/Records/interface/MuonNumberingRecord.h"
0027
0028 class MuonNumberingInitialization : public edm::ESProducer {
0029 public:
0030 MuonNumberingInitialization(const edm::ParameterSet&);
0031
0032 using ReturnType = std::unique_ptr<MuonDDDConstants>;
0033
0034 ReturnType produce(const MuonNumberingRecord&);
0035
0036 private:
0037 const edm::ESGetToken<DDCompactView, IdealGeometryRecord> geomToken_;
0038 };
0039
0040 MuonNumberingInitialization::MuonNumberingInitialization(const edm::ParameterSet&)
0041 : geomToken_{setWhatProduced(this).consumes()} {}
0042
0043 MuonNumberingInitialization::ReturnType MuonNumberingInitialization::produce(const MuonNumberingRecord& iRecord) {
0044 edm::ESTransientHandle<DDCompactView> pDD = iRecord.getTransientHandle(geomToken_);
0045
0046 return std::make_unique<MuonDDDConstants>(*pDD);
0047 }
0048
0049 DEFINE_FWK_EVENTSETUP_MODULE(MuonNumberingInitialization);