A type which encapsulates an IoV
Definition at line 23 of file iovtype.py.
◆ __reduce__()
def python.sugar.iovtype.IOVType.__reduce__ |
( |
|
self | ) |
|
Make IOVType pickleable
Definition at line 31 of file iovtype.py.
33 Make IOVType pickleable
36 bases =
type(self).__bases__[1:]
37 name =
type(self).__name__
38 args = name, self._fields[2:], bases, tuple(self), self._is_empty
39 return restore_iov_type, args
◆ _contents()
def python.sugar.iovtype.IOVType._contents |
( |
|
self | ) |
|
|
private |
Definition at line 84 of file iovtype.py.
85 return self[2+self._has_insertion_time:]
◆ connected_to()
def python.sugar.iovtype.IOVType.connected_to |
( |
|
self, |
|
|
|
rhs |
|
) |
| |
Definition at line 80 of file iovtype.py.
80 def connected_to(self, rhs):
81 return self.until == rhs.since
and self._contents == rhs._contents
◆ contains_point()
def python.sugar.iovtype.IOVType.contains_point |
( |
|
self, |
|
|
|
iovkey |
|
) |
| |
Definition at line 62 of file iovtype.py.
62 def contains_point(self, iovkey):
63 return self.since <= iovkey < self.until
◆ empty()
def python.sugar.iovtype.IOVType.empty |
( |
|
cls, |
|
|
|
since = None , |
|
|
|
until = None |
|
) |
| |
Definition at line 42 of file iovtype.py.
42 def empty(cls, since=None, until=None):
43 empty_fields = [since, until] + [
None] * (len(cls._fields)-2)
44 return cls._emptycls(*empty_fields)
◆ intersect()
def python.sugar.iovtype.IOVType.intersect |
( |
|
self, |
|
|
|
iov |
|
) |
| |
Definition at line 65 of file iovtype.py.
66 if not self.intersects(iov):
68 since, until =
max(self.since, iov.since),
min(self.until, iov.until)
71 return self._replace(since=since, until=until)
◆ intersect_run()
def python.sugar.iovtype.IOVType.intersect_run |
( |
|
self, |
|
|
|
run_number |
|
) |
| |
Definition at line 106 of file iovtype.py.
106 def intersect_run(self, run_number):
107 runpart = run_number << 32
108 sincelo, sincehi =
RunLumi(runpart | 1),
RunLumi(runpart | 0xFFFFFFFF)
109 since, until =
max(self.since, sincelo),
min(self.until, sincehi)
112 return self._replace(since=since, until=until)
◆ intersects()
def python.sugar.iovtype.IOVType.intersects |
( |
|
self, |
|
|
|
iov |
|
) |
| |
Definition at line 73 of file iovtype.py.
73 def intersects(self, iov):
74 return self.since < iov.until
and self.until >= iov.since
◆ is_time_based()
def python.sugar.iovtype.IOVType.is_time_based |
( |
|
self | ) |
|
Definition at line 103 of file iovtype.py.
103 def is_time_based(self):
104 return self.since.is_time
◆ length()
def python.sugar.iovtype.IOVType.length |
( |
|
self | ) |
|
Definition at line 77 of file iovtype.py.
78 return self.until - self.since
if self.until != IOVMAX
else 0
◆ merge()
def python.sugar.iovtype.IOVType.merge |
( |
|
self, |
|
|
|
rhs |
|
) |
| |
Assuming this and `rhs` are `connected_to` each other, then extend.
Definition at line 87 of file iovtype.py.
89 Assuming this and `rhs` are `connected_to` each other, then extend.
91 return self._replace(until=rhs.until)
◆ run()
def python.sugar.iovtype.IOVType.run |
( |
|
self | ) |
|
Returns the run the IoV started in
Definition at line 56 of file iovtype.py.
58 Returns the run the IoV started in
◆ runs()
def python.sugar.iovtype.IOVType.runs |
( |
|
self | ) |
|
Return a generator of runs
Definition at line 47 of file iovtype.py.
49 Return a generator of runs
51 if self.until == IOVMAX:
52 return [self.since.run]
53 return range(self.since.run, self.until.run+1)
◆ trimmed()
def python.sugar.iovtype.IOVType.trimmed |
( |
|
self | ) |
|
If this IoV starts on lumiblock 0, instead make it start from 1.
Definition at line 94 of file iovtype.py.
96 If this IoV starts on lumiblock 0, instead make it start from 1.
98 if self.since.lumi == 0:
99 return self._replace(since=self.since+1)
◆ __slots__
tuple python.sugar.iovtype.IOVType.__slots__ = () |
|
staticprivate |
◆ _contents
python.sugar.iovtype.IOVType._contents |
|
private |
◆ _is_empty
bool python.sugar.iovtype.IOVType._is_empty = False |
|
staticprivate |
◆ until
python.sugar.iovtype.IOVType.until |
The documentation for this class was generated from the following file:
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the closest approach of two lines.