Skip to content
Snippets Groups Projects
user avatar
Jonas Rembser authored
The `RooRealIntegral` class is smart enough to figure out which
variables the function the integrated function doesn't depend on and
trivially integrates them itself by multiplying with the variable
definition range.

However, if the integration range is a subrange of the variable range,
this was not considered. This resulted in wrong results. for integrals
like `pdf.createIntegral(x, "subrange")`, where the pdf doesn't depend
on x. These kind of integrals can occur in the projections that the
RooAddPdf does, so it's important that they work, and fixing this
partially addresses #11486.

This change also fixes a so-far unknown bug in the `RooXYChi2Var`, which
also used these kind of integrals. Without this fix, the `Integrate()`
feature for `chi2FitTo()` was completely broken, which can be seen in
the output of the `rf609` tutorial with any previous ROOT version. The
tutorial looks okay by chance, because the function is dominted by the
quadratic term in `x` that is constant in the fit. But if one makes this
a floating parameter, the problem gets obvious.

Probably that was the reason why the main model parameter was set
constant to begin with, to sweep the bug under the rug. Now, the
tutorials are updated to have the quadratic coefficient floating too.
And also `stressRooFit`, since the reference file has to be updated
anyway.

To demonstrate that things work correctly now, a new unit test was
implemented that does the closure check of the `integrate()` feature of
the `RooXYChi2Var` with a linear fit function.
ae7ef4fe
History
Name Last commit Last update
..
Prompt
ProofBench
RootIDE
RootShower
fit
histviewer
periodic
rhtml
Aclock.cxx
Aclock.h
Aclock.rootmap
CMakeLists.txt
CTestCustom.cmake
DrawTest.sh
Event.cxx
Event.h
EventLinkDef.h
EventMT.cxx
EventMT.h
GetWebHistogram.C
Hello.cxx
Hello.h
Hello.rootmap
HistFactoryTest.tar
MainEvent.cxx
Makefile
Makefile.win32
QpRandomDriver.cxx
README
TBench.cxx
TBench.h
TFormulaParsingTests.h
TFormulaTests.cxx
TFormulaVecTests.h
TestVectors.cxx
Tetris.cxx
Tetris.h
Tetris.rootmap
TrackMathCore.h
TrackMathCoreLinkDef.h
TrackMathCoreRflx.xml
bench.cxx
benchLinkDef.h
checkAssertsNDEBUG.cxx
ctorture.cxx
delaunayTriangulation.cxx
delaunayTriangulation_bug.h
dt_DrawTest.C
dt_MakeFiles.sh
dt_MakeRef.C
dt_Makefile
dt_RunDrawTest.C
dt_RunDrawTest.sh
dt_build.C
dt_wrap.C
eventa.cxx
eventb.cxx
eventload.cxx
guitest.cxx
guiviewer.cxx
guiviewer.h
guiviewerLinkDef.h
hsimple.cxx
hworld.cxx
hworld2.cxx
minexam.cxx
rootDownloadData.cmake
sqlitetest.cxx
stress.cxx
stressEntryList.cxx
stressFit.cxx
stressGUI.cxx
stressGeometry.cxx
stressGraphics.cxx
stressGraphics.ref
stressGraphics_builtinzlib.ref
stressHepix.cxx
stressHistFactory.cxx
stressHistFactory_models.cxx
stressHistFactory_ref.root
stressHistFactory_tests.cxx
stressHistoFit.cxx
stressHistogram.cxx
stressIOPlugins.cxx
stressInterpreter.cxx
stressIterators.cxx
stressIterators.h
stressLinear.cxx
stressMathCore.cxx
stressMathMore.cxx
stressProof.cxx
stressRooFit.cxx
stressRooFit_ref.root
stressRooFit_tests.h
stressRooStats.cxx
stressRooStats_models.h
stressRooStats_ref.root
stressRooStats_tests.h
stressShapes.cxx
stressSpectrum.cxx