Potting pdf over other than fitted bins

Hello,

My unbinned fit is set over variable

RooRealVar sbpQvalue(“sbQvalue”, “Q [GeV]”, 0.003, 0.210);

The unbinned

   RooDataSet* datSbp

defined over sbpQvalue 
is subjected to fit with model 
RooAddPdf* modelTot .

After the successful fit I plot the profile of the fit results
on the binned distribution (histogram):

const Double_t xLo = 0.003;
const Double_t xHi = 0.210;
const Int_t numBins = 69;
RooPlot* qframe6 = sbpQvalue.frame(xLo, xHi, numBins);
qframe6 ->SetYTitle(“candidates per 3 MeV”);
datSbp ->plotOn(qframe6);
//
modelTot ->plotOn(qframe6, LineStyle(kSolid), LineColor(kRed+2), LineWidth(2),
Normalization(1.0,RooAbsReal::RelativeExpected));

I have skipped from the fit the first effective bin to avoid the
non-physical cases where fitter could get into trouble.

The plot is nice and neat but without first bin: I want to have this data
bin (which was out of the fit) still to be shown.

Question: how do I plot the fitted pdf defined over (0.003, 0.210)
and resulted from the fit defined also over (0.003, 0.210) but
over the histogram filled with data over (0.0, 0.210) to show the
first skipped bin ? Important caveat: I do not want to set the fit over
(0., 0.210) and run the fitter over sub-range or “signal range” of (0.003, 0.210)
imposing limits to MINUIT as this latter case is not actually equivalent
to the original case as MINUIT will supplement the fitter
with some functions regularizing the left limit.

I will appreciate if somebody could give me a hint or a couple of
lines of codes…

Igor.

Hi Igor,

You should be able to do this like this: you define your observable
over the full range (starting from zero). Then instead of doing

pdf->fitTo(data,…) ;

you do

pdf->fitTo(data,Range(0.003,0.21) ;

[ At the likelihood level this is equivalent to defining your observable
range as (0.003,0.21) and then doing a fitTo() ]

Then you can make your plot as usual

RooPlot* frame = obs->frame() ;
data->plotOn(frame) ; // will plot all data
pdf->plotOn(frame) ; // will by default only plot range (0.003,0.21) as the fit was done on that range

Wouter

Hello Wouter,

Thank you so much!
The plots now became much more elegant.

Igor.

Hello Wouter,

You know I have realized that when I change the variable range
to (0., 0.210) but set the fit range of (0.003, 0.210) in the
fitTo(…, Range(0.003, 0.210) …)
my fit parameters, namely widths, get changed ( widths of convoluted Breit-Wigners with
P-wave factor modified, I use here the numerical FFT convolution of
two pdfs, in my case double Gaussian and two Br-Wig.)
not dramatically, but by (0.3…0.4)*stat.err. …
I understand that widths always tricky, volatile and my fitter is very
complicated, two Br.-Wigners with variable widths (*p^3/p0^3 p-wave factor)
but it looks like that still MINUIT is doing something with my pdf…,
extending it with something else… I checked out the fitter with 7K - 10K
toys and it behaves healthy, stable…
Any ideas?

Cheers,
Igor.