ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
python.sugar.iovtype.IOVType Class Reference
Inheritance diagram for python.sugar.iovtype.IOVType:
Collaboration diagram for python.sugar.iovtype.IOVType:

Public Member Functions

def __reduce__ (self)
 
def empty (cls, since=None, until=None)
 
def runs (self)
 
def run (self)
 
def contains_point (self, iovkey)
 
def intersect (self, iov)
 
def intersects (self, iov)
 
def length (self)
 
def connected_to (self, rhs)
 
def merge (self, rhs)
 
def trimmed (self)
 
def is_time_based (self)
 
def intersect_run (self, run_number)
 

Public Attributes

 until
 

Private Member Functions

def _contents (self)
 

Private Attributes

 _contents
 

Static Private Attributes

tuple __slots__ = ()
 
bool _is_empty = False
 

Detailed Description

A type which encapsulates an IoV

Definition at line 23 of file iovtype.py.

Member Function Documentation

◆ __reduce__()

def python.sugar.iovtype.IOVType.__reduce__ (   self)
Make IOVType pickleable

Definition at line 31 of file iovtype.py.

31  def __reduce__(self):
32  """
33  Make IOVType pickleable
34  """
35  # Take all but the first base class, which is unpicklable
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
40 

◆ _contents()

def python.sugar.iovtype.IOVType._contents (   self)
private

Definition at line 84 of file iovtype.py.

84  def _contents(self):
85  return self[2+self._has_insertion_time:]
86 

◆ 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
82 

◆ 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
64 

◆ 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)
45 

◆ intersect()

def python.sugar.iovtype.IOVType.intersect (   self,
  iov 
)

Definition at line 65 of file iovtype.py.

65  def intersect(self, iov):
66  if not self.intersects(iov):
67  return None
68  since, until = max(self.since, iov.since), min(self.until, iov.until)
69  if since == until:
70  return None
71  return self._replace(since=since, until=until)
72 

◆ 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)
110  if since >= until:
111  return None
112  return self._replace(since=since, until=until)
113 

◆ 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
75 

◆ 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
105 

◆ length()

def python.sugar.iovtype.IOVType.length (   self)

Definition at line 77 of file iovtype.py.

77  def length(self):
78  return self.until - self.since if self.until != IOVMAX else 0
79 

◆ 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.

87  def merge(self, rhs):
88  """
89  Assuming this and `rhs` are `connected_to` each other, then extend.
90  """
91  return self._replace(until=rhs.until)
92 

◆ run()

def python.sugar.iovtype.IOVType.run (   self)
Returns the run the IoV started in

Definition at line 56 of file iovtype.py.

56  def run(self):
57  """
58  Returns the run the IoV started in
59  """
60  return self.since.run
61 

◆ runs()

def python.sugar.iovtype.IOVType.runs (   self)
Return a generator of runs

Definition at line 47 of file iovtype.py.

47  def runs(self):
48  """
49  Return a generator of runs
50  """
51  if self.until == IOVMAX:
52  return [self.since.run]
53  return range(self.since.run, self.until.run+1)
54 

◆ 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.

94  def trimmed(self):
95  """
96  If this IoV starts on lumiblock 0, instead make it start from 1.
97  """
98  if self.since.lumi == 0:
99  return self._replace(since=self.since+1)
100  return self
101 

Member Data Documentation

◆ __slots__

tuple python.sugar.iovtype.IOVType.__slots__ = ()
staticprivate

Definition at line 27 of file iovtype.py.

◆ _contents

python.sugar.iovtype.IOVType._contents
private

Definition at line 81 of file iovtype.py.

◆ _is_empty

bool python.sugar.iovtype.IOVType._is_empty = False
staticprivate

Definition at line 28 of file iovtype.py.

◆ until

python.sugar.iovtype.IOVType.until

Definition at line 51 of file iovtype.py.


The documentation for this class was generated from the following file:
max
#define max(a, b)
Definition: cfImp.cxx:41
find_tgc_unfilled_channelids.runs
int runs
Definition: find_tgc_unfilled_channelids.py:10
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
python.sugar.runlumi.RunLumi
RunLumi
Definition: runlumi.py:131
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
min
#define min(a, b)
Definition: cfImp.cxx:40
Amg::intersect
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.
Definition: GeoPrimitivesHelpers.h:302
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.utility.LHE.merge
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
Definition: LHE.py:17
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26