this class provides access to the L1 prescales set
the methods are self-explanatory for people with knowledge of the configuration
Definition at line 150 of file L1TriggerConfigAccess.py.
◆ __init__()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.__init__ |
( |
|
self, |
|
|
|
filename = None , |
|
|
|
jsonString = None , |
|
|
|
dbalias = None , |
|
|
|
l1pskey = None , |
|
|
|
useCrest = False , |
|
|
|
crestServer = "" |
|
) |
| |
accessor needs to be initialized with either a filename or the dbalias and l1pskey
Definition at line 162 of file L1TriggerConfigAccess.py.
162 def __init__(self, filename = None, jsonString = None, dbalias = None, l1pskey = None, useCrest=False, crestServer=""):
164 accessor needs to be initialized with either a filename or the dbalias and l1pskey
166 super().
__init__(ConfigType.L1PS, mainkey =
"cutValues",
167 jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = l1pskey,
168 useCrest=useCrest, crestServer=crestServer)
169 self.loader.setQuery({
170 1:
"SELECT L1PS_DATA FROM {schema}.L1_PRESCALE_SET L1PS WHERE L1PS_ID=:dbkey"
173 if l1pskey
is not None:
174 log.info(f
"Loaded L1 prescales {self.name()} with {len(self)} items from {dbalias} with psk {l1pskey}{' using CREST' if useCrest else ''}")
175 elif filename
is not None:
176 log.info(f
"Loaded L1 prescales {self.name()} with {len(self)} items from file {filename}")
◆ calcPrescaleFromCut()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.calcPrescaleFromCut |
( |
|
cut | ) |
|
|
static |
turns cut value (which is what the hardware is configured with), into a float prescale value
Definition at line 156 of file L1TriggerConfigAccess.py.
156 def calcPrescaleFromCut(cut):
158 turns cut value (which is what the hardware is configured with), into a float prescale value
160 return 0xFFFFFF / ( 0x1000000 - cut )
◆ cut()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.cut |
( |
|
self, |
|
|
|
itemName |
|
) |
| |
◆ cutValues()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.cutValues |
( |
|
self | ) |
|
◆ enabled()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.enabled |
( |
|
self, |
|
|
|
itemName |
|
) |
| |
Definition at line 188 of file L1TriggerConfigAccess.py.
188 def enabled(self, itemName):
189 return self[
"cutValues"][itemName][
"enabled"]
◆ itemNames()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.itemNames |
( |
|
self | ) |
|
◆ prescale()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.prescale |
( |
|
self, |
|
|
|
itemName |
|
) |
| |
Definition at line 185 of file L1TriggerConfigAccess.py.
185 def prescale(self, itemName):
186 return L1PrescalesSetAccess.calcPrescaleFromCut( self.cut(itemName) )
◆ printSummary()
def python.L1TriggerConfigAccess.L1PrescalesSetAccess.printSummary |
( |
|
self | ) |
|
Definition at line 191 of file L1TriggerConfigAccess.py.
191 def printSummary(self):
192 print(
"L1 prescales set %s" % self.name())
193 print(
"Number of prescales: %i" % len(self) )
194 print(
"Number of enabled prescales: %i" %
sum(x[
"enabled"]
for x
in self[
"cutValues"].
values()) )
The documentation for this class was generated from the following file: