Multi-Range Simultaneous Fit: SplitRange() functionality not working

Hi Stephan,

Same output - the fit still automatically creates a new range for the Delta_M variable, over the whole range:

(I also tried range_{0} and range_{1} but got the same result)

[#1] INFO:Eval – RooRealVar::setRange(Delta_M) new range named ‘range_{pi0}’ created with bounds [135,210]
[#1] INFO:Eval – RooRealVar::setRange(Delta_M) new range named ‘range_{gamma}’ created with bounds [50,210]
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdfDeltaBkgPi0_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdfDeltaBkgPi0_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
reduceEng varSubset = (Delta_M) _wgtVar =
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdfDeltaBkgGamma_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdfDeltaBkgGamma_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
reduceEng varSubset = (Delta_M) _wgtVar =
RooAbsTestStatistic::initSimMode: creating slave calculator #0 for state pi0 (11000 dataset entries)
reduceEng varSubset = (Delta_M) _wgtVar =
[#1] INFO:Fitting – RooAbsOptTestStatistic::ctor(pi0) constructing test statistic for sub-range named range_pi0
[#1] INFO:Eval – RooRealVar::setRange(Delta_M) new range named ‘NormalizationRangeForrange_pi0’ created with bounds [0,210]
[#1] INFO:Fitting – RooAbsOptTestStatistic::ctor(pi0) fixing interpretation of coefficients of any RooAddPdf to full domain of observables
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdfDeltaBkgPi0_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
RooAbsTestStatistic::initSimMode: creating slave calculator #1 for state gamma (11000 dataset entries)
reduceEng varSubset = (Delta_M) _wgtVar =
[#1] INFO:Fitting – RooAbsOptTestStatistic::ctor(gamma) constructing test statistic for sub-range named range_gamma
[#1] INFO:Eval – RooRealVar::setRange(Delta_M) new range named ‘NormalizationRangeForrange_gamma’ created with bounds [0,210]
[#1] INFO:Fitting – RooAbsOptTestStatistic::ctor(gamma) fixing interpretation of coefficients of any RooAddPdf to full domain of observables
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdfDeltaBkgGamma_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
[#1] INFO:Fitting – RooAbsTestStatistic::initSimMode: created 2 slave calculators.

Hi Alexandra,

I ran your example, and the switch seems to work. The diff of the two examples (SplitRange commented out) reads:

--- arolling_out_noSplit.txt	2019-03-26 14:19:59.180227256 +0100
+++ arolling_out.txt	2019-03-26 14:19:20.751357488 +0100
@@ -12,13 +12,11 @@
 [#1] INFO:NumericIntegration -- RooRealIntegral::init(pdfDeltaBkgGamma_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
 [#1] INFO:NumericIntegration -- RooRealIntegral::init(pdfDeltaBkgGamma_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
 RooAbsTestStatistic::initSimMode: creating slave calculator #0 for state pi0 (11000 dataset entries)
-[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(pi0) constructing test statistic for sub-range named range
-[#1] INFO:Eval -- RooRealVar::setRange(Delta_M) new range named 'fit_pi0' created with bounds [0,210]
+[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(pi0) constructing test statistic for sub-range named range_pi0
 [#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(pi0) fixing interpretation of coefficients of any RooAddPdf component to range range
 [#1] INFO:NumericIntegration -- RooRealIntegral::init(pdfDeltaBkgPi0_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
 RooAbsTestStatistic::initSimMode: creating slave calculator #1 for state gamma (11000 dataset entries)
-[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(gamma) constructing test statistic for sub-range named range
-[#1] INFO:Eval -- RooRealVar::setRange(Delta_M) new range named 'fit_gamma' created with bounds [0,210]
+[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(gamma) constructing test statistic for sub-range named range_gamma
 [#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(gamma) fixing interpretation of coefficients of any RooAddPdf component to range range
 [#1] INFO:NumericIntegration -- RooRealIntegral::init(pdfDeltaBkgGamma_Int[Delta_M]) using numeric integrator RooIntegrator1D to calculate Int(Delta_M)
 [#1] INFO:Fitting -- RooAbsTestStatistic::initSimMode: created 2 slave calculators.
@@ -32,51 +30,45 @@
 [#1] INFO:Minization --  The following expressions have been identified as constant and will be precalculated and cached: (pdfDeltaBkgGamma)
 [#1] INFO:Minization --  The following expressions will be evaluated in cache-and-track mode: (pdfDeltaSigGamma1,pdfDeltaSigGamma2)
 Minuit2Minimizer: Minimize with max-calls 5500 convergence for edm < 1 strategy 2
-[#1] INFO:Minization -- RooNLLVar::evaluatePartition(pi0) first = 0 last = 11000 Likelihood offset now set to -36519.5
-[#1] INFO:Minization -- RooNLLVar::evaluatePartition(gamma) first = 0 last = 11000 Likelihood offset now set to -25446.4
-MnSeedGenerator: for initial parameters FCN = 3.637978807092e-12
-MnSeedGenerator: Initial state:   - FCN = 3.637978807092e-12 Edm =       7937.4 NCalls =     45
-MnSeedGenerator: run Hesse - new state:   - FCN = 3.637978807092e-12 Edm =      7324.92 NCalls =    145
+[#1] INFO:Minization -- RooNLLVar::evaluatePartition(pi0) first = 0 last = 10992 Likelihood offset now set to -36514.9
+[#1] INFO:Minization -- RooNLLVar::evaluatePartition(gamma) first = 0 last = 11000 Likelihood offset now set to -25446.5
+MnSeedGenerator: for initial parameters FCN = -1.091393642128e-11
+MnSeedGenerator: Initial state:   - FCN = -1.091393642128e-11 Edm =      7937.74 NCalls =     45
+MnSeedGenerator: run Hesse - new state:   - FCN = -1.091393642128e-11 Edm =      7255.47 NCalls =    145
 VariableMetric: start iterating until Edm is < 0.001

and then it converges to a different minimum. It seems to work with a range named just "range_pi0". I tested by setting the range to crazy values such as

  deltaMass.setRange("range_gamma", 200, 210);

and that also works (it breaks the fit, as it should).

What was giving you the impression that the fit it is being carried out on the full range?

Hi Stephan,

What makes me believe it is not working is that the ranges fit_gamma and fit_pi0 that you have pointed out above explicitly say in the result that they are covering [0,210] and not what we specify in the macro?

These are some relevant lines from my output:

[#1] INFO:Eval -- RooRealVar::setRange(Delta_M) new range named 'range_pi0' created with bounds [135,210]
[#1] INFO:Eval -- RooRealVar::setRange(Delta_M) new range named 'range_gamma' created with bounds [200,210]
...
[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(pi0) constructing test statistic for sub-range named range
[#1] INFO:Eval -- RooRealVar::setRange(Delta_M) new range named 'fit_pi0' created with bounds [0,210]
...
[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(gamma) constructing test statistic for sub-range named range
[#1] INFO:Eval -- RooRealVar::setRange(Delta_M) new range named 'fit_gamma' created with bounds [0,210]

Also, I found that editing ‘range_gamma’ from 50 - 210, to 200 - 210 gave the same minimum in both cases? I found the the fit only breaks if I include SplitRange, but this breaks it in both cases, not just the latter.

As well as this, the output of the macro is a file with the PFDs plotted onto the toy datasets - you can see that the PDF is plotted over the full range, on top of the data, and not only in the ranges specified. This is from the output:

[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdfGamma) p.d.f was fitted in range and no explicit plot,norm range was specified, using fit range as default
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdfGamma) only plotting range 'fit_gamma'
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdfGamma) p.d.f. curve is normalized using explicit choice of ranges 'fit_gamma'

So I still believe that it is not finding the values for the range that I specify.

Sorry for the delay in replying, I was away.

Thanks,
Alexandra

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