-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprintDatasets.py
executable file
·61 lines (47 loc) · 1.7 KB
/
printDatasets.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
#!/usr/bin/env python3
if __name__ == '__main__':
dsetDict = {}
for hltMenuType in [
'GRun',
'HIon',
'PIon',
'PRef',
'Fake',
'Fake1',
'Fake2',
]:
if hltMenuType == 'GRun':
from HLTrigger.Configuration.HLT_GRun_cff import cms,fragment
elif hltMenuType == 'HIon':
from HLTrigger.Configuration.HLT_HIon_cff import cms,fragment
elif hltMenuType == 'PIon':
from HLTrigger.Configuration.HLT_PIon_cff import cms,fragment
elif hltMenuType == 'PRef':
from HLTrigger.Configuration.HLT_PRef_cff import cms,fragment
elif hltMenuType == 'Fake':
from HLTrigger.Configuration.HLT_Fake_cff import cms,fragment
elif hltMenuType == 'Fake1':
from HLTrigger.Configuration.HLT_Fake1_cff import cms,fragment
elif hltMenuType == 'Fake2':
from HLTrigger.Configuration.HLT_Fake2_cff import cms,fragment
else:
raise Exception('invalid type of HLT menu (must be "GRun", "HIon", "PIon", or "PRef")')
foo = {'process': None}
exec(open('tmp_'+hltMenuType+'.py', 'r'), foo)
process = foo['process']
dsetDict[hltMenuType] = []
for dsetName in process.datasets.parameterNames_():
dsetDict[hltMenuType].append(dsetName)
for hltMenuType in dsetDict:
print('-'*50, hltMenuType, '-'*50)
dsets = sorted(list(set(dsetDict[hltMenuType])))
dsetStrFormat = 'Dataset_{: <'+str(max([len(tmp) for tmp in dsets]))+'} # CMSHLT-2245'
for dsetName in dsets:
print(dsetStrFormat.format(dsetName))
#for ttt in GRun HIon PIon PRef; do
# echo "" >> "${ttt}".txt
# ./printDatasets.py "${ttt}" >> "${ttt}".txt
# echo "" >> online_"${ttt,,}".txt
# ./printDatasets.py "${ttt}" >> online_"${ttt,,}".txt
#done
#unset ttt