For some reason, in ROOT the “OptFit” by default is 0, even when I have fitted a histogram.
I would like to set this option to 1 by default, how can I do this.
I know that I could set things in the “.rootrc” file, but I haven’t found how to set “gStyle->SetOptFit(1)” in .rootrc so that ROOT understands it.
According to the documentation for TStyle::SetOptFit the default is 0111 (not the octal number) or ‘cev’ meaning chisquare / ndf, errors and name / values.
After testing with 6.08.06, I agree that the default for SetOptFit is 0. This does not agree with the documentation nor the declaration of SetOptFit in TStyle.h:
@ksmith Seems to me the behavior is correct . By default gStyle->SetOptFit(); is not called. So the flag to turn on or off the fit option is 0. As soon as you call gStyle->SetOptFit(); the default value for the parameter value is set (i.e. 1). That’s what I can see with all the root version I have:
which would imply the default value be 111. Instead we have one, although at the end of the documentation we have:
Note: gStyle->SetOptFit(1) means "default value", so it is equivalent to gStyle->SetOptFit(111)
This is at the very least confusing. Is 1==111? What if I only want the values and no probability or errors?
The meaning of default here is confused with the two choices, default when ROOT starts or default when the method is called. SetOptStat behaves such that the default is set when ROOT starts.
What about clarification of the meaning of the work default? It seems that SetOptStat and SetOptFit are slightly different. And this brings up the question why is SetOptFit not set to 111 on startup?