ATLAS Offline Software
|
Class writing one variable from an xAOD object into a branch. More...
Public Member Functions | |
StatusCode | setup (TTree &tree, const std::string &auxName, const std::string &branchName, MsgStream &msg) |
Function setting up the object, and the branch. More... | |
StatusCode | resize (size_t size, MsgStream &msg) |
Function (re)sizing the variable for a new event. More... | |
StatusCode | process (const SG::AuxElement &element, size_t index, MsgStream &msg) |
Function processing the object, filling the variable. More... | |
Public Attributes | |
std::string | m_branchName |
Name of the branch being written. More... | |
std::unique_ptr< SG::AuxElement::TypelessConstAccessor > | m_acc |
Object accessing the variable in question. More... | |
const SG::IAuxTypeVectorFactory * | m_factory = nullptr |
Pointer to the helper object that handles this variable. More... | |
std::unique_ptr< SG::IAuxTypeVector > | m_data |
The object managing the memory of the written variable. More... | |
void * | m_dataPtr = nullptr |
Helper variable, pointing at the object to be written. More... | |
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 ElementProcessor::BranchProcessor
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 301 of file AsgxAODNTupleMakerAlg.h.
StatusCode CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::process | ( | const SG::AuxElement & | element, |
size_t | index, | ||
MsgStream & | msg | ||
) |
Function processing the object, filling the variable.
Definition at line 1010 of file AsgxAODNTupleMakerAlg.cxx.
StatusCode CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::resize | ( | size_t | size, |
MsgStream & | msg | ||
) |
Function (re)sizing the variable for a new event.
Definition at line 993 of file AsgxAODNTupleMakerAlg.cxx.
StatusCode CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::setup | ( | TTree & | tree, |
const std::string & | auxName, | ||
const std::string & | branchName, | ||
MsgStream & | msg | ||
) |
Function setting up the object, and the branch.
Definition at line 930 of file AsgxAODNTupleMakerAlg.cxx.
std::unique_ptr< SG::AuxElement::TypelessConstAccessor > CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::m_acc |
Object accessing the variable in question.
Definition at line 317 of file AsgxAODNTupleMakerAlg.h.
std::string CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::m_branchName |
Name of the branch being written.
Definition at line 315 of file AsgxAODNTupleMakerAlg.h.
std::unique_ptr< SG::IAuxTypeVector > CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::m_data |
The object managing the memory of the written variable.
Definition at line 321 of file AsgxAODNTupleMakerAlg.h.
void* CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::m_dataPtr = nullptr |
Helper variable, pointing at the object to be written.
Definition at line 323 of file AsgxAODNTupleMakerAlg.h.
const SG::IAuxTypeVectorFactory* CP::AsgxAODNTupleMakerAlg::ContainerProcessor::BranchProcessor::m_factory = nullptr |
Pointer to the helper object that handles this variable.
Definition at line 319 of file AsgxAODNTupleMakerAlg.h.