From a6a1fd03da8ee3461ec41a0781c7dbbe559f9540 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:27:04 +0200 Subject: [PATCH] Use `edm4hep::labels` (#200) --- k4FWCore/components/PodioInput.cpp | 4 ++-- .../src/components/ExampleEventHeaderConsumer.cpp | 2 +- .../ExampleFunctionalProducerRuntimeCollections.cpp | 6 +++--- .../src/components/k4FWCoreTest_cellID_reader.h | 2 +- .../src/components/k4FWCoreTest_cellID_writer.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/k4FWCore/components/PodioInput.cpp b/k4FWCore/components/PodioInput.cpp index ba7cc135..97a6e66a 100644 --- a/k4FWCore/components/PodioInput.cpp +++ b/k4FWCore/components/PodioInput.cpp @@ -213,8 +213,8 @@ StatusCode PodioInput::initialize() { } void PodioInput::operator()() const { - if (m_podioDataSvc->getEventFrame().get(edm4hep::EventHeaderName)) { - m_readers[edm4hep::EventHeaderCollection::typeName](edm4hep::EventHeaderName); + if (m_podioDataSvc->getEventFrame().get(edm4hep::labels::EventHeader)) { + m_readers[edm4hep::EventHeaderCollection::typeName](edm4hep::labels::EventHeader); } else { info() << "No EventHeader collection found in the event. Not reading it" << endmsg; } diff --git a/test/k4FWCoreTest/src/components/ExampleEventHeaderConsumer.cpp b/test/k4FWCoreTest/src/components/ExampleEventHeaderConsumer.cpp index 0915fa38..426f4ef1 100644 --- a/test/k4FWCoreTest/src/components/ExampleEventHeaderConsumer.cpp +++ b/test/k4FWCoreTest/src/components/ExampleEventHeaderConsumer.cpp @@ -35,7 +35,7 @@ struct ExampleEventHeaderConsumer final : k4FWCore::Consumer { ExampleEventHeaderConsumer(const std::string& name, ISvcLocator* svcLoc) - : Consumer(name, svcLoc, {KeyValues("EventHeaderName", {edm4hep::EventHeaderName})}) {} + : Consumer(name, svcLoc, {KeyValues("EventHeaderName", {edm4hep::labels::EventHeader})}) {} void operator()(const edm4hep::EventHeaderCollection& evtHeaderColl) const { if (evtHeaderColl.empty()) { diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalProducerRuntimeCollections.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalProducerRuntimeCollections.cpp index 7579844e..8d13f766 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalProducerRuntimeCollections.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalProducerRuntimeCollections.cpp @@ -34,15 +34,15 @@ struct ExampleFunctionalProducerRuntimeCollections final // This is the function that will be called to produce the data std::map operator()() const override { - std::map m_outputCollections; + std::map outputCollections; for (int i = 0; i < m_numberOfCollections; ++i) { std::string name = "MCParticles" + std::to_string(i); auto coll = edm4hep::MCParticleCollection(); coll->create(1, 2, 3, 4.f, 5.f, 6.f); coll->create(2, 3, 4, 5.f, 6.f, 7.f); - m_outputCollections[name] = std::move(coll); + outputCollections[name] = std::move(coll); } - return m_outputCollections; + return outputCollections; } private: diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_reader.h b/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_reader.h index f6541243..f8f9f88e 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_reader.h +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_reader.h @@ -55,7 +55,7 @@ class k4FWCoreTest_cellID_reader : public Gaudi::Algorithm { /// Handle for the SimTrackerHits to be read mutable DataHandle m_simTrackerHitReaderHandle{"SimTrackerHits", Gaudi::DataHandle::Reader, this}; - mutable MetaDataHandle m_cellIDHandle{m_simTrackerHitReaderHandle, edm4hep::CellIDEncoding, + mutable MetaDataHandle m_cellIDHandle{m_simTrackerHitReaderHandle, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Reader}; }; #endif /* K4FWCORE_K4FWCORETEST_CELLID */ diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_writer.h b/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_writer.h index 824e48dd..49848722 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_writer.h +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_cellID_writer.h @@ -57,7 +57,7 @@ class k4FWCoreTest_cellID_writer : public Gaudi::Algorithm { /// Handle for the SimTrackerHits to be written mutable DataHandle m_simTrackerHitWriterHandle{"SimTrackerHits", Gaudi::DataHandle::Writer, this}; - MetaDataHandle m_cellIDHandle{m_simTrackerHitWriterHandle, edm4hep::CellIDEncoding, + MetaDataHandle m_cellIDHandle{m_simTrackerHitWriterHandle, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer}; }; #endif /* K4FWCORE_K4FWCORETEST_CELLID_WRITER */