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

Functions

def main
 

Variables

tuple parser = argparse.ArgumentParser()
 

Function Documentation

def signal_to_background.main (   args)

Definition at line 6 of file signal_to_background.py.

6 
7 def main(args):
8  f = ROOT.TFile(args.input)
9 
10  sigs = [f.Get(h.lstrip("-")) for h in args.histo_sig]
11  util.validate_hists(args.histo_sig, sigs)
12  sigs = [util.resize_histo(args, h) for h in sigs]
13 
14  bkgs = [f.Get(h.lstrip("-")) for h in args.histo_bkg]
15  util.validate_hists(args.histo_bkg, bkgs)
16  bkgs = [util.resize_histo(args, h) for h in bkgs]
17 
18 
19  n_sig = 0.
20  for h in sigs:
21  n_sig += h.Integral()
22 
23  n_bkg = 0.
24  for h in bkgs:
25  n_bkg += h.Integral()
26 
27  print args.format % (n_sig / n_bkg)
def validate_hists
Definition: util.py:352
def resize_histo
Definition: util.py:118

Variable Documentation

tuple signal_to_background.parser = argparse.ArgumentParser()

Definition at line 29 of file signal_to_background.py.