diff --git a/python/templates/CollectionData.cc.jinja2 b/python/templates/CollectionData.cc.jinja2 index 3946ad756..cfa143060 100644 --- a/python/templates/CollectionData.cc.jinja2 +++ b/python/templates/CollectionData.cc.jinja2 @@ -83,11 +83,13 @@ void {{ class_type }}::clear(bool isSubsetColl) { podio::CollectionWriteBuffers {{ class_type }}::getCollectionBuffers(bool isSubsetColl) { {% if VectorMembers %} - // Make sure these point to the right place, even if a collection has been - // moved since it has been created + if (!isSubsetColl) { + // Make sure these point to the right place, even if a collection has been + // moved since it has been created {% for member in VectorMembers %} - m_vecmem_info[{{ loop.index0 }}].second = &m_vec_{{ member.name }}; + m_vecmem_info[{{ loop.index0 }}].second = &m_vec_{{ member.name }}; {% endfor %} + } {% endif -%} return {