Making predictions with a TF1Convolution function

Greetings rooters,

I am using ROOT’s TF1Convolution to fit a distribution, with this code template:

  TF1Convolution *fConv = new TF1Convolution("([0]/(1+exp(x-[1]/[2])))","gaus",-1,6, true);
   fConv->SetRange(-5.,5.);
   fConv->SetNofPointsFFT(1000);
   TF1   *fitFun = new TF1("fitFun",*fConv, -5, 5., fConv->GetNpar());
   hist -> Fit("fitFun");

My question: is there a way to make predictions with the convoluted function? Is it possible to calculate the function values once the fit parameters are determined, say for instance for x=6.0?

Thanks in advance.


_ROOT Version: 6
_Platform: CentOS
Compiler: GCC


Hi,

of course! What problem are you encountering?

Cheers,
P

Hi P,

How to do that? Can the analytical form be retrieved? or what class methods are available to perform the
calculation.

Thanks

TF1::Eval
TF1::operator()

TF1::EvalPar
TF1::operator()

Thanks @Wile_E_Coyote. I implemented using:

Blockquote
double params[6];
params[0] = fitFun->GetParameter(0);
params[1] = fitFun->GetParameter(1);
params[2] = fitFun->GetParameter(2);
params[3] = fitFun->GetParameter(3);
params[4] = fitFun->GetParameter(4);
params[5] = fitFun->GetParameter(5);
params[6] = fitFun->GetParameter(6);
// value to be calculated
double x=4, value{0};
value = fitFun->EvalPar(x, params);

It resolves into the following error:

Blockquote
error: no matching function for call to ‘TF1::EvalPar(double&, double [6])’
value = fitFun->EvalPar(x, &params[6]);

What might be the reason for this?

value = fitFun->Eval(x);

or:

value = fitFun->EvalPar(&x, params);

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