A simple python algorithm to retrieve PayLoads
Definition at line 76 of file StoreGateTests/python/Lib.py.
◆ StoreGateSvc_t
◆ __init__()
| python.Lib.PySgStressConsumer.__init__ |
( |
| self, |
|
|
| name = "PySgStressProducer", |
|
|
** | kw ) |
Definition at line 79 of file StoreGateTests/python/Lib.py.
79 def __init__(self, name = "PySgStressProducer", **kw):
80
81 kw['name'] = name
82 super(PySgStressConsumer,self).__init__(**kw)
83
84 if 'DataName' not in kw: self.DataName = "MyData"
85 if 'NbrOfObjects' not in kw: self.NbrOfObjects = 1000
86
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ evtStore()
◆ execute()
| python.Lib.PySgStressConsumer.execute |
( |
| self | ) |
|
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
| const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
51{
52
53
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects
◆ finalize()
| python.Lib.PySgStressConsumer.finalize |
( |
| self | ) |
|
Definition at line 115 of file StoreGateTests/python/Lib.py.
115 def finalize(self):
116 self.msg.info( "Finalizing %s...", self.name )
117 return StatusCode.Success
118
◆ initialize()
| python.Lib.PySgStressConsumer.initialize |
( |
| self | ) |
|
Definition at line 87 of file StoreGateTests/python/Lib.py.
88 self.msg.info( "Initializing %s...", self.name )
89 self.sg = PyAthena.py_svc("StoreGateSvc")
90 if not self.sg:
91 self.msg.error ("could not retrieve event store")
92 return StatusCode.Failure
93 return StatusCode.Success
94
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg()
◆ msgLvl()
| bool AthCommonMsg< Algorithm >::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inlineinherited |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ readData()
| python.Lib.PySgStressConsumer.readData |
( |
| self | ) |
|
Definition at line 99 of file StoreGateTests/python/Lib.py.
99 def readData(self):
100 allGood = True
101 for i in range(self.NbrOfObjects):
102 outName = "%s_payload_%i" % (self.DataName, i)
103 dv = self.sg.retrieve( "SgTests::PayLoadDv", outName )
104 if dv is None:
105 self.msg.
error(
"Could not retrieve payload !!" )
106 allGood = False
107
108 data = dv.at(0).m_data
109 if data.empty():
110 self.msg.
error(
"**NOT** my data!!" )
111 allGood = False
112 if allGood: return StatusCode.Success
113 return StatusCode.Failure
114
◆ reinitialize()
Definition at line 67 of file PyAthenaAlg.cxx.
68{
70 return PyAthena::callPyMethod(
m_self,
"sysReinitialize" );
71}
PyObject * m_self
Pointer to self (from the python world)
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
◆ renounceArray()
◆ self()
| virtual PyObject * PyAthena::Alg::self |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ setPyAttr()
|
|
overrideprotectedvirtualinherited |
attach the C++ component to its python cousin
Implements IPyComponent.
Definition at line 143 of file PyAthenaAlg.cxx.
144{
145
146 RootUtils::PyGILStateEnsure ensure;
147 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
149 if ( !pyobj ) {
150 PyErr_Clear();
151
152 pyobj = TPython::CPPInstance_FromVoidPtr ((void*)this, "PyAthena::Alg");
154 (
"could not dyncast component [" <<
name() <<
"] to a python "
155 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
156 <<
"dictionary)" <<
endmsg
157 << "fallback to [PyAthena::Alg]...");
158 }
159 if ( !pyobj ) {
160 PyErr_Clear();
162 <<
name() <<
"] to a pyobject of type ["
164 } else {
165 if ( -1 == PyObject_SetAttrString(o, "_cppHandle", pyobj) ) {
166 PyErr_Clear();
168 (
"Could not attach C++ handle [" <<
name() <<
"] to its python "
169 << "cousin !");
170 if ( -1 == PyObject_SetAttrString(o, "_cppHandle", Py_None) ) {
171 PyErr_Clear();
173 (
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
174 "python cousin !");
175 }
176 } else {
177 return true;
178 }
179 }
180 return false;
181}
#define ATH_MSG_WARNING(x)
virtual const char * typeName() const override
return the std::type_info name of the underlying py-component This is used by concrete implementation...
◆ start()
◆ stop()
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthAlgorithm.
Definition at line 105 of file PyAthenaAlg.cxx.
106{
107 ServiceHandle<IPyComponentMgr> pyMgr
108 (
"PyAthena::PyComponentMgr/PyComponentMgr",
name() );
109 if ( !pyMgr.retrieve().isSuccess() ) {
110 ATH_MSG_ERROR(
"Could not retrieve service [" << pyMgr.typeAndName()
111 << "] !!");
112 return StatusCode::FAILURE;
113 }
114
115
116 m_self = pyMgr->pyObject(
this );
117
118 if (
m_self == Py_None ) {
120 return StatusCode::FAILURE;
121 }
122
123
125}
virtual StatusCode sysInitialize() override
Override sysInitialize.
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ typeName()
| const char * Alg::typeName |
( |
| ) |
const |
|
overridevirtualinherited |
return the std::type_info name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part
Implements IPyComponent.
Definition at line 132 of file PyAthenaAlg.cxx.
133{
134 static const std::string tname = System::typeinfoName(typeid(*this));
135 return tname.c_str();
136}
◆ updateVHKA()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ DataName
| str python.Lib.PySgStressConsumer.DataName = "MyData" |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
| DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_self
Pointer to self (from the python world)
Definition at line 96 of file PyAthenaAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ name
| python.Lib.PySgStressConsumer.name |
◆ NbrOfObjects
| python.Lib.PySgStressConsumer.NbrOfObjects = 1000 |
◆ sg
| python.Lib.PySgStressConsumer.sg = PyAthena.py_svc("StoreGateSvc") |
The documentation for this class was generated from the following file: