Dear ROOT experts,
Ever since updating ROOT to the newest v6.26, when I try to create a Snapshot of a processed RDataFrame, all columns are converted from std::vector<float/double/int/char> to RVec<float/double/int/char>. I found in another topic that this is the expected behavior in the new ROOT versions.
While this is no doubt good when working with only RDataFrame, it breaks compatibility with other software expecting std::vectors in the TTree. In our case, running the HistFitter statistical framework (https://github.com/histfitter/histfitter) with the validated ROOT version v6.22, results in a ton of “Error in TExMap::Add: key 1 is not unique” error messages and an incorrect output.
Is there a way to prevent the vector → RVec conversion when storing the Snapshot? I tried manually redefining the columns back to RVec with
auto df_upd = df.Redefine("colName", [](const RVecI &v) -> std::vector<Int_t> {
return std::vector<Int_t>(v.data(), v.data() + v.size());
}, {"colName"});
but it doesn’t work; the stored branches still have the incorrect type.
Cheers,
Jean Yves
ROOT Version: 6.26
Platform: lxplus CentOS 7