ATLAS Offline Software
MonCounters.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 from functools import total_ordering
4 
5 from AthenaCommon.Logging import logging
6 log = logging.getLogger(__name__)
7 
9 
10  def __init__(self):
11  # list of monitoring counters
12  self.counters = {
13  'ctpmon': [],
14  'ctpin': []
15  }
16 
17  def addCounter(self, c):
18  if c.montype not in self.counters:
19  self.counters[c.montype] = []
20  self.counters[c.montype] += [c]
21 
22  def json(self):
23  confObj = { key: {c.name: c.json() for c in clist} for key,clist in self.counters.items() }
24  return confObj
25 
26 
27 @total_ordering
29 
30  def __init__(self, threshold, multiplicity, montype):
31  self.name = "%i%s" % (multiplicity, threshold)
32  self.threshold = threshold
33  self.multiplicity = int(multiplicity)
34  self.montype = montype
35  pass
36 
37  def __lt__(self, o):
38  if(self.threshold!=o.threshold):
39  return self.threshold < o.threshold
40  return self.multiplicity < o.multiplicity
41 
42  def __eq__(self, o):
43  return self.name == o.name
44 
45  def json(self):
46  confObj = {
47  "thr": self.threshold,
48  "multiplicity": self.multiplicity
49  }
50  return confObj
51 
52 
54  """
55  These monitor the CTP Item counts
56  """
57  def __init__(self, threshold, multiplicity):
58  super(CtpinCounter, self).__init__(threshold, multiplicity, 'ctpin')
59 
61  """
62  These monitor the CTPInput signal counts
63  """
64  def __init__(self, threshold, multiplicity):
65  super(CtpmonCounter, self).__init__(threshold, multiplicity, 'ctpmon')
66 
python.L1.Base.MonCounters.MenuMonCountersCollection.addCounter
def addCounter(self, c)
Definition: MonCounters.py:17
python.L1.Base.MonCounters.CtpinCounter.__init__
def __init__(self, threshold, multiplicity)
Definition: MonCounters.py:57
python.L1.Base.MonCounters.MenuMonCountersCollection
Definition: MonCounters.py:8
python.L1.Base.MonCounters.MenuMonCountersCollection.counters
counters
Definition: MonCounters.py:12
python.L1.Base.MonCounters.MonCounter.name
name
Definition: MonCounters.py:31
python.L1.Base.MonCounters.MonCounter.json
def json(self)
Definition: MonCounters.py:45
python.L1.Base.MonCounters.MonCounter.multiplicity
multiplicity
Definition: MonCounters.py:33
python.L1.Base.MonCounters.MenuMonCountersCollection.json
def json(self)
Definition: MonCounters.py:22
python.L1.Base.MonCounters.CtpmonCounter
Definition: MonCounters.py:60
python.L1.Base.MonCounters.MonCounter.__eq__
def __eq__(self, o)
Definition: MonCounters.py:42
python.L1.Base.MonCounters.CtpmonCounter.__init__
def __init__(self, threshold, multiplicity)
Definition: MonCounters.py:64
python.L1.Base.MonCounters.MonCounter.__init__
def __init__(self, threshold, multiplicity, montype)
Definition: MonCounters.py:30
python.L1.Base.MonCounters.MonCounter.montype
montype
Definition: MonCounters.py:34
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71
python.L1.Base.MonCounters.MonCounter.threshold
threshold
Definition: MonCounters.py:32
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
pickleTool.object
object
Definition: pickleTool.py:29
python.L1.Base.MonCounters.CtpinCounter
Definition: MonCounters.py:53
python.L1.Base.MonCounters.MenuMonCountersCollection.__init__
def __init__(self)
Definition: MonCounters.py:10
python.L1.Base.MonCounters.MonCounter.__lt__
def __lt__(self, o)
Definition: MonCounters.py:37
python.L1.Base.MonCounters.MonCounter
Definition: MonCounters.py:28