ATLAS Offline Software
Public Member Functions | Private Member Functions | List of all members
python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr Class Reference
Inheritance diagram for python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr:
Collaboration diagram for python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr:

Public Member Functions

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

Private Member Functions

def _installServices (self, cppself)
 

Detailed Description

Definition at line 12 of file PyAthenaEventLoopMgr.py.

Constructor & Destructor Documentation

◆ __init__()

def 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__()

def 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()

def python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr._installServices (   self,
  cppself 
)
private

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()

def 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

The documentation for this class was generated from the following file:
athena.value
value
Definition: athena.py:124
python.Bindings.py_svc
def py_svc(svcName, createIf=True, iface=None)
Definition: Control/AthenaPython/python/Bindings.py:98
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
CxxUtils::reset
constexpr std::enable_if_t< is_bitmask_v< E >, E & > reset(E &lhs, E rhs)
Convenience function to clear bits in a class enum bitmask.
Definition: bitmask.h:251
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127