ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
python.AtlRunQueryRun.RunData Class Reference
Collaboration diagram for python.AtlRunQueryRun.RunData:

Public Member Functions

def __init__ (self, run)
 
def __contains__ (self, k)
 
def __getitem__ (self, k)
 
def __setitem__ (self, k, value)
 
def __iter__ (self)
 
def keys (self)
 
def runNrS (self)
 
def lb (self)
 
def lbend (self, lb=None)
 
def NrLBs (self)
 
def result (self)
 
def isRejectedCurrentLB (self)
 
def isDQRejected (self)
 
def isDQDefectRejected (self)
 
def isRejected (self)
 
def isReady (self, lb=None)
 
def getLBRanges (self, activeOnly=False)
 
def addResult (self, iov, k, value, reject, valueForStorage=None)
 
def astxt (self)
 

Public Attributes

 run
 
 data
 
 data_current_lb
 
 current_lb
 
 stops
 

Static Public Attributes

list DQKeys = []
 
list DQLogic = []
 
 DefectSelector = None
 

Private Member Functions

def _setLB (self, lb)
 
def _calcStops (self)
 

Private Attributes

 __run_o
 

Detailed Description

Definition at line 120 of file AtlRunQueryRun.py.

Constructor & Destructor Documentation

◆ __init__()

def python.AtlRunQueryRun.RunData.__init__ (   self,
  run 
)

Definition at line 127 of file AtlRunQueryRun.py.

127  def __init__(self,run):
128  self.__run_o = run
129  self.run = run.runNr
130  self.data = {}
131  self.data_current_lb = {}
132  self.current_lb = 0
133  self.stops = []
134 

Member Function Documentation

◆ __contains__()

def python.AtlRunQueryRun.RunData.__contains__ (   self,
  k 
)

Definition at line 135 of file AtlRunQueryRun.py.

135  def __contains__(self,k):
136  if type(k)==DataKey:
137  return k in self.data or k.ResultKey in self.data
138  return k in self.data
139 

◆ __getitem__()

def python.AtlRunQueryRun.RunData.__getitem__ (   self,
  k 
)

Definition at line 140 of file AtlRunQueryRun.py.

140  def __getitem__(self,k):
141  if k not in self:
142  self.data[k] = DataEntryList(key=k, run=self.run)
143  return self.data[k]
144  else:
145  if type(k)==DataKey:
146  return self.data[k] if k in self.data else self.data[k.ResultKey]
147  return self.data[k]
148 

◆ __iter__()

def python.AtlRunQueryRun.RunData.__iter__ (   self)

Definition at line 152 of file AtlRunQueryRun.py.

152  def __iter__(self):
153  self.stops = self._calcStops()
154  for lb in self.stops: # the last stop is the LB after the last
155  if lb>self.__run_o.lastlb:
156  break
157  self._setLB(lb)
158  yield self
159 

◆ __setitem__()

def python.AtlRunQueryRun.RunData.__setitem__ (   self,
  k,
  value 
)

Definition at line 149 of file AtlRunQueryRun.py.

149  def __setitem__(self,k,value):
150  self.data[k]=value
151 

◆ _calcStops()

def python.AtlRunQueryRun.RunData._calcStops (   self)
private

Definition at line 280 of file AtlRunQueryRun.py.

280  def _calcStops(self):
281  stops = set()
282  for entrylist in self.data.values():
283  stops.update(entrylist.stops())
284  return sorted(list(stops))
285 

◆ _setLB()

def python.AtlRunQueryRun.RunData._setLB (   self,
  lb 
)
private

Definition at line 276 of file AtlRunQueryRun.py.

276  def _setLB(self,lb):
277  self.current_lb = lb
278  self.data_current_lb = dict([(k,entrylist.atLB(lb)) for k,entrylist in self.data.items()])
279 

◆ addResult()

def python.AtlRunQueryRun.RunData.addResult (   self,
  iov,
  k,
  value,
  reject,
  valueForStorage = None 
)

Definition at line 286 of file AtlRunQueryRun.py.

286  def addResult(self, iov, k, value, reject, valueForStorage = None):
287  if not iov:
288  iov = IOVRange(runStart=self.run, lbStart=1, runEnd=self.run+1, lbEnd=0)
289  self[k].append(DataEntry(iov=iov, value=value, reject=reject, valueForStorage=valueForStorage))
290 

◆ astxt()

def python.AtlRunQueryRun.RunData.astxt (   self)

Definition at line 291 of file AtlRunQueryRun.py.

291  def astxt(self):
292  s = ""
293  if Run.showrunnr:
294  s += "%*s %*s " % (4, self.lb, 4, self.lbend())
295  s += ("r" if self.isRejectedCurrentLB else "a")
296  if Run.showtime:
297  s += "%*s " % (_fW['Time'],'')
298  if Run.showduration:
299  s += " "
300  for k in Run.SortedShowOrder():
301  k = k.ResultKey
302  w = 10
303  if k in _fW:
304  w = _fW[k]
305  v=""
306  if self.data_current_lb[k]:
307  v = [x.value for x in self.data_current_lb[k]][0]
308  if v is None:
309  v=""
310  if k == "#Events" or k[0:4] == "STR:" or k=="TriggerMenu" or k=="TriggerRates" or k=="olc:bcidmask":
311  v = ""
312  s += "%*s " % (w,v)
313  return s
314 
315 
316 @total_ordering

◆ getLBRanges()

def python.AtlRunQueryRun.RunData.getLBRanges (   self,
  activeOnly = False 
)

Definition at line 252 of file AtlRunQueryRun.py.

252  def getLBRanges(self,activeOnly=False):
253  last_lb = self.__run_o.nr_lb
254  a = [(int(data.lb),not data.isRejectedCurrentLB) for data in self if data.lb<=last_lb]
255  #a = [(int(data.lb),not data.isRejectedCurrentLB) for data in self]
256  if not a:
257  return []
258  start,state = a[0]
259  ranges = []
260  for x in a[:-1]:
261  if x[1] == state:
262  continue
263  ranges += [(state, start, x[0])]
264  start,state = x
265  last_start,last_state = a[-1]
266  if last_state==state:
267  ranges += [(state, start, last_lb+1)]
268  else:
269  ranges += [(state, start, last_start)]
270  ranges += [(last_state, last_start, last_lb+1)]
271  if activeOnly:
272  return [x for x in ranges if x[0]]
273  else:
274  return ranges
275 

◆ isDQDefectRejected()

def python.AtlRunQueryRun.RunData.isDQDefectRejected (   self)

Definition at line 219 of file AtlRunQueryRun.py.

219  def isDQDefectRejected(self):
220  if 'DQ' not in self.data_current_lb:
221  return False
222  return not RunData.DefectSelector(self.data_current_lb['DQ'])
223 
224 

◆ isDQRejected()

def python.AtlRunQueryRun.RunData.isDQRejected (   self)

Definition at line 204 of file AtlRunQueryRun.py.

204  def isDQRejected(self):
205  for orGroup in RunData.DQLogic:
206  groupAccept = False
207  for k in orGroup:
208  if len(self.data_current_lb[k])==0:
209  passes = False
210  else:
211  passes = not self.data_current_lb[k][0].rejected
212  if passes:
213  groupAccept = True
214  break
215  if not groupAccept:
216  return True
217  return False
218 

◆ isReady()

def python.AtlRunQueryRun.RunData.isReady (   self,
  lb = None 
)

Definition at line 233 of file AtlRunQueryRun.py.

233  def isReady(self,lb=None):
234  if 'Ready for physics' not in self:
235  raise RuntimeError("No ready data available")
236  readydata = [x for x in self.data['Ready for physics'] if x.value=='1']
237  if lb is None:
238  return readydata
239  if type(lb)==int:
240  for x in readydata:
241  if x.contains(lb):
242  return True
243  return False
244  if type(lb)==tuple and len(lb)==2:
245  for x in readydata:
246  if x.intersects(lb):
247  return True
248  return False
249  raise RuntimeError("Can't interpret lb to check isReady(lb=%r)" % lb)
250 
251 

◆ isRejected()

def python.AtlRunQueryRun.RunData.isRejected (   self)

Definition at line 226 of file AtlRunQueryRun.py.

226  def isRejected(self):
227  for s in self:
228  if not s.isRejectedCurrentLB:
229  return False
230  return True
231 
232 

◆ isRejectedCurrentLB()

def python.AtlRunQueryRun.RunData.isRejectedCurrentLB (   self)

Definition at line 185 of file AtlRunQueryRun.py.

185  def isRejectedCurrentLB(self):
186  #print ("Checking Reject for LB",self.lb,"-",self.lbend())
187  need_dq_check = False
188  for k,s in self.data_current_lb.items():
189  if k in RunData.DQKeys:
190  need_dq_check = True
191  continue # exclude DQ from this, since it gets its own treatment
192  if s is None:
193  continue
194  for e in s:
195  if e.rejected:
196  return True
197  if need_dq_check:
198  if self.isDQRejected():
199  return True
200  if self.isDQDefectRejected():
201  return True
202  return False
203 

◆ keys()

def python.AtlRunQueryRun.RunData.keys (   self)

Definition at line 160 of file AtlRunQueryRun.py.

160  def keys(self):
161  return self.data.keys()
162 

◆ lb()

def python.AtlRunQueryRun.RunData.lb (   self)

Definition at line 168 of file AtlRunQueryRun.py.

168  def lb(self):
169  return self.current_lb
170 

◆ lbend()

def python.AtlRunQueryRun.RunData.lbend (   self,
  lb = None 
)

Definition at line 171 of file AtlRunQueryRun.py.

171  def lbend(self,lb=None):
172  if lb is None:
173  lb=self.current_lb
174  return self.stops[self.stops.index(lb)+1]-1
175 

◆ NrLBs()

def python.AtlRunQueryRun.RunData.NrLBs (   self)

Definition at line 177 of file AtlRunQueryRun.py.

177  def NrLBs(self):
178  return "%i" % max([el.lastlb for el in self.data.values()])
179 

◆ result()

def python.AtlRunQueryRun.RunData.result (   self)

Definition at line 181 of file AtlRunQueryRun.py.

181  def result(self):
182  return self.data_current_lb
183 

◆ runNrS()

def python.AtlRunQueryRun.RunData.runNrS (   self)

Definition at line 164 of file AtlRunQueryRun.py.

164  def runNrS(self):
165  return str(self.run)
166 

Member Data Documentation

◆ __run_o

python.AtlRunQueryRun.RunData.__run_o
private

Definition at line 128 of file AtlRunQueryRun.py.

◆ current_lb

python.AtlRunQueryRun.RunData.current_lb

Definition at line 132 of file AtlRunQueryRun.py.

◆ data

python.AtlRunQueryRun.RunData.data

Definition at line 130 of file AtlRunQueryRun.py.

◆ data_current_lb

python.AtlRunQueryRun.RunData.data_current_lb

Definition at line 131 of file AtlRunQueryRun.py.

◆ DefectSelector

python.AtlRunQueryRun.RunData.DefectSelector = None
static

Definition at line 125 of file AtlRunQueryRun.py.

◆ DQKeys

list python.AtlRunQueryRun.RunData.DQKeys = []
static

Definition at line 123 of file AtlRunQueryRun.py.

◆ DQLogic

list python.AtlRunQueryRun.RunData.DQLogic = []
static

Definition at line 124 of file AtlRunQueryRun.py.

◆ run

python.AtlRunQueryRun.RunData.run

Definition at line 129 of file AtlRunQueryRun.py.

◆ stops

python.AtlRunQueryRun.RunData.stops

Definition at line 133 of file AtlRunQueryRun.py.


The documentation for this class was generated from the following file:
get_generator_info.result
result
Definition: get_generator_info.py:21
IOVRange
Validity Range object. Holds two IOVTimes (start and stop)
Definition: IOVRange.h:30
max
#define max(a, b)
Definition: cfImp.cxx:41
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
index
Definition: index.py:1
python.Bindings.__iter__
__iter__
Definition: Control/AthenaPython/python/Bindings.py:783
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:797
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.Bindings.__setitem__
__setitem__
Definition: Control/AthenaPython/python/Bindings.py:763
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.Bindings.__getitem__
__getitem__
Definition: Control/AthenaPython/python/Bindings.py:771
python.Bindings.__contains__
__contains__
Definition: Control/AthenaPython/python/Bindings.py:757