Hello RooFitters,
I’m trying to do some fits over a restricted range, and then interpret the fit parameters over a separate range. To test my code, I took rf204_extrangefit.C and made the following changes:
localhost | tmp [39]: diff rf204_extrangefit.C /usr/local/root/root_v5.28.00/tutorials/roofit/rf204_extrangefit.C
82c82
< RooDataSet *data = model.generate(x,10000) ;
---
> RooDataSet *data = model.generate(x,1000) ;
86,87c86
< x.setRange("fitRange",1.0,9.0);
< RooFitResult* r = model.fitTo(*data,Extended(kTRUE),Save(),Range("fitRange")) ;
---
> RooFitResult* r = model.fitTo(*data,Extended(kTRUE),Save()) ;
However, with these simple changes, the results I get back are garbage (after getting lots of WARNINGs):
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
a0 5.0000e-01 +/- 1.68e-11
a1 -2.0000e-01 +/- 0.00e+00
nbkg 5.0000e+02 +/- 4.30e-06
nsig 5.0000e+02 +/- 2.26e+00
sig1frac 8.0000e-01 +/- 3.40e-02
Whereas, if I do not specify Range("fitRange")
in the fitTo command, they look something like this:
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
a0 4.7096e-01 +/- 1.75e-02
a1 -2.0000e-01 +/- 0.00e+00
nbkg 1.8225e+03 +/- 2.77e+01
nsig 1.7491e+03 +/- 6.48e+01
sig1frac 9.4061e-01 +/- 8.68e-02
The fitRange I’m specifying (0,9) is not that much smaller than the total range (0,10), so I would not expect the results to be so different. However, this seems to be my biggest hangup at the moment.
Can someone point me to a mistake in my code, or to a recipe for doing something like what I tried (unsuccessfully) to do here?
In case it’s important, I’m running ROOT v. 5.28.00, compiled locally on Fedora Core 11.
Thanks!
-Mike