|
def | __init__ (self, filename=None, jsonString=None, dbalias=None, smkey=None, useCrest=False, crestServer="") |
|
def | itemNames (self) |
|
def | itemsWithCtpid (self) |
|
def | items (self, includeKeys=[]) |
|
def | thresholdTypes (self) |
|
def | thresholds (self, thresholdType=None, fulldict=False) |
|
def | thresholdNames (self, thresholdType=None) |
|
def | thresholdExtraInfo (self, thresholdType) |
|
def | topoAlgorithmTypes (self) |
|
def | topoAlgorithms (self, topoAlgoType=None) |
|
def | topoAlgorithmNames (self, topoAlgoType=None) |
|
def | boardNames (self) |
|
def | boards (self) |
|
def | board (self, boardName) |
|
def | connectorNames (self) |
|
def | connectors (self) |
|
def | connector (self, connectorName) |
|
def | ctp (self) |
|
def | ctpInputs (self, inputType) |
|
def | printSummary (self) |
|
this class provides access to the L1Menu
the methods are self-explanatory for people with knowledge of the configuration
Definition at line 9 of file L1TriggerConfigAccess.py.
◆ __init__()
def python.L1TriggerConfigAccess.L1MenuAccess.__init__ |
( |
|
self, |
|
|
|
filename = None , |
|
|
|
jsonString = None , |
|
|
|
dbalias = None , |
|
|
|
smkey = None , |
|
|
|
useCrest = False , |
|
|
|
crestServer = "" |
|
) |
| |
accessor needs to be initialized with either a filename or the dbalias and smkey
Definition at line 14 of file L1TriggerConfigAccess.py.
14 def __init__(self, filename = None, jsonString = None, dbalias = None, smkey = None, useCrest=False, crestServer=""):
16 accessor needs to be initialized with either a filename or the dbalias and smkey
18 super().
__init__(ConfigType.L1MENU, mainkey =
"items",
19 jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = smkey,
20 useCrest=useCrest, crestServer=crestServer)
21 self.loader.setQuery({
22 2:
"SELECT L1MT.L1TM_DATA FROM {schema}.SUPER_MASTER_TABLE SMT, {schema}.L1_MENU L1MT WHERE L1MT.L1TM_ID=SMT.SMT_L1_MENU_ID AND SMT.SMT_ID=:dbkey",
23 1:
"SELECT L1MT.L1MT_MENU FROM {schema}.SUPER_MASTER_TABLE SMT, {schema}.L1_MASTER_TABLE L1MT WHERE L1MT.L1MT_ID=SMT.SMT_L1_MASTER_TABLE_ID AND SMT.SMT_ID=:dbkey"
27 log.info(f
"Loaded L1 menu {self.name()} with {len(self)} items from {dbalias} with smk {smkey}{' using CREST' if useCrest else ''}")
28 elif filename
is not None:
29 log.info(f
"Loaded L1 menu {self.name()} with {len(self)} chains from file {filename}")
◆ board()
def python.L1TriggerConfigAccess.L1MenuAccess.board |
( |
|
self, |
|
|
|
boardName |
|
) |
| |
◆ boardNames()
def python.L1TriggerConfigAccess.L1MenuAccess.boardNames |
( |
|
self | ) |
|
◆ boards()
def python.L1TriggerConfigAccess.L1MenuAccess.boards |
( |
|
self | ) |
|
◆ connector()
def python.L1TriggerConfigAccess.L1MenuAccess.connector |
( |
|
self, |
|
|
|
connectorName |
|
) |
| |
Definition at line 123 of file L1TriggerConfigAccess.py.
123 def connector(self, connectorName):
124 return self[
"connectors"][connectorName]
◆ connectorNames()
def python.L1TriggerConfigAccess.L1MenuAccess.connectorNames |
( |
|
self | ) |
|
◆ connectors()
def python.L1TriggerConfigAccess.L1MenuAccess.connectors |
( |
|
self | ) |
|
◆ ctp()
def python.L1TriggerConfigAccess.L1MenuAccess.ctp |
( |
|
self | ) |
|
◆ ctpInputs()
def python.L1TriggerConfigAccess.L1MenuAccess.ctpInputs |
( |
|
self, |
|
|
|
inputType |
|
) |
| |
inputType should be 'optical', 'electrical' or 'ctpin'
Definition at line 129 of file L1TriggerConfigAccess.py.
129 def ctpInputs(self, inputType):
130 """ inputType should be 'optical', 'electrical' or 'ctpin'
132 return self[
"ctp"][
"inputs"][inputType]
◆ itemNames()
def python.L1TriggerConfigAccess.L1MenuAccess.itemNames |
( |
|
self | ) |
|
◆ items()
def python.L1TriggerConfigAccess.L1MenuAccess.items |
( |
|
self, |
|
|
|
includeKeys = [] |
|
) |
| |
Definition at line 37 of file L1TriggerConfigAccess.py.
37 def items(self, includeKeys = [] ):
39 """ reduce returned dictionary """
40 items = self._config[
"items"]
41 return { x : {k : items[x][k]
for k
in includeKeys
if k
in items[x]}
for x
in items }
43 return self._config[
"items"]
◆ itemsWithCtpid()
def python.L1TriggerConfigAccess.L1MenuAccess.itemsWithCtpid |
( |
|
self | ) |
|
Definition at line 34 of file L1TriggerConfigAccess.py.
34 def itemsWithCtpid(self ):
35 return self.items( includeKeys = [
'ctpid'] )
◆ printSummary()
def python.L1TriggerConfigAccess.L1MenuAccess.printSummary |
( |
|
self | ) |
|
Definition at line 134 of file L1TriggerConfigAccess.py.
134 def printSummary(self):
135 print(
"L1 menu %s" % self.name())
136 print(
"Number of items: %i" % len(self))
137 print(
"Number of threshold types: %i" % len(self.thresholdTypes()) )
138 print(
"Number of thresholds: %i" % len(self.thresholds()) )
139 print(
"Number of topo algorithms: %i" % len(self.topoAlgorithms()))
140 print(
"Number of boards: %i (%i are legacy boards)" % ( len(self.boards()),
sum([
"legacy" in b
for b
in self.boards().
values()]) ))
141 print(
"Number of connectors: %i (%i are legacy connetors)" % ( len(self.connectors()),
sum([
"legacy" in c
for c
in self.connectors().
values()]) ))
142 print(
"CTP has %i optical, %i electrical, and %i CTPIN inputs" % ( len(self.ctpInputs(
"optical")), len(self.ctpInputs(
"electrical")),
144 lambda s1,i: s1.union(self.ctpInputs(
"ctpin")[f
"slot{i}"].
values()),
145 [7,8,9],
set()) -
set([
""]) )))
◆ thresholdExtraInfo()
def python.L1TriggerConfigAccess.L1MenuAccess.thresholdExtraInfo |
( |
|
self, |
|
|
|
thresholdType |
|
) |
| |
Definition at line 81 of file L1TriggerConfigAccess.py.
81 def thresholdExtraInfo(self, thresholdType):
82 if thresholdType
in self[
"thresholds"]:
83 thrDef = self[
"thresholds"][thresholdType]
84 elif thresholdType
in self[
"thresholds"][
"legacyCalo"]:
85 thrDef = self[
"thresholds"][
"legacyCalo"][thresholdType]
87 raise KeyError(
"Threshold type %s not known in thresholds section of the menu" % thresholdType)
88 return {k:thrDef[k]
for k
in thrDef
if k
not in (
"thresholds",
"type")}
◆ thresholdNames()
def python.L1TriggerConfigAccess.L1MenuAccess.thresholdNames |
( |
|
self, |
|
|
|
thresholdType = None |
|
) |
| |
Definition at line 73 of file L1TriggerConfigAccess.py.
73 def thresholdNames(self, thresholdType = None):
74 if thresholdType ==
"internal":
75 return self[
"thresholds"][
"internal"][
"names"]
76 elif thresholdType
is None:
77 return list(self.thresholds().
keys()) + self.thresholdNames(
"internal")
79 return list(self.thresholds(thresholdType).
keys())
◆ thresholds()
def python.L1TriggerConfigAccess.L1MenuAccess.thresholds |
( |
|
self, |
|
|
|
thresholdType = None , |
|
|
|
fulldict = False |
|
) |
| |
When setting fulldict the full dictionary is returned, else just thresholds
Definition at line 52 of file L1TriggerConfigAccess.py.
52 def thresholds(self, thresholdType = None, fulldict = False):
54 When setting fulldict the full dictionary is returned, else just thresholds
57 if thresholdType ==
"internal":
59 if thresholdType
in self[
"thresholds"]:
61 return self[
"thresholds"][thresholdType]
63 return self[
"thresholds"][thresholdType][
"thresholds"]
64 if thresholdType
in self[
"thresholds"][
"legacyCalo"]:
65 return self[
"thresholds"][
"legacyCalo"][thresholdType][
"thresholds"]
66 raise RuntimeError(
"Threshold type %s not known in thresholds section of the menu" % thresholdType)
69 for thrType
in self.thresholdTypes():
70 thrs.update( self.thresholds(thrType) )
◆ thresholdTypes()
def python.L1TriggerConfigAccess.L1MenuAccess.thresholdTypes |
( |
|
self | ) |
|
Definition at line 45 of file L1TriggerConfigAccess.py.
45 def thresholdTypes(self):
46 thrTypes =
list(self._config[
"thresholds"].
keys())
47 if "legacyCalo" in thrTypes:
48 thrTypes.remove(
"legacyCalo")
49 thrTypes +=
list(self._config[
"thresholds"][
"legacyCalo"].
keys())
◆ topoAlgorithmNames()
def python.L1TriggerConfigAccess.L1MenuAccess.topoAlgorithmNames |
( |
|
self, |
|
|
|
topoAlgoType = None |
|
) |
| |
Definition at line 103 of file L1TriggerConfigAccess.py.
103 def topoAlgorithmNames(self, topoAlgoType = None):
104 allAlgs = self.topoAlgorithms(topoAlgoType)
105 return allAlgs.keys()
◆ topoAlgorithms()
def python.L1TriggerConfigAccess.L1MenuAccess.topoAlgorithms |
( |
|
self, |
|
|
|
topoAlgoType = None |
|
) |
| |
Definition at line 93 of file L1TriggerConfigAccess.py.
93 def topoAlgorithms(self, topoAlgoType = None):
95 return self[
"topoAlgorithms"][topoAlgoType]
98 for x
in self[
"topoAlgorithms"].
values():
◆ topoAlgorithmTypes()
def python.L1TriggerConfigAccess.L1MenuAccess.topoAlgorithmTypes |
( |
|
self | ) |
|
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.