ATLAS Offline Software
Loading...
Searching...
No Matches
python.AtlRunQueryRun.DataEntry Class Reference
Collaboration diagram for python.AtlRunQueryRun.DataEntry:

Public Member Functions

 __init__ (self, iov, value, reject=False, valueForStorage=None)
 __str__ (self)
 __repr__ (self)
 __len__ (self)
 startlb (self)
 endlb (self)
 lastlb (self)
 __getitem__ (self, k)
 contains (self, lb)
 intersects (self, lbrange)
 pickled (self)
 json (self)

Public Attributes

 iov = iov
tuple lbrange = (self.iov.startTime.lb, self.iov.endTime.lb)
 value = value
 rejected = reject
 valueForStorage = valueForStorage
 endlb
 startlb
 lastlb

Detailed Description

Definition at line 34 of file AtlRunQueryRun.py.

Constructor & Destructor Documentation

◆ __init__()

python.AtlRunQueryRun.DataEntry.__init__ ( self,
iov,
value,
reject = False,
valueForStorage = None )

Definition at line 35 of file AtlRunQueryRun.py.

35 def __init__(self, iov, value, reject=False, valueForStorage=None):
36 self.iov = iov
37 self.lbrange = (self.iov.startTime.lb, self.iov.endTime.lb) # note that the end lb is not part of the iov
38 self.value = value
39 self.rejected = reject
40 self.valueForStorage = valueForStorage
41

Member Function Documentation

◆ __getitem__()

python.AtlRunQueryRun.DataEntry.__getitem__ ( self,
k )

Definition at line 66 of file AtlRunQueryRun.py.

66 def __getitem__(self,k):
67 return self.valueForStorage[k]
68

◆ __len__()

python.AtlRunQueryRun.DataEntry.__len__ ( self)

Definition at line 48 of file AtlRunQueryRun.py.

48 def __len__(self):
49 length_L = self.lastlb-self.startlb+1
50 if length_L>0x7FFFFFFF:
51 length_L = 0x7FFFFFFF
52 return int(length_L)
53

◆ __repr__()

python.AtlRunQueryRun.DataEntry.__repr__ ( self)

Definition at line 45 of file AtlRunQueryRun.py.

45 def __repr__(self):
46 return "<DataEntry %s>" % self
47

◆ __str__()

python.AtlRunQueryRun.DataEntry.__str__ ( self)

Definition at line 42 of file AtlRunQueryRun.py.

42 def __str__(self):
43 return "[%i-%i) %s %r" % (self.lbrange[0], self.lbrange[1], "r" if self.rejected else "a", self.value)
44

◆ contains()

python.AtlRunQueryRun.DataEntry.contains ( self,
lb )

Definition at line 69 of file AtlRunQueryRun.py.

69 def contains(self, lb):
70 return self.lbrange[0]<=lb and lb<self.lbrange[1]
71
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114

◆ endlb()

python.AtlRunQueryRun.DataEntry.endlb ( self)

Definition at line 59 of file AtlRunQueryRun.py.

59 def endlb(self):
60 return self.lbrange[1]
61

◆ intersects()

python.AtlRunQueryRun.DataEntry.intersects ( self,
lbrange )

Definition at line 72 of file AtlRunQueryRun.py.

72 def intersects(self,lbrange):
73 lbstart, lbend = lbrange
74 return self.contains(lbstart) or self.contains(lbend-1) or (lbstart<=self.lbrange[0] and self.lbrange[1]<lbend)
75

◆ json()

python.AtlRunQueryRun.DataEntry.json ( self)

Definition at line 80 of file AtlRunQueryRun.py.

80 def json(self):
81 retDict = { 'lbrange' : [self.startlb, self.lastlb] }
82 if self.valueForStorage is None:
83 v = self.value.pickled() if hasattr(self.value,'pickled') else self.value
84 retDict["value"] = v
85 else:
86 retDict.update(self.valueForStorage)
87 return retDict
88
89
nlohmann::json json

◆ lastlb()

python.AtlRunQueryRun.DataEntry.lastlb ( self)

Definition at line 63 of file AtlRunQueryRun.py.

63 def lastlb(self):
64 return ((0x100000000 + self.endlb)-1) & 0xFFFFFFFF
65

◆ pickled()

python.AtlRunQueryRun.DataEntry.pickled ( self)

Definition at line 76 of file AtlRunQueryRun.py.

76 def pickled(self):
77 v = self.value.pickled() if hasattr(self.value,'pickled') else self.value
78 return { 'firstlb' : self.startlb, 'lastlb' : self.lastlb, 'value' : v, 'accepted' : not self.rejected }
79

◆ startlb()

python.AtlRunQueryRun.DataEntry.startlb ( self)

Definition at line 55 of file AtlRunQueryRun.py.

55 def startlb(self):
56 return self.lbrange[0]
57

Member Data Documentation

◆ endlb

python.AtlRunQueryRun.DataEntry.endlb

Definition at line 64 of file AtlRunQueryRun.py.

◆ iov

python.AtlRunQueryRun.DataEntry.iov = iov

Definition at line 36 of file AtlRunQueryRun.py.

◆ lastlb

python.AtlRunQueryRun.DataEntry.lastlb

Definition at line 78 of file AtlRunQueryRun.py.

◆ lbrange

tuple python.AtlRunQueryRun.DataEntry.lbrange = (self.iov.startTime.lb, self.iov.endTime.lb)

Definition at line 37 of file AtlRunQueryRun.py.

◆ rejected

python.AtlRunQueryRun.DataEntry.rejected = reject

Definition at line 39 of file AtlRunQueryRun.py.

◆ startlb

python.AtlRunQueryRun.DataEntry.startlb

Definition at line 78 of file AtlRunQueryRun.py.

◆ value

python.AtlRunQueryRun.DataEntry.value = value

Definition at line 38 of file AtlRunQueryRun.py.

◆ valueForStorage

python.AtlRunQueryRun.DataEntry.valueForStorage = valueForStorage

Definition at line 40 of file AtlRunQueryRun.py.


The documentation for this class was generated from the following file: