Skip to content

AthContainers: Add methods returning spans of aux variables.

Scott Snyder requested to merge ssnyder/athena:spans.AthContainers-20230524 into 23.0

Add getDataSpan methods to both the accessor objects and to DataVector (actually AuxVectorData) which return the data for an auxiliary variable as a span object (CxxUtils::span for now, hopefully to be changed to std::span once we build with c++20).

So from pyroot you can do things like

list(acc.getDataSpan(tp))
sp = tp.getConstDataSpan['float']('chiSquared')
list(sp)

or then even

from numpy import np
ar = np.asarray (sp)

which should avoid any copies of the data itself.

Merge request reports

Loading