ATLAS Offline Software
Loading...
Searching...
No Matches
TrackTruthDecoratorAlg.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 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"};
39
40 // Accessors for truth particles
43 this, "acc_ftagTruthTypeLabel", "ftagTruthTypeLabel",
44 "Accessor for the truth type label of the truth particle"};
46 this, "acc_ftagTruthSourceLabel", "ftagTruthSourceLabel",
47 "Accessor for the truth label for the source of secondary particles"};
49 this, "acc_ftagTruthVertexIndex", "ftagTruthVertexIndex",
50 "Accessor for the vertex index of the truth particle"};
52 this, "acc_ftagTruthParentBarcode", "ftagTruthParentBarcode",
53 "Accessor for the uniqueID of the parent of linked truth particle"};
54
55 // Decorators for tracks
58 this, "dec_ftagTruthOriginLabel", "ftagTruthOriginLabel",
59 "Exclusive origin label of the track"};
61 this, "dec_ftagTruthTypeLabel", "ftagTruthTypeLabel",
62 "Exclusive truth type label of the track"};
64 this, "dec_ftagTruthSourceLabel", "ftagTruthSourceLabel",
65 "Exclusive truth label for the source of secondary tracks"};
67 this, "dec_ftagTruthVertexIndex", "ftagTruthVertexIndex",
68 "ftagTruth vertex index of the track"};
70 this, "dec_ftagTruthBarcode", "ftagTruthBarcode",
71 "UniqueID of linked truth particle"};
73 this, "dec_ftagTruthParentBarcode", "ftagTruthParentBarcode",
74 "UniqueID of parent of linked truth particle"};
76 this, "dec_ftagTruthMuonOriginLabel", "ftagTruthMuonOriginLabel",
77 "Exclusive origin label of the muon"};
78
79
80 // Truth origin tool
81 ToolHandle<InDet::InDetTrackTruthOriginTool> m_trackTruthOriginTool {
82 this, "trackTruthOriginTool", "InDet::InDetTrackTruthOriginTool",
83 "track truth origin tool"};
84 // Truth Lepton Origin tool (https://gitlab.cern.ch/atlas/athena/-/tree/main/PhysicsAnalysis/AnalysisCommon/TruthClassification)
85 ToolHandle<CP::IClassificationTool> m_truthLeptonTool{
86 this, "truthLeptonTool", "",
87 "Lepton truth classification tool"};
88
89 // Defining a map for proper muon origin labels
90 std::unordered_map<Truth::Type,unsigned int> m_muTruthMap = {
91 {Truth::Type::Unknown, 0}, //Fake(Uknown) muon
92 {Truth::Type::KnownUnknown, 1}, //KnownUknown muon
93 {Truth::Type::PromptMuon, 2}, //Prompt muon
94 {Truth::Type::BHadronDecay, 3}, //From B muon
95 // FromBC and FromC decay label are handled in the implementation since FromBC is not directly available for TruthClassificationTool
96 // FromBC and FromC decay label are handled in the implementation since FromBC is not directly available for TruthClassificationTool
97 {Truth::Type::LightFlavorDecay, 6}, //From light muon
98 {Truth::Type::TauDecay, 7}, //From tau muon
99 {Truth::Type::TauDecayLike, 8}, //4-like muons
100 {Truth::Type::BHadronDecayLike, 8}, //4-like muons
101 {Truth::Type::CHadronDecayLike, 8}, //4-like muons
102 {Truth::Type::NonMuonlike, 8}, //Non-muons like muons
103 // 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)
104 };
105
106 // ATLASRECTS-8290: this is for backward compatability, remove eventually
107 Gaudi::Property<bool> m_use_barcode {
108 this, "useBarcode", false, "use barcode rather than UID"
109 };
111
112 };
113}
114
115#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::WriteDecorHandleKey< xAOD::TrackParticleContainer > WDHK
ToolHandle< InDet::InDetTrackTruthOriginTool > m_trackTruthOriginTool
Helper class to provide constant type-safe access to aux data.