From 65ed7b25791642afda1c2b8ea04afd58e716a83d Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Wed, 17 Aug 2022 17:27:30 -0400 Subject: [PATCH] fix: `PodioOutput` metadata branch `CollectionTypeInfo` is not completely filled --- JugBase/src/components/PodioOutput.cpp | 10 +++------- JugBase/src/components/PodioOutput.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/JugBase/src/components/PodioOutput.cpp b/JugBase/src/components/PodioOutput.cpp index 27938784..fe2f97e1 100644 --- a/JugBase/src/components/PodioOutput.cpp +++ b/JugBase/src/components/PodioOutput.cpp @@ -76,10 +76,6 @@ void PodioOutput::resetBranches(const std::vector>& collections) { - // collectionID, collection type, subset collection - auto* collectionInfo = new std::vector>(); - collectionInfo->reserve(collections.size()); - for (const auto& [collName, collBuffers] : collections) { auto buffers = collBuffers->getBuffers(); auto* data = buffers.data; @@ -116,22 +112,22 @@ void PodioOutput::createBranches(const std::vectorgetCollectionIDs()->collectionID(collName); const auto collType = collBuffers->getValueTypeName() + "Collection"; - collectionInfo->emplace_back(collID, std::move(collType), collBuffers->isSubsetCollection()); + m_collectionInfo.emplace_back(collID, std::move(collType), collBuffers->isSubsetCollection()); debug() << isOn << " Registering collection " << collClassName << " " << collName.c_str() << " containing type " << className << endmsg; collBuffers->prepareForWrite(); } - - m_metadatatree->Branch("CollectionTypeInfo", collectionInfo); } StatusCode PodioOutput::execute() { // for now assume identical content for every event // register for writing if (m_firstEvent) { + m_collectionInfo.clear(); createBranches(m_podioDataSvc->getCollections()); createBranches(m_podioDataSvc->getReadCollections()); + m_metadatatree->Branch("CollectionTypeInfo", &m_collectionInfo); } else { resetBranches(m_podioDataSvc->getCollections()); resetBranches(m_podioDataSvc->getReadCollections()); diff --git a/JugBase/src/components/PodioOutput.h b/JugBase/src/components/PodioOutput.h index 5bb64086..2dba4dd8 100644 --- a/JugBase/src/components/PodioOutput.h +++ b/JugBase/src/components/PodioOutput.h @@ -58,6 +58,7 @@ private: gsl::owner m_colMDtree; /// The stored collections std::vector m_storedCollections; + std::vector> m_collectionInfo; }; #endif -- GitLab