7__doc__ =
"""Module containing a set of Python base classes for PyAthena"""
8__author__ =
"Sebastien Binet <binet@cern.ch>"
11__all__ = [
'StatusCode',
22from AthenaPython.Configurables
import (CfgPyAlgorithm,
30 """A convenient class to access py-components by name
34 self.__setattr__(k, weakref.ref(v))
37services.__doc__ =
"""The list of PyAthena::Svc which have been instantiated"""
38services.__setattr__ = __wk_setattr__
41algs.__doc__ =
"""The list of PyAthena::Alg which have been instantiated"""
42algs.__setattr__ = __wk_setattr__
48 if propname
in pycomp.properties()
and pycomp.properties()[propname] != pycomp.propertyNoValue:
49 return pycomp.properties()[propname]
51 return pycomp.getDefaultProperty(propname)
61class Alg( CfgPyAlgorithm ):
63 Base class from which all concrete algorithm classes should
66 In order for a concrete algorithm class to do anything
67 useful the methods initialize(), execute() and finalize()
71 if name
is None: name = kw.get(
'name', self.__class__.__name__)
72 kw.setdefault(
'OutputLevel', 3)
74 super(Alg, self).
__init__(name, **kw)
86 import AthenaPython.PyAthena
as PyAthena
93 import AthenaPython.PyAthena
as PyAthena
100 import AthenaPython.PyAthena
as PyAthena
105 if hasattr(self,
'OutputLevel'):
112 return StatusCode.Success
115 if hasattr(self,
'OutputLevel'):
122 return StatusCode.Success
126 self.
_ctx = cppyy.bind_object(cppcontext,
"EventContext")
134 return StatusCode.Success
140 return StatusCode.Success
146 return StatusCode.Success
152 return StatusCode.Success
155 """Did this algorithm pass or fail its filter criterion for the last event?"""
159 """Set the filter passed flag to the specified state"""
164 return StatusCode.Success
179 """Base class for all services
182 kw.setdefault(
'OutputLevel', 3)
183 if name
is None: name = kw.get(
'name', self.__class__.__name__)
185 super(Svc, self).
__init__(name, **kw)
190 if hasattr(self,
'OutputLevel'):
197 return StatusCode.Success
200 if hasattr(self,
'OutputLevel'):
207 return StatusCode.Success
213 return StatusCode.Success
219 return StatusCode.Success
225 return StatusCode.Success
232 Base class from which all concrete algtool classes should be derived.
236 kw.setdefault(
'OutputLevel', 3)
237 if name
is None: name = kw.get(
'name', self.__class__.__name__)
238 if parent
is not None:
239 if isinstance(parent, str): name =
"%s.%s" % (parent,name)
240 else: name =
"%s.%s" % (parent.name(),name)
242 super(AlgTool, self).
__init__(name, **kw)
252 import AthenaPython.PyAthena
as PyAthena
259 import AthenaPython.PyAthena
as PyAthena
266 import AthenaPython.PyAthena
as PyAthena
271 if hasattr(self,
'OutputLevel'):
278 raise NotImplementedError(
279 "You have to implement PyAthena.AlgTool.initialize() !"
283 if hasattr(self,
'OutputLevel'):
290 self.msg.info(
"==> re-initialize..." )
291 return StatusCode.Success
297 raise NotImplementedError(
298 "You have to implement PyAthena.AlgTool.finalize() !"
306 Base class from which all concrete auditor classes should be derived.
309 kw.setdefault(
'OutputLevel', 3)
310 if name
is None: name = kw.get(
'name', self.__class__.__name__)
312 super(Aud, self).
__init__(name, **kw)
316 if hasattr(self,
'OutputLevel'):
323 raise NotImplementedError(
324 "You have to implement PyAthena.Aud.initialize() !"
331 raise NotImplementedError(
332 "You have to implement PyAthena.Aud.finalize() !"
340 def after(self, evt_name, comp_name, sc):
sysExecute(self, cppcontext)
setFilterPassed(self, state)
__init__(self, name=None, **kw)
_pyath_evtstore
init base class
__init__(self, name=None, **kw)
before(self, evt_name, comp_name)
default no-op implementation...
after(self, evt_name, comp_name, sc)
PyAthena.StatusCode ----------------------------------------------------—.
__init__(self, name=None, **kw)
str __component_type__
init base class
__wk_setattr__(self, k, v)
_get_prop_value(pycomp, propname)
helper methods ---------------------------------------------------------—