Skip to content

Commit 55474bb

Browse files
committed
[RF] Remove redundante dependsOn() when creating norm. integral
The `depList` list is filled already with the subset of normalization variables that the pdf depends on (see `getObservables(nset, depList)` a few lines before. Therefore, the check `dependsOn(depList)` is redundant and causes unnecessary performance overheads, as the whole compute graph of the pdf has to be traversed. We might as well check if `depList` is empty for the same logic. (cherry picked from commit c1608ac)
1 parent aa63e73 commit 55474bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roofit/roofitcore/src/RooAbsPdf.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ bool RooAbsPdf::syncNormalization(const RooArgSet* nset, bool adjustProxies) con
532532
}
533533

534534
// Destroy old normalization & create new
535-
if (selfNormalized() || !dependsOn(depList)) {
535+
if (selfNormalized() || depList.empty()) {
536536
auto ntitle = std::string(GetTitle()) + " Unit Normalization";
537537
auto nname = std::string(GetName()) + "_UnitNorm";
538538
_norm = new RooRealVar(nname.c_str(),ntitle.c_str(),1) ;

0 commit comments

Comments
 (0)