ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagDiscriminants
FlavorTagDiscriminants
TrackTruthDecoratorAlg.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TRACK_TRUTH_DECORATOR_ALG_HH
6
#define TRACK_TRUTH_DECORATOR_ALG_HH
7
8
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
9
#include "GaudiKernel/ToolHandle.h"
10
#include "
AthContainers/AuxElement.h
"
11
#include "
StoreGate/WriteDecorHandleKey.h
"
12
#include "
StoreGate/ReadDecorHandleKey.h
"
13
14
#include "
xAODTruth/TruthParticleContainerFwd.h
"
15
#include "
xAODTruth/TruthEventContainer.h
"
16
#include "
xAODMuon/MuonContainer.h
"
17
#include "
InDetTrackSystematicsTools/InDetTrackTruthOriginTool.h
"
18
#include "
TruthClassification/TruthClassificationTool.h
"
19
20
21
namespace
FlavorTagDiscriminants
{
22
23
class
TrackTruthDecoratorAlg
:
public
AthReentrantAlgorithm
{
24
public
:
25
TrackTruthDecoratorAlg
(
const
std::string& name,
26
ISvcLocator* pSvcLocator );
27
28
virtual
StatusCode
initialize
()
override
;
29
virtual
StatusCode
execute
(
const
EventContext& )
const override
;
30
31
private
:
32
// Input Containers
33
SG::ReadHandleKey< xAOD::TrackParticleContainer >
m_TrackContainerKey
{
34
this
,
"trackContainer"
,
"InDetTrackParticles"
,
35
"Key for the input track collection"
};
36
SG::ReadHandleKey< xAOD::MuonContainer >
m_MuonContainerKey
{
37
this
,
"muonContainer"
,
"Muons"
,
38
"Key for the input muon collection"
};
39
SG::ReadHandleKey< xAOD::TruthParticleContainer >
m_truthParticleContainerKey
{
40
this
,
"truthParticleContainer"
,
"TruthParticles"
,
41
"Key for the input truth particle container"
};
42
43
// Accessors for truth particles
44
using
RDHK
=
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer >
;
45
RDHK
m_acc_type_label
{
46
this
,
"acc_ftagTruthTypeLabel"
,
m_truthParticleContainerKey
,
"ftagTruthTypeLabel"
,
47
"Accessor for the truth type label of the truth particle"
};
48
RDHK
m_acc_source_label
{
49
this
,
"acc_ftagTruthSourceLabel"
,
m_truthParticleContainerKey
,
"ftagTruthSourceLabel"
,
50
"Accessor for the truth label for the source of secondary particles"
};
51
RDHK
m_acc_vertex_index
{
52
this
,
"acc_ftagTruthVertexIndex"
,
m_truthParticleContainerKey
,
"ftagTruthVertexIndex"
,
53
"Accessor for the vertex index of the truth particle"
};
54
RDHK
m_acc_parent_uniqueID
{
55
this
,
"acc_ftagTruthParentBarcode"
,
m_truthParticleContainerKey
,
"ftagTruthParentBarcode"
,
56
"Accessor for the uniqueID of the parent of linked truth particle"
};
57
58
// Decorators for tracks
59
using
WDHK
=
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer >
;
60
WDHK
m_dec_origin_label
{
61
this
,
"dec_ftagTruthOriginLabel"
,
m_TrackContainerKey
,
"ftagTruthOriginLabel"
,
62
"Exclusive origin label of the track"
};
63
WDHK
m_dec_type_label
{
64
this
,
"dec_ftagTruthTypeLabel"
,
m_TrackContainerKey
,
"ftagTruthTypeLabel"
,
65
"Exclusive truth type label of the track"
};
66
WDHK
m_dec_source_label
{
67
this
,
"dec_ftagTruthSourceLabel"
,
m_TrackContainerKey
,
"ftagTruthSourceLabel"
,
68
"Exclusive truth label for the source of secondary tracks"
};
69
WDHK
m_dec_vertex_index
{
70
this
,
"dec_ftagTruthVertexIndex"
,
m_TrackContainerKey
,
"ftagTruthVertexIndex"
,
71
"ftagTruth vertex index of the track"
};
72
WDHK
m_dec_uniqueID
{
73
this
,
"dec_ftagTruthBarcode"
,
m_TrackContainerKey
,
"ftagTruthBarcode"
,
74
"UniqueID of linked truth particle"
};
75
WDHK
m_dec_parent_uniqueID
{
76
this
,
"dec_ftagTruthParentBarcode"
,
m_TrackContainerKey
,
"ftagTruthParentBarcode"
,
77
"UniqueID of parent of linked truth particle"
};
78
WDHK
m_dec_muon_origin_label
{
79
this
,
"dec_ftagTruthMuonOriginLabel"
,
m_TrackContainerKey
,
"ftagTruthMuonOriginLabel"
,
80
"Exclusive origin label of the muon"
};
81
82
83
// Truth origin tool
84
ToolHandle<InDet::InDetTrackTruthOriginTool>
m_trackTruthOriginTool
{
85
this
,
"trackTruthOriginTool"
,
"InDet::InDetTrackTruthOriginTool"
,
86
"track truth origin tool"
};
87
// Truth Lepton Origin tool (https://gitlab.cern.ch/atlas/athena/-/tree/main/PhysicsAnalysis/AnalysisCommon/TruthClassification)
88
ToolHandle<CP::IClassificationTool>
m_truthLeptonTool
{
89
this
,
"truthLeptonTool"
,
""
,
90
"Lepton truth classification tool"
};
91
92
// Defining a map for proper muon origin labels
93
std::unordered_map<Truth::Type,unsigned int>
m_muTruthMap
= {
94
{Truth::Type::Unknown, 0},
//Fake(Uknown) muon
95
{Truth::Type::KnownUnknown, 1},
//KnownUknown muon
96
{Truth::Type::PromptMuon, 2},
//Prompt muon
97
{Truth::Type::BHadronDecay, 3},
//From B muon
98
// FromBC and FromC decay label are handled in the implementation since FromBC is not directly available for TruthClassificationTool
99
{Truth::Type::LightFlavorDecay, 6},
//From light muon
100
{Truth::Type::TauDecay, 7},
//From tau muon
101
{Truth::Type::TauDecayLike, 8},
//4-like muons
102
{Truth::Type::BHadronDecayLike, 8},
//4-like muons
103
{Truth::Type::CHadronDecayLike, 8},
//4-like muons
104
{Truth::Type::NonMuonlike, 8},
//Non-muons like muons
105
// There are also cases where the muon has the truth particle associated to the ID track that is not a muon. Those muons are labelled as 9 (NotInnerDetector muons)
106
{Truth::Type::PromptPhotonConversion, 10},
//From photon conversion muon (gamma -> mu+ mu-)
107
};
108
109
// ATLASRECTS-8290: this is for backward compatability, remove eventually
110
Gaudi::Property<bool>
m_use_barcode
{
111
this
,
"useBarcode"
,
false
,
"use barcode rather than UID"
112
};
113
SG::ConstAccessor<int>
m_uid
{
"uid"
};
114
115
};
116
}
117
118
#endif
AthReentrantAlgorithm.h
AuxElement.h
Base class for elements of a container that can have aux data.
InDetTrackTruthOriginTool.h
MuonContainer.h
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
TruthClassificationTool.h
TruthEventContainer.h
TruthParticleContainerFwd.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_uniqueID
WDHK m_dec_uniqueID
Definition
TrackTruthDecoratorAlg.h:72
FlavorTagDiscriminants::TrackTruthDecoratorAlg::RDHK
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > RDHK
Definition
TrackTruthDecoratorAlg.h:44
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_muTruthMap
std::unordered_map< Truth::Type, unsigned int > m_muTruthMap
Definition
TrackTruthDecoratorAlg.h:93
FlavorTagDiscriminants::TrackTruthDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition
TrackTruthDecoratorAlg.cxx:29
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_use_barcode
Gaudi::Property< bool > m_use_barcode
Definition
TrackTruthDecoratorAlg.h:110
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_truthLeptonTool
ToolHandle< CP::IClassificationTool > m_truthLeptonTool
Definition
TrackTruthDecoratorAlg.h:88
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_uid
SG::ConstAccessor< int > m_uid
Definition
TrackTruthDecoratorAlg.h:113
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_muon_origin_label
WDHK m_dec_muon_origin_label
Definition
TrackTruthDecoratorAlg.h:78
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_origin_label
WDHK m_dec_origin_label
Definition
TrackTruthDecoratorAlg.h:60
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_type_label
WDHK m_dec_type_label
Definition
TrackTruthDecoratorAlg.h:63
FlavorTagDiscriminants::TrackTruthDecoratorAlg::TrackTruthDecoratorAlg
TrackTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TrackTruthDecoratorAlg.cxx:25
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_source_label
RDHK m_acc_source_label
Definition
TrackTruthDecoratorAlg.h:48
FlavorTagDiscriminants::TrackTruthDecoratorAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition
TrackTruthDecoratorAlg.cxx:67
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_parent_uniqueID
WDHK m_dec_parent_uniqueID
Definition
TrackTruthDecoratorAlg.h:75
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition
TrackTruthDecoratorAlg.h:36
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_parent_uniqueID
RDHK m_acc_parent_uniqueID
Definition
TrackTruthDecoratorAlg.h:54
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_vertex_index
WDHK m_dec_vertex_index
Definition
TrackTruthDecoratorAlg.h:69
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_TrackContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackContainerKey
Definition
TrackTruthDecoratorAlg.h:33
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Definition
TrackTruthDecoratorAlg.h:39
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_type_label
RDHK m_acc_type_label
Definition
TrackTruthDecoratorAlg.h:45
FlavorTagDiscriminants::TrackTruthDecoratorAlg::WDHK
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > WDHK
Definition
TrackTruthDecoratorAlg.h:59
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_source_label
WDHK m_dec_source_label
Definition
TrackTruthDecoratorAlg.h:66
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_trackTruthOriginTool
ToolHandle< InDet::InDetTrackTruthOriginTool > m_trackTruthOriginTool
Definition
TrackTruthDecoratorAlg.h:84
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_vertex_index
RDHK m_acc_vertex_index
Definition
TrackTruthDecoratorAlg.h:51
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer >
SG::ReadHandleKey< xAOD::TrackParticleContainer >
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer >
FlavorTagDiscriminants
Definition
CaloChargedFlowDecoratorAlg.h:15
Generated on
for ATLAS Offline Software by
1.17.0