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 394 of file AtlCoolLib.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 397 of file AtlCoolLib.py.

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

Member Function Documentation

◆ __str__()

def python.AtlCoolLib.RangeList.__str__ (   self)

Definition at line 436 of file AtlCoolLib.py.

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

◆ _insert()

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

Definition at line 448 of file AtlCoolLib.py.

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

◆ _remove()

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

Definition at line 443 of file AtlCoolLib.py.

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

◆ 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 427 of file AtlCoolLib.py.

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

◆ vetoRange()

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

Definition at line 402 of file AtlCoolLib.py.

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

Member Data Documentation

◆ _ends

python.AtlCoolLib.RangeList._ends
private

Definition at line 400 of file AtlCoolLib.py.

◆ _starts

python.AtlCoolLib.RangeList._starts
private

Definition at line 399 of file AtlCoolLib.py.


The documentation for this class was generated from the following file:
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194