Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Commit

Permalink
[BugFix] Restricted y axis range in SBitThresh Summary Graph (#261)
Browse files Browse the repository at this point in the history
* [BugFix] Restricted y axis range in SBitThresh Summary Graph
* updated `TLine` to use fixed y-axis and made code more consistent
  • Loading branch information
bregnery authored and jsturdy committed Nov 15, 2019
1 parent ca99453 commit 57a8f53
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions utils/threshAlgos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ def getDetName(entry):
# make nVFATs TLines
kneeLine= []
for vfat in range(0,nVFATS):
canv_Summary1D.cd(vfat + 1).SetLogy()
canv_Summary1D.cd(chamber_vfatPos2PadIdx[gemType][vfat]).SetLogy()

# make sure the inflection point is there
if dict_dacInflectPts[dacName][ohKey][vfat][0] == None:
Expand All @@ -1508,16 +1508,13 @@ def getDetName(entry):
if type(graph) == r.TH1F :
graph = r.TGraph(graph)

# get maximum y value
y = graph.GetY()
y = np.array(y)
ymax = np.amax(y)
graph.GetYaxis().SetRangeUser(1e-1,1e8)

# Draw a line on the graphs
kneeLine.append(r.TLine(dict_dacInflectPts[dacName][ohKey][vfat][0], 10.0, dict_dacInflectPts[dacName][ohKey][vfat][0], ymax) )
kneeLine.append(r.TLine(dict_dacInflectPts[dacName][ohKey][vfat][0], 1e-1, dict_dacInflectPts[dacName][ohKey][vfat][0], 1e8))
kneeLine[vfat].SetLineColor(2)
kneeLine[vfat].SetVertical()
canv_Summary1D.cd(chamber_vfatPos2PadIdx[gemType][vfat] )
canv_Summary1D.cd(chamber_vfatPos2PadIdx[gemType][vfat])
kneeLine[vfat].Draw()
canv_Summary1D.Update()

Expand Down

0 comments on commit 57a8f53

Please sign in to comment.