ATLAS Offline Software
show_mb_attr.py
Go to the documentation of this file.
1 #!/bin/env python
2 # Author: Michael Miller (miller@uchicago.edu)
3 
4 
5 import sys
6 import ROOT
7 
8 
9 def SetupDraw():
10 
11  ROOT.gROOT.SetStyle("Plain")
12  ROOT.gStyle.SetCanvasBorderMode(0)
13  ROOT.gStyle.SetPadBorderMode(0)
14  ROOT.gStyle.SetTitleX(0.12)
15  ROOT.gStyle.SetTitleY(1.0)
16  ROOT.gStyle.SetStatX(0.84)
17  ROOT.gStyle.SetStatY(0.84)
18  ROOT.gStyle.SetLabelFont(42,"XYZ")
19  ROOT.gStyle.SetTextFont(42)
20  ROOT.gStyle.SetOptStat(111110)
21  ROOT.gStyle.SetPalette(1)
22  ROOT.gStyle.SetTitleFont(42,"XYZ")
23  ROOT.gStyle.SetTitleBorderSize(0)
24  ROOT.gStyle.SetPadColor(0)
25  ROOT.gStyle.SetCanvasColor(0)
26  ROOT.gStyle.SetOptFit(0)
27 
28  c1 = ROOT.TCanvas()
29  c1.SetFrameBorderMode(0)
30  c1.SetBorderSize(0)
31  c1.SetBorderMode(0)
32  c1.SetFillColor(0)
33  c1.SetTickx()
34  c1.SetTicky()
35 
36  return c1
37 
38 
39 def main():
40 
41 
42 
43  ROOT.gROOT.SetBatch()
44  mb_names = ['MB 1', 'MB 2', 'MB 3', 'MB 4']
45  hists = [ROOT.TH1F('MB%d' % mb, mb_names[mb], 55, 0., 255./2.+1) for mb in range(4)]
46 
47  for hist in hists:
48  hist.SetFillColor(ROOT.kGray)
49  hist.GetXaxis().SetTitle('Current delay [ns]')
50  hist.GetXaxis().CenterTitle()
51  hist.GetYaxis().SetTitle('Number of mother boards')
52  hist.GetYaxis().CenterTitle()
53  infile=open("oks_mb_delays.txt", 'r')
54 
55 
56 
57  for line in infile:
58  a = line.strip().split(' ')
59  for ind in range(4):
60  hists[ind].Fill(float(a[ind+1])/2., 1.0)
61 
62  cnt = 1
63  can = SetupDraw()
64  can.Divide(2,2)
65  for hist in hists:
66  can.cd(cnt)
67  hist.Draw()
68  can.Update()
69  can.Modified()
70  cnt = cnt + 1
71  can.SaveAs('mb_attrs.ps')
72 
73 
74 
75 if __name__ == '__main__':
76  main()
show_mb_attr.main
def main()
Definition: show_mb_attr.py:39
show_mb_attr.SetupDraw
def SetupDraw()
Definition: show_mb_attr.py:9
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
Trk::open
@ open
Definition: BinningType.h:40
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38