-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcutflow-data
More file actions
executable file
·30 lines (23 loc) · 942 Bytes
/
cutflow-data
File metadata and controls
executable file
·30 lines (23 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
from mva.cutflow import get_parser, make_cutflow
parser = get_parser()
parser.add_argument('--grl', default=None)
parser.add_argument('--runs', type=int, nargs='*')
args = parser.parse_args()
data_name = 'data%d-JetTauEtmiss' % (args.year % 1e3)
if args.grl:
from goodruns import GRL
grl = GRL(args.grl)
samples = [(run, run, "{0}-{1}".format(data_name, run)) for run in grl]
elif args.runs:
samples = [(run, run, "{0}-{1}".format(data_name, run)) for run in args.runs]
else:
from pyAMI.client import AMIClient
from pyAMI.query import get_periods, get_runs
periods = get_periods(AMIClient(), year=args.year)
# only keep top-level periods (skip M)
periods = [p for p in periods if
len(p.name) == 1 and p.status == 'frozen'][:-1]
samples = [(p.name, p.name, "{0}-{1}".format(data_name, p.name))
for p in periods]
make_cutflow(samples, args)