| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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 424 of file pTools.py.

## Constructor & Destructor Documentation

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

Definition at line 425 of file pTools.py.

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

## Member Function Documentation

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

Definition at line 481 of file pTools.py.

481 def __repr__( self ) :
482 s = "LumiFSR Python class\n"
483 s += "\tRuns : \n"
484 for r in self.runs :
485 s += "\t\t%i\n"%(r)
486 s += "\tFiles : \n"
487 for f in self.files :
488 s += "\t\t%s\n"%(f)
489 s += "\tInfo : \n"
490 for k in self.keys :
491 increment, integral = self.info[k]
492 s += "\t\t%i\t%i\t%i\n"%(k,increment,integral)
493 return s
494
495 # =============================================================================
496
GaudiMP.pTools.LumiFSR.runs
runs
Definition: pTools.py:432
GaudiMP.pTools.LumiFSR.__repr__
def __repr__(self)
Definition: pTools.py:481
GaudiMP.pTools.LumiFSR.keys
keys
Definition: pTools.py:435
GaudiMP.pTools.LumiFSR.files
files
Definition: pTools.py:433
GaudiMP.pTools.LumiFSR.info
info
Definition: pTools.py:434

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

Definition at line 455 of file pTools.py.

455 def merge( self, otherLumi ) :
456 assert otherLumi.__class__.__name__ == "LumiFSR"
457 # add any extra runs
458 for r in otherLumi.runs :
459 if r in self.runs :
460 pass
461 else :
462 self.runs.append( r )
463 self.runs.sort()
464 # add any extra fileIDs
465 for f in otherLumi.files :
466 if f in self.files :
467 pass
468 else :
469 self.files.append( f )
470 self.files.sort()
471 # Now add any extra records
472 for k in otherLumi.keys :
473 increment, integral = otherLumi.info[k]
474 if k in self.keys :
475 myIncrement, myIntegral = self.info[k]
476 self.info[k] = ( myIncrement+increment, myIntegral+integral )
477 else :
478 self.info[k] = ( increment, integral )
479 # don't forget to update keys
480 self.keys = self.info.keys()
GaudiMP.pTools.LumiFSR.runs
runs
Definition: pTools.py:432
GaudiMP.pTools.LumiFSR.keys
keys
Definition: pTools.py:435
GaudiMP.pTools.LumiFSR.merge
def merge(self, otherLumi)
Definition: pTools.py:455
GaudiMP.pTools.LumiFSR.files
files
Definition: pTools.py:433
GaudiMP.pTools.LumiFSR.info
info
Definition: pTools.py:434

## Member Data Documentation

GaudiMP.pTools.LumiFSR.files

Definition at line 433 of file pTools.py.

GaudiMP.pTools.LumiFSR.info

Definition at line 434 of file pTools.py.

GaudiMP.pTools.LumiFSR.keys

Definition at line 435 of file pTools.py.

GaudiMP.pTools.LumiFSR.runs

Definition at line 432 of file pTools.py.

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

- GaudiMP/python/GaudiMP/pTools.py