Simultaneous fit in different distribution regions

Hi Rooters,
I have a background distribution binned from 40-150 and, splitting the data set in two interval, 40-70 and 100-150 (excluding the signal region), i would fit simultaneously these two regions with the same exponential distribution.
I’ve tried with RooSimultaneous in RooFit but i’m not able to correctly address the two regions to the pdf.

Any suggestion ?

Many thanks,

Wouter will answer your mail about Roofit.

Outside Roofit see an example in standard Root in tutorial fitExclude.C


Hi Rene,
thanks, it works great !!

Only one question: is there a simple way to draw the fit function
only in the fitting regions (so without those vertical lines) ?


I have modified the tutorial to do what you want.
see attachement

fitExclude.C (1.13 KB)