| # Gaudi Framework, version v22r0 |

Home |  | Generated: 9 Feb 2011

# GaudiMP::GMPBase::Reader Class Reference

Inheritance diagram for GaudiMP::GMPBase::Reader:
[legend]
Collaboration diagram for GaudiMP::GMPBase::Reader:
[legend]

List of all members.

## Public Member Functions
def | __init__
def | processConfiguration
def | DumpEvent
def | DoFirstEvent
def | Engine
## Public Attributes
| evtMax
| nOut
| currentEvent
| firstEvTime
| stat
| tTime

## Detailed Description

Definition at line 616 of file GMPBase.py.

## Member Function Documentation

def GaudiMP::GMPBase::Reader::__init__ | ( |  | self,
|  |  | queues,
|  |  | events,
|  |  | params |
| ) |  |  |

Definition at line 617 of file GMPBase.py.

    00618                                                  :
    00619         GMPComponent.__init__(self, 'Reader', -1, queues, events, params )

def GaudiMP::GMPBase::Reader::DoFirstEvent | ( |  | self | ) |

Definition at line 639 of file GMPBase.py.

    00640                              :
    00641         # Do First Event ------------------------------------------------------
    00642         # Check Termination Criteria
    00643         startFirst = time.time()
    00644         self.log.info('Reader : First Event')
    00645         if self.nOut == self.evtMax :
    00646             self.log.info('evtMax( %i ) reached'%(self.evtMax))
    00647             self.lastEvent.set()
    00648             return SUCCESS
    00649         else :
    00650             # Continue to read, dump and send event
    00651             self.a.run(1)
    00652             if not bool(self.evt['/Event']) :
    00653                 self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
    00654                 self.lastEvent.set()
    00655                 return SUCCESS
    00656             else :
    00657                 # Popluate TESSerializer list and send Event
    00658                 try :
    00659                     lst = self.evt.getList()
    00660                 except :
    00661                     self.log.critical('Reader could not acquire TES List!')
    00662                     self.lastEvent.set()
    00663                     return FAILURE
    00664                 self.log.info('Reader : TES List : %i items'%(len(lst)))
    00665                 for l in lst :
    00666                     self.ts.addItem(l)
    00667                 self.currentEvent = self.getEventNumber( )
    00668                 tb = self.TS.Dump( )
    00669                 self.log.info('First Event Sent')
    00670                 self.evcom.send( (self.currentEvent, tb) )
    00671                 self.nOut += 1
    00672                 self.eventLoopSyncer.set()
    00673                 self.evt.clearStore( )
    00674                 self.firstEvTime = time.time()-startFirst
    00675                 return SUCCESS

def GaudiMP::GMPBase::Reader::DumpEvent | ( |  | self | ) |

Definition at line 632 of file GMPBase.py.

    00633                           :
    00634         tb = TBufferFile( TBuffer.kWrite )
    00635         # print '----Reader dumping Buffer!!!'
    00636         self.ts.dumpBuffer( tb )
    00637         # print '\tBuffer Dumped, size : %i'%( tb.Length() )
    00638         return tb

def GaudiMP::GMPBase::Reader::Engine | ( |  | self | ) |

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 676 of file GMPBase.py.

    00677                        :
    00678
    00679         startEngine = time.time()
    00680         self.log.name = 'Reader'
    00681         self.log.info('Reader Process starting')
    00682
    00683         self.Initialize()
    00684
    00685         # add the Histogram Collection Algorithm
    00686         self.a.addAlgorithm( CollectHistograms(self) )
    00687
    00688         self.log.info('Reader Beginning Distribution')
    00689         sc = self.DoFirstEvent( )
    00690         if sc.isSuccess() :
    00691             self.log.info('Reader First Event OK')
    00692         else :
    00693             self.log.critical('Reader Failed on First Event')
    00694             self.stat = FAILURE
    00695
    00696         # Do All Others -------------------------------------------------------
    00697         while True :
    00698             # Check Termination Criteria
    00699             if self.nOut == self.evtMax :
    00700                 self.log.info('evtMax( %i ) reached'%(self.evtMax))
    00701                 break
    00702             # Check Health
    00703             if not self.stat.isSuccess() :
    00704                 self.log.critical( 'Reader is Damaged!' )
    00705                 break
    00706             # Continue to read, dump and send event
    00707             t = time.time()
    00708             self.a.run(1)
    00709             self.rTime += (time.time()-t)
    00710             if not bool(self.evt['/Event']) :
    00711                 self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
    00712                 break
    00713             self.currentEvent = self.getEventNumber( )
    00714             tb = self.TS.Dump( )
    00715             self.evcom.send( (self.currentEvent, tb) )
    00716             # clean up
    00717             self.nOut += 1
    00718             self.eventLoopSyncer.set()
    00719             self.evt.clearStore( )
    00720         self.log.info('Setting <Last> Event')
    00721         self.lastEvent.set()
    00722
    00723         # Finalize
    00724         self.log.info( 'Reader : Event Distribution complete.' )
    00725         self.evcom.finalize()
    00726         self.Finalize()
    00727         self.tTime = time.time() - startEngine
    00728         self.Report()
    00729
    00730 # =============================================================================

def GaudiMP::GMPBase::Reader::processConfiguration | ( |  | self | ) |

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 620 of file GMPBase.py.

    00621                                      :
    00622         # Reader :
    00623         #   No algorithms
    00624         #   No output
    00625         #   No histos
    00626         self.config[ 'ApplicationMgr' ].TopAlg    = []
    00627         self.config[ 'ApplicationMgr' ].OutStream = []
    00628         if "HistogramPersistencySvc" in self.config.keys() :
    00629             self.config[ 'HistogramPersistencySvc' ].OutputFile = ''
    00630         self.config['MessageSvc'].Format    = '[Reader]% F%18W%S%7W%R%T %0W%M'
    00631         self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax

## Member Data Documentation

GaudiMP::GMPBase::Reader::currentEvent

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 666 of file GMPBase.py.

GaudiMP::GMPBase::Reader::evtMax

Definition at line 630 of file GMPBase.py.

GaudiMP::GMPBase::Reader::firstEvTime

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 673 of file GMPBase.py.

GaudiMP::GMPBase::Reader::nOut

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 644 of file GMPBase.py.

GaudiMP::GMPBase::Reader::stat

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 693 of file GMPBase.py.

GaudiMP::GMPBase::Reader::tTime

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 726 of file GMPBase.py.

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

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

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