My idea is that I don’t need large precision for each leaf, thus saving space. But to calculate the mean, I would like to increase the precision of the result to avoid numerical errors. Unfortunately I get an error with that code (see the first line):
Error in TTreeReaderValueBase::CreateProxy(): Leaf of type Float_t cannot be read by TTreeReaderValue.
Traceback (most recent call last):
File “…/read_phys_file.py”, line 46, in
print(“no cut, cuts:”, dr_th_no_cut.GetValue(), dr_th_wcuts.GetValue())
~~~~~~~~~~~~~~~~~~~~~^^
cppyy.gbl.std.runtime_error: const double& ROOT::RDF::RResultPtr::GetValue() =>
runtime_error: An error was encountered while processing the data. TTreeReader status code is: 6
Can RDataFrame support increasing accuracy for such aggregation operations? Is there a good workaround to solve that?
Maybe with Redefine (or Define, for new extra columns), but the result seems to be the same, so maybe it doesn’t matter if it’s float originally, ROOT will use double precision (or it’s not really converting to double? an RDataFrame expert may clarify)?