Main Page
Related Pages
Modules
Namespaces
Classes
Files
Namespace List
Namespace Members
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)
util.validate_hists
def validate_hists
Definition:
util.py:352
util.style
def style
Definition:
util.py:237
util.write
def write
Definition:
util.py:23
util::enumerate
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition:
enumerate.h:69
projections.main
def main
Definition:
projections.py:9
util.wait
def wait
Definition:
util.py:19
util.optstat
def optstat
Definition:
util.py:233
util::zip
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition:
zip.h:295
util.fillcolors
def fillcolors
Definition:
util.py:272
util.draw_text
def draw_text
Definition:
util.py:62
util.resize_histo
def resize_histo
Definition:
util.py:118
Variable Documentation
tuple projections.parser = argparse.ArgumentParser()
Definition at line
47
of file
projections.py
.
Generated by
1.8.5