ATLAS Offline Software
Loading...
Searching...
No Matches
TauTruthMatchingTool.h File Reference
#include "TauAnalysisTools/ITauTruthMatchingTool.h"
#include "TauAnalysisTools/BuildTruthTaus.h"
#include "CxxUtils/CachedValue.h"
#include "AsgTools/PropertyWrapper.h"
#include <vector>
#include <string>
Include dependency graph for TauTruthMatchingTool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (TauAnalysisTools)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( TauAnalysisTools )

Create a proper constructor for Athena

Decorations produced by an algorithm need to be locked; otherwise, they will be ignored by deep copies. The interfaces of this tool take a single object at a time, so we can't do the locking there. Instead, call this method after all taus in a container have been processed.

Definition at line 1 of file TauTruthMatchingTool.h.

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
97 SG::ConstAccessor<double> m_accPtVis;
98 SG::ConstAccessor<double> m_accEtaVis;
99 SG::ConstAccessor<double> m_accPhiVis;
100 SG::ConstAccessor<double> m_accMVis;
101
102}; // class TauTruthMatchingTool
103
104}
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
static Double_t taus
Athena::TPCnvVers::Current TruthParticleContainer
::StatusCode StatusCode
StatusCode definition for legacy code.
void initialize()
#define private
Definition testRead.cxx:27