ROOT Version: 6.24/02
Platform: Linux/Fedora 34
Compiler: gcc version 11.3.1 20220421
Hello,
I have a ROOT file which contains a tree with several branches and I’m trying to use RDataFrame to generate a histogram for one of the branches (eX
) as shown below:
ROOT::RDataFrame df("gTree", "testF.root");
auto h = df.Fill(TH1D("eX","eX",8192.,0,8192),{"eX"});
h->Draw();
This works perfectly as expected.
Please note that eX
is a variable array of type ULong64_t
However, when I try to apply filter e.g. eX > 100
using an example given here & using the following code
ROOT::RDataFrame df("gTree", "testF.root");
auto h = df.Filter("eX > 100").Histo1D("eX");
h->Draw();
It is throwing the following error:
In module 'ROOTDataFrame':
/opt/root/pro/include/ROOT/RDF/InterfaceUtils.hxx:276:4: error: static_assert failed due to requirement 'std::is_convertible<ROOT::VecOps::RVec<int>, bool>::value' "filter expression returns a type that is not convertible to bool"
static_assert(std::is_convertible<FilterRet_t, bool>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/root/pro/include/ROOT/RDF/InterfaceUtils.hxx:389:17: note: in instantiation of function template specialization 'ROOT::Internal::RDF::CheckFilter<__rdf::(lambda at input_line_33:2:16)>' requested here
RDFInternal::CheckFilter(f);
^
input_line_35:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitFilterHelper<__rdf::(lambda at input_line_33:2:16) &, ROOT::Detail::RDF::RNodeBase>' requested here
ROOT::Internal::RDF::JitFilterHelper(__rdf::lambda0, new const char*[1]{"E_Ge"}, 1, "", reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedFilter>*>(0x4953920), reinterpret_cast<std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x497b9b0),reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x6295660));
^
In module 'ROOTDataFrame':
/opt/root/pro/include/ROOT/RDF/RFilter.hxx:108:14: error: no viable conversion from returned value of type 'ROOT::VecOps::RVec<int>' to function return type 'bool'
return fFilter(fValues[slot][S]->template Get<ColTypes>(entry)...);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help is highly appreciated.
Regards,
Ajay