Regarding the Fitting

I wanted to fit my data with that of power fitting.How can i do that by writing the command and also directly from the fit panel of the canvas? since i didn’t find the option of doing that in the fit panel as well.


Suppose you want to fit an histogram, which you have called h1, with a function
f(x) = A * x + b.

auto f1 = new TF1("f", "[A]*x + [B}");

If you want to use the FItPanel, you have a text field where you can enter your own function or use some pre-defined functions.

More information is available in the Fitting chapter of the user guide

and you can find examples in the tutorials/fit directory


suppose i want the power fit of the form: y=Ax^c,where i want to know c from the fit,i.e how its varying with x.
here in my case,its dev=A*(rigidity)^c. my command is written as:

{TNtuple calls(“calls”,“calls”,“dev:rigidity”);

TCanvas *alpha1 = new TCanvas(“alpha1”,“canvas”);


auto z1 = new TF1(“dev”, “[A]*[rigidity]^[c]”);



now,what’s wrong in this,can you correct that pls? since i din’t find it.


this is a dupe of Regarding the fit of the data


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.