ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleVariables.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONPRDTEST_PARTICLEVARIABLES_H
6#define MUONPRDTEST_PARTICLEVARIABLES_H
7
9
12
13namespace MuonPRDTest{
16 public:
18 const std::string& containerKey,
19 const std::string& outName,
20 MSG::Level msglvl);
21
22 bool fill(const EventContext& ctx) override final;
23 bool declare_keys() override final;
29 template <typename T>
30 bool addVariable(const std::string& variable, const bool declareDep = false) {
31 if (declareDep) {
32 declare_decorator(variable);
33 }
34 return m_branch->addVariable<T>(variable);
35 }
36
41 template <typename T>
42 bool addVariable(const std::string& variable, const std::string& accName,
43 const bool declareDep = false) {
44 if (declareDep){
45 declare_decorator(variable);
46 }
47 return m_branch->addVariable<T>(variable, accName);
48 }
49
55 template <typename T>
56 bool addVariableGeV(const std::string& variable, const bool declareDep = false) {
57 if (declareDep) {
58 declare_decorator(variable);
59 }
60 return m_branch->addVariableGeV<T>(variable);
61 }
62
68 template <typename T>
69 bool addVariableGeV(const std::string& variable, const std::string& accName,
70 const bool declareDep = false) {
71 if (declareDep){
72 declare_decorator(variable);
73 }
74 return m_branch->addVariableGeV<T>(variable, accName);
75 }
76
77 bool addVariable(std::shared_ptr<IParticleDecorationBranch> branch);
78 size_t push_back(const xAOD::IParticle* p);
79
82 void declare_decorator(const std::string& decorName);
83
84 private:
88 std::shared_ptr<IParticleFourMomBranch> m_branch{};
89 };
90}
91#endif
bool addVariableGeV(const std::string &variable, const bool declareDep=false)
Adds a variable of the primitive data type that can be directly read-off from the xAOD::IParticle as ...
std::shared_ptr< IParticleFourMomBranch > m_branch
SG::ReadHandleKey< xAOD::IParticleContainer > m_key
void declare_decorator(const std::string &decorName)
Declares the dependency on a decorator.
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_decorKeys
size_t push_back(const xAOD::IParticle *p)
bool addVariable(const std::string &variable, const bool declareDep=false)
Adds a variable of the primitive data type that can be directly read-off from the xAOD::IParticle as ...
bool addVariableGeV(const std::string &variable, const std::string &accName, const bool declareDep=false)
Adds a variable of the primitive data type that can be directly read-off from the xAOD::IParticle as ...
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
SG::ReadDecorHandleKey< xAOD::IParticleContainer > DecorKey_t
bool addVariable(const std::string &variable, const std::string &accName, const bool declareDep=false)
Adds a variable of the primitive data type that can be directly read-off from the xAOD::IParticle as ...
ParticleVariables(MuonTesterTree &tree, const std::string &containerKey, const std::string &outName, MSG::Level msglvl)
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
TTree * tree() override final
Returns the underlying TTree object.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Class providing the definition of the 4-vector interface.
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray