runtime_error: Template method resolution failed:
ROOT::RDF::RInterface<ROOT::Detail::RDF::RRange<ROOT::Detail::RDF::RLoopManager>,void>
ROOT::RDF::RInterface<ROOT::Detail::RDF::RRange<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.
not sure if it’s automatically handled, but when i need to combine RVec object with custom function i always avoid to make copies for each call , with const even better if possible
A thing you can also bare in mind is that if you would have done
Define( "pt2", "tr_px*tr_px + tr_py*tr_py")
RDF is smart enough to provide vector[size] * vector[size] = product-element wise or also with vector*scalar. Not sure if the pow( RVec<T>, 0.5 ) is also implemented (apparently yes, see next comment) , if so you would not even need to declare your function