I’m trying to get a confidence level based on chi2 and degrees of freedom; after some digging I found this TMath::Prob function. When I try to use it, however, it returns values on the order of 10^8. Here’s the relevent part of my code:
(the print chi2dof line returns a value of ~3)
I’ve also discovered that if I make dof negative the function does not return 0 like it should, it still returns something on the order of 10^8. This is also the case if I remove dof from the function call, as in
do you really have quotation marks around the calls to TMath::Prob?! You do this very consistently in your postings, so I’m getting a bit worried now…
Could you send us a working macro which demonstrates what you see? It might just be printf("%f\n", TMath::Prob(42.,17));or whatever your actual values for chi2 and ndf are.
It would seem something has been changed to fix this; and yes, as stupid as it seems I did have the quotes there the whole time. Without them I got some error I can’t remember exactly which seemed to imply that Prob was defined but not usable. This error has gone away as well; in case it’s not obvious I’m at best mediocre at coding so I can’t make a good guess as to what was wrong. I am now getting reasonable numbers, but since I did have the quotes there the whole time I’m not sure at which point I fixed the other issues. Unfortunately I now have to deal with my bad fits, as the values
chisq = 294
dof = 92
return a CL of 0, which seems reasonable (especially when you look at my fit). Other fits return good CL values though, so I believe things are working. Thank you for your help.