#include <TPyEvent.h>
Public Member Functions | |
TPyEvent () | |
Default constructor. | |
::Bool_t | contains (const std::string &key, const std::string &type) |
Function checking if an object is available from the store. | |
::Bool_t | transientContains (const std::string &key, const std::string &type) const |
Function checking if an object is already in memory. | |
TReturnCode | record (void *obj, const std::string &key, const std::string &type,::Int_t basketSize=32000,::Int_t splitLevel=0) |
Add an output object to the event. |
Python interface to xAOD::TEvent
In order to make it possible to record objects that are created in Python, into an xAOD::TEvent object (in order to record selected objects into an output file for instance), this class extends the xAOD::TEvent object with some non-template functions. Functions that are inconvenient to use from C++, but which allow for much more flexibility in PyROOT.
TReturnCode xAOD::TPyEvent::record | ( | void * | obj, | |
const std::string & | key, | |||
const std::string & | type, | |||
::Int_t | basketSize = 32000 , |
|||
::Int_t | splitLevel = 0 | |||
) |
Add an output object to the event.
This function is designed to be callable from PyROOT in order to record hand-made containers into an output file.
Notice that unline TEvent::record(...), this function doesn't take ownership of the object that's given to it. That's because all objects created by the Python interpreter are garbage collected by the Python interpreter. And we don't want to run into double-deletes.
obj | Typeless pointer to the object that is to be recorded | |
key | The key with which the object is to be recorded | |
type | The type name of the object being recorded | |
basketSize | The size of the baskets used to write the payload | |
splitLevel | The split level of the branch created |