ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TauID
TauAnalysisTools
Root
DiTauSmearingTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// EDM include(s):
6
#include "
PATInterfaces/SystematicRegistry.h
"
7
8
// Local include(s):
9
#include "
TauAnalysisTools/DiTauSmearingTool.h
"
10
#include "
TauAnalysisTools/SharedFilesVersion.h
"
11
12
namespace
ADD_CMODE(TauAnalysisTools)
13
{
14
15
DiTauSmearingTool::DiTauSmearingTool(
const
std::string& sName )
16
:
asg::AsgTool
( sName )
17
, m_tCommonDiTauSmearingTool(sName+
"_CommonDiTauSmearingTool"
,
this
)
18
, m_sInputFilePath(
""
)
19
{
20
}
21
22
StatusCode DiTauSmearingTool::initialize()
23
{
24
// Greet the user:
25
ATH_MSG_INFO
(
"Initializing DiTauSmearingTool"
);
26
27
if
(m_bSkipTruthMatchCheck)
28
ATH_MSG_WARNING
(
"Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!"
);
29
30
std::string sDirectory =
"TauAnalysisTools/"
+std::string(
sSharedFilesVersion
)+
"/Smearing/"
;
31
32
if
(m_sRecommendationTag ==
"2019-winter"
)
33
{
34
if
(m_sInputFilePath.empty()){
35
sDirectory =
"TauAnalysisTools/00-03-16/Smearing/"
;
36
m_sInputFilePath = sDirectory+
"TES_TrueHadDiTau_2019-winter.root"
;
37
}
38
ATH_CHECK
(
ASG_MAKE_ANA_TOOL
(m_tCommonDiTauSmearingTool, TauAnalysisTools::CommonDiTauSmearingTool));
39
ATH_CHECK
(m_tCommonDiTauSmearingTool.setProperty(
"InputFilePath"
, m_sInputFilePath));
40
ATH_CHECK
(m_tCommonDiTauSmearingTool.setProperty(
"SkipTruthMatchCheck"
, m_bSkipTruthMatchCheck));
41
ATH_CHECK
(m_tCommonDiTauSmearingTool.setProperty(
"OutputLevel"
, this->msg().level()));
42
}
43
else
44
{
45
ATH_MSG_FATAL
(
"unknown recommendation tag "
<<m_sRecommendationTag);
46
return
StatusCode::FAILURE;
47
}
48
49
ATH_CHECK
(m_tCommonDiTauSmearingTool.initialize());
50
51
// Add the affecting systematics to the global registry
52
CP::SystematicRegistry
& registry =
CP::SystematicRegistry::getInstance
();
53
if
(!registry.registerSystematics(*
this
))
54
{
55
ATH_MSG_ERROR
(
"Unable to register the systematics"
);
56
return
StatusCode::FAILURE;
57
}
58
59
return
StatusCode::SUCCESS;
60
}
61
62
CP::CorrectionCode
DiTauSmearingTool::applyCorrection(
xAOD::DiTauJet
& xDiTau )
const
63
{
64
return
m_tCommonDiTauSmearingTool->applyCorrection(xDiTau);
65
}
66
67
CP::CorrectionCode
DiTauSmearingTool::correctedCopy(
const
xAOD::DiTauJet
& input,
68
xAOD::DiTauJet
*& output )
const
69
{
70
return
m_tCommonDiTauSmearingTool->correctedCopy(input, output);
71
}
72
74
bool
DiTauSmearingTool::isAffectedBySystematic(
const
CP::SystematicVariation
& systematic )
const
75
{
76
return
m_tCommonDiTauSmearingTool->isAffectedBySystematic( systematic );
77
}
78
80
CP::SystematicSet
DiTauSmearingTool::affectingSystematics()
const
81
{
82
return
m_tCommonDiTauSmearingTool->affectingSystematics();
83
}
84
86
CP::SystematicSet
DiTauSmearingTool::recommendedSystematics()
const
87
{
88
return
m_tCommonDiTauSmearingTool->recommendedSystematics();
89
}
90
91
StatusCode DiTauSmearingTool::applySystematicVariation (
const
CP::SystematicSet
& sSystematicSet)
92
{
93
return
m_tCommonDiTauSmearingTool->applySystematicVariation( sSystematicSet );
94
}
95
96
97
}
// namespace ADD_CMODE(TauAnalysisTools)
98
ASG_MAKE_ANA_TOOL
#define ASG_MAKE_ANA_TOOL(handle, type)
create the tool in the given tool handle
Definition
AnaToolHandle.h:693
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x,...)
Definition
AthMsgStreamMacros.h:46
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
DiTauSmearingTool.h
SharedFilesVersion.h
sSharedFilesVersion
static const char *const sSharedFilesVersion
Version of the calibration files.
Definition
SharedFilesVersion.h:9
SystematicRegistry.h
CP::CorrectionCode
Return value from object correction CP tools.
Definition
CorrectionCode.h:31
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition
SystematicRegistry.h:25
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition
SystematicRegistry.cxx:25
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition
SystematicSet.h:31
CP::SystematicVariation
Definition
SystematicVariation.h:47
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
xAOD::DiTauJet
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition
DiTauJet.h:17
Generated on
for ATLAS Offline Software by
1.17.0