From c0c5a5c94c54ac58715e34e6eacf3432ef6a751d Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 21 Jul 2023 20:19:12 +0200 Subject: [PATCH] Only recast vector members for non-subset collections --- python/templates/Collection.cc.jinja2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/templates/Collection.cc.jinja2 b/python/templates/Collection.cc.jinja2 index 99cbd01af..44b4c139d 100644 --- a/python/templates/Collection.cc.jinja2 +++ b/python/templates/Collection.cc.jinja2 @@ -198,14 +198,15 @@ podio::CollectionReadBuffers createBuffers(bool isSubset) { }; readBuffers.recast = [](podio::CollectionReadBuffers& buffers) { + // We only have any of these buffers if this is not a subset collection if (buffers.data) { buffers.data = podio::CollectionWriteBuffers::asVector<{{ class.full_type }}Data>(buffers.data); - } {% if VectorMembers %} {% for member in VectorMembers %} (*buffers.vectorMembers)[{{ loop.index0 }}].second = podio::CollectionWriteBuffers::asVector<{{ member.full_type }}>((*buffers.vectorMembers)[{{ loop.index0 }}].second); {% endfor %} {% endif %} + } }; return readBuffers;