| # Gaudi Framework, version v22r0 |

Home |  | Generated: 9 Feb 2011

# GaudiMP::pTools::LumiFSR Class Reference

List of all members.

## Public Member Functions
def | __init__
def | merge
def | __repr__
## Public Attributes
| runs
| files
| info
| keys

## Detailed Description

Definition at line 411 of file pTools.py.

## Member Function Documentation

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

Definition at line 412 of file pTools.py.

    00413                              :
    00414         # lumi looks like :
    00415         # {  runs : 69857 69858
    00416         #    files : root:/castor/cer.../069857_0000000006.raw
    00417         #    info (key/incr/integral) : 0 8 0 / 1 8 259 / 2 8 76 ... }
    00418
    00419         # class variables
    00420         self.runs  = []
    00421         self.files = []
    00422         self.info  = {}
    00423         self.keys  = []
    00424
    00425         # get run numbers
    00426         for r in lumi.runNumbers() :
    00427             self.runs.append(r)
    00428         # get file ids
    00429         for f in lumi.fileIDs() :
    00430             self.files.append(f)
    00431         # Now the tricky bit, the info is not accessible via Python
    00432         # except as a string
    00433         s = str(lumi)
    00434         sa = s.split("info (key/incr/integral) : ")[-1]
    00435         sa = sa.split('/')[:-1]
    00436         for rec in sa :
    00437             k,i,t = rec.split()
    00438             k = int(k)
    00439             i = int(i)
    00440             t = int(t)
    00441             self.info[k] = (i,t)
            self.keys = self.info.keys()

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

Definition at line 468 of file pTools.py.

    00469                          :
    00470         s  = "LumiFSR Python class\n"
    00471         s += "\tRuns : \n"
    00472         for r in self.runs :
    00473             s += "\t\t%i\n"%(r)
    00474         s +=  "\tFiles : \n"
    00475         for f in self.files :
    00476             s += "\t\t%s\n"%(f)
    00477         s += "\tInfo : \n"
    00478         for k in self.keys :
    00479             increment, integral = self.info[k]
    00480             s += "\t\t%i\t%i\t%i\n"%(k,increment,integral)
    00481         return s
    00482
    00483 # =============================================================================

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

Definition at line 442 of file pTools.py.

    00443                                  :
    00444         assert otherLumi.__class__.__name__ == "LumiFSR"
    00445         # add any extra runs
    00446         for r in otherLumi.runs :
    00447             if r in self.runs :
    00448                 pass
    00449             else :
    00450                 self.runs.append( r )
    00451         self.runs.sort()
    00452         # add any extra fileIDs
    00453         for f in otherLumi.files :
    00454             if f in self.files :
    00455                 pass
    00456             else :
    00457                 self.files.append( f )
    00458         self.files.sort()
    00459         # Now add any extra records
    00460         for k in otherLumi.keys :
    00461             increment, integral = otherLumi.info[k]
    00462             if k in self.keys :
    00463                 myIncrement, myIntegral = self.info[k]
    00464                 self.info[k] = ( myIncrement+increment, myIntegral+integral )
    00465             else :
    00466                 self.info[k] = ( increment, integral )
    00467         # don't forget to update keys
            self.keys = self.info.keys()

## Member Data Documentation

GaudiMP::pTools::LumiFSR::files

Definition at line 420 of file pTools.py.

GaudiMP::pTools::LumiFSR::info

Definition at line 421 of file pTools.py.

GaudiMP::pTools::LumiFSR::keys

Definition at line 422 of file pTools.py.

GaudiMP::pTools::LumiFSR::runs

Definition at line 419 of file pTools.py.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines