ATLAS Offline Software
Loading...
Searching...
No Matches
python.L1TriggerConfigAccess.L1PrescalesSetAccess Class Reference
Inheritance diagram for python.L1TriggerConfigAccess.L1PrescalesSetAccess:
Collaboration diagram for python.L1TriggerConfigAccess.L1PrescalesSetAccess:

Public Member Functions

 __init__ (self, str filename="", str jsonString="", str dbalias="", int l1pskey=0, bool useCrest=False, str crestServer="")
 itemNames (self)
 cutValues (self)
 cut (self, itemName)
 prescale (self, itemName)
 enabled (self, itemName)
 printSummary (self)

Static Public Member Functions

 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 151 of file L1TriggerConfigAccess.py.

Constructor & Destructor Documentation

◆ __init__()

python.L1TriggerConfigAccess.L1PrescalesSetAccess.__init__ ( self,
str filename = "",
str jsonString = "",
str dbalias = "",
int l1pskey = 0,
bool useCrest = False,
str crestServer = "" )
accessor needs to be initialized with either a filename or the dbalias and l1pskey

Definition at line 163 of file L1TriggerConfigAccess.py.

164 useCrest: bool = False, crestServer: str = ""):
165 """
166 accessor needs to be initialized with either a filename or the dbalias and l1pskey
167 """
168 super().__init__(ConfigType.L1PS, mainkey = "cutValues", jsonString = jsonString, filename = filename,
169 dbalias = dbalias, dbkey = l1pskey, useCrest=useCrest, crestServer=crestServer)
170 self.loader.setQuery({
171 1: "SELECT L1PS_DATA FROM {schema}.L1_PRESCALE_SET L1PS WHERE L1PS_ID=:dbkey" # for current and new db schema
172 })
173 self.load()
174 if l1pskey is not None:
175 log.info(f"Loaded L1 prescales {self.name()} with {len(self)} items from {dbalias} with psk {l1pskey}{' using CREST' if useCrest else ''}")
176 elif filename is not None:
177 log.info(f"Loaded L1 prescales {self.name()} with {len(self)} items from file {filename}")
178
179

Member Function Documentation

◆ calcPrescaleFromCut()

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 157 of file L1TriggerConfigAccess.py.

157 def calcPrescaleFromCut(cut):
158 """
159 turns cut value (which is what the hardware is configured with), into a float prescale value
160 """
161 return 0xFFFFFF / ( 0x1000000 - cut )
162

◆ cut()

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

Definition at line 184 of file L1TriggerConfigAccess.py.

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

◆ cutValues()

python.L1TriggerConfigAccess.L1PrescalesSetAccess.cutValues ( self)

Definition at line 182 of file L1TriggerConfigAccess.py.

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

◆ enabled()

python.L1TriggerConfigAccess.L1PrescalesSetAccess.enabled ( self,
itemName )

Definition at line 189 of file L1TriggerConfigAccess.py.

189 def enabled(self, itemName):
190 return self["cutValues"][itemName]["enabled"]
191

◆ itemNames()

python.L1TriggerConfigAccess.L1PrescalesSetAccess.itemNames ( self)

Definition at line 180 of file L1TriggerConfigAccess.py.

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

◆ prescale()

python.L1TriggerConfigAccess.L1PrescalesSetAccess.prescale ( self,
itemName )

Definition at line 186 of file L1TriggerConfigAccess.py.

186 def prescale(self, itemName):
187 return L1PrescalesSetAccess.calcPrescaleFromCut( self.cut(itemName) )
188

◆ printSummary()

python.L1TriggerConfigAccess.L1PrescalesSetAccess.printSummary ( self)

Definition at line 192 of file L1TriggerConfigAccess.py.

192 def printSummary(self):
193 print("L1 prescales set %s" % self.name())
194 print("Number of prescales: %i" % len(self) )
195 print("Number of enabled prescales: %i" % sum(x["enabled"] for x in self["cutValues"].values()) )
196
197
void print(char *figname, TCanvas *c1)

The documentation for this class was generated from the following file: