The Gaudi Framework  v36r6 (b1ee9983)
GaudiMP.pTools.LumiFSR Class Reference

Public Member Functions

def __init__ (self, lumi)
 
def merge (self, otherLumi)
 
def __repr__ (self)
 

Public Attributes

 runs
 
 files
 
 info
 
 keys
 

Detailed Description

Definition at line 472 of file pTools.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiMP.pTools.LumiFSR.__init__ (   self,
  lumi 
)

Definition at line 473 of file pTools.py.

473  def __init__(self, lumi):
474  # lumi looks like :
475  # { runs : 69857 69858
476  # files : root:/castor/cer.../069857_0000000006.raw
477  # info (key/incr/integral) : 0 8 0 / 1 8 259 / 2 8 76 ... }
478 
479  # class variables
480  self.runs = []
481  self.files = []
482  self.info = {}
483  self.keys = []
484 
485  # get run numbers
486  for r in lumi.runNumbers():
487  self.runs.append(r)
488  # get file ids
489  for f in lumi.fileIDs():
490  self.files.append(f)
491  # Now the tricky bit, the info is not accessible via Python
492  # except as a string
493  s = str(lumi)
494  sa = s.split("info (key/incr/integral) : ")[-1]
495  sa = sa.split("/")[:-1]
496  for rec in sa:
497  k, i, t = rec.split()
498  k = int(k)
499  i = int(i)
500  t = int(t)
501  self.info[k] = (i, t)
502  self.keys = self.info.keys()
503 

Member Function Documentation

◆ __repr__()

def GaudiMP.pTools.LumiFSR.__repr__ (   self)

Definition at line 531 of file pTools.py.

531  def __repr__(self):
532  s = "LumiFSR Python class\n"
533  s += "\tRuns : \n"
534  for r in self.runs:
535  s += "\t\t%i\n" % (r)
536  s += "\tFiles : \n"
537  for f in self.files:
538  s += "\t\t%s\n" % (f)
539  s += "\tInfo : \n"
540  for k in self.keys:
541  increment, integral = self.info[k]
542  s += "\t\t%i\t%i\t%i\n" % (k, increment, integral)
543  return s
544 
545 
546 # =============================================================================
547 
548 

◆ merge()

def GaudiMP.pTools.LumiFSR.merge (   self,
  otherLumi 
)

Definition at line 504 of file pTools.py.

504  def merge(self, otherLumi):
505  assert otherLumi.__class__.__name__ == "LumiFSR"
506  # add any extra runs
507  for r in otherLumi.runs:
508  if r in self.runs:
509  pass
510  else:
511  self.runs.append(r)
512  self.runs.sort()
513  # add any extra fileIDs
514  for f in otherLumi.files:
515  if f in self.files:
516  pass
517  else:
518  self.files.append(f)
519  self.files.sort()
520  # Now add any extra records
521  for k in otherLumi.keys:
522  increment, integral = otherLumi.info[k]
523  if k in self.keys:
524  myIncrement, myIntegral = self.info[k]
525  self.info[k] = (myIncrement + increment, myIntegral + integral)
526  else:
527  self.info[k] = (increment, integral)
528  # don't forget to update keys
529  self.keys = self.info.keys()
530 

Member Data Documentation

◆ files

GaudiMP.pTools.LumiFSR.files

Definition at line 481 of file pTools.py.

◆ info

GaudiMP.pTools.LumiFSR.info

Definition at line 482 of file pTools.py.

◆ keys

GaudiMP.pTools.LumiFSR.keys

Definition at line 483 of file pTools.py.

◆ runs

GaudiMP.pTools.LumiFSR.runs

Definition at line 480 of file pTools.py.


The documentation for this class was generated from the following file:
GaudiPython.HistoUtils.__repr__
__repr__
Definition: HistoUtils.py:536
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:430
StringKeyEx.keys
list keys
Definition: StringKeyEx.py:67