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