-
Notifications
You must be signed in to change notification settings - Fork 1
/
showHLTL1TSeeds_compareToL1T.sh
executable file
·36 lines (31 loc) · 1.3 KB
/
showHLTL1TSeeds_compareToL1T.sh
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
#!/bin/bash
#[ -f hlt.py ] || (wget https://raw.githubusercontent.com/cms-sw/cmssw/master/HLTrigger/Configuration/python/HLT_FULL_cff.py -O hlt.py)
[ -f hlt.py ] || (hltConfigFromDB --adg --configName /cdaq/circulating/2022/v1.1/HLT/V1 > hlt.py)
#[ -f hlt.py ] || (hltConfigFromDB --adg --configName /cdaq/cosmic/commissioning2022/CRAFT/v2.2/HLT/V1 > hlt.py)
python3 <<EOF
from hlt import cms, fragment as process
def selectPaths(pathName):
return True
retDict = {}
for pathName in process.paths_():
if not selectPaths(pathName):
continue
retDict[pathName] = []
path = getattr(process, pathName)
for moduleName in path.moduleNames():
module = getattr(process, moduleName)
if module.type_() == 'HLTL1TSeed' and hasattr(module, 'L1SeedsLogicalExpression'):
strippedL1TSeedStr = module.L1SeedsLogicalExpression.value()
for specialStr in ['(', ')', ' OR', ' AND', ' NOT', 'OR ', 'AND ', 'NOT ']:
strippedL1TSeedStr = strippedL1TSeedStr.replace(specialStr, ' ')
retDict[pathName] += sorted(list(set(strippedL1TSeedStr.split())))
for pathName in sorted(retDict.keys()):
l1tSeeds = retDict[pathName]
if l1tSeeds:
print(pathName)
for l1tSeed in retDict[pathName]:
if l1tSeed.startswith('L1_'):
print(' ', l1tSeed)
else:
raise Exception(l1tSeed)
EOF