Skip to content

Commit f77cd93

Browse files
maxgallianigamova
authored andcommitted
Immediately safe_import CMSHistFuncWrapper instead of looping over them - reduce time taken by ROOT.RooFit.RecycleConflictNodes to go through the dependency graph
1 parent 1df3a9f commit f77cd93

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

python/ShapeTools.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def __init__(self, datacard, options):
6767
ROOT.gSystem.Load(lib)
6868
self.wspnames = {}
6969
self.wsp = None
70-
self.extraImports = []
7170
self.norm_rename_map = {}
7271
self._fileCache = FileCache(self.options.baseDir)
7372

@@ -365,7 +364,7 @@ def doIndividualModels(self):
365364
"combine.channel",
366365
pdfs.at(idx).getStringAttribute("combine.channel"),
367366
)
368-
self.extraImports.append(wrapper)
367+
self.out.safe_import(wrapper, ROOT.RooFit.RecycleConflictNodes())
369368

370369
if len(bbb_names) > 0:
371370
bbb_nuisanceargset = ROOT.RooArgSet()
@@ -433,9 +432,6 @@ def doCombination(self):
433432
self.getObj("pdf_bin%s_bonly" % self.DC.bins[0]).clone("model_b"),
434433
ROOT.RooFit.Silence(),
435434
)
436-
for arg in self.extraImports:
437-
# print 'Importing extra arg: %s' % arg.GetName()
438-
self.out.safe_import(arg, ROOT.RooFit.RecycleConflictNodes())
439435
if self.options.fixpars:
440436
pars = self.out.pdf("model_s").getParameters(self.out.obs)
441437
for arg in pars:

0 commit comments

Comments
 (0)