5#ifndef ASGANALYSISALGORITHMS_ASGXAODNTUPLEMAKERALG_H
6#define ASGANALYSISALGORITHMS_ASGXAODNTUPLEMAKERALG_H
9#include <unordered_map>
30class TVirtualCollectionProxy;
84 StatusCode
setupBranch(
const std::string &branchDecl,
91 Gaudi::Property<std::string>
m_treeName {
this,
"TreeName",
"physics",
"Name of the tree to write"};
93 Gaudi::Property<std::vector<std::string>>
m_branches {
this,
"Branches", {},
"Branches to write to the output tree"};
141 StatusCode
addBranch( TTree&
tree,
const std::string& auxName,
142 const std::string& branchName,
179 StatusCode
setup( TTree&
tree,
const std::string& auxName,
180 const std::string& branchName,
201 std::unique_ptr< SG::TypelessConstAccessor >
m_acc;
205 std::unique_ptr< SG::IAuxTypeVector >
m_data;
274 StatusCode
addBranch( TTree&
tree,
const std::string& auxName,
275 const std::string& branchName,
305 StatusCode
setup( TTree&
tree,
const std::string& auxName,
306 const std::string& branchName,
309 StatusCode
resize(
size_t size, MsgStream&
msg );
317 std::unique_ptr< SG::TypelessConstAccessor >
m_acc;
321 std::unique_ptr< SG::IAuxTypeVector >
m_data;
351 std::unordered_map< std::string, ElementProcessor >
m_elements;
Base class for elements of a container that can have aux data.
Abstract interface for manipulating vectors of arbitrary types.
Define macros for attributes used to control the static checker.
TTree * tree(const std::string &treeName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered TTrees.
Class writing one variable from an xAOD object into a branch.
std::unique_ptr< SG::IAuxTypeVector > m_data
The object managing the memory of the written variable.
std::string m_branchName
Name of the branch being written.
const SG::IAuxTypeVectorFactory * m_factory
Pointer to the helper object that handles this variable.
void * m_dataPtr
Helper variable, pointing at the object to be written.
std::unique_ptr< SG::TypelessConstAccessor > m_acc
Object accessing the variable in question.
StatusCode resize(size_t size, MsgStream &msg)
Function (re)sizing the variable for a new event.
std::list< BranchProcessor > m_branches
List of branch processors set up for this xAOD object.
ContainerProcessor()
Default constructor.
StatusCode addBranch(TTree &tree, const std::string &auxName, const std::string &branchName, bool allowMissing, bool &created)
Add one branch to the output tree.
TVirtualCollectionProxy * m_collProxy
Collection proxy used for iterating over the container.
int m_auxElementOffset
Offset of the element type to SG::AuxElement.
Class writing one variable from an xAOD object into a branch.
std::unique_ptr< SG::TypelessConstAccessor > m_acc
Object accessing the variable in question.
const SG::IAuxTypeVectorFactory * m_factory
Pointer to the helper object that handles this variable.
void * m_dataPtr
Helper variable, pointing at the object to be written.
std::string m_branchName
Name of the branch being written.
std::unique_ptr< SG::IAuxTypeVector > m_data
The object managing the memory of the written variable.
StatusCode addBranch(TTree &tree, const std::string &auxName, const std::string &branchName, bool allowMissing, bool &created)
Add one branch to the output tree.
std::list< BranchProcessor > m_branches
List of branch processors set up for this xAOD object.
ElementProcessor()
Default constructor.
Algorithm that can write a simple ntuple from xAOD objects/variables.
ServiceHandle< ISystematicsSvc > m_systematicsService
the handle for the systematics service
StatusCode execute() override
Function executed once per event.
StatusCode setupBranch(const std::string &branchDecl, const CP::SystematicSet &sys)
Function setting up an individual branch on the first event.
std::unordered_map< std::string, ElementProcessor > m_elements
Objects to write branches from.
StatusCode finalize() override
Function executed as part of the job finalisation.
bool m_isInitialized
Internal status flag, showing whether the algorithm is initialised.
Gaudi::Property< std::string > m_treeName
The name of the output tree to write.
StatusCode setupTree()
Function setting up the internal data structures on the first event.
TTree * m_tree
The tree being written.
Gaudi::Property< std::vector< std::string > > m_branches
The branches to write into this output tree.
std::unordered_map< std::string, ContainerProcessor > m_containers
Containers to write branches from.
Class to wrap a set of SystematicVariations.
the (new) base class for EventLoop algorithms
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Base class for elements of a container that can have aux data.
Manage index tracking and synchronization of auxiliary data.
Interface for factory objects that create vectors.
Class mimicking the AthMessaging class from the offline software.
MsgStream & msg() const
The standard message stream.
bool setup(asg::AnaToolHandle< Interface > &tool, const std::string &type, const std::vector< std::string > &config, const std::string &progressFile="")
mostly useful for athena, which will otherwise re-use the previous tool
const std::string process
Select isolated Photons, Electrons and Muons.
void ErrorHandler ATLAS_NOT_THREAD_SAFE(Int_t level, Bool_t abort, const char *location, const char *message)
Function filtering the warnings coming from ROOT.