CMS 3D CMS Logo

Functions

hltTrgSeedMapper Namespace Reference

Functions

def findUniqueSeed

Function Documentation

def hltTrgSeedMapper::findUniqueSeed (   hltPath,
  ExprStr 
)
given a hltpath and its L1SeedExpression, find the L1 bit name
can return None

if hltPath contains the following, skip do not parse seed.

FakeHLTPATH*, HLT_Physics*, HLT_*Calibration*, HLT_HFThreashold,
HLT_MiniBias*,HLT_Random*,HLTTriggerFinalPath,HLT_PixelFED*

parse hltpath contains at most 2 logics x OR y, x AND y, and return left val
do not consider path containing operator NOT

Definition at line 2 of file hltTrgSeedMapper.py.

00003                                    :
00004     '''
00005     given a hltpath and its L1SeedExpression, find the L1 bit name
00006     can return None
00007     
00008     if hltPath contains the following, skip do not parse seed.
00009     
00010     FakeHLTPATH*, HLT_Physics*, HLT_*Calibration*, HLT_HFThreashold,
00011     HLT_MiniBias*,HLT_Random*,HLTTriggerFinalPath,HLT_PixelFED*
00012 
00013     parse hltpath contains at most 2 logics x OR y, x AND y, and return left val
00014     do not consider path containing operator NOT
00015 
00016     '''
00017     if re.match('FakeHLTPATH',hltPath)!=None :
00018         return None
00019     if re.match('HLT_Physics',hltPath)!=None :
00020         return None
00021     if re.match('HLT_[aA-zZ]*Calibration',hltPath)!=None :
00022         return None
00023     if re.match('HLT_[aA-zZ]*Threshold',hltPath)!=None :
00024         return None
00025     if re.match('HLT_MiniBias',hltPath)!=None :
00026         return None
00027     if re.match('HLT_Random',hltPath)!=None :
00028         return None
00029     if re.match('HLTTriggerFinalPath',hltPath)!=None :
00030         return None
00031     if re.match('HLT_[aA-zZ]*FEDSize',hltPath)!=None :
00032         return None
00033     if ExprStr.find('(')!=-1 : #we don't parse expression with ()
00034         return None
00035     sep=re.compile('\sAND\s|\sOR\s')
00036     result=re.split(sep,ExprStr)
00037     if len(result)>2:
00038         return None
00039     for r in result:
00040         if r.find('NOT ')!=-1 : #we don't know what to do with NOT
00041             return None
00042     #the result we return the first one
00043     return result[0]