From a675c542efc6ca6944cff8c5174ab0af41d7519c Mon Sep 17 00:00:00 2001 From: Markus Frank <Markus.Frank@cern.ch> Date: Tue, 17 Jan 2023 13:34:07 +0100 Subject: [PATCH] Temporary fix until new podio release is ready --- .github/workflows/linux.yml | 2 +- DDDigi/io/DigiEdm4hepInput.cpp | 15 ++++++++------- DDDigi/io/DigiFrame.h | 14 +++----------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 72b45845b..c575c6e73 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -132,7 +132,7 @@ jobs: -DDD4HEP_USE_GEANT4=ON \ -DBoost_NO_BOOST_CMAKE=ON \ -DDD4HEP_USE_LCIO=ON \ - -DDD4HEP_USE_EDM4HEP=ON \ + -DDD4HEP_USE_EDM4HEP=OFF \ -DDD4HEP_USE_TBB=ON \ -DDD4HEP_USE_HEPMC3=ON \ -DDD4HEP_BUILD_DEBUG=OFF \ diff --git a/DDDigi/io/DigiEdm4hepInput.cpp b/DDDigi/io/DigiEdm4hepInput.cpp index 9415f19d3..464951b1f 100644 --- a/DDDigi/io/DigiEdm4hepInput.cpp +++ b/DDDigi/io/DigiEdm4hepInput.cpp @@ -102,6 +102,7 @@ namespace dd4hep { } // End namespace digi } // End namespace dd4hep +//#include <podio/Frame.h> #include "DigiFrame.h" #include <podio/ROOTFrameReader.h> #include <edm4hep/SimTrackerHit.h> @@ -128,7 +129,8 @@ namespace dd4hep { class edm4hep_read_frame_t : public DigiInputAction::event_frame { public: podio::Frame frame { }; - edm4hep_read_frame_t(podio::Frame&& frm) : frame(std::move(frm)) {} + edm4hep_read_frame_t(podio::Frame&& frm) : frame(std::move(frm)) { } + const podio::CollectionBase* get(const std::string& nam) const { return frame.self()->get(nam); } }; using reader_t = podio::ROOTFrameReader; using frame_t = edm4hep_read_frame_t; @@ -271,20 +273,19 @@ namespace dd4hep { /// Access the next event record. If the courrent source is exhausted, open next source std::shared_ptr<frame_t> DigiEdm4hepInput::internals_t::next() { if ( !m_source || m_source->done() || m_parent->fileLimitReached(*m_source) ) { - int mask = m_parent->input_mask(); m_source = open_source(); if ( m_source ) { auto frame = m_source->next(); if ( frame ) { - auto table = frame->frame.getIDTable(); - const auto& ids = table.ids(); - for( int id : ids ) { - std::string nam = table.name(id); + auto table = frame->frame.getAvailableCollections(); + int id = 0, mask = m_parent->input_mask(); + for( const auto& nam : table ) { m_parent->info("+++ Collection id: %04X --> '%s'", id, nam.c_str()); if ( m_parent->object_loading_is_enabled(nam) ) { Key key(nam, mask); m_source->collections.emplace( key, collection_t(id, nam) ); } + ++id; } m_parent->onProcessEvent(*m_source, *frame); return frame; @@ -322,7 +323,7 @@ namespace dd4hep { for( auto& coll : internals->m_source->collections ) { const auto& nam = coll.second.name; - const podio::CollectionBase* collection = frame->frame.get(nam); + const podio::CollectionBase* collection = frame->get(nam); if ( collection ) { work_t work { context, coll, segment, collection }; (*this)(context, work); diff --git a/DDDigi/io/DigiFrame.h b/DDDigi/io/DigiFrame.h index 8a1a04258..565c286bd 100644 --- a/DDDigi/io/DigiFrame.h +++ b/DDDigi/io/DigiFrame.h @@ -1,5 +1,5 @@ -#ifndef DIGI_FRAME_H -#define DIGI_FRAME_H +#ifndef PODIO_FRAME_H +#define PODIO_FRAME_H #include "podio/CollectionBase.h" #include "podio/CollectionIDTable.h" @@ -162,15 +162,7 @@ public: /** Frame destructor */ ~Frame() = default; - /// Access CollectionIDTable from concept - podio::CollectionIDTable getIDTable() const { - return m_self->getIDTable(); - } - - /// Generic collection access from concept - const CollectionBase* get(const std::string& name) const { - return m_self->get(name); - } + const std::unique_ptr<FrameConcept>& self() const { return m_self; } /** Get a collection from the Frame */ -- GitLab