Unbinned fit data with some blinded range

Dear RooFit expert,

I would like to fit my data curve using unbinned dataset but I have to remove some range (blinded range) from the fit. I have prepared unbinned dataset (TTree) with blinded range (zero event at this blinded region) but when I tried to fit, I’m not sure if RooFit includes data in this region (which is zero and large error) or not. If so, how can I exclude this region from the fit? Shall I try to do RooFit::SplitRange? If so, could you also show me how to do it? I can’t find a clear example to follow.

Thank you in advance.

Best regards,
Chayanit

Hi Chayanit,
In case you haven’t seen this, here’s an example on how to do this:
https://root.cern.ch/root/html532/tutorials/roofit/rf312_multirangefit.C.html

more specifically, suppose your observable be x:

RooRealVar x("x", "x", xmin, xmax);
x.setRange("SB1", xmin, smin + 100.);
x.setRange("Signal", smin, smax);
x.setRange("SB2", smax - 100, xmax);
x.setRange("full", xmin, xmax);

//Perform fit in SideBand1 region (RooAddPdf coefficients will be interpreted in full range)
RooFitResult* r_sb1 = pwl->fitTo(*data,Range("SB1"),Save()) ;

//Perform fit in SideBand2 region (RooAddPdf coefficients will be interpreted in full range)
RooFitResult* r_sb2 = pwl->fitTo(*data,Range("SB2"),Save()) ;

//(RooAddPdf coefficients will be interpreted in full range)
RooFitResult* r_sb12 = pwl->fitTo(*data,Range("SB1,SB2"),Save()) ;

// finally to get the propagated error (on some parameter of interest) and fix to 2sigma its best-fit value:
gamma.setRange(gamma.getVal() - 2*gamma.getPropagatedError(*r_sb12),
                   gamma.getVal() + 2*gamma.getPropagatedError(*r_sb12));