From fe5d0a08d90e0eed9ff87672b3d4e12d14b0d131 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Sat, 3 May 2025 11:18:02 -0500
Subject: [PATCH] feat: forward support podio-v1.2 ROOTFrameReader removal

---
 benchmarks/rich/include/Tools.h  | 5 +++++
 benchmarks/rich/src/benchmark.cc | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/benchmarks/rich/include/Tools.h b/benchmarks/rich/include/Tools.h
index c34a142a..8458626d 100644
--- a/benchmarks/rich/include/Tools.h
+++ b/benchmarks/rich/include/Tools.h
@@ -17,6 +17,7 @@
 #include <Evaluator/DD4hepUnits.h>
 
 // data model
+#include <edm4hep/EDM4hepVersion.h>
 #include <edm4hep/SimTrackerHitCollection.h>
 #include <edm4hep/utils/kinematics.h>
 
@@ -67,7 +68,11 @@ namespace benchmarks {
       // -------------------------------------------------------------------------------------
       // get photon wavelength
       static double GetPhotonWavelength(const edm4hep::SimTrackerHit& hit, std::shared_ptr<spdlog::logger> log) {
+#if EDM4HEP_BUILD_VERSION >= EDM4HEP_VERSION(0, 99, 0)
+        auto phot = hit.getParticle();
+#else
         auto phot = hit.getMCParticle();
+#endif
         if(!phot.isAvailable()) {
           log->error("no MCParticle in hit");
           return -1.0;
diff --git a/benchmarks/rich/src/benchmark.cc b/benchmarks/rich/src/benchmark.cc
index d988601f..afe8c351 100644
--- a/benchmarks/rich/src/benchmark.cc
+++ b/benchmarks/rich/src/benchmark.cc
@@ -8,7 +8,12 @@
 
 #include <TFile.h>
 
+#include <podio/podioVersion.h>
+#if podio_VERSION >= PODIO_VERSION(0, 99, 0)
+#include <podio/ROOTReader.h>
+#else
 #include <podio/ROOTFrameReader.h>
+#endif
 #include <podio/Frame.h>
 
 #include "SimHitAnalysis.h"
@@ -264,7 +269,11 @@ int main(int argc, char** argv) {
   // -------------------------------------------------------------
 
   // open the input files
+#if podio_VERSION >= PODIO_VERSION(0, 99, 0)
+  podio::ROOTReader podioReader;
+#else
   podio::ROOTFrameReader podioReader;
+#endif
   m_log->warn("podio::ROOTFrameReader cannot yet support multiple files; reading only the first");
   // podioReader.openFiles(rec_files);
   podioReader.openFile(rec_files.front());
-- 
GitLab