ATLAS Offline Software
Functions | Variables
plotTrigSF Namespace Reference

Functions

def main ()
 
def plotErr (hbase, hsyst, rf, can)
 
def updateCanvas (can, name=None)
 
def plotNom (hbase, rf, can)
 

Variables

 p = OptionParser(usage="usage: <path:ROOT file directory>", version="0.1")
 
 type
 
 default
 
 None
 
 dest
 
 action
 
 False
 
 options
 
 args
 

Function Documentation

◆ main()

def plotTrigSF.main ( )

Definition at line 28 of file plotTrigSF.py.

28 def main():
29 
30  import PhysicsLight.PhysicsLightConfig as Config
31 
32  Config.setPlotDefaults(ROOT)
33 
34  can = ROOT.TCanvas('can', 'can', 650, 600)
35  can.Draw()
36 
37  ROOT.gStyle.SetPaintTextFormat('0.2f')
38  ROOT.gStyle.SetPalette(1)
39  ROOT.gROOT.ForceStyle()
40 
41  rf = ROOT.TFile(args[0], 'READ')
42 
43  regions = ['barrel_sf', 'endcap_sf']
44 
45  err_hists = ['err_stat_up',
46  'err_stat_dw',
47  'err_syst_up',
48  'err_syst_dw',
49  ]
50 
51  for r in regions:
52  plotNom(r, rf, can)
53 
54  if options.do_err:
55  for h in err_hists:
56  plotErr(r, '%s_%s' %(r, h), rf, can)
57 
58 #-----------------------------------------------------------------------------

◆ plotErr()

def plotTrigSF.plotErr (   hbase,
  hsyst,
  rf,
  can 
)

Definition at line 59 of file plotTrigSF.py.

59 def plotErr(hbase, hsyst, rf, can):
60 
61  print 'plotErr - %s / %s' %(hsyst, hbase)
62 
63  hb = rf.Get(hbase)
64  hs = rf.Get(hsyst)
65 
66  hb.SetStats(False)
67  hs.SetStats(False)
68 
69  hs.Divide(hb)
70 
71  hs.Draw('COLZ TEXT')
72 
73  updateCanvas(can, '%s_over_nominal' %hsyst)
74 
75 #-------------------------------------------------------------------------

◆ plotNom()

def plotTrigSF.plotNom (   hbase,
  rf,
  can 
)

Definition at line 94 of file plotTrigSF.py.

94 def plotNom(hbase, rf, can):
95 
96  print 'plotNom - %s' %(hbase)
97 
98  hb = rf.Get(hbase)
99 
100  hb.SetStats(False)
101  hb.Draw('COLZ TEXT')
102 
103  updateCanvas(can, hbase)
104 

◆ updateCanvas()

def plotTrigSF.updateCanvas (   can,
  name = None 
)

Definition at line 76 of file plotTrigSF.py.

76 def updateCanvas(can, name=None):
77 
78  if not can:
79  sys.exit(0)
80 
81  can.Modified()
82  can.Update()
83 
84  if options.wait:
85  can.WaitPrimitive()
86 
87  if not can:
88  sys.exit(0)
89 
90  if options.save and name != None:
91  can.Print('%s.pdf' %name, 'pdf')
92 
93 #-----------------------------------------------------------------------------

Variable Documentation

◆ action

plotTrigSF.action

Definition at line 12 of file plotTrigSF.py.

◆ args

plotTrigSF.args

Definition at line 17 of file plotTrigSF.py.

◆ default

plotTrigSF.default

Definition at line 8 of file plotTrigSF.py.

◆ dest

plotTrigSF.dest

Definition at line 8 of file plotTrigSF.py.

◆ False

plotTrigSF.False

Definition at line 12 of file plotTrigSF.py.

◆ None

plotTrigSF.None

Definition at line 8 of file plotTrigSF.py.

◆ options

plotTrigSF.options

Definition at line 17 of file plotTrigSF.py.

◆ p

plotTrigSF.p = OptionParser(usage="usage: <path:ROOT file directory>", version="0.1")

Definition at line 6 of file plotTrigSF.py.

◆ type

plotTrigSF.type

Definition at line 8 of file plotTrigSF.py.

plotTrigSF.plotNom
def plotNom(hbase, rf, can)
Definition: plotTrigSF.py:94
plotTrigSF.main
def main()
Definition: plotTrigSF.py:28
plotTrigSF.plotErr
def plotErr(hbase, hsyst, rf, can)
Definition: plotTrigSF.py:59
plotTrigSF.updateCanvas
def updateCanvas(can, name=None)
Definition: plotTrigSF.py:76