ATLAS Offline Software
Loading...
Searching...
No Matches
MonCounters.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from functools import total_ordering
4
5from AthenaCommon.Logging import logging
6log = 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
nlohmann::json json
if(febId1==febId2)
__init__(self, threshold, multiplicity)
__init__(self, threshold, multiplicity)
__init__(self, threshold, multiplicity, montype)