![]() |
ATLAS Offline Software
|
Class writing one variable from an xAOD object into a branch. More...
#include <TreeBranchHelpers.h>
Public Member Functions | |
| StatusCode | setup (TTree &tree, const BranchConfig &branchConfig, OutputBranchData &outputData, MsgStream &msg) |
| Function setting up the object, and the branch. | |
| StatusCode | resize (size_t size, MsgStream &msg) |
| Function (re)sizing the variable for a new event. | |
| StatusCode | process (const SG::AuxElement &element, size_t index, MsgStream &msg) |
| Function processing the object, filling the variable. | |
Public Attributes | |
| std::string | m_branchName |
| Name of the branch being written. | |
| std::unique_ptr< SG::TypelessConstAccessor > | m_acc |
| Object accessing the variable in question. | |
| const SG::IAuxTypeVectorFactory * | m_factory = nullptr |
| Pointer to the helper object that handles this variable. | |
| std::unique_ptr< SG::IAuxTypeVector > | m_data |
| The object managing the memory of the written variable. | |
| void * | m_dataPtr = nullptr |
| Helper variable, pointing at the object to be written. | |
Class writing one variable from an xAOD object into a branch.
It is used for both setting up the branch in the outut TTree during the setup of the tree, and then to fill the "output
variable" with the right payload during the event processing.
Note that since we may have a lot of such objects, I didn't want to make it inherit from asg::AsgMessaging. Which means that all of the class's functions need to receive its parent's message stream object to be able to log error messages "nicely".
Also note that since this is very much an internal class, all of its members are public. Since the owner of such objects should know perfectly well how they behave.
Finally, note that it is more complicated than the ElementBranchProcessor class. Since in this case we need to explicitly deal with std::vector types, which we need to fill explicitly when extracting the variables from the xAOD objects.
Definition at line 285 of file TreeBranchHelpers.h.
| StatusCode CP::TreeBranchHelpers::ContainerBranchProcessor::process | ( | const SG::AuxElement & | element, |
| size_t | index, | ||
| MsgStream & | msg ) |
Function processing the object, filling the variable.
Definition at line 733 of file TreeBranchHelpers.cxx.
| StatusCode CP::TreeBranchHelpers::ContainerBranchProcessor::resize | ( | size_t | size, |
| MsgStream & | msg ) |
Function (re)sizing the variable for a new event.
Definition at line 716 of file TreeBranchHelpers.cxx.
| StatusCode CP::TreeBranchHelpers::ContainerBranchProcessor::setup | ( | TTree & | tree, |
| const BranchConfig & | branchConfig, | ||
| OutputBranchData & | outputData, | ||
| MsgStream & | msg ) |
Function setting up the object, and the branch.
Definition at line 668 of file TreeBranchHelpers.cxx.
| std::unique_ptr< SG::TypelessConstAccessor > CP::TreeBranchHelpers::ContainerBranchProcessor::m_acc |
Object accessing the variable in question.
Definition at line 299 of file TreeBranchHelpers.h.
| std::string CP::TreeBranchHelpers::ContainerBranchProcessor::m_branchName |
Name of the branch being written.
Definition at line 297 of file TreeBranchHelpers.h.
| std::unique_ptr< SG::IAuxTypeVector > CP::TreeBranchHelpers::ContainerBranchProcessor::m_data |
The object managing the memory of the written variable.
Definition at line 303 of file TreeBranchHelpers.h.
| void* CP::TreeBranchHelpers::ContainerBranchProcessor::m_dataPtr = nullptr |
Helper variable, pointing at the object to be written.
Definition at line 305 of file TreeBranchHelpers.h.
| const SG::IAuxTypeVectorFactory* CP::TreeBranchHelpers::ContainerBranchProcessor::m_factory = nullptr |
Pointer to the helper object that handles this variable.
Definition at line 301 of file TreeBranchHelpers.h.