Taylor expansion of RooFit functions using the taylorExpand function with RooPolyFunc
{
double x0 = 2.0;
auto frame =
x.frame(
Title(
"x^{4} - 5x^{3} + 5x^{2} + 5x - 6"));
auto c =
new TCanvas(
"rf710_roopoly",
"rf710_roopoly", 400, 400);
f.plotOn(frame,
Name(
"f"));
frame->SetMinimum(-8.0);
frame->SetMaximum(+8.0);
frame->SetYTitle("function value");
frame->Draw();
auto legend =
new TLegend(0.53, 0.7, 0.86, 0.87);
legend->SetTextSize(0.02);
legend->AddEntry("taylor_o1", "Taylor expansion upto first order", "L");
legend->AddEntry("taylor_o2", "Taylor expansion upto second order", "L");
legend->AddEntry("f", "Polynomial of fourth order", "L");
legend->Draw();
c->SaveAs(
"rf710_roopoly.png");
}
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooPolyFunc implements a polynomial function in multi-variables.
static std::unique_ptr< RooPolyFunc > taylorExpand(const char *name, const char *title, RooAbsReal &func, const RooArgList &observables, int order=1, std::vector< double > const &observableValues={}, double eps1=1e-6, double eps2=1e-3)
Taylor expanding given function in terms of observables around observableValues.
RooRealVar represents a variable that can be changed from the outside.
This class displays a legend box (TPaveText) containing several legend entries.
RooCmdArg LineColor(Color_t color)
RooCmdArg LineStyle(Style_t style)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
- Date
- December 2021
- Author
- Rahul Balasubramanian
Definition in file rf710_roopoly.C.