Thank you for your reply and suggestion! I am somehow not able to implement the correct syntax for RooAbsReal::asTF() the way you have mentioned it. I looked at its definition in the root documentation and also tried looking for examples online to use it correctly but without any avail. Here’s my RooPolynomial:
You have to pass the observables and parameters. I also suggest to wrap the returned object in a std::unique_ptr, such that you don’t have to delete it manually.
In your call to TH1::Add(), you can then use this smart pointer like Add(polyf.get()).
going by the definition of TH1::Add() but I keep on getting the error:
Error: Symbol polyf is not defined in current scope
Error: Failed to evaluate polyf.get()
I later even included the header #include <memory> (which I forgot to include before) since there’s a unique_ptr, but the error persists. Any further help is highly appreciated, thank you!