| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
GaudiMP.pTools.LumiFSR Class Reference

## Public Member Functions
def | __init__
def | merge
def | __repr__

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

## Member Function Documentation

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

Definition at line 481 of file pTools.py.

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

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

Definition at line 455 of file pTools.py.

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

## 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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiMP/python/GaudiMP/pTools.py