ATLAS Offline Software
Loading...
Searching...
No Matches
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
9#include "GaudiKernel/ToolHandle.h"
13
19
20
21namespace FlavorTagDiscriminants {
22
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
34 this, "trackContainer", "InDetTrackParticles",
35 "Key for the input track collection"};
37 this, "muonContainer", "Muons",
38 "Key for the input muon collection"};
40 this, "truthParticleContainer", "TruthParticles",
41 "Key for the input truth particle container"};
42
43 // Accessors for truth particles
46 this, "acc_ftagTruthTypeLabel", m_truthParticleContainerKey, "ftagTruthTypeLabel",
47 "Accessor for the truth type label of the truth particle"};
49 this, "acc_ftagTruthSourceLabel", m_truthParticleContainerKey, "ftagTruthSourceLabel",
50 "Accessor for the truth label for the source of secondary particles"};
52 this, "acc_ftagTruthVertexIndex", m_truthParticleContainerKey, "ftagTruthVertexIndex",
53 "Accessor for the vertex index of the truth particle"};
55 this, "acc_ftagTruthParentBarcode", m_truthParticleContainerKey, "ftagTruthParentBarcode",
56 "Accessor for the uniqueID of the parent of linked truth particle"};
57
58 // Decorators for tracks
61 this, "dec_ftagTruthOriginLabel", m_TrackContainerKey, "ftagTruthOriginLabel",
62 "Exclusive origin label of the track"};
64 this, "dec_ftagTruthTypeLabel", m_TrackContainerKey, "ftagTruthTypeLabel",
65 "Exclusive truth type label of the track"};
67 this, "dec_ftagTruthSourceLabel", m_TrackContainerKey, "ftagTruthSourceLabel",
68 "Exclusive truth label for the source of secondary tracks"};
70 this, "dec_ftagTruthVertexIndex", m_TrackContainerKey, "ftagTruthVertexIndex",
71 "ftagTruth vertex index of the track"};
73 this, "dec_ftagTruthBarcode", m_TrackContainerKey, "ftagTruthBarcode",
74 "UniqueID of linked truth particle"};
76 this, "dec_ftagTruthParentBarcode", m_TrackContainerKey, "ftagTruthParentBarcode",
77 "UniqueID of parent of linked truth particle"};
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 // FromBC and FromC decay label are handled in the implementation since FromBC is not directly available for TruthClassificationTool
100 {Truth::Type::LightFlavorDecay, 6}, //From light muon
101 {Truth::Type::TauDecay, 7}, //From tau muon
102 {Truth::Type::TauDecayLike, 8}, //4-like muons
103 {Truth::Type::BHadronDecayLike, 8}, //4-like muons
104 {Truth::Type::CHadronDecayLike, 8}, //4-like muons
105 {Truth::Type::NonMuonlike, 8}, //Non-muons like muons
106 // 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)
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 };
114
115 };
116}
117
118#endif
Base class for elements of a container that can have aux data.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > RDHK
std::unordered_map< Truth::Type, unsigned int > m_muTruthMap
ToolHandle< CP::IClassificationTool > m_truthLeptonTool
TrackTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &) const override
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > WDHK
ToolHandle< InDet::InDetTrackTruthOriginTool > m_trackTruthOriginTool
Helper class to provide constant type-safe access to aux data.