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

Public Member Functions

def __init__ (self, start, end)
 
def vetoRange (self, start, end)
 
def getAllowedRanges (self, start, end)
 
def __str__ (self)
 

Private Member Functions

def _remove (self, idx)
 
def _insert (self, idx, start, end)
 

Private Attributes

 _starts
 
 _ends
 

Detailed Description

Hold a list of IOVs (start/end pairs) which are good, allowing parts
of list to be vetoed. start/end interpreted in COOL convention

Definition at line 395 of file AtlCoolLib.py.

Constructor & Destructor Documentation

◆ __init__()

def python.AtlCoolLib.RangeList.__init__ (   self,
  start,
  end 
)

Definition at line 398 of file AtlCoolLib.py.

398  def __init__(self,start,end):
399  "Initalise RangeList with given start and end (end=1 after last valid)"
400  self._starts=[start]
401  self._ends=[end]
402 

Member Function Documentation

◆ __str__()

def python.AtlCoolLib.RangeList.__str__ (   self)

Definition at line 437 of file AtlCoolLib.py.

437  def __str__(self):
438  "Print representation of range as list of [x,y] allowed values"
439  rep=''
440  for i in range(0,len(self._starts)):
441  rep+='[%i,%i] ' % (self._starts[i],self._ends[i])
442  return rep
443 

◆ _insert()

def python.AtlCoolLib.RangeList._insert (   self,
  idx,
  start,
  end 
)
private

Definition at line 449 of file AtlCoolLib.py.

449  def _insert(self,idx,start,end):
450  "Put a new entry at idx, moving others to make space"
451  self._starts.insert(idx,start)
452  self._ends.insert(idx,end)
453 

◆ _remove()

def python.AtlCoolLib.RangeList._remove (   self,
  idx 
)
private

Definition at line 444 of file AtlCoolLib.py.

444  def _remove(self,idx):
445  "Remove the entry at idx"
446  self._starts[idx:]=self._starts[1+idx:]
447  self._ends[idx:]=self._ends[1+idx:]
448 

◆ getAllowedRanges()

def python.AtlCoolLib.RangeList.getAllowedRanges (   self,
  start,
  end 
)
Return a list of tuples giving the allowed (start,end) within the
specified (start,end)

Definition at line 428 of file AtlCoolLib.py.

428  def getAllowedRanges(self,start,end):
429  """Return a list of tuples giving the allowed (start,end) within the
430  specified (start,end)"""
431  result=[]
432  for ix in range(0,len(self._starts)):
433  if (self._ends[ix]>start and self._starts[ix]<end):
434  result+=[(max(self._starts[ix],start),min(self._ends[ix],end))]
435  return result
436 

◆ vetoRange()

def python.AtlCoolLib.RangeList.vetoRange (   self,
  start,
  end 
)

Definition at line 403 of file AtlCoolLib.py.

403  def vetoRange(self,start,end):
404  "Veto part of the original range, splitting it if needed"
405  if (start>=end): return
406  if (len(self._starts)==0): return
407  ix=0
408  while (ix<len(self._starts) and end>self._starts[ix]):
409  if (end>=self._starts[ix]):
410  if (start<=self._starts[ix] and end>=self._ends[ix]):
411  # remove whole interval
412  self._remove(ix)
413  ix-=1
414  elif (start<=self._starts[ix] and end<self._ends[ix]):
415  # remove front of stored interval
416  self._starts[ix]=end
417  elif (start<=self._ends[ix] and end>=self._ends[ix]):
418  # remove back of stored interval
419  self._ends[ix]=start
420  elif (start>self._starts[ix] and end<self._ends[ix]):
421  # have to split the stored interval
422  oldend=self._ends[ix]
423  self._ends[ix]=start
424  self._insert(ix+1,end,oldend)
425  ix+=1
426  ix+=1
427 

Member Data Documentation

◆ _ends

python.AtlCoolLib.RangeList._ends
private

Definition at line 401 of file AtlCoolLib.py.

◆ _starts

python.AtlCoolLib.RangeList._starts
private

Definition at line 400 of file AtlCoolLib.py.


The documentation for this class was generated from the following file:
max
#define max(a, b)
Definition: cfImp.cxx:41
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
min
#define min(a, b)
Definition: cfImp.cxx:40
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18