forked from BrieucF/FCNCLimits
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all_closureChecks.py
More file actions
21 lines (18 loc) · 921 Bytes
/
run_all_closureChecks.py
File metadata and controls
21 lines (18 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os, sys
from subprocess import call
print "Usage: python run_all_limits.py datacard_folder"
current_dir = os.getcwd()
datacard_path = sys.argv[1]
signal_folders = [folder for folder in os.listdir(datacard_path) if os.path.isdir(os.path.join(datacard_path, folder))]
if not signal_folders:
print "Found no signal directory inside %s"%datacard_path
for signal_folder in signal_folders:
os.chdir(os.path.join(datacard_path, signal_folder))
limit_scripts = [limit_script for limit_script in os.listdir(".") if limit_script.endswith('run_closureChecks.sh')]
if not limit_scripts:
print "Found no limit script in directory %s"%os.path.join(datacard_path, signal_folder)
for limit_script in limit_scripts:
if 'fullComb' in datacard_path and not 'all' in limit_script: continue
print "Executing %s"%limit_script
call(['bash', limit_script])
os.chdir(current_dir)