| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
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 433 of file pTools.py.

## Constructor & Destructor Documentation

## ◆ __init__()

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

Definition at line 434 of file pTools.py.

434 def __init__(self, lumi):
435 # lumi looks like :
436 # { runs : 69857 69858
437 # files : root:/castor/cer.../069857_0000000006.raw
438 # info (key/incr/integral) : 0 8 0 / 1 8 259 / 2 8 76 ... }
439
440 # class variables
441 self.runs = []
442 self.files = []
443 self.info = {}
444 self.keys = []
445
446 # get run numbers
447 for r in lumi.runNumbers():
448 self.runs.append(r)
449 # get file ids
450 for f in lumi.fileIDs():
451 self.files.append(f)
452 # Now the tricky bit, the info is not accessible via Python
453 # except as a string
454 s = str(lumi)
455 sa = s.split("info (key/incr/integral) : ")[-1]
456 sa = sa.split('/')[:-1]
457 for rec in sa:
458 k, i, t = rec.split()
459 k = int(k)
460 i = int(i)
461 t = int(t)
462 self.info[k] = (i, t)
463 self.keys = self.info.keys()
464

## Member Function Documentation

## ◆ __repr__()

def GaudiMP.pTools.LumiFSR.__repr__ | ( |  | self | ) |

Definition at line 492 of file pTools.py.

492 def __repr__(self):
493 s = "LumiFSR Python class\n"
494 s += "\tRuns : \n"
495 for r in self.runs:
496 s += "\t\t%i\n" % (r)
497 s += "\tFiles : \n"
498 for f in self.files:
499 s += "\t\t%s\n" % (f)
500 s += "\tInfo : \n"
501 for k in self.keys:
502 increment, integral = self.info[k]
503 s += "\t\t%i\t%i\t%i\n" % (k, increment, integral)
504 return s
505
506
507 # =============================================================================
508
509
GaudiPython.HistoUtils.__repr__
__repr__
Definition: HistoUtils.py:508

## ◆ merge()

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

Definition at line 465 of file pTools.py.

465 def merge(self, otherLumi):
466 assert otherLumi.__class__.__name__ == "LumiFSR"
467 # add any extra runs
468 for r in otherLumi.runs:
469 if r in self.runs:
470 pass
471 else:
472 self.runs.append(r)
473 self.runs.sort()
474 # add any extra fileIDs
475 for f in otherLumi.files:
476 if f in self.files:
477 pass
478 else:
479 self.files.append(f)
480 self.files.sort()
481 # Now add any extra records
482 for k in otherLumi.keys:
483 increment, integral = otherLumi.info[k]
484 if k in self.keys:
485 myIncrement, myIntegral = self.info[k]
486 self.info[k] = (myIncrement + increment, myIntegral + integral)
487 else:
488 self.info[k] = (increment, integral)
489 # don't forget to update keys
490 self.keys = self.info.keys()
491
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:420

## Member Data Documentation

## ◆ files

GaudiMP.pTools.LumiFSR.files

Definition at line 442 of file pTools.py.

## ◆ info

GaudiMP.pTools.LumiFSR.info

Definition at line 443 of file pTools.py.

## ◆ keys

GaudiMP.pTools.LumiFSR.keys

Definition at line 444 of file pTools.py.

## ◆ runs

GaudiMP.pTools.LumiFSR.runs

Definition at line 441 of file pTools.py.

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

- GaudiMP/python/GaudiMP/pTools.py