ATLAS Offline Software
Loading...
Searching...
No Matches
DiTauSmearingTool.cxx File Reference
Include dependency graph for DiTauSmearingTool.cxx:

Go to the source code of this file.

Functions

namespace ADD_CMODE (TauAnalysisTools)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( TauAnalysisTools )

returns: whether this tool is affected by the given systematis

returns: the list of all systematics this tool can be affected by

returns: the list of all systematics this tool recommends to use

Definition at line 1 of file DiTauSmearingTool.cxx.

13{
14
15DiTauSmearingTool::DiTauSmearingTool( const std::string& sName )
16 : asg::AsgTool( sName )
17 , m_tCommonDiTauSmearingTool(sName+"_CommonDiTauSmearingTool", this)
18 , m_sInputFilePath("")
19{
20}
21
22StatusCode 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
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
62CP::CorrectionCode DiTauSmearingTool::applyCorrection( xAOD::DiTauJet& xDiTau ) const
63{
64 return m_tCommonDiTauSmearingTool->applyCorrection(xDiTau);
65}
66
67CP::CorrectionCode DiTauSmearingTool::correctedCopy( const xAOD::DiTauJet& input,
68 xAOD::DiTauJet*& output ) const
69{
70 return m_tCommonDiTauSmearingTool->correctedCopy(input, output);
71}
72
74bool DiTauSmearingTool::isAffectedBySystematic( const CP::SystematicVariation& systematic ) const
75{
76 return m_tCommonDiTauSmearingTool->isAffectedBySystematic( systematic );
77}
78
80CP::SystematicSet DiTauSmearingTool::affectingSystematics() const
81{
82 return m_tCommonDiTauSmearingTool->affectingSystematics();
83}
84
86CP::SystematicSet DiTauSmearingTool::recommendedSystematics() const
87{
88 return m_tCommonDiTauSmearingTool->recommendedSystematics();
89}
90
91StatusCode DiTauSmearingTool::applySystematicVariation ( const CP::SystematicSet& sSystematicSet)
92{
93 return m_tCommonDiTauSmearingTool->applySystematicVariation( sSystematicSet );
94}
95
96
97} // namespace ADD_CMODE(TauAnalysisTools)
#define ASG_MAKE_ANA_TOOL(handle, type)
create the tool in the given tool handle
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
static const char *const sSharedFilesVersion
Version of the calibration files.
Return value from object correction CP tools.
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
::StatusCode StatusCode
StatusCode definition for legacy code.
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17