ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkMCTruth
src
TruthNavigationDecorator.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 DERIVATIONFRAMEWORK_TRUTHNAVIGATIONDECORATOR_H
6
#define DERIVATIONFRAMEWORK_TRUTHNAVIGATIONDECORATOR_H
7
8
// Interface classes
9
#include "
AthenaBaseComps/AthAlgTool.h
"
10
#include "
DerivationFrameworkInterfaces/IAugmentationTool.h
"
11
12
// Handles
13
#include "
StoreGate/ReadHandleKeyArray.h
"
14
#include "
StoreGate/ReadHandleKey.h
"
15
#include "
StoreGate/WriteDecorHandleKeyArray.h
"
16
17
// EDM includes -- typedefs, so can't just be forward declared
18
#include "
xAODTruth/TruthParticleContainer.h
"
19
#include "
xAODTruth/TruthEventContainer.h
"
20
21
// STL includes
22
#include <string>
23
#include <vector>
24
#include <map>
25
26
namespace
DerivationFramework
{
27
28
class
TruthNavigationDecorator
:
public
extends<AthAlgTool, IAugmentationTool> {
29
public
:
30
31
using
base_class::base_class;
32
33
virtual
StatusCode
initialize
()
override
final
;
34
virtual
StatusCode
addBranches
(
const
EventContext& ctx)
const
override
final
;
35
36
private
:
38
SG::ReadHandleKeyArray<xAOD::TruthParticleContainer>
m_inputKeys
39
{
this
,
"InputCollections"
, {},
"Input truth particle collection keys"
};
40
SG::ReadHandleKey<xAOD::TruthEventContainer>
m_truthEventKey
41
{
this
,
"TruthEventKey"
,
"TruthEvents"
,
"SG key for the TruthEvent container"
};
42
43
SG::WriteDecorHandleKeyArray<xAOD::TruthParticleContainer, std::vector<ElementLink<xAOD::TruthParticleContainer>
>>
m_parentLinksDecorKeys
44
{
this
,
"parentDecorKeys"
, {},
"dependent on the names in InputCollections"
};
45
SG::WriteDecorHandleKeyArray<xAOD::TruthParticleContainer, std::vector<ElementLink<xAOD::TruthParticleContainer>
>>
m_childLinksDecorKeys
46
{
this
,
"childDecorKeys"
, {},
"dependent on the name in InputCollections"
};
47
48
void
find_parents
(
const
xAOD::TruthParticle
* part ,
49
std::vector<
ElementLink<xAOD::TruthParticleContainer>
>& parents ,
50
std::map<
int
,
ElementLink<xAOD::TruthParticleContainer>
>& linkMap ,
51
std::vector<int>& seen_particles )
const
;
53
void
find_children
(
const
xAOD::TruthParticle
* part ,
54
std::vector<
ElementLink<xAOD::TruthParticleContainer>
>& parents ,
55
std::map<
int
,
ElementLink<xAOD::TruthParticleContainer>
>& linkMap ,
56
std::vector<int>& seen_particles )
const
;
57
};
58
}
59
60
#endif
// DERIVATIONFRAMEWORK_TRUTHNAVIGATIONDECORATOR_H
AthAlgTool.h
TruthParticleContainer.h
IAugmentationTool.h
ReadHandleKeyArray.h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
WriteDecorHandleKeyArray.h
TruthEventContainer.h
DerivationFramework::TruthNavigationDecorator
Definition
TruthNavigationDecorator.h:28
DerivationFramework::TruthNavigationDecorator::find_parents
void find_parents(const xAOD::TruthParticle *part, std::vector< ElementLink< xAOD::TruthParticleContainer > > &parents, std::map< int, ElementLink< xAOD::TruthParticleContainer > > &linkMap, std::vector< int > &seen_particles) const
Helper function for finding all the parents of a particle.
Definition
TruthNavigationDecorator.cxx:105
DerivationFramework::TruthNavigationDecorator::find_children
void find_children(const xAOD::TruthParticle *part, std::vector< ElementLink< xAOD::TruthParticleContainer > > &parents, std::map< int, ElementLink< xAOD::TruthParticleContainer > > &linkMap, std::vector< int > &seen_particles) const
Helper function for finding all the children of a particle.
Definition
TruthNavigationDecorator.cxx:127
DerivationFramework::TruthNavigationDecorator::m_inputKeys
SG::ReadHandleKeyArray< xAOD::TruthParticleContainer > m_inputKeys
Parameter: input particle collections.
Definition
TruthNavigationDecorator.h:39
DerivationFramework::TruthNavigationDecorator::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition
TruthNavigationDecorator.cxx:27
DerivationFramework::TruthNavigationDecorator::m_truthEventKey
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventKey
Definition
TruthNavigationDecorator.h:41
DerivationFramework::TruthNavigationDecorator::m_childLinksDecorKeys
SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, std::vector< ElementLink< xAOD::TruthParticleContainer > > > m_childLinksDecorKeys
Definition
TruthNavigationDecorator.h:46
DerivationFramework::TruthNavigationDecorator::initialize
virtual StatusCode initialize() override final
Definition
TruthNavigationDecorator.cxx:14
DerivationFramework::TruthNavigationDecorator::m_parentLinksDecorKeys
SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, std::vector< ElementLink< xAOD::TruthParticleContainer > > > m_parentLinksDecorKeys
Decor keys.
Definition
TruthNavigationDecorator.h:44
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
SG::WriteDecorHandleKeyArray
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
Definition
StoreGate/StoreGate/WriteDecorHandleKeyArray.h:35
SG::ReadHandleKeyArray
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
Definition
StoreGate/StoreGate/ReadHandleKeyArray.h:32
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
Generated on
for ATLAS Offline Software by
1.17.0