Unfortunatelly it’s quite hard to have a small reproducer. Are you referring to the name of the Histo1d?
I tried to pass in AddEntry directly RoHigh and RoHigh_neg without .GetPtr(), but there is an error:
In file included from input_line_8:1:
/home/commodo98/programmi/CMProject/analysis/dalitz.cpp:321:11: error: no matching member function for call to 'AddEntry'
legend2->AddEntry(RoHigh,"#rho_{high} from B+", "l");
~~~~~~~~~^~~~~~~~
/home/commodo98/root/builddir/include/TLegend.h:36:20: note: candidate function not viable: no known conversion from 'ROOT::RDF::RResultPtr<TH1D>' to 'const TObject *' for 1st argument
TLegendEntry *AddEntry(const TObject* obj, const char* label = "", Option_t* option = "lpf" );
^
/home/commodo98/root/builddir/include/TLegend.h:37:20: note: candidate function not viable: no known conversion from 'ROOT::RDF::RResultPtr<TH1D>' to 'const char *' for 1st argument
TLegendEntry *AddEntry(const char *name, const char* label = "", Option_t* option = "lpf" );
However, if I assign a name to the histrogram and pass that to AddEntry it’s working!
My question now is, why are there problems if I try to pass the pointer?
And is it possible that also for other functions, like the Add() for adding two histograms (which requires the pointer to pass) there is the same problem?