Gaudi Framework, version v23r5

Home   Generated: Wed Nov 28 2012
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
GaudiMP.GMPBase.Reader Class Reference
Inheritance diagram for GaudiMP.GMPBase.Reader:
Inheritance graph
[legend]
Collaboration diagram for GaudiMP.GMPBase.Reader:
Collaboration graph
[legend]

Public Member Functions

def __init__
 
def processConfiguration
 
def DumpEvent
 
def DoFirstEvent
 
def Engine
 
- Public Member Functions inherited from GaudiMP.GMPBase.GMPComponent
def __init__
 
def Start
 
def Engine
 
def processConfiguration
 
def SetupGaudiPython
 
def StartGaudiPython
 
def LoadTES
 
def getEventNumber
 
def IdentifyWriters
 
def dumpHistograms
 
def Initialize
 
def Finalize
 
def Report
 

Public Attributes

 evtMax
 
 nOut
 
 app
 
 currentEvent
 
 firstEvTime
 
 stat
 
 tTime
 
- Public Attributes inherited from GaudiMP.GMPBase.GMPComponent
 nodeType
 
 finalEvent
 
 lastEvent
 
 log
 
 nodeID
 
 currentEvent
 
 evcom
 
 evcoms
 
 hq
 
 fq
 
 nIn
 
 nOut
 
 stat
 
 iTime
 
 rTime
 
 fTime
 
 firstEvTime
 
 tTime
 
 proc
 
 a
 
 evt
 
 hvt
 
 fsr
 
 inc
 
 pers
 
 ts
 
 TS
 
 num
 
 app
 
 cntr
 

Additional Inherited Members

- Static Public Attributes inherited from GaudiMP.GMPBase.GMPComponent
tuple ks self.config.keys()
 
list list ["Brunel", "DaVinci", "Boole", "Gauss"]
 

Detailed Description

Definition at line 641 of file GMPBase.py.

Constructor & Destructor Documentation

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

Definition at line 642 of file GMPBase.py.

643  def __init__( self, queues, events, params ) :
644  GMPComponent.__init__(self, 'Reader', -1, queues, events, params )

Member Function Documentation

def GaudiMP.GMPBase.Reader.DoFirstEvent (   self)

Definition at line 664 of file GMPBase.py.

665  def DoFirstEvent( self ) :
666  # Do First Event ------------------------------------------------------
667  # Check Termination Criteria
668  startFirst = time.time()
669  self.log.info('Reader : First Event')
670  if self.nOut == self.evtMax :
671  self.log.info('evtMax( %i ) reached'%(self.evtMax))
672  self.lastEvent.set()
673  return SUCCESS
674  else :
675  # Continue to read, dump and send event
676  self.a.run(1)
677  if not bool(self.evt['/Event']) :
678  self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
679  self.lastEvent.set()
680  return SUCCESS
681  else :
682  # Popluate TESSerializer list and send Event
683  if self.app == "Gauss":
684  lst = self.evt.getHistoNames()
685  else:
686  try :
687  lst = self.evt.getList()
688  if self.app == "DaVinci":
689  daqnode = self.evt.retrieveObject( '/Event/DAQ' ).registry()
690  setOwnership( daqnode, False )
691  self.evt.getList( daqnode, lst, daqnode.address().par() )
692  except :
693  self.log.critical('Reader could not acquire TES List!')
694  self.lastEvent.set()
695  return FAILURE
696  self.log.info('Reader : TES List : %i items'%(len(lst)))
697  for l in lst :
698  self.ts.addItem(l)
699  self.currentEvent = self.getEventNumber( )
700  tb = self.TS.Dump( )
701  self.log.info('First Event Sent')
702  self.evcom.send( (self.currentEvent, tb) )
703  self.nOut += 1
704  self.eventLoopSyncer.set()
705  self.evt.clearStore( )
706  self.firstEvTime = time.time()-startFirst
707  return SUCCESS
def GaudiMP.GMPBase.Reader.DumpEvent (   self)

Definition at line 657 of file GMPBase.py.

658  def DumpEvent( self ) :
659  tb = TBufferFile( TBuffer.kWrite )
660  # print '----Reader dumping Buffer!!!'
661  self.ts.dumpBuffer( tb )
662  # print '\tBuffer Dumped, size : %i'%( tb.Length() )
663  return tb
def GaudiMP.GMPBase.Reader.Engine (   self)

Definition at line 708 of file GMPBase.py.

709  def Engine( self ) :
710 
711  startEngine = time.time()
712  self.log.name = 'Reader'
713  self.log.info('Reader Process starting')
714 
715  self.Initialize()
716 
717  # add the Histogram Collection Algorithm
718  self.a.addAlgorithm( CollectHistograms(self) )
719 
720  self.log.info('Reader Beginning Distribution')
721  sc = self.DoFirstEvent( )
722  if sc.isSuccess() :
723  self.log.info('Reader First Event OK')
724  else :
725  self.log.critical('Reader Failed on First Event')
726  self.stat = FAILURE
727 
728  # Do All Others -------------------------------------------------------
729  while True :
730  # Check Termination Criteria
731  if self.nOut == self.evtMax :
732  self.log.info('evtMax( %i ) reached'%(self.evtMax))
733  break
734  # Check Health
735  if not self.stat.isSuccess() :
736  self.log.critical( 'Reader is Damaged!' )
737  break
738  # Continue to read, dump and send event
739  t = time.time()
740  self.a.run(1)
741  self.rTime += (time.time()-t)
742  if not bool(self.evt['/Event']) :
743  self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
744  break
745  self.currentEvent = self.getEventNumber( )
746  tb = self.TS.Dump( )
747  self.evcom.send( (self.currentEvent, tb) )
748  # clean up
749  self.nOut += 1
750  self.eventLoopSyncer.set()
751  self.evt.clearStore( )
752  self.log.info('Setting <Last> Event')
753  self.lastEvent.set()
754 
755  # Finalize
756  self.log.info( 'Reader : Event Distribution complete.' )
757  self.evcom.finalize()
758  self.Finalize()
759  self.tTime = time.time() - startEngine
760  self.Report()
761 
762 # =============================================================================
def GaudiMP.GMPBase.Reader.processConfiguration (   self)

Definition at line 645 of file GMPBase.py.

646  def processConfiguration( self ) :
647  # Reader :
648  # No algorithms
649  # No output
650  # No histos
651  self.config[ 'ApplicationMgr' ].TopAlg = []
652  self.config[ 'ApplicationMgr' ].OutStream = []
653  if "HistogramPersistencySvc" in self.config.keys() :
654  self.config[ 'HistogramPersistencySvc' ].OutputFile = ''
655  self.config['MessageSvc'].Format = '[Reader]% F%18W%S%7W%R%T %0W%M'
656  self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax

Member Data Documentation

GaudiMP.GMPBase.Reader.app

Definition at line 682 of file GMPBase.py.

GaudiMP.GMPBase.Reader.currentEvent

Definition at line 698 of file GMPBase.py.

GaudiMP.GMPBase.Reader.evtMax

Definition at line 655 of file GMPBase.py.

GaudiMP.GMPBase.Reader.firstEvTime

Definition at line 705 of file GMPBase.py.

GaudiMP.GMPBase.Reader.nOut

Definition at line 669 of file GMPBase.py.

GaudiMP.GMPBase.Reader.stat

Definition at line 725 of file GMPBase.py.

GaudiMP.GMPBase.Reader.tTime

Definition at line 758 of file GMPBase.py.


The documentation for this class was generated from the following file:
Generated at Wed Nov 28 2012 12:17:39 for Gaudi Framework, version v23r5 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004