Fit only the sidebands, yield on full range using RooExtendPdf

Dear experts,

my problem is the following: I am looking for a “peak” over an exponential, smooth background.
The mass window around the signal needs to stay out of the fit and blinded, the idea is to extract the slope of the exponential from the fitting the data sidebands and then calculate the expected background yield using RooExtendPdf and let it figure out the normalisation.

Here’s the code fragment that does it

# fit the data sidebands
results_expo = expo.fitTo(fulldata, ROOT.RooFit.Range('left,right'), ROOT.RooFit.Save())
expo.plotOn(frame, ROOT.RooFit.LineColor(ROOT.kBlack))

# var to store the number of background events
nbkg = ROOT.RooRealVar  ('nbkg', 'bkg n', 10, 0, 100)

# extend the expo to the full range
mass.setRange('full', 1.61, 1.99)
ebkg = ROOT.RooExtendPdf('ebkg', 'ebkg',  expo, nbkg, 'full') 

# fit again the sidebands
ebkg.fitTo(fulldata, ROOT.RooFit.Range('left,right'))
ebkg.plotOn(frame, ROOT.RooFit.LineColor(ROOT.kBlue))

Then I would expect the original fit and the second fit to coincide in the plot, but they don’t

and in fact the slope changes

  EXT PARAMETER                                INTERNAL      INTERNAL
  NO.   NAME      VALUE            ERROR       STEP SIZE       VALUE
   1  nbkg         2.75083e+01   6.34502e+00   1.83204e-06  -1.55665e+00
   2  slope       -4.58018e+00   1.93502e+00   1.00286e-06   1.56652e+00


 EXT PARAMETER                                   STEP         FIRST
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
   1  slope       -6.92909e+00   6.53287e+00   1.19188e-05  -1.00018e+00

I cannot understand this behaviour, is there something that I am missing?

I tried to fit the sidebands with plain ROOT and I obtain something close to the blue curve, but, at this point, I am not sure which is the correct option.


Hello Riccardo,

the problem is that when you fit in two regions, RooFit can get confused to which region the coefficients refer to.
Wouter Verkerke has a solution for this, and he promised to send me details during the day.

Hello Riccardo,

the short answer is that with the RooExtendPdf, the reinterpration of the normalisation coefficients is very difficult when there are two regions involved. The RooAddPdf will handle this case correctly if you use the following constructor:

I changed the rf204 tutorial a bit to demonstrate how you can get it to work:
rf204_extrangefit.C (3.9 KB)

The result looks like this:

If you fit the the same model multiple times with different ranges, it will confuse the correction factors for the yields in the different ranges again. Therefore, I had to clone the model for the example.

Note also that in the middle example, where the signal region is missing, the uncertainty on the signal yield is very high. This is exactly what you would expect in such a case.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.