Fitting tool features in the right click menu

ROOTers

I was able to find a bug in my program. I don’t really understand why it happens though. I have attached the minimum code to reproduce the problem. I try to fit a pol1 function to one of my lines. If I do it in the following sequence:

[color=red]Right click -> fit > pol1 -> range [0…100][/color]

The program crashes.

However if I do

[color=green]Right click - > fitpanel -> pol1 -> range [0…100] IT works.[/color]

Furthermore if I do the following in the second line:

[color=green]Right click -> fit > pol1 -> range [0…100][/color]

That function will work and the program doesn’t crashed. It took me a bit to figure this problem. I tested in Root version 19,22,24 and they all seem to have the same problem. Just though to bring it to your attention…

Kris
APIfittingFails.tar (150 KB)

Hi,

I have fixed this problem now in the math branch. It will probably be in the next release.

The issue here is that the Fit method that was being called was not the correct one. If you watch carefully in the Fit window, it is asking for a pointer to a TF1, while it should ask for a char* containing a formula. Now it does it that way.

In the case of the fitpanel, it builds a proper TF1 containing the specified formula, but it does so behind the scene.

Please, next time post this as a bug in Savannah.
Thanks for your help!
David

Sorry, what is Savannah?


I find fit panel to be slightly better now in release 5.24.00 when you have the option to include your range limit for the fitting on the numerical text boxes instead of using the sliding bars. Even better to have this option still available.

Two thumbs up!

Kris

[quote=“dmgonzal”]Hi,

I have fixed this problem now in the math branch. It will probably be in the next release.

The issue here is that the Fit method that was being called was not the correct one. If you watch carefully in the Fit window, it is asking for a pointer to a TF1, while it should ask for a char* containing a formula. Now it does it that way.

In the case of the fitpanel, it builds a proper TF1 containing the specified formula, but it does so behind the scene.

Please, next time post this as a bug in Savannah.
Thanks for your help!
David[/quote]

savannah.cern.ch/bugs/?func=add … up=savroot

(see the home page of the ROOT forum)