Definition at line 10 of file EI_Lib.py.
◆ result
◆ __init__()
| python.EI_Lib.IOV.__init__ |
( |
| self | ) |
|
Definition at line 15 of file EI_Lib.py.
15 def __init__(self):
16 pass
17
◆ add()
| python.EI_Lib.IOV.add |
( |
| self, |
|
|
| key, |
|
|
| value, |
|
|
| interval ) |
Definition at line 55 of file EI_Lib.py.
55 def add(self, key, value, interval):
56 if key not in self._iovs:
57 self._iovs[key] = []
58
59 try:
60 if len(interval) != 4:
61 raise TypeError("interval must contain 4 elements")
62 except Exception:
63 raise TypeError("interval must be a tuple or list")
64
65 try:
66
67 interval2 = []
68 for number in interval:
69 interval2.append(int(number))
70 except Exception:
71 raise TypeError("interval ranges must be a integers or longs")
72
73 self._iovs[key].append((interval2, value))
74
bool add(const std::string &hname, TKey *tobj)
◆ cmpBN()
| python.EI_Lib.IOV.cmpBN |
( |
| self, |
|
|
| a, |
|
|
| b ) |
Definition at line 18 of file EI_Lib.py.
18 def cmpBN(self, a, b):
19
20
21
22
23
24 try:
25 (r, e) = a
26 (r1, e1) = b
27 except Exception:
28 raise TypeError("element must be a tuple with two components")
29
30 c = cmp(r, r1)
31 if c == 0:
32 c = cmp(e, e1)
33
34 return c
35
◆ dump()
| python.EI_Lib.IOV.dump |
( |
| self | ) |
|
Definition at line 75 of file EI_Lib.py.
76 for k in self._iovs:
78 for e in self._iovs[k]:
80
void print(char *figname, TCanvas *c1)
◆ get()
| python.EI_Lib.IOV.get |
( |
| self, |
|
|
| key, |
|
|
| point ) |
Definition at line 81 of file EI_Lib.py.
81 def get(self, key, point):
82 if key not in self._iovs:
83 return None
84 if key in self._cached:
85 i, v = self._cached[key]
86 if self.isInInterval(point, i):
87 return v
88 ivalues = self._iovs[key]
89 for i, v in ivalues:
90 if self.isInInterval(point, i):
91 self._cached[key] = (i, v)
92 return v
93 return None
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
◆ isInInterval()
| python.EI_Lib.IOV.isInInterval |
( |
| self, |
|
|
| point, |
|
|
| interval ) |
Definition at line 36 of file EI_Lib.py.
36 def isInInterval(self, point, interval):
37
38 try:
39 if len(interval) != 4:
40 raise TypeError("interval must contain 4 elements")
41 except Exception:
42 raise TypeError("interval must be a tuple or list")
43
44
45
46 i1 = interval[:2]
47 i2 = interval[2:]
48
49
50 if self.cmpBN(point, i1) >= 0 and self.cmpBN(point, i2) < 0:
51 return True
52 else:
53 return False
54
◆ _cached
| dict python.EI_Lib.IOV._cached = {} |
|
staticprotected |
◆ _iovs
| dict python.EI_Lib.IOV._iovs = {} |
|
staticprotected |
The documentation for this class was generated from the following file: