#include <PyAthenaAlg.h>
Inherits IPyComponent, and AthAlgorithm.
Inherited by AthDictLoaderSvc_test.AthDictLoaderTestAlg, CopyTruthParticlesAlg.CopyTruthParticlesAlg, HECNoiseD3PDMaker.HECNoiseD3PDMaker, L1CaloDumpRampDataAlgorithm.L1CaloDumpRampDataAlgorithm, LArCellNtuple.CellE, LArNoisyROSummNtuple.NoisyRO, LogicalExpressionFilter.LogicalExpressionFilter, python.BeamSpotUpdate.BeamSpotWriteAlg, python.DQPostProcessingAlg.DQPostProcessingAlg, python.DumperConfig.Dumper, python.EvgenAlg.EvgenAlg, python.EvgenAnalysisAlg.EvgenAnalysisAlg, python.FilePeekerLib.FilePeeker, python.FilterUtils.BCIDFilter, python.FilterUtils.LBFilter, python.FilterUtils.LBPrinter, python.FilterUtils.LumiBlockFilter, python.FilterUtils.ZFilter, python.LArBadChannelBrowserLib.LArBadChannelBrowserAlg, python.LArBlobMergeAlg.LArBlobMergeAlg, python.LArCellConditionsAlg.LArCellConditionsAlg, python.Lib.PyClidsTestWriter, python.Lib.PyReadFatObject, python.Lib.PyReadNonThinnedData, python.Lib.PySgStressConsumer, python.Lib.PySgStressProducer, python.Lib.PyWriteThinnedData, python.POOL2EI_Lib.POOL2EI, python.PublicStreamFilter.PublicStreamFilter, python.PyComps.DataProxyLoader, python.PyComps.PyEvtFilter, python.PyComps.PyReader, python.PyComps.PySgDumper, python.PyComps.PyWriter, python.ReOrderMcEventCollection.FixMcEventCollection, python.egammaD3PDConfig.MergeElectrons, python.tests.PyTHistTestsLib.PyHistReader, python.tests.PyTHistTestsLib.PyHistWriter, python.tests.PyTestsLib.MyAlg, test_athena_evtstore_root.MyAlg, test_athena_root.MyAlg, and test_athena_variable_shape_ntuple.MyAlg.
|
| | Alg (const std::string &name, ISvcLocator *pSvcLocator) |
| | Constructor:
|
| virtual | ~Alg () |
| | Destructor:
|
| virtual StatusCode | initialize () override |
| virtual StatusCode | reinitialize () override |
| virtual StatusCode | start () override |
| virtual StatusCode | execute () override |
| virtual StatusCode | stop () override |
| virtual StatusCode | finalize () override |
| virtual StatusCode | sysInitialize () override |
| | Override sysInitialize.
|
| virtual const char * | typeName () const override |
| | 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
|
| virtual PyObject * | self () override |
| | return associated python object.
|
| | DeclareInterfaceID (IPyComponent, 1, 0) |
| virtual const DataObjIDColl & | extraOutputDeps () const override |
| | Return the list of extra output dependencies.
|
| ServiceHandle< StoreGateSvc > & | evtStore () |
| | The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
|
| const ServiceHandle< StoreGateSvc > & | detStore () const |
| | The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
|
| virtual StatusCode | sysStart () override |
| | Handle START transition.
|
| virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| | Return this algorithm's input handles.
|
| virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| | Return this algorithm's output handles.
|
| Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
| void | updateVHKA (Gaudi::Details::PropertyBase &) |
| MsgStream & | msg () const |
| bool | msgLvl (const MSG::Level lvl) const |
Definition at line 31 of file PyAthenaAlg.h.
◆ StoreGateSvc_t
◆ Alg() [1/2]
| Alg::Alg |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
Constructor:
Definition at line 40 of file PyAthenaAlg.cxx.
40 :
43{}
PyObject * m_self
Pointer to self (from the python world)
◆ ~Alg()
Destructor:
Definition at line 47 of file PyAthenaAlg.cxx.
48{
51 RootUtils::PyGILStateEnsure ensure;
54 }
55}
◆ Alg() [2/2]
◆ 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)
◆ DeclareInterfaceID()
◆ 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()
| StatusCode Alg::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 93 of file PyAthenaAlg.cxx.
94{
95
96 RootUtils::PyGILStateEnsure ensure;
97 PyObject* pycontext = PyCapsule_New (
const_cast<EventContext*
>(&getContext()),
nullptr,
nullptr);
98
100 Py_DECREF (pycontext);
102}
::StatusCode StatusCode
StatusCode definition for legacy code.
◆ 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()
| StatusCode Alg::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
| StatusCode Alg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 60 of file PyAthenaAlg.cxx.
61{
63 return PyAthena::callPyMethod(
m_self,
"sysInitialize" );
64}
◆ 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.
◆ reinitialize()
| StatusCode Alg::reinitialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 67 of file PyAthenaAlg.cxx.
68{
70 return PyAthena::callPyMethod(
m_self,
"sysReinitialize" );
71}
◆ 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 |
( |
| ) |
|
|
inlineoverridevirtual |
◆ setPyAttr()
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()
| StatusCode Alg::start |
( |
| ) |
|
|
overridevirtual |
◆ stop()
◆ sysInitialize()
| StatusCode Alg::sysInitialize |
( |
| ) |
|
|
overridevirtual |
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 |
|
overridevirtual |
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
◆ 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
The documentation for this class was generated from the following files: