Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:48:55

0001 // -*- C++ -*-
0002 //
0003 // Package:    MuonNumberingInitialization
0004 // Class:      MuonNumberingInitialization
0005 //
0006 /**\class MuonNumberingInitialization MuonNumberingInitialization.h Geometry/MuonNumberingInitialization/interface/MuonNumberingInitialization.h
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Michael Case
0015 //         Created:  Thu Sep 28 16:40:29 PDT 2006
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);