ATLAS Offline Software
Loading...
Searching...
No Matches
CommonSmearingTool.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_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
24// Local include(s):
29
30#include <map>
31#include "TH1.h"
32
33class TFile;
34
35namespace ADD_CMODE(TauAnalysisTools)
36{
37
38class CommonSmearingTool
39 : public virtual ITauSmearingTool
41{
43 ASG_TOOL_CLASS( CommonSmearingTool, TauAnalysisTools::ITauSmearingTool )
44
45public:
46
47 CommonSmearingTool(const std::string& sName);
48
49 ~CommonSmearingTool();
50
51 virtual StatusCode initialize();
52
53 // CommonSmearingTool pure virtual public functionality
54 //__________________________________________________________________________
55
57 virtual CP::CorrectionCode applyCorrection( xAOD::TauJet& xTau ) const;
58
60 virtual CP::CorrectionCode correctedCopy( const xAOD::TauJet& xTau,
61 xAOD::TauJet*& xTauCopy) const;
62
64 virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const;
65
67 virtual CP::SystematicSet affectingSystematics() const;
68
70 virtual CP::SystematicSet recommendedSystematics() const;
71
74 virtual StatusCode applySystematicVariation ( const CP::SystematicSet& sSystematicSet);
75
76protected:
77
78 std::string ConvertProngToString(const int iProngness) const;
79
80 std::map<std::string, TH1*> m_mSF;
81 std::unordered_map < CP::SystematicSet, std::string > m_mSystematicSets;
82 const CP::SystematicSet* m_sSystematicSet;
83 std::map<std::string, int> m_mSystematics;
84 std::map<std::string, std::string> m_mSystematicsHistNames;
85
86 // std::function<double> m_fX;
87 double (*m_fX)(const xAOD::TauJet& xTau);
88 double (*m_fY)(const xAOD::TauJet& xTau);
89
90 template<class T>
91 void ReadInputs(TFile* fFile, std::map<std::string, T>& mMap);
92
93 virtual CP::CorrectionCode getValue(const std::string& sHistName,
94 const xAOD::TauJet& xTau,
95 double& dEfficiencyScaleFactor) const;
96
97 void generateSystematicSets();
98
99 Gaudi::Property<std::string> m_sInputFilePath{this, "InputFilePath", ""};
100 Gaudi::Property<bool> m_bSkipTruthMatchCheck{this, "SkipTruthMatchCheck", false};
101 Gaudi::Property<bool> m_bApplyFading{this, "ApplyFading", true};
102 Gaudi::Property<bool> m_bMVATESQualityCheck{this, "MVATESQualityCheck", true};
103 Gaudi::Property<bool> m_bApplyInsituCorrection{this, "ApplyInsituCorrection", true};
104
105 bool m_bIsData;
106 bool m_bIsConfigured;
107
108 asg::AnaToolHandle<TauAnalysisTools::ITauResolutionTool> m_tauResolutionTool;
109
111 CP::SystematicSet m_sAffectingSystematics;
112 CP::SystematicSet m_sRecommendedSystematics;
113
114private:
115
116 CxxUtils::CachedValue<bool> m_bIsTESCompatibilityCheckAvailable;
117
118 // Execute at each event
119 virtual StatusCode beginEvent();
120
121};
122} // namespace ADD_CMODE(TauAnalysisTools)
123
124#endif // TAUANALYSISTOOLS_COMMONSMEARINGTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Return value from object correction CP tools.
Class to wrap a set of SystematicVariations.
Base class for dual-use tools that provide file metadata access.
::StatusCode StatusCode
StatusCode definition for legacy code.
TauJet_v3 TauJet
Definition of the current "tau version".
Definition TauJet.h:17
void initialize()