Skip to content

Commit 8891aad

Browse files
committed
[RF] Don't warn about duplicates in temporary RooArgSet in RealIntegral
Adding duplicates to a RooArgSet is intended in this case, profiting from the automatic de-duplication. But that means the duplicate errors should be suppressed with the "silent" flag. Thanks to the following forum post for spotting this problem: https://root-forum.cern.ch/t/ownership-errors-generating-data-from-morphed-pdfs/64028
1 parent 233f877 commit 8891aad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

roofit/roofitcore/src/RooRealIntegral.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,12 @@ RooRealIntegral::RooRealIntegral(const char *name, const char *title,
399399
RooArgSet branchListVD;
400400
branchListVD.reserve(branchListVDAll.size());
401401
for (RooAbsArg *branch : branchListVDAll) {
402-
if (branch != &function) branchListVD.add(*branch);
402+
if (branch != &function) {
403+
// The branchListVDAll is a RooArgList, so it's not de-duplicated yet.
404+
// Add elements to the branchListVD with the "silent" flag, so it
405+
// de-duplicates while adding without printing errors.
406+
branchListVD.add(*branch, /*silent=*/true);
407+
}
403408
}
404409

405410
for (auto branch: branchList) {

0 commit comments

Comments
 (0)