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 | process (const SG::AuxElement &element, 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.
Definition at line 138 of file AsgxAODMetNTupleMakerAlg.h.
StatusCode CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::process | ( | const SG::AuxElement & | element, |
MsgStream & | msg | ||
) |
Function processing the object, filling the variable.
This function is called by ElementProcessor
, to extract one variable from the standalone object, and move its payload into the memory address from which the output tree is writing its branch.
element | The standalone object to get the auxiliary variable from |
msg | Reference to the parent's MsgStream object |
StatusCode
values Definition at line 529 of file AsgxAODMetNTupleMakerAlg.cxx.
StatusCode CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::setup | ( | TTree & | tree, |
const std::string & | auxName, | ||
const std::string & | branchName, | ||
MsgStream & | msg | ||
) |
Function setting up the object, and the branch.
This is pretty much the constructor of the class. I just decided to implement it as a regular function and not a "real" constructor, to be able to return a StatusCode
value from the call. Since the setup of the object may very well fail.
tree | The tree to set up the new branch in |
auxName | The name of the auxiliary variable to create a branch from |
branchName | Name of the branch to create in the tree |
msg | Reference to the parent's MsgStream object |
StatusCode
values Definition at line 435 of file AsgxAODMetNTupleMakerAlg.cxx.
std::unique_ptr< SG::AuxElement::TypelessConstAccessor > CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::m_acc |
Object accessing the variable in question.
Definition at line 177 of file AsgxAODMetNTupleMakerAlg.h.
std::string CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::m_branchName |
Name of the branch being written.
Definition at line 175 of file AsgxAODMetNTupleMakerAlg.h.
std::unique_ptr< SG::IAuxTypeVector > CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::m_data |
The object managing the memory of the written variable.
Definition at line 181 of file AsgxAODMetNTupleMakerAlg.h.
void* CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::m_dataPtr = nullptr |
Helper variable, pointing at the object to be written.
Definition at line 183 of file AsgxAODMetNTupleMakerAlg.h.
const SG::IAuxTypeVectorFactory* CP::AsgxAODMetNTupleMakerAlg::ElementProcessor::BranchProcessor::m_factory = nullptr |
Pointer to the helper object that handles this variable.
Definition at line 179 of file AsgxAODMetNTupleMakerAlg.h.