Fitting function with TF2 Integral

Hi Experts!

I’m trying to fit a function using TF2 integral, its a simultaneous reduction of Chi-square.
I have attached the zip file with the fitting code SSHA.cxx and the data files to be read is also attached.
The code FitOverlay.C overlays the fit on the data. I have also attached a README file on how to run.

Any insight would be appreciated!.

Best,
Rutik

Hi @Rutik ,

the attachments seem to be missing?

Cheers,
Enrico

Fitting function.zip (12.0 KB)
Oh, I’m so sorry, here you go.

Best,
Rutik

Hi @Rutik ,

SSHA.cxx contains ~600 lines of code :slight_smile: What is the issue exactly? If you encounter an error or a crash, can you please provide a minimal self-contained reproducer for the problem?

Cheers,
Enrico

Hi @eguiraud,
I know its messy and I’m sorry for that.
The fit I get is really bad and I can’t seem to figure out what it is that I’m doing wrong.
It’s not a data issue or physics related issue, but rather somewhere in the code. I just thought
that maybe someone could figure it out, but I understand that’s asking for a lot.

Best,
Rutik

Ok, maybe @moneta can suggest ways to debug bad fits, let’s ping him.

I will try to have a look at the code, but can you explain better what the problem exactly is ?

Lorenzo

Hi @moneta,

Thank you for even considering it. So to be exact, two of the fit parameters are always at the maximum.
The chi-square/NDF is extremely high. I also try to plot the fit function on the data points and that gives a bad plot as well.

Best,
Rutik

Hi @moneta ,

I just realized an issue with this I need a TF3 function and then integrate over variables, like a TF23 implementation. I saw your link https://root-forum.cern.ch/t/equivalent-for-tf12-for-tf3/9619 for it.
So, I guess I should be implementing that.

Best,
Rutik

Hi,
That example was showing how to make a f(x,z) from a g(x,y,z) for fixed y value.
If you need to integrate or one or more variable you can also do in a similar way.

Best,

Lorenzo

1 Like

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