ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
MuonPRDTest
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
8
#include "
MuonPRDTest/PrdTesterModule.h
"
9
10
#include "
xAODBase/IParticleContainer.h
"
11
#include "
StoreGate/ReadDecorHandleKeyArray.h
"
12
13
namespace
MuonPRDTest
{
15
class
ParticleVariables
:
public
PrdTesterModule
{
16
public
:
17
ParticleVariables
(
MuonTesterTree
&
tree
,
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
:
85
SG::ReadHandleKey<xAOD::IParticleContainer>
m_key
{};
86
using
DecorKey_t
=
SG::ReadDecorHandleKey<xAOD::IParticleContainer>
;
87
SG::ReadDecorHandleKeyArray<xAOD::IParticleContainer>
m_decorKeys
{};
88
std::shared_ptr<IParticleFourMomBranch>
m_branch
{};
89
};
90
}
91
#endif
PrdTesterModule.h
ReadDecorHandleKeyArray.h
MuonPRDTest::ParticleVariables::addVariableGeV
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 ...
Definition
ParticleVariables.h:56
MuonPRDTest::ParticleVariables::m_branch
std::shared_ptr< IParticleFourMomBranch > m_branch
Definition
ParticleVariables.h:88
MuonPRDTest::ParticleVariables::m_key
SG::ReadHandleKey< xAOD::IParticleContainer > m_key
Definition
ParticleVariables.h:85
MuonPRDTest::ParticleVariables::declare_decorator
void declare_decorator(const std::string &decorName)
Declares the dependency on a decorator.
Definition
ParticleVariables.cxx:35
MuonPRDTest::ParticleVariables::m_decorKeys
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_decorKeys
Definition
ParticleVariables.h:87
MuonPRDTest::ParticleVariables::push_back
size_t push_back(const xAOD::IParticle *p)
Definition
ParticleVariables.cxx:46
MuonPRDTest::ParticleVariables::addVariable
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 ...
Definition
ParticleVariables.h:30
MuonPRDTest::ParticleVariables::addVariableGeV
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 ...
Definition
ParticleVariables.h:69
MuonPRDTest::ParticleVariables::fill
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...
Definition
ParticleVariables.cxx:17
MuonPRDTest::ParticleVariables::DecorKey_t
SG::ReadDecorHandleKey< xAOD::IParticleContainer > DecorKey_t
Definition
ParticleVariables.h:86
MuonPRDTest::ParticleVariables::addVariable
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 ...
Definition
ParticleVariables.h:42
MuonPRDTest::ParticleVariables::ParticleVariables
ParticleVariables(MuonTesterTree &tree, const std::string &containerKey, const std::string &outName, MSG::Level msglvl)
Definition
ParticleVariables.cxx:9
MuonPRDTest::ParticleVariables::declare_keys
bool declare_keys() override final
Definition
ParticleVariables.cxx:28
MuonPRDTest::PrdTesterModule::PrdTesterModule
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
Definition
PrdTesterModule.cxx:8
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition
StoreGate/StoreGate/ReadDecorHandleKey.h:86
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MuonPRDTest
Definition
MuonHitTesterAlg.h:15
SG::ReadDecorHandleKeyArray
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
Definition
StoreGate/StoreGate/ReadDecorHandleKeyArray.h:35
IParticleContainer.h
Generated on
for ATLAS Offline Software by
1.17.0