| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Public Attributes

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

## Constructor & Destructor Documentation

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

Definition at line 413 of file pTools.py.

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

## Member Function Documentation

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

Definition at line 469 of file pTools.py.

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

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

Definition at line 443 of file pTools.py.

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

## Member Data Documentation

GaudiMP::pTools::LumiFSR::files

Definition at line 413 of file pTools.py.

GaudiMP::pTools::LumiFSR::info

Definition at line 413 of file pTools.py.

GaudiMP::pTools::LumiFSR::keys

Definition at line 413 of file pTools.py.

GaudiMP::pTools::LumiFSR::runs

Definition at line 413 of file pTools.py.

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

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

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