The error I get during compilation is a bit cryptic to me, it appears to be some problem with the type of the variables passed to the Compute
function?
error: no match for call to '(const TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12>, float, TMVA::Experimental::RReader&>) (__gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&, __gnu_cxx::__alloc_traits<ROOT::Detail::VecOps::RAdoptAllocator<float>, float>::value_type&)'
126 | float v = evaluator(f0[i], f1[i], f2[i], f3[i], f4[i], f5[i], f6[i], f7[i], f8[i], f9[i], f10[i], f11[i], f12[i]);
| ^
...
[in] /root/6.24.07-bf41b0420bc269850b74e23486e2953a/include/TMVA/RInferenceUtils.hxx:24:9: note: candidate: 'decltype (((TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>*)this)->TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>::fFunc.Compute({TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>::operator()::args ...})) TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>::operator()(TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>::AlwaysT<N>...) [with long unsigned int ...N = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; T = float; F = TMVA::Experimental::RReader&; decltype (((TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>*)this)->TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>::fFunc.Compute({TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, _Idx ...>, T, F>::operator()::args ...})) = std::vector<float, std::allocator<float> >]' (near match)
24 | auto operator()(AlwaysT<N>... args) -> decltype(fFunc.Compute({args...})) { return fFunc.Compute({args...}); }
| ^~~~~~~~
[in] /root/6.24.07-bf41b0420bc269850b74e23486e2953a/include/TMVA/RInferenceUtils.hxx:24:9: note: passing 'const TMVA::Experimental::Internal::ComputeHelper<std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12>, float, TMVA::Experimental::RReader&>*' as 'this' argument discards qualifiers
For reference I am using ROOT 6.24/07
.
I am including the following things in my script:
#include "ROOT/RDataFrame.hxx"
#include "ROOT/RVec.hxx"
#include "TChain.h"
#include "Math/Vector4D.h"
using namespace ROOT;
using namespace ROOT::VecOps;
using RNode = ROOT::RDF::RNode;
#include "TMVA/RReader.hxx"
#include "TMVA/RInferenceUtils.hxx"
using namespace TMVA::Experimental;
#include "correction.h"
using correction::CorrectionSet;
#include <iostream>
#include <fstream>
using doubles = ROOT::VecOps::RVec<Double_t>;
using floats = ROOT::VecOps::RVec<float>;
using bools = ROOT::VecOps::RVec<Bool_t>;
using ints = ROOT::VecOps::RVec<Int_t>;
using chars = ROOT::VecOps::RVec<unsigned char>;
And the command to compile is
g++ $(root-config --cflags --ldflags --libs) -lMLP -lMinuit -lTreePlayer -lTMVA -lTMVAGui -lXMLIO -lMLP -lm