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 72 of file PyAthenaEventLoopMgr.py.

Constructor & Destructor Documentation

◆ __init__()

def python.PyAthenaEventLoopMgr.PyAthenaEventLoopMgr.__init__ (   self)

Definition at line 74 of file PyAthenaEventLoopMgr.py.

74  def __init__( self ):
75  PyGaudi.iService.__init__( self, 'PyAthenaEventLoopMgr' )
76 

Member Function Documentation

◆ __getattr__()

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

Definition at line 110 of file PyAthenaEventLoopMgr.py.

110  def __getattr__( self, attr ):
111  # note the lookup order: should be as per the C++ side
112  for obj in [ self._evtSeek, self._state, self._evtpro ]:
113  try:
114  return getattr( obj, attr )
115  except Exception:
116  pass
117 
118  # let properties be tried last
119  return super( PyAthenaEventLoopMgr, self ).__getattr__( attr )
120 

◆ _installServices()

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

Definition at line 77 of file PyAthenaEventLoopMgr.py.

77  def _installServices( self, cppself ):
78  # install the interfaces onto oneself; the order is (as per the
79  # cpp side multiple inheritence:
80  # IEventSeek
81  # IService => from here ...
82  # INamedInterface
83  # IInterface
84  # IProperty => ... up to here from the iService base class
85  # IStateful
86  # IEventProcessor
87  #
88  # The expectation from the C++ side it that an IEventSeek is received. Note
89  # that this code can not call into the application manager, as this is run
90  # during initialize, making the IService PyAthenaEventLoopMgr unavailable.
91  #
92  # Note that this is all a poor man's way of not needing to have dictionaries
93  # for all base classes of the C++ PyAthenaEventLoopMgr.
94 
95  import cppyy
96 
97  # need to set all the following through the __dict__ b/c of iPropert.__setattr__
98 
99  # the expect IEventSeek
100  self.__dict__[ '_evtSeek' ] = cppyy.bind_object( cppself, cppyy.gbl.IEventSeek )
101 
102  # the IService needed for iService._isvc and likewise iProperty._ip
103  self.__dict__[ '_isvc' ] = PyGaudi.InterfaceCast( cppyy.gbl.IService )( self._evtSeek )
104  self.__dict__[ '_ip' ] = PyGaudi.InterfaceCast( cppyy.gbl.IProperty )( self._evtSeek )
105 
106  # IStateful and IEventProcessor
107  self.__dict__[ '_state' ] = PyGaudi.InterfaceCast( cppyy.gbl.IStateful )( self._evtSeek )
108  self.__dict__[ '_evtpro' ] = PyGaudi.InterfaceCast( cppyy.gbl.IEventProcessor )( self._evtSeek )
109 

◆ executeAlgorithms()

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

Definition at line 121 of file PyAthenaEventLoopMgr.py.

121  def executeAlgorithms( self, cppcontext ):
122 
123  from AthenaPython.PyAthena import py_svc
124  from AthenaPython.PyAthenaComps import StatusCode
125  appmgr = py_svc('ApplicationMgr',iface="IProperty")
126  algmgr = py_svc('ApplicationMgr',iface='IAlgManager')
127 
128  import cppyy
129  ctx = cppyy.bind_object(cppcontext, "EventContext")
130 
131  try:
132  for name in appmgr.getProperty("TopAlg").value():
133  ialg=algmgr.algorithm(name).get()
134  ialg.execState(ctx).reset()
135  result = ialg.sysExecute(ctx)
136  if result.isFailure():
137  from AthenaCommon.Logging import log as msg
138  msg.error( "Execution of algorithm %s failed", name )
139  return result.getCode()
140  except KeyboardInterrupt:
141  from AthenaCommon.Logging import log as msg
142  msg.critical( "event loop stopped by user interrupt" )
143  return StatusCode.Failure
144 
145  return StatusCode.Success

The documentation for this class was generated from the following file:
athena.value
value
Definition: athena.py:122
python.Bindings.py_svc
def py_svc(svcName, createIf=True, iface=None)
Definition: Control/AthenaPython/python/Bindings.py:102
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:243
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127