|
def | reset (cls) |
|
def | init (cls) |
|
def | setConfigFlags (cls, flags) |
|
def | setRelease (cls, release) |
|
def | setCustomGRL (cls, grl) |
|
def | getLowestUnprescaled (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False) |
|
def | getLowestUnprescaledAnyPeriod (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False) |
|
def | getUnprescaled (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False) |
|
def | getUnprescaledAnyPeriod (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False) |
|
def | getInactive (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1e-99, reparse=False) |
|
def | getActive (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1e-99, reparse=False) |
|
def | getAllHLT (cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=0, reparse=False) |
|
def | checkPeriodConsistency (cls, period=TriggerPeriod.future, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", reparse=False) |
|
def | dumpAPI (cls, full=False) |
|
Definition at line 13 of file TriggerAPI.py.
◆ _loadTriggerPeriod()
def python.TriggerAPI.TriggerAPI.TriggerAPI._loadTriggerPeriod |
( |
|
cls, |
|
|
|
period, |
|
|
|
reparse |
|
) |
| |
|
private |
Definition at line 152 of file TriggerAPI.py.
152 def _loadTriggerPeriod(cls, period, reparse):
153 if period != TriggerPeriod.customGRL
and not period & TriggerPeriod.future: cls.init()
154 if (period,cls.customGRL)
not in cls.dbQueries:
155 if TriggerPeriod.isRunNumber(period)
or (isinstance(period,TriggerPeriod)
and period.isBasePeriod()):
156 cls.dbQueries[(period,cls.customGRL)] =
TriggerInfo(period,cls.customGRL,cls.release,cls.flags)
158 basePeriods = [tp
for tp
in TriggerPeriod.basePeriods()
if tp & period]
159 for bp
in basePeriods:
160 cls._loadTriggerPeriod(bp,reparse)
161 cls.dbQueries[(period,cls.customGRL)] = TriggerInfo.merge([cls.dbQueries[(bp,cls.customGRL)]
for bp
in basePeriods])
162 if reparse: cls.dbQueries[(period,cls.customGRL)].reparse()
◆ checkPeriodConsistency()
Returns a list of triggers that are tighter than the lowest unprescaled but are not flagged as primary
This only makes sense for future periods, the past is already consistent :)
See getLowestUnprescaled for a detailed description of the options
Definition at line 142 of file TriggerAPI.py.
142 def checkPeriodConsistency(cls, period=TriggerPeriod.future, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", reparse=False):
143 ''' Returns a list of triggers that are tighter than the lowest unprescaled but are not flagged as primary
144 This only makes sense for future periods, the past is already consistent :)
145 See getLowestUnprescaled for a detailed description of the options
147 period &= TriggerPeriod.future
148 cls._loadTriggerPeriod(period,reparse)
149 return cls.dbQueries[(period,cls.customGRL)]._checkPeriodConsistency(triggerType, additionalTriggerType, matchPattern)
◆ dumpAPI()
def python.TriggerAPI.TriggerAPI.TriggerAPI.dumpAPI |
( |
|
cls, |
|
|
|
full = False |
|
) |
| |
Definition at line 165 of file TriggerAPI.py.
165 def dumpAPI(cls, full=False):
167 for period,grl
in list(cls.dbQueries.
keys()):
168 if TriggerPeriod.isRunNumber(period)
or (isinstance(period,TriggerPeriod)
and period.isBasePeriod()):
continue
169 del cls.dbQueries[(period,grl)]
170 SerializeAPI.dump(cls.dbQueries)
◆ getActive()
def python.TriggerAPI.TriggerAPI.TriggerAPI.getActive |
( |
|
cls, |
|
|
|
period, |
|
|
|
triggerType = TriggerType.ALL , |
|
|
|
additionalTriggerType = TriggerType.UNDEFINED , |
|
|
|
matchPattern = "" , |
|
|
|
livefraction = 1e-99 , |
|
|
|
reparse = False |
|
) |
| |
Returns a list of HLT chains that were active at some point, including disabled chains in rerun.
See getLowestUnprescaled for a detailed description of the options
Definition at line 124 of file TriggerAPI.py.
124 def getActive(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1e-99, reparse=False):
125 ''' Returns a list of HLT chains that were active at some point, including disabled chains in rerun.
126 See getLowestUnprescaled for a detailed description of the options
128 cls._loadTriggerPeriod(period,reparse)
129 return cls.dbQueries[(period,cls.customGRL)]._getActive(triggerType, additionalTriggerType, matchPattern, livefraction)
◆ getAllHLT()
Returns a map of {HLT chains: average live fraction} for a given period.
The average live fraction is an approximation weighting the number of lumiblocks by prescale.
*** Don't use this number in analysis!!! ***
See getLowestUnprescaled for a detailed description of the options
Definition at line 132 of file TriggerAPI.py.
132 def getAllHLT(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=0, reparse=False):
133 ''' Returns a map of {HLT chains: average live fraction} for a given period.
134 The average live fraction is an approximation weighting the number of lumiblocks by prescale.
135 *** Don't use this number in analysis!!! ***
136 See getLowestUnprescaled for a detailed description of the options
138 cls._loadTriggerPeriod(period,reparse)
139 return cls.dbQueries[(period,cls.customGRL)]._getAllHLT(triggerType, additionalTriggerType, matchPattern, livefraction)
◆ getInactive()
def python.TriggerAPI.TriggerAPI.TriggerAPI.getInactive |
( |
|
cls, |
|
|
|
period, |
|
|
|
triggerType = TriggerType.ALL , |
|
|
|
additionalTriggerType = TriggerType.UNDEFINED , |
|
|
|
matchPattern = "" , |
|
|
|
livefraction = 1e-99 , |
|
|
|
reparse = False |
|
) |
| |
Returns a list of HLT chains that were fully inactive, excluding disabled chains in rerun.
See getLowestUnprescaled for a detailed description of the options
Definition at line 116 of file TriggerAPI.py.
116 def getInactive(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1e-99, reparse=False):
117 ''' Returns a list of HLT chains that were fully inactive, excluding disabled chains in rerun.
118 See getLowestUnprescaled for a detailed description of the options
120 cls._loadTriggerPeriod(period,reparse)
121 return cls.dbQueries[(period,cls.customGRL)]._getInactive(triggerType, additionalTriggerType, matchPattern, livefraction)
◆ getLowestUnprescaled()
def python.TriggerAPI.TriggerAPI.TriggerAPI.getLowestUnprescaled |
( |
|
cls, |
|
|
|
period, |
|
|
|
triggerType = TriggerType.ALL , |
|
|
|
additionalTriggerType = TriggerType.UNDEFINED , |
|
|
|
matchPattern = "" , |
|
|
|
livefraction = 1.0 , |
|
|
|
reparse = False |
|
) |
| |
Returns a list of the lowest-pt-threshold HLT chains that were always unprescaled in the given period.
period: see TriggerEnums.TriggerPeriod for all possibilities, recommeded TriggerPeriod.y2018
triggerType: see TriggerEnums.TriggerType for all possibilities, example TriggerType.el_single
additionalTriggerType: can request additional types to match, use TriggerType.ALL to show combined triggers of any kind
accepts also a list as input in that case all types have to match
matchPattern: provide additionally a regex-like expression to be applied
livefraction: accept items that are not unprescaled but have a live fraction above this threshold, example 0.95
The live fraction is only an approximation, weighting the number of lumiblocks by prescale.
Definition at line 63 of file TriggerAPI.py.
63 def getLowestUnprescaled(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False):
64 ''' Returns a list of the lowest-pt-threshold HLT chains that were always unprescaled in the given period.
65 period: see TriggerEnums.TriggerPeriod for all possibilities, recommeded TriggerPeriod.y2018
66 triggerType: see TriggerEnums.TriggerType for all possibilities, example TriggerType.el_single
67 additionalTriggerType: can request additional types to match, use TriggerType.ALL to show combined triggers of any kind
68 accepts also a list as input in that case all types have to match
69 matchPattern: provide additionally a regex-like expression to be applied
70 livefraction: accept items that are not unprescaled but have a live fraction above this threshold, example 0.95
71 The live fraction is only an approximation, weighting the number of lumiblocks by prescale.
73 cls._loadTriggerPeriod(period,reparse)
74 return cls.dbQueries[(period,cls.customGRL)]._getLowestUnprescaled(triggerType, additionalTriggerType, matchPattern, livefraction)
◆ getLowestUnprescaledAnyPeriod()
def python.TriggerAPI.TriggerAPI.TriggerAPI.getLowestUnprescaledAnyPeriod |
( |
|
cls, |
|
|
|
period, |
|
|
|
triggerType = TriggerType.ALL , |
|
|
|
additionalTriggerType = TriggerType.UNDEFINED , |
|
|
|
matchPattern = "" , |
|
|
|
livefraction = 1.0 , |
|
|
|
reparse = False |
|
) |
| |
Returns a list of the lowest-pt-threshold HLT chains that were unprescaled in at least one of
the subperiods within the given period. The lowest granularity can be seen in TriggerEnums.TriggerPeriod
See getLowestUnprescaled for a detailed description of the options
Definition at line 77 of file TriggerAPI.py.
77 def getLowestUnprescaledAnyPeriod(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False):
78 ''' Returns a list of the lowest-pt-threshold HLT chains that were unprescaled in at least one of
79 the subperiods within the given period. The lowest granularity can be seen in TriggerEnums.TriggerPeriod
80 See getLowestUnprescaled for a detailed description of the options
83 for i, ibin
in enumerate(reversed(
bin(period)[2:])):
87 cls._loadTriggerPeriod(subperiod, reparse)
88 subperiodset =
set( cls.dbQueries[(subperiod,cls.customGRL)]._getLowestUnprescaled(triggerType, additionalTriggerType, matchPattern, livefraction) )
89 lowset |= subperiodset
◆ getUnprescaled()
def python.TriggerAPI.TriggerAPI.TriggerAPI.getUnprescaled |
( |
|
cls, |
|
|
|
period, |
|
|
|
triggerType = TriggerType.ALL , |
|
|
|
additionalTriggerType = TriggerType.UNDEFINED , |
|
|
|
matchPattern = "" , |
|
|
|
livefraction = 1.0 , |
|
|
|
reparse = False |
|
) |
| |
Returns a list of always-unprescaled HLT chains, including backup items with higher thresholds.
See getLowestUnprescaled for a detailed description of the options
Definition at line 93 of file TriggerAPI.py.
93 def getUnprescaled(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False):
94 ''' Returns a list of always-unprescaled HLT chains, including backup items with higher thresholds.
95 See getLowestUnprescaled for a detailed description of the options
97 return cls.dbQueries[(period,cls.customGRL)]._getUnprescaled(triggerType, additionalTriggerType, matchPattern, livefraction)
◆ getUnprescaledAnyPeriod()
def python.TriggerAPI.TriggerAPI.TriggerAPI.getUnprescaledAnyPeriod |
( |
|
cls, |
|
|
|
period, |
|
|
|
triggerType = TriggerType.ALL , |
|
|
|
additionalTriggerType = TriggerType.UNDEFINED , |
|
|
|
matchPattern = "" , |
|
|
|
livefraction = 1.0 , |
|
|
|
reparse = False |
|
) |
| |
Returns a list of HLT chains that were unprescaled in at least one of
the subperiods within the given period. The lowest granularity can be seen in TriggerEnums.TriggerPeriod
See getLowestUnprescaled for a detailed description of the options
Definition at line 100 of file TriggerAPI.py.
100 def getUnprescaledAnyPeriod(cls, period, triggerType=TriggerType.ALL, additionalTriggerType=TriggerType.UNDEFINED, matchPattern="", livefraction=1.0, reparse=False):
101 ''' Returns a list of HLT chains that were unprescaled in at least one of
102 the subperiods within the given period. The lowest granularity can be seen in TriggerEnums.TriggerPeriod
103 See getLowestUnprescaled for a detailed description of the options
106 for i, ibin
in enumerate(reversed(
bin(period)[2:])):
108 if not ibin:
continue
110 cls._loadTriggerPeriod(subperiod, reparse)
111 subperiodset =
set( cls.dbQueries[(subperiod,cls.customGRL)]._getUnprescaled(triggerType, additionalTriggerType, matchPattern, livefraction) )
112 lowset |= subperiodset
◆ init()
def python.TriggerAPI.TriggerAPI.TriggerAPI.init |
( |
|
cls | ) |
|
Definition at line 30 of file TriggerAPI.py.
31 if cls.cacheread:
return
33 cls.dbQueries = SerializeAPI.load()
34 todel = [(p,grl)
for p,grl
in cls.dbQueries
if p & TriggerPeriod.future]
36 del cls.dbQueries[key]
◆ reset()
def python.TriggerAPI.TriggerAPI.TriggerAPI.reset |
( |
|
cls | ) |
|
◆ setConfigFlags()
def python.TriggerAPI.TriggerAPI.TriggerAPI.setConfigFlags |
( |
|
cls, |
|
|
|
flags |
|
) |
| |
Set ConfigFlags (only required for "future" periods)
Definition at line 39 of file TriggerAPI.py.
39 def setConfigFlags(cls, flags):
40 """Set ConfigFlags (only required for "future" periods)"""
◆ setCustomGRL()
def python.TriggerAPI.TriggerAPI.TriggerAPI.setCustomGRL |
( |
|
cls, |
|
|
|
grl |
|
) |
| |
Definition at line 54 of file TriggerAPI.py.
54 def setCustomGRL(cls, grl):
55 if TriggerInfo.testCustomGRL(grl):
58 cls.log.warning(
"Couldn't set GRL: "+grl)
59 cls.log.warning(
"Will use default GRL")
◆ setRelease()
def python.TriggerAPI.TriggerAPI.TriggerAPI.setRelease |
( |
|
cls, |
|
|
|
release |
|
) |
| |
Definition at line 44 of file TriggerAPI.py.
44 def setRelease(cls, release):
46 if release
and re.match(
r'21\.1(\.[0-9]+)+$',release):
48 elif release==
"current":
51 cls.log.warning(
"Release doesn't seem to be a well-formed 21.1 release, ignoring: "+release)
◆ cacheread
python.TriggerAPI.TriggerAPI.TriggerAPI.cacheread |
|
static |
◆ customGRL
python.TriggerAPI.TriggerAPI.TriggerAPI.customGRL |
|
static |
◆ dbQueries
python.TriggerAPI.TriggerAPI.TriggerAPI.dbQueries |
|
static |
◆ flags
python.TriggerAPI.TriggerAPI.TriggerAPI.flags |
|
static |
◆ log
python.TriggerAPI.TriggerAPI.TriggerAPI.log |
|
static |
◆ release
python.TriggerAPI.TriggerAPI.TriggerAPI.release |
|
static |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
constexpr std::enable_if_t< is_bitmask_v< E >, E & > reset(E &lhs, E rhs)
Convenience function to clear bits in a class enum bitmask.