Open krasznaa opened 1 year ago
Hi Attila,
This is a know limitation. The work-around is to wrap the std::array
by another class (for which you need to declare a dictionary).
How urgently would you need the proper implementation?
Cheers, Philippe.
Hi Philippe,
I don't think we have a super strict timeline on this.
We would prefer to use STL types in such branches as much as possible. In this case std::array
would be preferred because std::vector<std::array<T, N> >
is nicely contiguous in memory. Which we would really like to have for using accelerators efficiently with these new data types. (Since such an object would map super easily into an std::mdspan
.)
We'll think internally a bit whether we'd go for std::vector<std::vector<T> >
or std::vector<ATLASType>
for now...
Cheers, Attila
You can mark this as "very nice to have" also for CMS :-)
CMS is finally getting its own edm::StdArray
(https://github.com/cms-sw/cmssw/pull/43076) to work around this issue :-)
Describe the bug
While updating ATLAS's EDM, we tried to introduce some
std::vector<std::array<float, 3> >
variables into our output files. But was met with the following types of errors:You can find the details in https://gitlab.cern.ch/atlas/athena/-/merge_requests/59648, but the problem is luckily fairly easy to reproduce in a completely "standalone" way as well.
Expected behavior
We would like to be able to write and read
std::vector<std::array<T, N> >
variables (and ideally even more complicated combinations ofstd::vector
andstd::array
types) usingTTree
branches.To Reproduce
I wrote the following small example:
Makefile
:LinkDef.h
:arrayWrite.cpp
:Building and running this example gets me:
Setup
Tried it with ROOT 6.26/06 and 6.24/06. With both the "LCG version" on
x86_64-centos7-gcc11-opt
and with hand-built versions on Ubuntu 22.04.Additional context
N/A