ATLAS Offline Software
Public Member Functions | Static Public Member Functions | List of all members
python.L1TriggerConfigAccess.L1PrescalesSetAccess Class Reference
Inheritance diagram for python.L1TriggerConfigAccess.L1PrescalesSetAccess:
Collaboration diagram for python.L1TriggerConfigAccess.L1PrescalesSetAccess:

Public Member Functions

def __init__ (self, filename=None, jsonString=None, dbalias=None, l1pskey=None, useCrest=False, crestServer="")
 
def itemNames (self)
 
def cutValues (self)
 
def cut (self, itemName)
 
def prescale (self, itemName)
 
def enabled (self, itemName)
 
def printSummary (self)
 

Static Public Member Functions

def calcPrescaleFromCut (cut)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __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=""):
163  """
164  accessor needs to be initialized with either a filename or the dbalias and l1pskey
165  """
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" # for current and new db schema
171  })
172  self.load()
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}")
177 
178 

Member Function Documentation

◆ 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):
157  """
158  turns cut value (which is what the hardware is configured with), into a float prescale value
159  """
160  return 0xFFFFFF / ( 0x1000000 - cut )
161 

◆ cut()

def python.L1TriggerConfigAccess.L1PrescalesSetAccess.cut (   self,
  itemName 
)

Definition at line 183 of file L1TriggerConfigAccess.py.

183  def cut(self, itemName):
184  return self["cutValues"][itemName]["cut"]

◆ cutValues()

def python.L1TriggerConfigAccess.L1PrescalesSetAccess.cutValues (   self)

Definition at line 181 of file L1TriggerConfigAccess.py.

181  def cutValues(self):
182  return self["cutValues"]

◆ 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"]
190 

◆ itemNames()

def python.L1TriggerConfigAccess.L1PrescalesSetAccess.itemNames (   self)

Definition at line 179 of file L1TriggerConfigAccess.py.

179  def itemNames(self):
180  return self["cutValues"].keys()

◆ 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) )
187 

◆ 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()) )
195 
196 

The documentation for this class was generated from the following file:
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798