ATLAS Offline Software
Loading...
Searching...
No Matches
python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr Class Reference
Inheritance diagram for python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr:
Collaboration diagram for python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr:

Public Member Functions

 __init__ (self)
 __getattr__ (self, attr)
 executeAlgorithms (self, cppcontext)

Protected Member Functions

 _installServices (self, cppself)

Protected Attributes

 _evtSeek
 _state

Detailed Description

Definition at line 12 of file PyAthenaEventLoopMgr.py.

Constructor & Destructor Documentation

◆ __init__()

python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr.__init__ ( self)

Definition at line 14 of file PyAthenaEventLoopMgr.py.

14 def __init__( self ):
15 PyGaudi.iService.__init__( self, 'PyAthenaEventLoopMgr' )
16

Member Function Documentation

◆ __getattr__()

python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr.__getattr__ ( self,
attr )

Definition at line 50 of file PyAthenaEventLoopMgr.py.

50 def __getattr__( self, attr ):
51 # note the lookup order: should be as per the C++ side
52 for obj in [ self._evtSeek, self._state, self._evtpro ]:
53 try:
54 return getattr( obj, attr )
55 except Exception:
56 pass
57
58 # let properties be tried last
59 return super( PyAthenaEventLoopMgr, self ).__getattr__( attr )
60

◆ _installServices()

python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr._installServices ( self,
cppself )
protected

Definition at line 17 of file PyAthenaEventLoopMgr.py.

17 def _installServices( self, cppself ):
18 # install the interfaces onto oneself; the order is (as per the
19 # cpp side multiple inheritence:
20 # IEventSeek
21 # IService => from here ...
22 # INamedInterface
23 # IInterface
24 # IProperty => ... up to here from the iService base class
25 # IStateful
26 # IEventProcessor
27 #
28 # The expectation from the C++ side it that an IEventSeek is received. Note
29 # that this code can not call into the application manager, as this is run
30 # during initialize, making the IService PyAthenaEventLoopMgr unavailable.
31 #
32 # Note that this is all a poor man's way of not needing to have dictionaries
33 # for all base classes of the C++ PyAthenaEventLoopMgr.
34
35 import cppyy
36
37 # need to set all the following through the __dict__ b/c of iPropert.__setattr__
38
39 # the expect IEventSeek
40 self.__dict__[ '_evtSeek' ] = cppyy.bind_object( cppself, cppyy.gbl.IEventSeek )
41
42 # the IService needed for iService._isvc and likewise iProperty._ip
43 self.__dict__[ '_isvc' ] = PyGaudi.InterfaceCast( cppyy.gbl.IService )( self._evtSeek )
44 self.__dict__[ '_ip' ] = PyGaudi.InterfaceCast( cppyy.gbl.IProperty )( self._evtSeek )
45
46 # IStateful and IEventProcessor
47 self.__dict__[ '_state' ] = PyGaudi.InterfaceCast( cppyy.gbl.IStateful )( self._evtSeek )
48 self.__dict__[ '_evtpro' ] = PyGaudi.InterfaceCast( cppyy.gbl.IEventProcessor )( self._evtSeek )
49

◆ executeAlgorithms()

python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr.executeAlgorithms ( self,
cppcontext )

Definition at line 61 of file PyAthenaEventLoopMgr.py.

61 def executeAlgorithms( self, cppcontext ):
62
63 from AthenaPython.PyAthena import py_svc
64 from AthenaPython.PyAthenaComps import StatusCode
65 appmgr = py_svc('ApplicationMgr',iface="IProperty")
66 algmgr = py_svc('ApplicationMgr',iface='IAlgManager')
67
68 import cppyy
69 ctx = cppyy.bind_object(cppcontext, "EventContext")
70
71 try:
72 for name in appmgr.getProperty("TopAlg").value():
73 ialg=algmgr.algorithm(name).get()
74 ialg.execState(ctx).reset()
75 result = ialg.sysExecute(ctx)
76 if result.isFailure():
77 from AthenaCommon.Logging import log as msg
78 msg.error( "Execution of algorithm %s failed", name )
79 return result.getCode()
80 except KeyboardInterrupt:
81 from AthenaCommon.Logging import log as msg
82 msg.critical( "event loop stopped by user interrupt" )
83 return StatusCode.Failure
84
85 return StatusCode.Success
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

Member Data Documentation

◆ _evtSeek

python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr._evtSeek
protected

Definition at line 52 of file PyAthenaEventLoopMgr.py.

◆ _state

python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr._state
protected

Definition at line 52 of file PyAthenaEventLoopMgr.py.


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