1 from __future__
import print_function
5 given a hltpath and its L1SeedExpression, find the L1 bit name 8 if hltPath contains the following, skip do not parse seed. 10 FakeHLTPATH*, HLT_Physics*, HLT_*Calibration*, HLT_HFThreashold, 11 HLT_MiniBias*,HLT_Random*,HLTTriggerFinalPath,HLT_PixelFED* 13 parse hltpath contains at most 2 logics x OR y, x AND y, and return left val 14 do not consider path containing operator NOT 17 if re.match(
'FakeHLTPATH',hltPath)!=
None :
19 if re.match(
'HLT_Physics',hltPath)!=
None :
21 if re.match(
'HLT_[aA-zZ]*Calibration',hltPath)!=
None :
23 if re.match(
'HLT_[aA-zZ]*Threshold',hltPath)!=
None :
25 if re.match(
'HLT_MiniBias',hltPath)!=
None :
27 if re.match(
'HLT_Random',hltPath)!=
None :
29 if re.match(
'HLTriggerFinalPath',hltPath)!=
None :
31 if re.match(
'HLT_[aA-zZ]*FEDSize',hltPath)!=
None :
33 if ExprStr.find(
'(')!=-1 :
35 sep=re.compile(
'(\sAND\s|\sOR\s)',re.IGNORECASE)
36 result=re.split(sep,ExprStr)
41 notsep=re.compile(
'NOT\s',re.IGNORECASE)
42 andsep=re.compile(
'\sAND\s',re.IGNORECASE)
43 orsep=re.compile(
'\sOR\s',re.IGNORECASE)
54 cleanresult.append(
'"'+string.strip(r).
replace(
'\"',
'')+
'"')
55 return (exptype,cleanresult)
57 if __name__==
'__main__':
59 print(
findUniqueSeed(
"HLT_HcalNZS_8E29",
"L1_SingleEG1 OR L1_SingleEG2 OR L1_SingleEG5 OR L1_SingleEG8 OR L1_SingleEG10"))
def replace(string, replacements)
S & print(S &os, JobReport::InputFile const &f)
def findUniqueSeed(hltPath, ExprStr)