ATLAS Offline Software
TrackTruthDecoratorAlg.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 TRACK_TRUTH_DECORATOR_ALG_HH
6 #define TRACK_TRUTH_DECORATOR_ALG_HH
7 
9 #include "GaudiKernel/ToolHandle.h"
13 
16 #include "xAODMuon/MuonContainer.h"
19 
20 
21 namespace 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 barcode 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  "Barcode of linked truth particle"};
73  this, "dec_ftagTruthParentBarcode", "ftagTruthParentBarcode",
74  "Barcode of parent of linked truth particle"};
76  this, "dec_ftagTruthMuonOriginLabel", "ftagTruthMuonOriginLabel",
77  "Exclusive origin label of the muon"};
78 
79  // Truth origin tool
80  ToolHandle<InDet::InDetTrackTruthOriginTool> m_trackTruthOriginTool {
81  this, "trackTruthOriginTool", "InDet::InDetTrackTruthOriginTool",
82  "track truth origin tool"};
83  // Truth Lepton Origin tool (https://gitlab.cern.ch/atlas/athena/-/tree/main/PhysicsAnalysis/AnalysisCommon/TruthClassification)
84  ToolHandle<CP::IClassificationTool> m_truthLeptonTool{
85  this, "truthLeptonTool", "",
86  "Lepton truth classification tool"};
87 
88  // Defining a map for proper muon origin labels
89  std::unordered_map<Truth::Type,unsigned int> m_muTruthMap = {
90  {Truth::Type::Unknown, 0}, //Fake(Uknown) muon
91  {Truth::Type::KnownUnknown, 1}, //KnownUknown muon
92  {Truth::Type::PromptMuon, 2}, //Prompt muon
93  {Truth::Type::BHadronDecay, 3}, //From B muon
94  // FromBC and FromC decay label are handled in the implementation since FromBC is not directly available for TruthClassificationTool
95  // FromBC and FromC decay label are handled in the implementation since FromBC is not directly available for TruthClassificationTool
96  {Truth::Type::LightFlavorDecay, 6}, //From light muon
97  {Truth::Type::TauDecay, 7}, //From tau muon
98  {Truth::Type::TauDecayLike, 8}, //4-like muons
99  {Truth::Type::BHadronDecayLike, 8}, //4-like muons
100  {Truth::Type::CHadronDecayLike, 8}, //4-like muons
101  {Truth::Type::NonMuonlike, 8}, //Non-muons like muons
102  };
103  };
104 }
105 
106 #endif
TruthParticleContainerFwd.h
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer >
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_source_label
WDHK m_dec_source_label
Definition: TrackTruthDecoratorAlg.h:63
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_vertex_index
RDHK m_acc_vertex_index
Definition: TrackTruthDecoratorAlg.h:48
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
Truth::Type::LightFlavorDecay
@ LightFlavorDecay
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_TrackContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackContainerKey
Definition: TrackTruthDecoratorAlg.h:33
Truth::Type::TauDecayLike
@ TauDecayLike
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_parent_barcode
WDHK m_dec_parent_barcode
Definition: TrackTruthDecoratorAlg.h:72
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_truthLeptonTool
ToolHandle< CP::IClassificationTool > m_truthLeptonTool
Definition: TrackTruthDecoratorAlg.h:84
FlavorTagDiscriminants::TrackTruthDecoratorAlg
Definition: TrackTruthDecoratorAlg.h:23
SG::ReadHandleKey< xAOD::TrackParticleContainer >
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_muTruthMap
std::unordered_map< Truth::Type, unsigned int > m_muTruthMap
Definition: TrackTruthDecoratorAlg.h:89
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_parent_barcode
RDHK m_acc_parent_barcode
Definition: TrackTruthDecoratorAlg.h:51
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_barcode
WDHK m_dec_barcode
Definition: TrackTruthDecoratorAlg.h:69
Truth::Type::BHadronDecayLike
@ BHadronDecayLike
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_type_label
WDHK m_dec_type_label
Definition: TrackTruthDecoratorAlg.h:60
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Truth::Type::TauDecay
@ TauDecay
Truth::Type::Unknown
@ Unknown
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_trackTruthOriginTool
ToolHandle< InDet::InDetTrackTruthOriginTool > m_trackTruthOriginTool
Definition: TrackTruthDecoratorAlg.h:80
Truth::Type::BHadronDecay
@ BHadronDecay
AthReentrantAlgorithm.h
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_type_label
RDHK m_acc_type_label
Definition: TrackTruthDecoratorAlg.h:42
Truth::Type::NonMuonlike
@ NonMuonlike
Truth::Type::KnownUnknown
@ KnownUnknown
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition: TrackTruthDecoratorAlg.h:36
FlavorTagDiscriminants::TrackTruthDecoratorAlg::TrackTruthDecoratorAlg
TrackTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrackTruthDecoratorAlg.cxx:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_vertex_index
WDHK m_dec_vertex_index
Definition: TrackTruthDecoratorAlg.h:66
TruthClassificationTool.h
InDetTrackTruthOriginTool.h
MuonContainer.h
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_muon_origin_label
WDHK m_dec_muon_origin_label
Definition: TrackTruthDecoratorAlg.h:75
FlavorTagDiscriminants::TrackTruthDecoratorAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition: TrackTruthDecoratorAlg.cxx:74
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_acc_source_label
RDHK m_acc_source_label
Definition: TrackTruthDecoratorAlg.h:45
Truth::Type::CHadronDecayLike
@ CHadronDecayLike
FlavorTagDiscriminants::TrackTruthDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: TrackTruthDecoratorAlg.cxx:29
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer >
TruthEventContainer.h
Truth::Type::PromptMuon
@ PromptMuon
AuxElement.h
Base class for elements of a container that can have aux data.
FlavorTagDiscriminants::TrackTruthDecoratorAlg::m_dec_origin_label
WDHK m_dec_origin_label
Definition: TrackTruthDecoratorAlg.h:57