Skip to content

Commit

Permalink
Only recast vector members for non-subset collections
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jul 25, 2023
1 parent d303c90 commit c0c5a5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/templates/Collection.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0c5a5c

Please sign in to comment.