Definition at line 18 of file test_athena_root.py.
◆ StoreGateSvc_t
◆ __init__()
| test_athena_root.MyAlg.__init__ |
( |
| self, |
|
|
| name = 'MyAlg', |
|
|
** | kw ) |
Definition at line 20 of file test_athena_root.py.
20 def __init__(self, name='MyAlg', **kw):
21 kw['name'] = name
22 self.activeBranches = kw.get('activeBranches',
23 ['EventNumber',
24 'RunNumber',
25 ])
26 super(MyAlg, self).__init__(**kw)
27 return
28
◆ 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()
| test_athena_root.MyAlg.execute |
( |
| self | ) |
|
Definition at line 44 of file test_athena_root.py.
44 def execute(self):
45 self.msg.info('running execute...')
46 for br in self.activeBranches:
47 b = getattr(self.tree, br)
48 if hasattr(b, 'at'):
49 b = list(b)
50 self.msg.info('branch [%s]: %r', br, b)
51 return StatusCode.Success
52
◆ 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()
| test_athena_root.MyAlg.finalize |
( |
| self | ) |
|
Definition at line 53 of file test_athena_root.py.
53 def finalize(self):
54 return StatusCode.Success
55
◆ initialize()
| test_athena_root.MyAlg.initialize |
( |
| self | ) |
|
Definition at line 29 of file test_athena_root.py.
30
31 self.thSvc = PyAthena.py_svc('THistSvc', iface='ITHistSvc')
32 if not self.thSvc:
33 self.msg.
error(
"Could not retrieve THistSvc !")
34 return StatusCode.Failure
35
36 self.tree = self.thSvc.
get(
'/temp/TTreeStream/egamma',
37 klass='TTree')
38 if not self.tree:
39 self.msg.
error(
'could not retrieve tree from THistSvc')
40 return StatusCode.Failure
41
42 return StatusCode.Success
43
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
◆ 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()
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
◆ activeBranches
| test_athena_root.MyAlg.activeBranches |
Initial value:= kw.get('activeBranches',
['EventNumber',
'RunNumber',
])
Definition at line 22 of file test_athena_root.py.
◆ 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
◆ thSvc
| test_athena_root.MyAlg.thSvc = PyAthena.py_svc('THistSvc', iface='ITHistSvc') |
◆ tree
| test_athena_root.MyAlg.tree |
Initial value:= self.thSvc.
get(
'/temp/TTreeStream/egamma',
klass='TTree')
Definition at line 36 of file test_athena_root.py.
The documentation for this class was generated from the following file: