ATLAS Offline Software
Loading...
Searching...
No Matches
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):
7
8// Local include(s):
11
12namespace TauAnalysisTools
13{
14
15DiTauSmearingTool::DiTauSmearingTool( const std::string& sName )
16 : asg::AsgTool( sName )
17 , m_tCommonDiTauSmearingTool(sName+"_CommonDiTauSmearingTool", this)
19{
20}
21
23{
24 // Greet the user:
25 ATH_MSG_INFO( "Initializing DiTauSmearingTool" );
26
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 }
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
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
66
68 xAOD::DiTauJet*& output )
69{
70 return m_tCommonDiTauSmearingTool->correctedCopy(input, output);
71}
72
75{
76 return m_tCommonDiTauSmearingTool->isAffectedBySystematic( systematic );
77}
78
84
90
92{
93 return m_tCommonDiTauSmearingTool->applySystematicVariation( sSystematicSet );
94}
95
96
97} // namespace TauAnalysisTools
98
#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_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(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.
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Class to wrap a set of SystematicVariations.
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
Gaudi::Property< bool > m_bSkipTruthMatchCheck
virtual CP::CorrectionCode correctedCopy(const xAOD::DiTauJet &input, xAOD::DiTauJet *&output) override
Create a corrected copy from a constant ditau.
asg::AnaToolHandle< IDiTauSmearingTool > m_tCommonDiTauSmearingTool
DiTauSmearingTool(const std::string &sName)
Create a proper constructor for Athena.
virtual StatusCode initialize() override
Function initialising the tool.
virtual CP::SystematicSet recommendedSystematics() const override
returns: the list of all systematics this tool recommends to use
virtual CP::SystematicSet affectingSystematics() const override
returns: the list of all systematics this tool can be affected by
virtual CP::CorrectionCode applyCorrection(xAOD::DiTauJet &xDiTau) override
Apply the correction on a modifyable object.
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const override
returns: whether this tool is affected by the given systematis
Gaudi::Property< std::string > m_sRecommendationTag
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17