![]() |
ATLAS Offline Software
|
A Python wrapper around xAOD::TPyEvent. More...
Public Member Functions | |
| def | __init__ (self, mode=ROOT.xAOD.TEvent.kClassAccess) |
| Constructor for the class. More... | |
| def | __getitem__ (self, key) |
| Convenient shorthand for retrieving an object. More... | |
| def | contains (self, key, type) |
| Convenient version of the base class's contains function. More... | |
| def | transientContains (self, key, type) |
| Convenient version of the base class's transientContains function. More... | |
| def | record (self, obj, key) |
| Convenient version of the base class's record function. More... | |
A Python wrapper around xAOD::TPyEvent.
In order to make the semi-templated functions of xAOD::TPyEvent more convenient to use from PyROOT, the user is supposed to use an instance of this class, and not ROOT.xAOD.TPyEvent directly.
Definition at line 17 of file TPyEvent.py.
| def python.TPyEvent.TPyEvent.__init__ | ( | self, | |
mode = ROOT.xAOD.TEvent.kClassAccess |
|||
| ) |
| def python.TPyEvent.TPyEvent.__getitem__ | ( | self, | |
| key | |||
| ) |
Convenient shorthand for retrieving an object.
Definition at line 27 of file TPyEvent.py.
| def python.TPyEvent.TPyEvent.contains | ( | self, | |
| key, | |||
| type | |||
| ) |
Convenient version of the base class's contains function.
This function allows the user to, instead of figuring out the exact type name of some C++ type, to rather write code like:
if event.contains( "Electrons", ROOT.xAOD.ElectronContainer ):
| key | The string key of the object to check for |
| type | The type of the object we are looking for |
True if the object is available in the event, False if it's not Definition at line 44 of file TPyEvent.py.
| def python.TPyEvent.TPyEvent.record | ( | self, | |
| obj, | |||
| key | |||
| ) |
Convenient version of the base class's record function.
This is the main function of this wrapper class. It allows the user to record objects into an output file like:
el = ROOT.xAOD.ElectronContainer() event.record( el, "MyElectrons" )
| obj | The object to be recorded into the output file |
| key | The key (branch name) for the object |
StatusCode::SUCCESS if all was successful, or StatusCode::FAILURE if not Definition at line 93 of file TPyEvent.py.
| def python.TPyEvent.TPyEvent.transientContains | ( | self, | |
| key, | |||
| type | |||
| ) |
Convenient version of the base class's transientContains function.
This function allows the used to, instead of figuring out the exact type name of some C++ type, to rather write code like:
if event.transientContains( "MyElectrons",
ROOT.xAOD.ElectronContainer ):
| key | The string key of the object to check for |
| type | The type of the object we are looking for |
True if the object is available in the event in a modifyable form, False if it's not Definition at line 68 of file TPyEvent.py.
1.8.18