forked from fgolf/ProjectMetis
-
Notifications
You must be signed in to change notification settings - Fork 10
/
alldata.py
98 lines (74 loc) · 3.31 KB
/
alldata.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from __future__ import print_function
import time
import itertools
import json
import traceback
from metis.Sample import DBSSample
from metis.CMSSWTask import CMSSWTask
from metis.StatsParser import StatsParser
from metis.Utils import send_email
if __name__ == "__main__":
pds = ["MuonEG","SingleElectron","MET","SinglePhoton","SingleMuon","DoubleMuon","JetHT","DoubleEG","HTMHT"]
proc_vers = [
# ("Run2017B","v1"),
# ("Run2017B","v2"),
# ("Run2017C","v1"),
# ("Run2017C","v2"),
# ("Run2017C","v3"),
# ("Run2017D","v1"),
# ("Run2017E","v1"),
("Run2017F","v1"),
]
dataset_names = ["/{0}/{1}-PromptReco-{2}/MINIAOD".format(x[0],x[1][0],x[1][1]) for x in itertools.product(pds,proc_vers)]
for i in range(10000):
total_summary = {}
total_counts = {}
for dsname in dataset_names:
open_dataset = False
cmsswver = "CMSSW_9_2_7_patch1"
tarfile = "/nfs-7/userdata/libCMS3/lib_CMS4_V00-00-06.tar.gz"
if "2017C-PromptReco-v2" in dsname:
open_dataset = False
if "2017C-PromptReco-v3" in dsname:
cmsswver = "CMSSW_9_2_8"
tarfile = "/nfs-7/userdata/libCMS3/lib_CMS4_V00-00-06_928.tar.gz"
open_dataset = False
if "2017D-PromptReco-v1" in dsname:
cmsswver = "CMSSW_9_2_10"
tarfile = "/nfs-7/userdata/libCMS3/lib_CMS4_V00-00-06_9210.tar.gz"
open_dataset = False
if "2017E-PromptReco-v1" in dsname:
cmsswver = "CMSSW_9_2_12"
tarfile = "/nfs-7/userdata/libCMS3/lib_CMS4_V00-00-06_9212.tar.gz"
open_dataset = False
if "2017F-PromptReco-v1" in dsname:
cmsswver = "CMSSW_9_2_13"
tarfile = "/nfs-7/userdata/libCMS3/lib_CMS4_V00-00-06_9213.tar.gz"
open_dataset = False
try:
task = CMSSWTask(
sample = DBSSample(dataset=dsname),
open_dataset = open_dataset,
flush = ((i+1)%48==0),
# flush = ((i)%48==0),
events_per_output = 450e3,
output_name = "merged_ntuple.root",
tag = "CMS4_V00-00-06",
global_tag = "", # if global tag blank, one from DBS is used
pset = "main_pset.py",
pset_args = "data=True prompt=True",
cmssw_version = cmsswver,
condor_submit_params = {"use_xrootd":True},
tarfile = tarfile,
is_data = True,
publish_to_dis = True,
)
task.process()
except:
traceback_string = traceback.format_exc()
print("Runtime error:\n{0}".format(traceback_string))
send_email(subject="metis error", body=traceback_string)
total_summary[dsname] = task.get_task_summary()
StatsParser(data=total_summary, webdir="~/public_html/dump/metis/", make_plots=False).do()
# time.sleep(1.*3600)
time.sleep(60.*60)