| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
GaudiMP.GMPBase.Reader Class Reference
Inheritance diagram for GaudiMP.GMPBase.Reader:
[legend]
Collaboration diagram for GaudiMP.GMPBase.Reader:
[legend]

## Public Member Functions
def | __init__ (self, queues, events, params, subworkers)
def | processConfiguration (self)
def | DumpEvent (self)
def | DoFirstEvent (self)
def | Engine (self)
Public Member Functions inherited from GaudiMP.GMPBase.GMPComponent
def | __init__ (self, nodeType, nodeID, queues, events, params, subworkers)
def | Start (self)
def | Engine (self)
def | processConfiguration (self)
def | SetupGaudiPython (self)
def | StartGaudiPython (self)
def | LoadTES (self, tbufferfile)
def | getEventNumber (self)
def | IdentifyWriters (self)
def | dumpHistograms (self)
def | Initialize (self)
def | Finalize (self)
def | Report (self)

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

## Detailed Description

Definition at line 647 of file GMPBase.py.

## Constructor & Destructor Documentation

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

Definition at line 648 of file GMPBase.py.

648 def __init__( self, queues, events, params, subworkers ) :
649 GMPComponent.__init__(self, 'Reader', -1, queues, events, params, subworkers )
650
GaudiMP.GMPBase.Reader.__init__
def __init__(self, queues, events, params, subworkers)
Definition: GMPBase.py:648

## Member Function Documentation

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

Definition at line 670 of file GMPBase.py.

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

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

Definition at line 663 of file GMPBase.py.

663 def DumpEvent( self ) :
664 tb = TBufferFile( TBuffer.kWrite )
665 # print '----Reader dumping Buffer!!!'
666 self.ts.dumpBuffer( tb )
667 # print '\tBuffer Dumped, size : %i'%( tb.Length() )
668 return tb
669
GaudiMP.GMPBase.Reader.DumpEvent
def DumpEvent(self)
Definition: GMPBase.py:663

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

Definition at line 714 of file GMPBase.py.

714 def Engine( self ) :
715 # rename process
716 import os
717 import ctypes
718 libc = ctypes.CDLL('libc.so.6')
719 name = str(self.nodeType) + str(self.nodeID) + '\0'
720 libc.prctl(15,name,0,0,0)
721
722
723 startEngine = time.time()
724 self.log.name = 'Reader'
725 self.log.info('Reader Process starting')
726
727 self.Initialize()
728
729 # add the Histogram Collection Algorithm
730 self.a.addAlgorithm( CollectHistograms(self) )
731
732 self.log.info('Reader Beginning Distribution')
733 sc = self.DoFirstEvent( )
734 if sc.isSuccess() :
735 self.log.info('Reader First Event OK')
736 else :
737 self.log.critical('Reader Failed on First Event')
738 self.stat = FAILURE
739
740 # Do All Others -------------------------------------------------------
741 while True :
742 # Check Termination Criteria
743 if self.nOut == self.evtMax :
744 self.log.info('evtMax( %i ) reached'%(self.evtMax))
745 break
746 # Check Health
747 if not self.stat.isSuccess() :
748 self.log.critical( 'Reader is Damaged!' )
749 break
750 # Continue to read, dump and send event
751 t = time.time()
752 self.a.run(1)
753 self.rTime += (time.time()-t)
754 if not bool(self.evt['/Event']) :
755 self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
756 break
757 self.currentEvent = self.getEventNumber( )
758 tb = self.TS.Dump( )
759 self.evcom.send( (self.currentEvent, tb) )
760 # clean up
761 self.nOut += 1
762 self.eventLoopSyncer.set()
763 self.evt.clearStore( )
764 self.log.info('Setting <Last> Event')
765 self.lastEvent.set()
766
767 # Finalize
768 self.log.info( 'Reader : Event Distribution complete.' )
769 self.evcom.finalize()
770 self.Finalize()
771 self.tTime = time.time() - startEngine
772 self.Report()
773
774 # =============================================================================
GaudiMP.GMPBase.GMPComponent.tTime
tTime
Definition: GMPBase.py:473
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:419
GaudiMP.GMPBase.GMPComponent.Report
def Report(self)
Definition: GMPBase.py:631
GaudiMP.GMPBase.GMPComponent.nOut
nOut
Definition: GMPBase.py:459
GaudiMP.GMPBase.CollectHistograms
Definition: GMPBase.py:182
GaudiMP.GMPBase.Reader.DoFirstEvent
def DoFirstEvent(self)
Definition: GMPBase.py:670
GaudiMP.GMPBase.GMPComponent.nodeType
nodeType
Definition: GMPBase.py:409
GaudiMP.GMPBase.GMPComponent.rTime
rTime
Definition: GMPBase.py:470
GaudiMP.GMPBase.GMPComponent.Finalize
def Finalize(self)
Definition: GMPBase.py:623
GaudiMP.GMPBase.GMPComponent.currentEvent
currentEvent
Definition: GMPBase.py:422
GaudiMP.GMPBase.Reader.evtMax
evtMax
Definition: GMPBase.py:661
GaudiMP.GMPBase.GMPComponent.getEventNumber
def getEventNumber(self)
Definition: GMPBase.py:521
GaudiMP.GMPBase.GMPComponent.stat
stat
Definition: GMPBase.py:462
GaudiMP.GMPBase.GMPComponent.Initialize
def Initialize(self)
Definition: GMPBase.py:607
GaudiMP.GMPBase.Reader.Engine
def Engine(self)
Definition: GMPBase.py:714
GaudiMP.GMPBase.GMPComponent.evt
evt
Definition: GMPBase.py:500

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

Definition at line 651 of file GMPBase.py.

651 def processConfiguration( self ) :
652 # Reader :
653 # No algorithms
654 # No output
655 # No histos
656 self.config[ 'ApplicationMgr' ].TopAlg = []
657 self.config[ 'ApplicationMgr' ].OutStream = []
658 if "HistogramPersistencySvc" in self.config.keys() :
659 self.config[ 'HistogramPersistencySvc' ].OutputFile = ''
660 self.config['MessageSvc'].Format = '[Reader]% F%18W%S%7W%R%T %0W%M'
661 self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax
662
GaudiMP.GMPBase.Reader.evtMax
evtMax
Definition: GMPBase.py:661
GaudiMP.GMPBase.Reader.processConfiguration
def processConfiguration(self)
Definition: GMPBase.py:651

## Member Data Documentation

GaudiMP.GMPBase.Reader.app

Definition at line 688 of file GMPBase.py.

GaudiMP.GMPBase.Reader.currentEvent

Definition at line 704 of file GMPBase.py.

GaudiMP.GMPBase.Reader.evtMax

Definition at line 661 of file GMPBase.py.

GaudiMP.GMPBase.Reader.firstEvTime

Definition at line 711 of file GMPBase.py.

GaudiMP.GMPBase.Reader.nOut

Definition at line 675 of file GMPBase.py.

GaudiMP.GMPBase.Reader.stat

Definition at line 738 of file GMPBase.py.

GaudiMP.GMPBase.Reader.tTime

Definition at line 771 of file GMPBase.py.

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

- GaudiMP/python/GaudiMP/GMPBase.py