ra4_draw  4bd0201e3d922d42bd545d4b045ed44db33454a4
run_2016-06-03_freeze_preapp_all_preds.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 ###### Script to find all the closure tables
4 import os, sys, subprocess
5 import glob
6 import string
7 
8 do_unblind = True
9 full_lumi = True
10 
11 ## Aggregate bins
12 methods = ["agg_himet", "agg_mixed", "agg_himult", "agg_1b"]
13 
14 ## 815 ipb tests
15 methods = ['m2lveto', 'm2lveto_el', 'm2lveto_mu', 'm2lveto_lonj', 'm2lveto_hinj', 'm2l', 'mveto', 'm2lvetomet150', 'm2lmet150',
16  'met200', 'met500', 'm5j', 'm1lmet150']
17 
18 ## Dilepton tests
19 methods = ['m2lveto', 'm2lveto_2015', 'm2lveto_lonj', 'm2lveto_hinj', 'm2l', 'mveto',
20  'm2lmet150', 'm2lvetomet150', 'mvetomet150', 'm2lmet150',
21  'm2lveto_el', 'm2lveto_mu', 'm2lveto_el_2015', 'm2lveto_mu_2015',
22  'm2l_2015', 'mveto_2015', 'm2lmet150_2015', 'm2lvetomet150_2015',
23  'mvetomet150_2015', 'm2lmet150_2015']
24 
25 methods = ['m2lvetomet150_lonj', 'm2lvetomet150_hinj']
26 
27 
28 os.system("./compile.sh")
29 
30 options = ""
31 if full_lumi: options = options + " -f"
32 if do_unblind: options = options + " -u"
33 
34 goodtex = []
35 missing_files = []
36 for method in methods:
37  cmd = "./run/table_all_preds.exe "+options+" -m "+method
38  print "\n\n"+cmd+"\n"
39  os.system(cmd)
40 
41  tag = "lumi"
42  if full_lumi:
43  if "2015" in method: tag = tag+"2p3"
44  else: tag = tag+"2p6"
45  else: tag = tag+"0p815"
46  if do_unblind: tag = "unblind_"+tag
47 
48  texfile = "txt/table_predictions_"+tag+"_"+method+".tex"
49  if os.path.isfile(texfile):
50  os.system("pdflatex "+texfile+" > /dev/null")
51  goodtex.append(texfile)
52  else: missing_files.append([texfile, cmd])
53 
54 for mfile in missing_files:
55  print "Could not find "+mfile[0]+". Command is "+mfile[1]
56 
57 sys.exit(0)