| The Gaudi Framework v29r1 (5cd95fa2)

- 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 669 of file GMPBase.py.

## Constructor & Destructor Documentation

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

Definition at line 670 of file GMPBase.py.

670 def __init__(self, queues, events, params, subworkers):
671 GMPComponent.__init__(self, 'Reader', -1, queues,
672 events, params, subworkers)
673
GaudiMP.GMPBase.Reader.__init__
def __init__(self, queues, events, params, subworkers)
Definition: GMPBase.py:670

## Member Function Documentation

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

Definition at line 693 of file GMPBase.py.

693 def DoFirstEvent(self):
694 # Do First Event ------------------------------------------------------
695 # Check Termination Criteria
696 startFirst = time.time()
697 self.log.info('Reader : First Event')
698 if self.nOut == self.evtMax:
699 self.log.info('evtMax( %i ) reached' % (self.evtMax))
700 self.lastEvent.set()
701 return SUCCESS
702 else:
703 # Continue to read, dump and send event
704 self.a.run(1)
705 if not bool(self.evt['/Event']):
706 self.log.warning('No More Events! (So Far : %i)' % (self.nOut))
707 self.lastEvent.set()
708 return SUCCESS
709 else:
710 # Popluate TESSerializer list and send Event
711 if self.app == "Gauss":
712 lst = self.evt.getHistoNames()
713 else:
714 try:
715 lst = self.evt.getList()
716 if self.app == "DaVinci":
717 daqnode = self.evt.retrieveObject(
718 '/Event/DAQ').registry()
719 setOwnership(daqnode, False)
720 self.evt.getList(
721 daqnode, lst, daqnode.address().par())
722 except:
723 self.log.critical('Reader could not acquire TES List!')
724 self.lastEvent.set()
725 return FAILURE
726 self.log.info('Reader : TES List : %i items' % (len(lst)))
727 for l in lst:
728 self.ts.addItem(l)
729 self.currentEvent = self.getEventNumber()
730 tb = self.TS.Dump()
731 self.log.info('First Event Sent')
732 self.evcom.send((self.currentEvent, tb))
733 self.nOut += 1
734 self.eventLoopSyncer.set()
735 self.evt.clearStore()
736 self.firstEvTime = time.time() - startFirst
737 return SUCCESS
738
GaudiMP.GMPBase.GMPComponent.nOut
nOut
Definition: GMPBase.py:481
GaudiMP.GMPBase.Reader.DoFirstEvent
def DoFirstEvent(self)
Definition: GMPBase.py:693
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
GaudiMP.GMPBase.GMPComponent.currentEvent
currentEvent
Definition: GMPBase.py:443
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:70
GaudiMP.GMPBase.GMPComponent.app
app
Definition: GMPBase.py:450
GaudiMP.GMPBase.Reader.evtMax
evtMax
Definition: GMPBase.py:684
GaudiMP.GMPBase.GMPComponent.firstEvTime
firstEvTime
Definition: GMPBase.py:494
GaudiMP.GMPBase.GMPComponent.getEventNumber
def getEventNumber(self)
Definition: GMPBase.py:540
GaudiPython.Bindings.setOwnership
setOwnership
Definition: Bindings.py:84
GaudiMP.GMPBase.GMPComponent.evt
evt
Definition: GMPBase.py:519

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

Definition at line 686 of file GMPBase.py.

686 def DumpEvent(self):
687 tb = TBufferFile(TBuffer.kWrite)
688 # print '----Reader dumping Buffer!!!'
689 self.ts.dumpBuffer(tb)
690 # print '\tBuffer Dumped, size : %i'%( tb.Length() )
691 return tb
692
GaudiMP.GMPBase.Reader.DumpEvent
def DumpEvent(self)
Definition: GMPBase.py:686

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

Definition at line 739 of file GMPBase.py.

739 def Engine(self):
740 # rename process
741 import os
742 import ctypes
743 libc = ctypes.CDLL('libc.so.6')
744 name = str(self.nodeType) + str(self.nodeID) + '\0'
745 libc.prctl(15, name, 0, 0, 0)
746
747 startEngine = time.time()
748 self.log.name = 'Reader'
749 self.log.info('Reader Process starting')
750
751 self.Initialize()
752
753 # add the Histogram Collection Algorithm
754 self.a.addAlgorithm(CollectHistograms(self))
755
756 self.log.info('Reader Beginning Distribution')
757 sc = self.DoFirstEvent()
758 if sc.isSuccess():
759 self.log.info('Reader First Event OK')
760 else:
761 self.log.critical('Reader Failed on First Event')
762 self.stat = FAILURE
763
764 # Do All Others -------------------------------------------------------
765 while True:
766 # Check Termination Criteria
767 if self.nOut == self.evtMax:
768 self.log.info('evtMax( %i ) reached' % (self.evtMax))
769 break
770 # Check Health
771 if not self.stat.isSuccess():
772 self.log.critical('Reader is Damaged!')
773 break
774 # Continue to read, dump and send event
775 t = time.time()
776 self.a.run(1)
777 self.rTime += (time.time() - t)
778 if not bool(self.evt['/Event']):
779 self.log.warning('No More Events! (So Far : %i)' % (self.nOut))
780 break
781 self.currentEvent = self.getEventNumber()
782 tb = self.TS.Dump()
783 self.evcom.send((self.currentEvent, tb))
784 # clean up
785 self.nOut += 1
786 self.eventLoopSyncer.set()
787 self.evt.clearStore()
788 self.log.info('Setting <Last> Event')
789 self.lastEvent.set()
790
791 # Finalize
792 self.log.info('Reader : Event Distribution complete.')
793 self.evcom.finalize()
794 self.Finalize()
795 self.tTime = time.time() - startEngine
796 self.Report()
797
798 # =============================================================================
799
800
GaudiMP.GMPBase.GMPComponent.tTime
tTime
Definition: GMPBase.py:495
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:440
GaudiMP.GMPBase.GMPComponent.Report
def Report(self)
Definition: GMPBase.py:652
GaudiMP.GMPBase.GMPComponent.nOut
nOut
Definition: GMPBase.py:481
GaudiMP.GMPBase.CollectHistograms
Definition: GMPBase.py:187
GaudiMP.GMPBase.Reader.DoFirstEvent
def DoFirstEvent(self)
Definition: GMPBase.py:693
GaudiMP.GMPBase.GMPComponent.nodeType
nodeType
Definition: GMPBase.py:430
GaudiMP.GMPBase.GMPComponent.rTime
rTime
Definition: GMPBase.py:492
GaudiMP.GMPBase.GMPComponent.Finalize
def Finalize(self)
Definition: GMPBase.py:644
GaudiMP.GMPBase.GMPComponent.currentEvent
currentEvent
Definition: GMPBase.py:443
GaudiMP.GMPBase.Reader.evtMax
evtMax
Definition: GMPBase.py:684
GaudiMP.GMPBase.GMPComponent.getEventNumber
def getEventNumber(self)
Definition: GMPBase.py:540
GaudiMP.GMPBase.GMPComponent.stat
stat
Definition: GMPBase.py:484
GaudiMP.GMPBase.GMPComponent.Initialize
def Initialize(self)
Definition: GMPBase.py:628
GaudiMP.GMPBase.Reader.Engine
def Engine(self)
Definition: GMPBase.py:739
GaudiMP.GMPBase.GMPComponent.evt
evt
Definition: GMPBase.py:519

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

Definition at line 674 of file GMPBase.py.

674 def processConfiguration(self):
675 # Reader :
676 # No algorithms
677 # No output
678 # No histos
679 self.config['ApplicationMgr'].TopAlg = []
680 self.config['ApplicationMgr'].OutStream = []
681 if "HistogramPersistencySvc" in self.config.keys():
682 self.config['HistogramPersistencySvc'].OutputFile = ''
683 self.config['MessageSvc'].Format = '[Reader]% F%18W%S%7W%R%T %0W%M'
684 self.evtMax = self.config['ApplicationMgr'].EvtMax
685
GaudiMP.GMPBase.Reader.evtMax
evtMax
Definition: GMPBase.py:684
GaudiMP.GMPBase.Reader.processConfiguration
def processConfiguration(self)
Definition: GMPBase.py:674

## Member Data Documentation

GaudiMP.GMPBase.Reader.app

Definition at line 711 of file GMPBase.py.

GaudiMP.GMPBase.Reader.currentEvent

Definition at line 729 of file GMPBase.py.

GaudiMP.GMPBase.Reader.evtMax

Definition at line 684 of file GMPBase.py.

GaudiMP.GMPBase.Reader.firstEvTime

Definition at line 736 of file GMPBase.py.

GaudiMP.GMPBase.Reader.nOut

Definition at line 698 of file GMPBase.py.

GaudiMP.GMPBase.Reader.stat

Definition at line 762 of file GMPBase.py.

GaudiMP.GMPBase.Reader.tTime

Definition at line 795 of file GMPBase.py.

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

- GaudiMP/python/GaudiMP/GMPBase.py