Skip to content

F.VALUE_OR should work with LHCb::linalg::Vec

@tfulghes attempted to use F.VALUE_OR with F.TOLINALG in FunTuple, but it seems the current F.VALUE_OR implementation is incompatible with LHCb::linalg::Vec<T,N>. The existing F.VALUE_OR can take a Python array and convert it to a C++ std::vector.

One potential solution might be to simply allow LHCb::linalg::Vec<T,N> to be constructed by a std::vector, then invoke the constructor in the C++ implementation of F.VALUE_OR.

Another alternative would be to extend the Python grammar to accommodate a string, convert it into C++ code, and then call the LHCb::linalg::Vec<T,N> constructor with it.

The latter proposal would be more flexible and could accommodate more class types in the future as more classes are adapted in FunTuple.

FYI: @graven @amathad @tfulghes

Edited by Jiahui Zhuo