File indexing completed on 2024-04-06 12:15:28
0001 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0002 #include "FWCore/Framework/interface/Event.h"
0003 #include "FWCore/Framework/interface/EventSetup.h"
0004 #include "FWCore/Framework/interface/MakerMacros.h"
0005
0006 #include "Geometry/Records/interface/PTrackerParametersRcd.h"
0007 #include "CondFormats/GeometryObjects/interface/PTrackerParameters.h"
0008
0009 #include <iostream>
0010
0011 class TrackerParametersAnalyzer : public edm::one::EDAnalyzer<> {
0012 public:
0013 explicit TrackerParametersAnalyzer(const edm::ParameterSet&) : ptpToken_(esConsumes()) {}
0014
0015 void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0016
0017 private:
0018 edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> ptpToken_;
0019 };
0020
0021 void TrackerParametersAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0022 edm::LogVerbatim("TrackerParametersAnalyzer") << "Here I am";
0023
0024 auto const& ptp = iSetup.getData(ptpToken_);
0025
0026 for (const auto& vitem : ptp.vitems) {
0027 edm::LogVerbatim("TrackerParametersAnalyzer") << vitem.id << " has " << vitem.vpars.size() << ":";
0028 for (const auto& in : vitem.vpars) {
0029 edm::LogVerbatim("TrackerParametersAnalyzer") << in << ";";
0030 }
0031 }
0032 for (int vpar : ptp.vpars) {
0033 std::cout << vpar << "; ";
0034 }
0035 }
0036
0037 DEFINE_FWK_MODULE(TrackerParametersAnalyzer);