Skip to content

Commit

Permalink
Fix implementation of RooSimultaneous::extendMode()
Browse files Browse the repository at this point in the history
For returning the extend mode examine all the pdf in the list and
flag as CanExtend or MustExtend if just one of the pdf can be extended.

Fix also passing the extended flags when creating the sub-NLL in RooNLLVar::create().
If one of the sim component cannot be extended then switch off the extended flag for that component. Before it was passed for all components.

This fixes issue root-project#6894
  • Loading branch information
lmoneta committed Dec 1, 2020
1 parent 0a98f99 commit 43357da
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 109 deletions.
8 changes: 5 additions & 3 deletions roofit/roofitcore/src/RooNLLVar.cxx
Expand Up @@ -225,9 +225,11 @@ RooNLLVar::RooNLLVar(const RooNLLVar& other, const char* name) :
RooAbsTestStatistic* RooNLLVar::create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
const RooArgSet& projDeps, const char* rangeName, const char* addCoefRangeName,
Int_t nCPU, RooFit::MPSplit interleave, bool verbose, bool splitRange, bool binnedL) {
auto testStat = new RooNLLVar(name, title,
dynamic_cast<RooAbsPdf&>(pdf), adata,
projDeps, _extended, rangeName, addCoefRangeName, nCPU, interleave, verbose, splitRange, false, binnedL,
RooAbsPdf & thePdf = dynamic_cast<RooAbsPdf&>(pdf);
// check if pdf can be extended
bool extendedPdf = _extended & thePdf.canBeExtended();
auto testStat = new RooNLLVar(name, title, thePdf, adata,
projDeps, extendedPdf , rangeName, addCoefRangeName, nCPU, interleave, verbose, splitRange, false, binnedL,
_integrateBinsPrecision);
testStat->batchMode(_batchEvaluations);
return testStat;
Expand Down

0 comments on commit 43357da

Please sign in to comment.