ATLAS Offline Software
Loading...
Searching...
No Matches
AsgxAODMetNTupleMakerAlg.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef ASGANALYSISALGORITHMS_ASGXAODMETNTUPLEMAKERALG_H
6#define ASGANALYSISALGORITHMS_ASGXAODMETNTUPLEMAKERALG_H
7
8// // Framework include(s):
15
16// EDM include(s):
18
19namespace CP {
20
36
37 public:
39 AsgxAODMetNTupleMakerAlg( const std::string& name, ISvcLocator* svcLoc );
40
43
45 StatusCode initialize() override;
46
48 StatusCode execute() override;
49
51 StatusCode finalize() override;
52
54
55 private:
57 StatusCode setupTree();
58
60 StatusCode setupBranch( const std::string &branchDecl,
61 const CP::SystematicSet &sys );
62
65
67 Gaudi::Property<std::string> m_treeName {this, "TreeName", "physics", "Name of the tree to write"};
69 Gaudi::Property<std::vector< std::string >> m_branches {this, "Branches", {}, "Branches to write to the output tree"};
70
72
80
81 public:
89
99 StatusCode process( const SG::AuxElement& element );
100
117 StatusCode addBranch( TTree& tree, const std::string& auxName,
118 const std::string& branchName,
119 bool allowMissing,
120 bool &created );
121
122 private:
139
140 public:
155 StatusCode setup( TTree& tree, const std::string& auxName,
156 const std::string& branchName,
157 MsgStream& msg );
158
171 StatusCode process( const SG::AuxElement& element,
172 MsgStream& msg );
173
175 std::string m_branchName;
177 std::unique_ptr< SG::TypelessConstAccessor > m_acc;
181 std::unique_ptr< SG::IAuxTypeVector > m_data;
183 void* m_dataPtr = nullptr;
184
185 }; // class BranchProcessor
186
196 std::list< BranchProcessor > m_branches;
197
198 }; // class ElementProcessor
199
202
204 TTree* m_tree = nullptr;
205
207 std::unordered_map< std::string, ElementProcessor > m_elements;
208
215 bool m_isInitialized = false;
216
217 Gaudi::Property<std::string> m_termName {this, "termName", "Final", "the name of the MissingET term to save"};
218
220 ServiceHandle<ISystematicsSvc> m_systematicsService {this, "systematicsSvc", "SystematicsSvc", "systematics service"};
221
223
224 }; // class AsgxAODMetNTupleMakerAlg
225
226} // namespace CP
227
228#endif // ASGANALYSISALGORITHMS_ASGXAODNTUPLEMAKERALG_H
Base class for elements of a container that can have aux data.
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::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.
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.
TTree * m_tree
The tree being written.
std::unordered_map< std::string, ElementProcessor > m_elements
Objects to write branches from.
ServiceHandle< ISystematicsSvc > m_systematicsService
the handle for the systematics service
StatusCode setupBranch(const std::string &branchDecl, const CP::SystematicSet &sys)
Function setting up an individual branch on the first event.
Gaudi::Property< std::vector< std::string > > m_branches
The branches to write into this output tree.
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 finalize() override
Function executed as part of the job finalisation.
AsgxAODMetNTupleMakerAlg(const std::string &name, ISvcLocator *svcLoc)
Algorithm constructor.
StatusCode setupTree()
Function setting up the internal data structures on the first event.
StatusCode execute() override
Function executed once per event.
Gaudi::Property< std::string > m_termName
Class to wrap a set of SystematicVariations.
the (new) base class for EventLoop algorithms
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
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.
Definition Init.cxx:105
void initialize()