FairRoot icon indicating copy to clipboard operation
FairRoot copied to clipboard

Write std::array to file using FairRootManager->RegisterAny()

Open vadimr3b opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. Since PR#4425 (more information) it is possible to store a simple std::array into a TTree. After installing FairRoot with Root 6.20.00 I was hoping to achive the same with FairRoot by FairRootManager->RegisterAny, but this still fails with [FATAL] No dictionary found for std::array<double, 1ul>. Maybe I did not consider something inside FairRoot while installing it with the newest Root version and it will work out of the box with the next release?

Describe the solution you'd like auto ptrToArray = new std::array<double, 5>(); FairRootManager::Instance()->RegisterAny("myArray", ptrToArray, kTRUE); should write the array into the file.

vadimr3b avatar Feb 27 '20 18:02 vadimr3b

Dear Vadim,

since we are still not supporting the latest ROOT (6.20), we do not support storing std::array as branch in FairRoot yet. Did you try to use the std::vector to store your data?

karabowi avatar Mar 23 '20 11:03 karabowi