ATLAS Offline Software
Loading...
Searching...
No Matches
CommonSmearingTool.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 TAUANALYSISTOOLS_COMMONSMEARINGTOOL_H
6#define TAUANALYSISTOOLS_COMMONSMEARINGTOOL_H
7
8/*
9 author: Dirk Duschinger
10 mail: dirk.duschinger@cern.ch
11 documentation in: ../README.rst
12*/
13
14// Framework include(s):
18
19// EDM include(s):
20#include "xAODTau/TauJet.h"
23
25
26// Local include(s):
30
31// ROOT include(s):
32#include "TFile.h"
33#include "TH1.h"
34
35// tauRecTools include(s)
37
38namespace TauAnalysisTools
39{
40
42 : public virtual ITauSmearingTool
44{
47
48public:
49
50 CommonSmearingTool(const std::string& sName);
51
53
54 virtual StatusCode initialize();
55
56 // CommonSmearingTool pure virtual public functionality
57 //__________________________________________________________________________
58
60 virtual CP::CorrectionCode applyCorrection( xAOD::TauJet& xTau ) const;
61
64 xAOD::TauJet*& xTauCopy) const;
65
67 virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const;
68
71
74
77 virtual StatusCode applySystematicVariation ( const CP::SystematicSet& sSystematicSet);
78
79protected:
80
81 std::string ConvertProngToString(const int iProngness) const;
82
83 std::map<std::string, TH1*> m_mSF;
84 std::unordered_map < CP::SystematicSet, std::string > m_mSystematicSets;
86 std::map<std::string, int> m_mSystematics;
87 std::map<std::string, std::string> m_mSystematicsHistNames;
88
89 // std::function<double> m_fX;
90 double (*m_fX)(const xAOD::TauJet& xTau);
91 double (*m_fY)(const xAOD::TauJet& xTau);
92
93 template<class T>
94 void ReadInputs(TFile* fFile, std::map<std::string, T>& mMap);
95
96 virtual CP::CorrectionCode getValue(const std::string& sHistName,
97 const xAOD::TauJet& xTau,
98 double& dEfficiencyScaleFactor) const;
99
101
102 Gaudi::Property<std::string> m_sInputFilePath{this, "InputFilePath", ""};
103 Gaudi::Property<bool> m_bSkipTruthMatchCheck{this, "SkipTruthMatchCheck", false};
104 Gaudi::Property<bool> m_bApplyFading{this, "ApplyFading", true};
105 Gaudi::Property<bool> m_bMVATESQualityCheck{this, "MVATESQualityCheck", true};
106 Gaudi::Property<bool> m_bApplyInsituCorrection{this, "ApplyInsituCorrection", true};
107
110
112
116
117private:
118
119 // Execute at each event
120 virtual StatusCode beginEvent();
121
122};
123} // namespace TauAnalysisTools
124
125#endif // TAUANALYSISTOOLS_COMMONSMEARINGTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Return value from object correction CP tools.
Class to wrap a set of SystematicVariations.
std::unordered_map< CP::SystematicSet, std::string > m_mSystematicSets
std::map< std::string, int > m_mSystematics
virtual CP::CorrectionCode getValue(const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
std::map< std::string, TH1 * > m_mSF
double(* m_fX)(const xAOD::TauJet &xTau)
virtual StatusCode applySystematicVariation(const CP::SystematicSet &sSystematicSet)
configure this tool for the given list of systematic variations.
Gaudi::Property< bool > m_bMVATESQualityCheck
asg::AnaToolHandle< ITauToolBase > m_tTauCombinedTES
virtual StatusCode beginEvent()
Function called when a new events is loaded.
void ReadInputs(TFile *fFile, std::map< std::string, T > &mMap)
CommonSmearingTool(const std::string &sName)
Create a proper constructor for Athena.
Gaudi::Property< bool > m_bSkipTruthMatchCheck
Gaudi::Property< std::string > m_sInputFilePath
std::string ConvertProngToString(const int iProngness) const
Gaudi::Property< bool > m_bApplyInsituCorrection
virtual CP::SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematics
double(* m_fY)(const xAOD::TauJet &xTau)
std::map< std::string, std::string > m_mSystematicsHistNames
virtual CP::CorrectionCode applyCorrection(xAOD::TauJet &xTau) const
Apply the correction on a modifyable object.
virtual CP::CorrectionCode correctedCopy(const xAOD::TauJet &xTau, xAOD::TauJet *&xTauCopy) const
Create a corrected copy from a constant tau.
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
const CP::SystematicSet * m_sSystematicSet
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
a modified tool handle that allows its owner to configure new tools from the C++ side
Base class for dual-use tools that provide file metadata access.
TauJet_v3 TauJet
Definition of the current "tau version".