Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012
Public Member Functions | Public Attributes

GaudiMP::GMPBase::Reader Class Reference

Inheritance diagram for GaudiMP::GMPBase::Reader:
Inheritance graph
[legend]
Collaboration diagram for GaudiMP::GMPBase::Reader:
Collaboration graph
[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 617 of file GMPBase.py.


Constructor & Destructor Documentation

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

Definition at line 618 of file GMPBase.py.

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


Member Function Documentation

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

Definition at line 640 of file GMPBase.py.

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

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

Definition at line 633 of file GMPBase.py.

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

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

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 677 of file GMPBase.py.

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

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

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 621 of file GMPBase.py.

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


Member Data Documentation

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 640 of file GMPBase.py.

Definition at line 621 of file GMPBase.py.

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 640 of file GMPBase.py.

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 640 of file GMPBase.py.

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 677 of file GMPBase.py.

Reimplemented from GaudiMP::GMPBase::GMPComponent.

Definition at line 677 of file GMPBase.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Jan 30 2012 13:53:33 for Gaudi Framework, version v23r0 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004