ATLAS Offline Software
Loading...
Searching...
No Matches
TauTruthMatchingTool.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 TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
6#define TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
7
8/*
9 author: Dirk Duschinger
10 mail: dirk.duschinger@cern.ch
11 documentation in: ../README.rst
12*/
13
14// Local include(s):
19#include <vector>
20#include <string>
21
22namespace ADD_CMODE(TauAnalysisTools)
23{
24
25class TauTruthMatchingTool
26 : public virtual BuildTruthTaus
27 , public virtual ITauTruthMatchingTool
28{
30 ASG_TOOL_CLASS2( TauTruthMatchingTool,
31 IBuildTruthTaus,
32 ITauTruthMatchingTool )
33
34public: // Interface functions
35
36 TauTruthMatchingTool( const std::string& name );
37
38 virtual ~TauTruthMatchingTool() = default;
39
40 // initialize the tool
41 virtual StatusCode initialize() override final;
42
43 virtual std::unique_ptr<ITruthTausEvent> getEvent() const override final;
44
45 // get pointer to the truth matched particle, if no truth particle was found a null pointer is returned
46 virtual const xAOD::TruthParticle* getTruth(const xAOD::TauJet& xTau) override final;
47 virtual const xAOD::TruthParticle* getTruth(const xAOD::TauJet& xTau,
48 ITruthTausEvent& truthTausEVent) const override final;
49 virtual std::vector<const xAOD::TruthParticle*> getTruth(const std::vector<const xAOD::TauJet*>& vTaus) override final;
50
51public: // Wrapper functions
52
53 // wrapper function to get truth tau visible TLorentzvector
54 virtual TLorentzVector getTruthTauP4Vis(const xAOD::TauJet& xTau) override final;
55 virtual TLorentzVector getTruthTauP4Vis(const xAOD::TruthParticle& xTruthTau) const override final;
56
57 // wrapper function to get truth tau invisible TLorentzvector
58 virtual TLorentzVector getTruthTauP4Invis(const xAOD::TauJet& xTau) override final;
59 virtual TLorentzVector getTruthTauP4Invis(const xAOD::TruthParticle& xTruthTau) const override final;
60
61 // function to check if a reconstructed electron or muon is matched to a true tau
62 bool matchTruthLeptonicTauDecay(const xAOD::IParticle* p, const xAOD::TruthParticleContainer* truth_taus);
63
64 // get type of truth match particle (hadronic tau, leptonic tau, electron, muon, jet)
65 virtual TauAnalysisTools::TruthMatchedParticleType getTruthParticleType(const xAOD::TauJet& xTau) override final;
66
67 // wrapper function to count number of decay particles of given pdg id
68 virtual int getNTauDecayParticles(const xAOD::TauJet& xTau, int iPdgId, bool bCompareAbsoluteValues = false) override final;
69 virtual int getNTauDecayParticles(const xAOD::TruthParticle& xTruthTau, int iPdgId, bool bCompareAbsoluteValues = false) const override final;
70
71 // wrapper function to obtain truth verion of xAOD::TauJetParameters::DecayMode
72 virtual xAOD::TauJetParameters::DecayMode getDecayMode(const xAOD::TauJet& xTau) override final;
73 virtual xAOD::TauJetParameters::DecayMode getDecayMode(const xAOD::TruthParticle& xTruthTau) const override final;
74
80 virtual StatusCode lockDecorations (const xAOD::TauJetContainer& taus) const override final;
81
82private: // private helper functions
83
84 StatusCode findTruthTau(const xAOD::TauJet& xTau,
85 TruthTausEvent& truthTausEvent) const;
86 StatusCode checkTruthMatch (const xAOD::TauJet& xTau, const xAOD::TruthParticleContainer& xTauContainer, const TruthTausEvent& truthTausEvent) const;
87
88private: // steering variables
89
90 Gaudi::Property<double> m_dMaxDeltaR{this, "MaxDeltaR", 0.2};
91
92 CxxUtils::CachedValue<bool> m_bIsTruthMatchedAvailable;
93 CxxUtils::CachedValue<bool> m_bIsTruthParticleLinkAvailable;
94
95private: // private helper variables
96
98 SG::ConstAccessor<double> m_accEtaVis;
99 SG::ConstAccessor<double> m_accPhiVis;
101
102}; // class TauTruthMatchingTool
103
104}
105#endif // TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Cached value with atomic update.
static Double_t taus
Cached value with atomic update.
Definition CachedValue.h:55
Helper class to provide constant type-safe access to aux data.
Class providing the definition of the 4-vector interface.
TauJet_v3 TauJet
Definition of the current "tau version".
Definition TauJet.h:17
TruthParticle_v1 TruthParticle
Typedef to implementation.
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
void initialize()