cms-analysis / CombineHarvester

CMSSW package for the creation, editing and analysis of combine datacards and workspaces
cms-analysis.github.io/CombineHarvester/
15 stars 180 forks source link

Basic fixes for 11_2_X, no validation yet #256

Closed ajgilbert closed 1 year ago

nsmith- commented 2 years ago

I found a small issue with plot1DScan.py in 112x, here is a patch:

commit d763ab5a7f30d47f5d5cf52cd8761605b3fc50aa (HEAD -> 112x)
Author: Nick Smith <nick.smith@cern.ch>
Date:   Tue Feb 22 18:35:35 2022 -0600

    Fix 'callable was deleted' error in plot1DScan.py

diff --git a/CombineTools/scripts/plot1DScan.py b/CombineTools/scripts/plot1DScan.py
index 2d7dfac..66152aa 100755
--- a/CombineTools/scripts/plot1DScan.py
+++ b/CombineTools/scripts/plot1DScan.py
@@ -44,7 +44,9 @@ def BuildScan(scan, param, files, color, yvals, ycut):
     graph.SetMarkerColor(color)
     spline = ROOT.TSpline3("spline3", graph)
     global NAMECOUNTER
-    func = ROOT.TF1('splinefn'+str(NAMECOUNTER), partial(Eval, spline), graph.GetX()[0], graph.GetX()[graph.GetN() - 1], 1)
+    func_method = partial(Eval, spline)
+    func = ROOT.TF1('splinefn'+str(NAMECOUNTER), func_method, graph.GetX()[0], graph.GetX()[graph.GetN() - 1], 1)
+    func._method = func_method
     NAMECOUNTER += 1
     func.SetLineColor(color)
     func.SetLineWidth(3)

I'll leave it here in case it is useful later