All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
projections Namespace Reference

Functions

def main
 

Variables

tuple parser = argparse.ArgumentParser()
 

Function Documentation

def projections.main (   args)

Definition at line 9 of file projections.py.

9 
10 def main(args):
11  util.optstat(args)
12  f = ROOT.TFile(args.input)
13  hist = f.Get(args.hist)
14  util.validate_hists([args.hist], [hist])
15  hist = util.resize_histo(args, hist, "")
16  hstack = ROOT.THStack()
17  canvas = ROOT.TCanvas("canvas", "Canvas", 250,100,700,500)
18 
19  class ArgDict(dict):
20  __getattr__ = dict.get
21 
22  hists = []
23  for i,(low,high) in enumerate(zip(args.lows, args.highs)):
24  this_args = ArgDict({"y_min": low, "y_max": high, "projectionX": True})
25  h = util.resize_histo(this_args, hist.Clone(), str(i))
26  h.SetLineColor(util.fillcolors(i))
27  h.SetLineWidth(3)
28  if args.names:
29  name = args.names[i]
30  h.SetTitle(name)
31  hists.append(h)
32  hstack.Add(h)
33 
34  hstack.Draw("NOSTACK HIST")
35  legend = ROOT.gPad.BuildLegend(*(args.legend_position + [""]))
36  if args.title is not None:
37  hstack.SetTitle(args.title)
38  util.style(args, canvas, hstack)
39 
40  box = util.draw_text(args)
41 
42  canvas.Update()
43 
44  util.wait(args)
45  util.write(args, canvas)
def validate_hists
Definition: util.py:352
def style
Definition: util.py:237
def write
Definition: util.py:23
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
def wait
Definition: util.py:19
def optstat
Definition: util.py:233
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:295
def fillcolors
Definition: util.py:272
def draw_text
Definition: util.py:62
def resize_histo
Definition: util.py:118

Variable Documentation

tuple projections.parser = argparse.ArgumentParser()

Definition at line 47 of file projections.py.