I am trying to do a binned fit using the functions that I have written. I am able to do the fit but I am not able to make the pull distributions for this fit. I do.t want to use Roofit for this case
Would you please have a look? Here’s the working macro and the root file. KS_binned_fit.tar.gz (18.6 KB)
Thanks in Advance.
_
ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
How are you unable to make the pull distributions? Do you get an error, if so, what error? Over which entries do you want to plot the pulls - I only see one histogram? I suppose you want to plot the pull over each data point? Then this should help: Plot of Fit Residuals
I used the definition of pull which was was given in the link that you shared.
I have now slightly changed the code for the pull, now, I am doing hpull->SetBinContent(i,pull), and I am able to get stuff in the pull histogram but i don’t think they are correct.
Thank you for the links. There are no entries on over flow or underflow bins. I understand that the link was for residuals, but what should be the definition of the pull, I think I am missing a term in it.
The values I get are much higher than 0.45 to 0.55.
You might want to have a chat with your advisor to understand these terms, what under-/overflow means, and how to plot the pull. Just quickly:
You measure y_m \pm \Delta y, the fit for the corresponding x value is at y_f. Then the pull p is p = \frac{y_m - y_f}{\Delta y}.
If you create a histogram TH1F hist("h","h", 10, 0.45, 0.55) and call hist.Fill(0.51); hist.Fill(7.3); then you will see only one entry in the histogram, as the second Fill adds an entry out of range (“overflow”, as it’s larger than the upper limit of 0.55). You can see the number of under-/overflow entries with gStyle->SetOptStat(111111) before drawing. IOn your case, about 12 entries ended up in the range of 0.45…0.55, the rest of the 200 entries were in under-/overflow bins.
Now - we’re happy to help with how to use ROOT, but we get to our limits with a general introduction to experimental particle physics You might find friendly people here in the forum who help you nonetheless, but it’s better to consult with your advisor / physics group / professor / … for these kind of non-ROOT-related questions.