Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:18

0001 #include "FWCore/Framework/interface/Event.h"
0002 #include "FWCore/Framework/interface/EventSetup.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h"
0007 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0008 #include <iostream>
0009 
0010 class MuonOffsetAnalyzer : public edm::one::EDAnalyzer<> {
0011 public:
0012   explicit MuonOffsetAnalyzer(const edm::ParameterSet&);
0013 
0014   void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0015 
0016 private:
0017   edm::ESGetToken<MuonOffsetMap, IdealGeometryRecord> parToken_;
0018 };
0019 
0020 MuonOffsetAnalyzer::MuonOffsetAnalyzer(const edm::ParameterSet&) {
0021   parToken_ = esConsumes<MuonOffsetMap, IdealGeometryRecord>(edm::ESInputTag{});
0022 }
0023 
0024 void MuonOffsetAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) {
0025   const auto& par = iSetup.getData(parToken_);
0026   const MuonOffsetMap* php = &par;
0027 
0028   edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD: Finds " << php->muonMap_.size() << " entries in the map";
0029 
0030   unsigned int k(0);
0031   for (auto itr = php->muonMap_.begin(); itr != php->muonMap_.end(); ++itr, ++k) {
0032     edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", "
0033                                  << (itr->second).second << ")";
0034   }
0035 }
0036 
0037 DEFINE_FWK_MODULE(MuonOffsetAnalyzer);