diff --git a/JugBase/src/components/PodioOutput.cpp b/JugBase/src/components/PodioOutput.cpp index 279387849c282c15e76f6ebcc2bd772f41cbd3df..fe2f97e16a75d01af5731fc7f47fb4d34db31d8a 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 5bb6408686df3c8f71d308fc33f4f869eb17f3dd..2dba4dd8c3de59d60ca15d0a4cfc879776786bd5 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