/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc
37 строк
1 KB
Sunanda
Take care of ESGetToken in Geometry/MuonNumbering
22 июн 2021, 17:24
22 июн 2021, 17:24
8180690
Код
Авторство
О чём код?
#include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #include <iostream> class MuonOffsetAnalyzer : public edm::one::EDAnalyzer<> { public: explicit MuonOffsetAnalyzer(const edm::ParameterSet&); void analyze(edm::Event const& iEvent, edm::EventSetup const&) override; private: edm::ESGetToken<MuonOffsetMap, IdealGeometryRecord> parToken_; }; MuonOffsetAnalyzer::MuonOffsetAnalyzer(const edm::ParameterSet&) { parToken_ = esConsumes<MuonOffsetMap, IdealGeometryRecord>(edm::ESInputTag{}); } void MuonOffsetAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) { const auto& par = iSetup.getData(parToken_); const MuonOffsetMap* php = ∥ edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD: Finds " << php->muonMap_.size() << " entries in the map"; unsigned int k(0); for (auto itr = php->muonMap_.begin(); itr != php->muonMap_.end(); ++itr, ++k) { edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " << (itr->second).second << ")"; } } DEFINE_FWK_MODULE(MuonOffsetAnalyzer);