ATLAS Offline Software
Functions
Hough_plots Namespace Reference

Functions

def main (filepath)
 

Function Documentation

◆ main()

def Hough_plots.main (   filepath)

Definition at line 19 of file Hough_plots.py.

19 def main(filepath):
20  ROOT.gStyle.SetOptStat(0)
21  f = ROOT.TFile(filepath)
22  for key in f.Get("Hough/Images").GetListOfKeys():
23  if key.GetClassName() == "TH2I":
24  c = ROOT.TCanvas("c1","c1",800,600)
25  h = key.ReadObj()
26  h.Draw("COLZ")
27 
28  # Draw boxes around fired roads.
29  # Hough monitoring tool uses the bin error to indicate if a road was found.
30  # Bin errors are sqrt(n), so anything > sqrt(n_layers) is safe to use.
31  # Error is set to 100 + nLayers_missed.
32  boxes = [] # need to store so they don't get garbage collected
33  for x in range(1, h.GetNbinsX() + 1):
34  for y in range(1, h.GetNbinsY() + 1):
35  if h.GetBinError(x, y) >= 100:
36  b = ROOT.TBox(h.GetXaxis().GetBinLowEdge(x),
37  h.GetYaxis().GetBinLowEdge(y),
38  h.GetXaxis().GetBinWidth(x) + h.GetXaxis().GetBinLowEdge(x),
39  h.GetYaxis().GetBinWidth(y) + h.GetYaxis().GetBinLowEdge(y))
40  b.SetFillColor(ROOT.kRed + int(h.GetBinError(x, y)) - 100)
41  b.Draw()
42  boxes.append(b)
43 
44  c.Print(h.GetName() + ".png")
45 
46 
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Hough_plots.main
def main(filepath)
Definition: Hough_plots.py:19
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195