Skip to content

Commit

Permalink
[RF] Correcty syncronize integral objects for RooFit driver
Browse files Browse the repository at this point in the history
  • Loading branch information
guitargeek committed Aug 10, 2021
1 parent 95d064d commit a0cdcdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion roofit/roofitcore/inc/RooAbsPdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ class RooAbsPdf : public RooAbsReal {
}
virtual Double_t getNorm(const RooArgSet* set=0) const ;
inline const RooAbsReal* getIntegral(RooArgSet const& set) const {
if(!_norm) getVal(&set);
if(!_norm) {
syncNormalization(&set,true) ;
getVal(set);
}
assert(_norm != nullptr);
return _norm;
}

Expand Down
1 change: 1 addition & 0 deletions roofit/roofitcore/src/RooAbsCachedPdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Double_t RooAbsCachedPdf::getValV(const RooArgSet* nset) const
Double_t value = cache->pdf()->getVal(nset) ;

_value = value ;
_norm = cache->pdf()->_norm;
return _value ;
}

Expand Down
1 change: 1 addition & 0 deletions roofit/roofitcore/src/RooAbsPdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3645,6 +3645,7 @@ void RooAbsPdf::computeBatch(double* output, size_t nEvents, rbc::DataMap& dataM
output[i] *= oneOverNorm;
}
} else {
assert(integralSpan.size() == nEvents);
for (std::size_t i=0; i < nEvents; ++i) {
output[i] /= integralSpan[i];
}
Expand Down

0 comments on commit a0cdcdf

Please sign in to comment.