|
def | __init__ (self, filename=None, jsonString=None, dbalias=None, smkey=None, monikey=None, useCrest=False, crestServer="") |
|
def | monitoringDict (self) |
|
def | monitoredChains (self, signatures="", monLevels="", wildcard="") |
|
def | monitoringLevels (self, signatures=None) |
|
def | printSummary (self) |
|
this class provides access to the HLT monitoring json
Definition at line 143 of file HLTTriggerConfigAccess.py.
◆ __init__()
def python.HLTTriggerConfigAccess.HLTMonitoringAccess.__init__ |
( |
|
self, |
|
|
|
filename = None , |
|
|
|
jsonString = None , |
|
|
|
dbalias = None , |
|
|
|
smkey = None , |
|
|
|
monikey = None , |
|
|
|
useCrest = False , |
|
|
|
crestServer = "" |
|
) |
| |
accessor needs to be initialized with either a filename or the dbalias and hlpskey
Definition at line 147 of file HLTTriggerConfigAccess.py.
147 def __init__(self, filename = None, jsonString = None, dbalias = None, smkey = None, monikey = None,
148 useCrest=False, crestServer=""):
150 accessor needs to be initialized with either a filename or the dbalias and hlpskey
152 super().
__init__(ConfigType.HLTMON, mainkey =
"signatures",
153 jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = smkey
if smkey
else monikey,
154 useCrest=useCrest, crestServer=crestServer)
155 self.loader.setQuery({
157 "SELECT HMG.HMG_DATA FROM {schema}.HLT_MONITORING_GROUPS HMG, {schema}.SUPER_MASTER_TABLE SMT WHERE HMG.HMG_IN_USE=1 "
158 "AND SMT.SMT_HLT_MENU_ID = HMG.HMG_HLT_MENU_ID AND SMT.SMT_ID=:dbkey ORDER BY HMG.HMG_ID DESC"
161 7:
"SELECT HMG.HMG_DATA FROM {schema}.HLT_MONITORING_GROUPS HMG WHERE HMG.HMG_ID=:dbkey"
164 if smkey
is not None:
165 log.info(f
"Loaded HLT monitoring {self.name()} with {len(self)} signatures from {dbalias} with smk {smkey}{' using CREST' if useCrest else ''}")
166 elif filename
is not None:
167 log.info(f
"Loaded HLT monitoring {self.name()} with {len(self)} signatures from file {filename}")
◆ monitoredChains()
def python.HLTTriggerConfigAccess.HLTMonitoringAccess.monitoredChains |
( |
|
self, |
|
|
|
signatures = "" , |
|
|
|
monLevels = "" , |
|
|
|
wildcard = "" |
|
) |
| |
return list of all monitored shifter chains for given signature and for a given monitoring level
signatures - monitored signature or list of signatures for which to return the chains
empty string means all signatures
monLevels - levels of monitoring (shifter, t0 (expert), val (validation))
wildcard - regexp pattern to match the chains' names
if monitoring level is not defined return all the chains for given signature
if signature is not defined return all the chains for given monitoring level
if both monitoring level and signature are not defined, raturn all chains
return can be filtered by wildcard
Definition at line 177 of file HLTTriggerConfigAccess.py.
177 def monitoredChains(self, signatures="", monLevels="", wildcard=""):
179 return list of all monitored shifter chains for given signature and for a given monitoring level
181 signatures - monitored signature or list of signatures for which to return the chains
182 empty string means all signatures
183 monLevels - levels of monitoring (shifter, t0 (expert), val (validation))
184 wildcard - regexp pattern to match the chains' names
186 if monitoring level is not defined return all the chains for given signature
187 if signature is not defined return all the chains for given monitoring level
188 if both monitoring level and signature are not defined, raturn all chains
190 return can be filtered by wildcard
195 signatures =
set(self)
198 if isinstance(signatures, str):
199 signatures =
set([signatures])
200 signatures =
set(signatures)
203 noMonAvailable = signatures.difference(self)
205 log.warning(
"These monitoring signatures are requested but not available in HLT monitoring: %s",
', '.
join(noMonAvailable))
206 signatures.intersection_update(self)
209 if isinstance(monLevels, str):
210 monLevels =
set([monLevels])
211 monLevels =
set(monLevels)
213 for signature
in signatures:
214 for chainName, targets
in self[
"signatures"][signature].
items():
215 if monLevels.intersection(targets+[
""]):
216 chains.add(chainName)
220 r = re.compile(wildcard)
221 chains =
filter(r.search, chains)
222 except re.error
as exc:
223 log.warning(
"Wildcard regex: %r is not correct!", exc)
◆ monitoringDict()
def python.HLTTriggerConfigAccess.HLTMonitoringAccess.monitoringDict |
( |
|
self | ) |
|
return stored monitoring dictionary
Definition at line 170 of file HLTTriggerConfigAccess.py.
170 def monitoringDict(self):
172 return stored monitoring dictionary
174 return self[
"signatures"]
◆ monitoringLevels()
def python.HLTTriggerConfigAccess.HLTMonitoringAccess.monitoringLevels |
( |
|
self, |
|
|
|
signatures = None |
|
) |
| |
return all monitoring levels
If one ore more signatures are specified, return only monitoring levels for those
Definition at line 230 of file HLTTriggerConfigAccess.py.
230 def monitoringLevels(self, signatures = None):
232 return all monitoring levels
233 If one ore more signatures are specified, return only monitoring levels for those
235 if signatures
is None:
236 signatures =
set(self)
237 if isinstance(signatures, str):
238 signatures =
set([signatures])
239 signatures =
set(signatures)
241 for signatureName, chains
in self[
"signatures"].
items():
242 if signatureName
in signatures:
243 levels =
reduce(
lambda x, y: x.union(y), chains.values(), levels )
◆ printSummary()
def python.HLTTriggerConfigAccess.HLTMonitoringAccess.printSummary |
( |
|
self | ) |
|
Definition at line 247 of file HLTTriggerConfigAccess.py.
247 def printSummary(self):
248 print(
"HLT monitoring groups %s" % self.name())
249 print(
"Signatures (%i): %s" % (len(self),
", ".
join(self)) )
250 print(
"Monitoring levels (%i): %s" % (len(self.monitoringLevels()),
", ".
join(self.monitoringLevels())))
◆ maxsize
python.HLTTriggerConfigAccess.HLTMonitoringAccess.maxsize |
|
static |
The documentation for this class was generated from the following file:
void reduce(HepMC::GenEvent *ge, std::vector< HepMC::GenParticlePtr > toremove)
Remove unwanted particles from the event, collapsing the graph structure consistently.
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.