Fitting and Coefficient ranges

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 
<   RooDataSet *data = model.generate(x,10000) ;
>   RooDataSet *data = model.generate(x,1000) ;
<   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.



Hi Mike,

I think you are simply missing one statement to tell RooFit to fit coefficients (nsig and nbkg) in the signalRange.

Basically, something like this should work.

RooFitResult* r = model.fitTo(*data,Extended(kTRUE),Save(),Range("fitRange")) ;



Hi Andrée,

Thanks a lot! it seems that you’re right - with that change, things work much better.

I have just one question concerning this: I thought that specifying the signal range when declaring the RooExtendPdf variables was sufficient to accomplish this:

  RooExtendPdf esig("esig","extended signal p.d.f",sig,nsig,"signalRange") ;
  RooExtendPdf ebkg("ebkg","extended background p.d.f",bkg,nbkg,"signalRange") ;

So what’s the difference between fixCoefRange() and the above construction?

Thanks again!