ATLAS Offline Software
InnerDetector
InDetValidation
InDetTrackPerfMon
src
TruthDecoratorAlg.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef INDETTRACKPERFMON_TruthDECORATORALG_H
6
#define INDETTRACKPERFMON_TruthDECORATORALG_H
7
16
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
18
#include "
MCTruthClassifier/IMCTruthClassifier.h
"
19
21
#include "
xAODTruth/TruthParticleContainer.h
"
22
23
25
#include <string>
26
#include <vector>
27
29
#include "
SafeDecorator.h
"
30
31
32
namespace
IDTPM
{
33
34
class
TruthDecoratorAlg
:
35
public
AthReentrantAlgorithm
{
36
37
public
:
38
39
TruthDecoratorAlg
(
const
std::string&
name
, ISvcLocator* pSvcLocator );
40
41
virtual
~TruthDecoratorAlg
() =
default
;
42
43
virtual
StatusCode
initialize
()
override
;
44
45
virtual
StatusCode
execute
(
const
EventContext& ctx )
const override
;
46
47
private
:
48
49
SG::ReadHandleKey<xAOD::TruthParticleContainer>
m_truthParticlesName
{
50
this
,
"TruthParticleContainerName"
,
"TruthParticles"
,
"Name of container of truth particles"
};
51
52
StringProperty
m_prefix
{
this
,
"Prefix"
,
"Truth_"
,
"Decoration prefix to avoid clashes"
};
53
54
StatusCode
decorateTruthParticle
(
55
const
xAOD::TruthParticle
& truth,
56
std::vector<
IDTPM::OptionalDecoration< xAOD::TruthParticleContainer, int >
>& truth_decor )
const
;
57
58
59
enum
TruthDecorations
:
size_t
{
60
Type
,
61
Origin
,
62
NDecorations
63
};
64
65
const
std::vector< std::string >
m_decor_truth_names
{
66
"truthType"
,
67
"truthOrigin"
68
};
69
70
std::vector<
IDTPM::WriteKeyAccessorPair
<
xAOD::TruthParticleContainer
,
71
int
> >
m_decor_truth
{};
72
73
74
PublicToolHandle< IMCTruthClassifier >
m_truthClassifier
{
75
this
,
"MCTruthClassifier"
,
"MCTruthClassifier/MCTruthClassifier"
,
"Truth classification tool"
};
76
77
};
78
79
}
// namespace IDTPM
80
81
#endif // > ! INDETTRACKPERFMON_TruthDECORATORALG_H
IDTPM::TruthDecoratorAlg::Type
@ Type
Definition:
TruthDecoratorAlg.h:60
TruthParticleContainer.h
IDTPM::TruthDecoratorAlg::m_truthParticlesName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticlesName
Definition:
TruthDecoratorAlg.h:49
IDTPM::TruthDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition:
TruthDecoratorAlg.cxx:26
SG::ReadHandleKey< xAOD::TruthParticleContainer >
IDTPM::TruthDecoratorAlg::TruthDecoratorAlg
TruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Local includes.
Definition:
TruthDecoratorAlg.cxx:17
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition:
AthReentrantAlgorithm.h:74
IDTPM::TruthDecoratorAlg::decorateTruthParticle
StatusCode decorateTruthParticle(const xAOD::TruthParticle &truth, std::vector< IDTPM::OptionalDecoration< xAOD::TruthParticleContainer, int >> &truth_decor) const
Definition:
TruthDecoratorAlg.cxx:86
IMCTruthClassifier.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition:
TruthParticle_v1.h:37
IDTPM::TruthDecoratorAlg::m_decor_truth_names
const std::vector< std::string > m_decor_truth_names
Definition:
TruthDecoratorAlg.h:65
IDTPM::TruthDecoratorAlg::m_prefix
StringProperty m_prefix
Definition:
TruthDecoratorAlg.h:52
IDTPM::TruthDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition:
TruthDecoratorAlg.cxx:50
IDTPM::TruthDecoratorAlg::~TruthDecoratorAlg
virtual ~TruthDecoratorAlg()=default
IDTPM::TruthDecoratorAlg::Origin
@ Origin
Definition:
TruthDecoratorAlg.h:61
AthReentrantAlgorithm.h
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:240
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition:
Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
IDTPM::TruthDecoratorAlg::m_decor_truth
std::vector< IDTPM::WriteKeyAccessorPair< xAOD::TruthParticleContainer, int > > m_decor_truth
Definition:
TruthDecoratorAlg.h:71
SafeDecorator.h
Helper functions to perform safe decoration of xAOD objects in this package.
IDTPM::WriteKeyAccessorPair
std::pair< SG::WriteDecorHandleKey< ContainerType >, SG::AuxElement::ConstAccessor< VariableType > > WriteKeyAccessorPair
Useful declarations.
Definition:
SafeDecorator.h:38
IDTPM::TruthDecoratorAlg::NDecorations
@ NDecorations
Definition:
TruthDecoratorAlg.h:62
IDTPM::TruthDecoratorAlg
Definition:
TruthDecoratorAlg.h:35
IDTPM::TruthDecoratorAlg::TruthDecorations
TruthDecorations
Definition:
TruthDecoratorAlg.h:59
IDTPM::OptionalDecoration
std::pair< SG::WriteDecorHandle< ContainerType, VariableType >, bool > OptionalDecoration
Definition:
SafeDecorator.h:47
IDTPM
Athena include(s).
Definition:
IPlotsDefinitionSvc.h:25
IDTPM::TruthDecoratorAlg::m_truthClassifier
PublicToolHandle< IMCTruthClassifier > m_truthClassifier
Definition:
TruthDecoratorAlg.h:74
Generated on Mon Sep 1 2025 21:23:18 for ATLAS Offline Software by
1.8.18