Skip to content

Commit

Permalink
Merge pull request #17091 from makortel/fixTrackingPlotting
Browse files Browse the repository at this point in the history
Fix crash in tracking MC validation plot scripts
  • Loading branch information
cmsbuild committed Jan 10, 2017
2 parents 78092c5 + d97bfeb commit f3f51eb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Validation/RecoTrack/python/plotting/plotting.py
Expand Up @@ -625,6 +625,11 @@ def create(self, tdirectory):
ret = histoA.Clone(self._name)
ret.SetTitle(self._title)

# Disable canExtend if it is set, otherwise setting the
# overflow bin will extend instead, possibly causing weird
# effects downstream
ret.SetCanExtend(False)

for i in xrange(0, histoA.GetNbinsX()+2): # include under- and overflow too
val = histoA.GetBinContent(i)-histoB.GetBinContent(i)
ret.SetBinContent(i, val)
Expand Down Expand Up @@ -660,6 +665,11 @@ def create(self, tdirectory):
ret = histo.Clone(self._name)
ret.SetTitle(self._title)

# Disable canExtend if it is set, otherwise setting the
# overflow bin will extend instead, possibly causing weird
# effects downstream
ret.SetCanExtend(False)

for i in xrange(0, histo.GetNbinsX()+2):
ret.SetBinContent(i, self._func(histo.GetBinContent(i)))
return ret
Expand Down

0 comments on commit f3f51eb

Please sign in to comment.