Dear ROOT experts,
I need to work with the .root files that contain trees with branches that have spaces in the name. There’s nothing I can do with how the files are produced.
auto a = tree_PFLOW->GetListOfBranches()
a->At(440)->GetName()
(const char *) "weight_var_th_nominal "
If I try to access it in the with the RDataFrame
df = ROOT.RDataFrame('tree_PFLOW', 'file.root')
df.Define('x', 'weight_var_th_nominal ')
I get the following error
input_line_73:2:28: error: use of undeclared identifier 'weight_var_th_nominal'
auto lambda0 = [](){return weight_var_th_nominal
^
input_line_77:2:28: error: use of undeclared identifier 'weight_var_th_nominal'
auto lambda0 = [](){return weight_var_th_nominal
^
Traceback (most recent call last):
File "/eos/home-a/apetukho/IncZZ/throwaway_scripts/dataframe_space.py", line 9, in <module>
df.Define('x', 'weight_var_th_nominal ')
cppyy.gbl.std.runtime_error: Template method resolution failed:
ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Define(basic_string_view<char,char_traits<char> > name, basic_string_view<char,char_traits<char> > expression) =>
runtime_error:
RDataFrame: An error occurred during just-in-time compilation. The lines above might indicate the cause of the crash
All RDF objects that have not run an event loop yet should be considered in an invalid state.
ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Define(basic_string_view<char,char_traits<char> > name, basic_string_view<char,char_traits<char> > expression) =>
runtime_error:
RDataFrame: An error occurred during just-in-time compilation. The lines above might indicate the cause of the crash
All RDF objects that have not run an event loop yet should be considered in an invalid state.
Is there any way to access such branches provided I cannot change the way the initial files are produced?
Thanks in advance,
Aleksandr
ROOT Version: 6.26/04