Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
RecoLuminosity
LumiDB
python
hltTrgSeedMapper.py
Go to the documentation of this file.
1
import
re,string
2
def
findUniqueSeed
(hltPath,ExprStr):
3
'''
4
given a hltpath and its L1SeedExpression, find the L1 bit name
5
can return None
6
7
if hltPath contains the following, skip do not parse seed.
8
9
FakeHLTPATH*, HLT_Physics*, HLT_*Calibration*, HLT_HFThreashold,
10
HLT_MiniBias*,HLT_Random*,HLTTriggerFinalPath,HLT_PixelFED*
11
12
parse hltpath contains at most 2 logics x OR y, x AND y, and return left val
13
do not consider path containing operator NOT
14
15
'''
16
if
re.match(
'FakeHLTPATH'
,hltPath)!=
None
:
17
return
None
18
if
re.match(
'HLT_Physics'
,hltPath)!=
None
:
19
return
None
20
if
re.match(
'HLT_[aA-zZ]*Calibration'
,hltPath)!=
None
:
21
return
None
22
if
re.match(
'HLT_[aA-zZ]*Threshold'
,hltPath)!=
None
:
23
return
None
24
if
re.match(
'HLT_MiniBias'
,hltPath)!=
None
:
25
return
None
26
if
re.match(
'HLT_Random'
,hltPath)!=
None
:
27
return
None
28
if
re.match(
'HLTriggerFinalPath'
,hltPath)!=
None
:
29
return
None
30
if
re.match(
'HLT_[aA-zZ]*FEDSize'
,hltPath)!=
None
:
31
return
None
32
if
ExprStr.find(
'('
)!=-1 :
#we don't parse expression with ()
33
return
None
34
sep=re.compile(
'(\sAND\s|\sOR\s)'
,re.IGNORECASE)
35
result=re.split(sep,ExprStr)
36
if
len(result)>3:
37
return
(
''
,
None
)
38
cleanresult=[]
39
exptype=
''
40
notsep=re.compile(
'NOT\s'
,re.IGNORECASE)
41
andsep=re.compile(
'\sAND\s'
,re.IGNORECASE)
42
orsep=re.compile(
'\sOR\s'
,re.IGNORECASE)
43
44
for
r
in
result:
45
if
notsep.match(r) :
#we don't know what to do with NOT
46
return
(
''
,
None
)
47
if
orsep.match(r):
48
exptype=
'OR'
49
continue
50
if
andsep.match(r):
51
exptype=
'AND'
52
continue
53
cleanresult.append(
'"'
+string.strip(r).
replace
(
'\"'
,
''
)+
'"'
)
54
return
(exptype,cleanresult)
55
56
if
__name__==
'__main__'
:
57
print
findUniqueSeed
(
"HLT_ForwardBSC"
,
"36 OR 37"
)
58
print
findUniqueSeed
(
"HLT_HcalNZS_8E29"
,
"L1_SingleEG1 OR L1_SingleEG2 OR L1_SingleEG5 OR L1_SingleEG8 OR L1_SingleEG10"
)
59
print
findUniqueSeed
(
"HLT_ZeroBiasPixel_SingleTrack"
,
"L1_ZeroBias AND me"
)
60
hltTrgSeedMapper.findUniqueSeed
def findUniqueSeed
Definition:
hltTrgSeedMapper.py:2
python.rootplot.root2matplotlib.replace
def replace
Definition:
root2matplotlib.py:443
Generated for CMSSW Reference Manual by
1.8.5