The Delphes python analysis code relies on PyROOT’s MakeRootClass() method for the pythonisation of user-defined classes (see https://github.com/delphes/delphes/blob/master/python/DelphesAnalysis/Delphes.py#L30). This method seems have been obsoleted in recent ROOT versions. What is the currently recommended way to perform such pythonisations?
The API you are using to add pythonizations is internal to PyROOT (
MakeRootClass) and it changed already in ROOT 6.04.
However, you can get the same functionality now by invoking
Thanks, that solved my problem.
Glad that helped. I just wanted to add that we are working on supporting pythonizations for user classes via a public API. The idea would be something like:
klass.__iter__ = custom_iterator_generator
That would make it easier for you to add those pythonizations (no need for
CreateScopeProxy or similar anymore) and it would make the pythonization lazy: only if you use a given class from your python script, the pythonizations for that class would be applied.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.