|
def | _getUnprescaled (self, triggerType, additionalTriggerType, matchPattern, livefraction=1.0) |
|
def | _getLowestUnprescaled (self, triggerType, additionalTriggerType, matchPattern, livefraction=1.0) |
|
def | _getAllHLT (self, triggerType, additionalTriggerType, matchPattern, livefraction) |
|
def | _getActive (self, triggerType, additionalTriggerType, matchPattern, livefraction) |
|
def | _getInactive (self, triggerType, additionalTriggerType, matchPattern, livefraction) |
|
def | _checkPeriodConsistency (self, triggerType, additionalTriggerType, matchPattern) |
|
Object containing all the HLT information related to a given period.
Stores a list of TriggerChain objects and the functions to skim them
Definition at line 14 of file TriggerInfo.py.
◆ __init__()
def python.TriggerAPI.TriggerInfo.TriggerInfo.__init__ |
( |
|
self, |
|
|
|
period = 0 , |
|
|
|
customGRL = None , |
|
|
|
release = None , |
|
|
|
flags = None |
|
) |
| |
Definition at line 18 of file TriggerInfo.py.
18 def __init__(self,period=0, customGRL=None, release=None, flags=None):
19 self.triggerChains = []
22 self.totalLBByRun = {}
24 if not period
and not customGRL:
return
25 from .TriggerDataAccess
import getHLTlist
26 HLTlist, self.totalLB, self.totalLBByRun =
getHLTlist(period, customGRL, release, flags)
27 for hlt, l1, livefraction, activeLB, hasRerun, activeLBByRun
in HLTlist:
28 self.triggerChains.
append( TriggerChain(hlt, l1, livefraction, activeLB, hasRerun, activeLBByRun))
◆ __str__()
def python.TriggerAPI.TriggerInfo.TriggerInfo.__str__ |
( |
|
self | ) |
|
Definition at line 42 of file TriggerInfo.py.
43 return f
"<TriggerMenuMT.TriggerAPI.TriggerInfo.TriggerInfo object with {len(self.triggerChains)} triggerChains, period={self.period}, totalLB={self.totalLB}>"
◆ _checkPeriodConsistency()
def python.TriggerAPI.TriggerInfo.TriggerInfo._checkPeriodConsistency |
( |
|
self, |
|
|
|
triggerType, |
|
|
|
additionalTriggerType, |
|
|
|
matchPattern |
|
) |
| |
|
private |
Definition at line 111 of file TriggerInfo.py.
111 def _checkPeriodConsistency(self,triggerType, additionalTriggerType, matchPattern):
113 for i
in range(len(self.triggerChains)):
114 probe1 = self.triggerChains[i]
115 if not (probe1.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, probe1.name)):
continue
116 for j
in range(i+1,len(self.triggerChains)):
117 probe2 = self.triggerChains[j]
118 if not (probe2.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, probe2.name)):
continue
119 if probe1.isUnprescaled()
and not probe2.isUnprescaled()
and probe1.isLowerThan(probe2,self.period)==1:
120 log.error(f
"Found {probe2.name} that is tighter than Primary {probe1.name}")
121 inconsistent.add(probe2.name)
122 if probe2.isUnprescaled()
and not probe1.isUnprescaled()
and probe2.isLowerThan(probe1,self.period)==1:
123 log.error(f
"Found {probe1.name} that is tighter than Primary {probe2.name}")
124 inconsistent.add(probe1.name)
◆ _getActive()
def python.TriggerAPI.TriggerInfo.TriggerInfo._getActive |
( |
|
self, |
|
|
|
triggerType, |
|
|
|
additionalTriggerType, |
|
|
|
matchPattern, |
|
|
|
livefraction |
|
) |
| |
|
private |
Definition at line 106 of file TriggerInfo.py.
106 def _getActive(self,triggerType, additionalTriggerType, matchPattern, livefraction):
107 return [x.name
for x
in self.triggerChains
if x.isActive(livefraction)
and x.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, x.name)]
◆ _getAllHLT()
def python.TriggerAPI.TriggerInfo.TriggerInfo._getAllHLT |
( |
|
self, |
|
|
|
triggerType, |
|
|
|
additionalTriggerType, |
|
|
|
matchPattern, |
|
|
|
livefraction |
|
) |
| |
|
private |
Definition at line 103 of file TriggerInfo.py.
103 def _getAllHLT(self,triggerType, additionalTriggerType, matchPattern, livefraction):
104 return {x.name: x.livefraction
for x
in self.triggerChains
if x.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, x.name)
and x.isUnprescaled(livefraction)}
◆ _getInactive()
def python.TriggerAPI.TriggerInfo.TriggerInfo._getInactive |
( |
|
self, |
|
|
|
triggerType, |
|
|
|
additionalTriggerType, |
|
|
|
matchPattern, |
|
|
|
livefraction |
|
) |
| |
|
private |
Definition at line 108 of file TriggerInfo.py.
108 def _getInactive(self,triggerType, additionalTriggerType, matchPattern, livefraction):
109 return [x.name
for x
in self.triggerChains
if x.isInactive(livefraction)
and x.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, x.name)]
◆ _getLowestUnprescaled()
def python.TriggerAPI.TriggerInfo.TriggerInfo._getLowestUnprescaled |
( |
|
self, |
|
|
|
triggerType, |
|
|
|
additionalTriggerType, |
|
|
|
matchPattern, |
|
|
|
livefraction = 1.0 |
|
) |
| |
|
private |
Definition at line 83 of file TriggerInfo.py.
83 def _getLowestUnprescaled(self,triggerType, additionalTriggerType, matchPattern, livefraction=1.0):
84 chainList = [ x
for x
in self.triggerChains
if x.isUnprescaled(livefraction)
and x.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, x.name)]
86 for chain
in chainList:
87 if chain.triggerType
not in typeMap:
88 typeMap[chain.triggerType] = [chain]
91 for other
in typeMap[chain.triggerType][:]:
92 comp = chain.isLowerThan(other,self.period)
97 if comp == 1: typeMap[chain.triggerType].
remove(other)
99 typeMap[chain.triggerType].
append(chain)
100 return [x.name
for t
in six.itervalues (typeMap)
for x
in t ]
◆ _getUnprescaled()
def python.TriggerAPI.TriggerInfo.TriggerInfo._getUnprescaled |
( |
|
self, |
|
|
|
triggerType, |
|
|
|
additionalTriggerType, |
|
|
|
matchPattern, |
|
|
|
livefraction = 1.0 |
|
) |
| |
|
private |
Definition at line 80 of file TriggerInfo.py.
80 def _getUnprescaled(self,triggerType, additionalTriggerType, matchPattern, livefraction=1.0):
81 return [x.name
for x
in self.triggerChains
if x.isUnprescaled(livefraction)
and x.passType(triggerType, additionalTriggerType)
and re.search(matchPattern, x.name)]
◆ merge()
def python.TriggerAPI.TriggerInfo.TriggerInfo.merge |
( |
|
cls, |
|
|
|
listofTI |
|
) |
| |
Definition at line 49 of file TriggerInfo.py.
49 def merge(cls,listofTI):
50 from copy
import deepcopy
54 mergedTI.period |= ti.period
55 mergedTI.totalLB += ti.totalLB
56 for run,lb
in ti.totalLBByRun.items():
57 if run
not in mergedTI.totalLBByRun: mergedTI.totalLBByRun[run] = 0
58 mergedTI.totalLBByRun[run] += lb
59 for tc
in ti.triggerChains:
60 if tc.name
not in mergedHLTmap: mergedHLTmap[tc.name] = deepcopy(tc)
61 else: mergedHLTmap[tc.name].activeLB += tc.activeLB
63 for run,lb
in tc.activeLBByRun.items():
64 if run
not in mergedHLTmap[tc.name].activeLBByRun: mergedHLTmap[tc.name].activeLBByRun = 0
65 mergedHLTmap[tc.name].activeLBByRun += lb
66 for tc
in six.itervalues (mergedHLTmap):
67 tc.livefraction = tc.activeLB/
float(mergedTI.totalLB)
68 mergedTI.triggerChains =
list(mergedHLTmap.values())
◆ reparse()
def python.TriggerAPI.TriggerInfo.TriggerInfo.reparse |
( |
|
self | ) |
|
Definition at line 77 of file TriggerInfo.py.
78 self.triggerChains = [ TriggerChain(t.name, t.l1seed, t.livefraction, t.activeLB)
for t
in self.triggerChains ]
◆ setRunRange()
def python.TriggerAPI.TriggerInfo.TriggerInfo.setRunRange |
( |
|
self, |
|
|
|
start = 0 , |
|
|
|
end = 999999 |
|
) |
| |
Definition at line 30 of file TriggerInfo.py.
30 def setRunRange(self,start=0,end=999999):
31 if not self.totalLBByRun:
33 totalLB = self.totalLB
36 for run,efflb
in self.totalLBByRun.
items():
39 for tc
in self.triggerChains:
40 tc.setRunRange(start,end,totalLB)
◆ testCustomGRL()
def python.TriggerAPI.TriggerInfo.TriggerInfo.testCustomGRL |
( |
|
cls, |
|
|
|
grl |
|
) |
| |
Definition at line 73 of file TriggerInfo.py.
73 def testCustomGRL(cls, grl):
74 from TriggerMenuMT.TriggerAPI.TriggerPeriodData
import TriggerPeriodData
75 return TriggerPeriodData.testCustomGRL(grl)
◆ toJSON()
def python.TriggerAPI.TriggerInfo.TriggerInfo.toJSON |
( |
|
self | ) |
|
Definition at line 45 of file TriggerInfo.py.
46 return dict(period= TriggerPeriod.toName(self.period), totalLB=self.totalLB,triggerChains=self.triggerChains,totalLBByRun=self.totalLBByRun)
◆ period
python.TriggerAPI.TriggerInfo.TriggerInfo.period |
◆ totalLB
python.TriggerAPI.TriggerInfo.TriggerInfo.totalLB |
◆ totalLBByRun
python.TriggerAPI.TriggerInfo.TriggerInfo.totalLBByRun |
◆ triggerChains
python.TriggerAPI.TriggerInfo.TriggerInfo.triggerChains |
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.