ATLAS Offline Software
TauEfficiencyCorrectionsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TAUANALYSISTOOLS_TAUEFFICIENCYCORRECTIONSTOOL_H
6 #define TAUANALYSISTOOLS_TAUEFFICIENCYCORRECTIONSTOOL_H
7 
8 /*
9  author: Dirk Duschinger
10  maintainer: Guillermo Hamity
11  mail: guillermo.nicolas.hamity@cern.ch
12  documentation in: ../README.rst
13  https://gitlab.cern.ch/atlas/athena/-/blob/master/PhysicsAnalysis/TauID/TauAnalysisTools/README.rst
14 */
15 
16 // Framework include(s):
18 #include "AsgTools/AnaToolHandle.h"
19 
20 // Local include(s):
24 
25 // Tool include(s)
27 
28 namespace TauAnalysisTools
29 {
30 
32  : public virtual ITauEfficiencyCorrectionsTool
33  , public asg::AsgMetadataTool
34 {
37 
38 public:
40  TauEfficiencyCorrectionsTool( const std::string& sName );
41 
43 
45  virtual StatusCode initialize();
46 
47  virtual StatusCode beginInputFile();
48 
50  virtual void printConfig() const;
51 
54  double& eff, unsigned int iRunNumber = 0, unsigned int iMu = 0);
55 
58  unsigned int iRunNumber = 0, unsigned int iMu = 0);
59 
61  virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const;
62 
65 
68 
69  virtual StatusCode applySystematicVariation( const CP::SystematicSet& systConfig );
70 
71  virtual bool isSupportedRunNumber( int /*iRunNumber*/ ) const
72  {
73  return true;
74  };
75 
76 private:
79 
80  std::string ConvertJetIDToString(const int iLevel) const;
81 
82  std::string ConvertEleIDToString(const int iLevel) const;
83 
84  std::string ConvertTriggerIDToString(const int iLevel) const;
85 
86  std::string GetTriggerSFMeasurementString() const;
87 
89 
91 
92 private:
93 
94  std::vector<int> m_vEfficiencyCorrectionTypes;
95  std::vector< asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* > m_vCommonEfficiencyTools;
96  std::vector< asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* > m_vTriggerEfficiencyTools;
103  std::string m_sVarNameBase;
104  std::string m_sVarNameRecoHadTau;
110  std::string m_sRecommendationTag;
111  std::string m_sTriggerName;
115  bool m_bIsData;
120  std::string m_sMCCampaign;
122  bool m_firstEvent = false;
123  unsigned int m_iRunNumber;
124  unsigned int m_iMu;
125 
126  ToolHandle<CP::IPileupReweightingTool> m_tPRWTool;
127 
128 }; // class TauEfficiencyCorrectionsTool
129 
130 } // namespace TauAnalysisTools
131 
132 #endif // TAUANALYSISTOOLS_TAUEFFICIENCYCORRECTIONSTOOL_H
TauAnalysisTools
Definition: TruthCollectionMakerTau.h:16
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bIsConfigured
bool m_bIsConfigured
Definition: TauEfficiencyCorrectionsTool.h:116
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bReadRandomRunNumber
bool m_bReadRandomRunNumber
Definition: TauEfficiencyCorrectionsTool.h:117
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_tPRWTool
ToolHandle< CP::IPileupReweightingTool > m_tPRWTool
Definition: TauEfficiencyCorrectionsTool.h:126
TauAnalysisTools::TauEfficiencyCorrectionsTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematics
Definition: TauEfficiencyCorrectionsTool.cxx:258
TauEfficiencyTriggerTool.h
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameJetIDHadTau
std::string m_sVarNameJetIDHadTau
Definition: TauEfficiencyCorrectionsTool.h:107
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathJetIDHadTau
std::string m_sInputFilePathJetIDHadTau
Definition: TauEfficiencyCorrectionsTool.h:98
TauAnalysisTools::TauEfficiencyCorrectionsTool::GetTriggerSFMeasurementString
std::string GetTriggerSFMeasurementString() const
Definition: TauEfficiencyCorrectionsTool.cxx:533
TauAnalysisTools::TauEfficiencyCorrectionsTool::ConvertEleIDToString
std::string ConvertEleIDToString(const int iLevel) const
Definition: TauEfficiencyCorrectionsTool.cxx:499
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_firstEvent
bool m_firstEvent
Definition: TauEfficiencyCorrectionsTool.h:122
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameTriggerHadTau
std::string m_sVarNameTriggerHadTau
Definition: TauEfficiencyCorrectionsTool.h:109
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameEleIDHadTau
std::string m_sVarNameEleIDHadTau
Definition: TauEfficiencyCorrectionsTool.h:105
TauAnalysisTools::TauEfficiencyCorrectionsTool::~TauEfficiencyCorrectionsTool
~TauEfficiencyCorrectionsTool()
Definition: TauEfficiencyCorrectionsTool.cxx:55
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sTriggerSFMeasurement
std::string m_sTriggerSFMeasurement
Definition: TauEfficiencyCorrectionsTool.h:112
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathTriggerHadTau
std::string m_sInputFilePathTriggerHadTau
Definition: TauEfficiencyCorrectionsTool.h:102
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathEleIDElectron
std::string m_sInputFilePathEleIDElectron
Definition: TauEfficiencyCorrectionsTool.h:101
CP::SystematicVariation
Definition: SystematicVariation.h:47
TauAnalysisTools::TauEfficiencyCorrectionsTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: TauEfficiencyCorrectionsTool.cxx:457
ITauEfficiencyCorrectionsTool.h
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vTriggerEfficiencyTools
std::vector< asg::AnaToolHandle< ITauEfficiencyCorrectionsTool > * > m_vTriggerEfficiencyTools
Definition: TauEfficiencyCorrectionsTool.h:96
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vEfficiencyCorrectionTypes
std::vector< int > m_vEfficiencyCorrectionTypes
Definition: TauEfficiencyCorrectionsTool.h:94
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameEleIDElectron
std::string m_sVarNameEleIDElectron
Definition: TauEfficiencyCorrectionsTool.h:106
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iRunNumber
unsigned int m_iRunNumber
Definition: TauEfficiencyCorrectionsTool.h:123
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vCommonEfficiencyTools
std::vector< asg::AnaToolHandle< ITauEfficiencyCorrectionsTool > * > m_vCommonEfficiencyTools
Definition: TauEfficiencyCorrectionsTool.h:95
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bUseTauSubstructure
bool m_bUseTauSubstructure
Definition: TauEfficiencyCorrectionsTool.h:114
IPileupReweightingTool.h
TauAnalysisTools::TauEfficiencyCorrectionsTool::beginEvent
StatusCode beginEvent()
Function called when a new events is loaded.
Definition: TauEfficiencyCorrectionsTool.cxx:131
TauAnalysisTools::TauEfficiencyCorrectionsTool::readRandomRunNumber
StatusCode readRandomRunNumber()
Definition: TauEfficiencyCorrectionsTool.cxx:547
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TauAnalysisTools::TauEfficiencyCorrectionsTool
Definition: TauEfficiencyCorrectionsTool.h:34
TauAnalysisTools::TauEfficiencyCorrectionsTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: TauEfficiencyCorrectionsTool.cxx:64
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sTriggerName
std::string m_sTriggerName
Definition: TauEfficiencyCorrectionsTool.h:111
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
TauAnalysisTools::TauEfficiencyCorrectionsTool::TauEfficiencyCorrectionsTool
TauEfficiencyCorrectionsTool(const std::string &sName)
Create a proper constructor for Athena.
Definition: TauEfficiencyCorrectionsTool.cxx:18
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameBase
std::string m_sVarNameBase
Definition: TauEfficiencyCorrectionsTool.h:103
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iEleIDLevel
int m_iEleIDLevel
Definition: TauEfficiencyCorrectionsTool.h:119
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bSkipTruthMatchCheck
bool m_bSkipTruthMatchCheck
Definition: TauEfficiencyCorrectionsTool.h:113
TauAnalysisTools::TauEfficiencyCorrectionsTool::ConvertTriggerIDToString
std::string ConvertTriggerIDToString(const int iLevel) const
Definition: TauEfficiencyCorrectionsTool.cxx:516
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathEleIDHadTau
std::string m_sInputFilePathEleIDHadTau
Definition: TauEfficiencyCorrectionsTool.h:100
AnaToolHandle.h
TauAnalysisTools::TauEfficiencyCorrectionsTool::getEfficiencyScaleFactor
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::TauJet &xTau, double &eff, unsigned int iRunNumber=0, unsigned int iMu=0)
Get the tau efficiency scale factor.
Definition: TauEfficiencyCorrectionsTool.cxx:196
TauAnalysisTools::TauEfficiencyCorrectionsTool::printConfig
virtual void printConfig() const
Print tool configuration.
Definition: TauEfficiencyCorrectionsTool.cxx:168
CommonEfficiencyTool.h
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sMCCampaign
std::string m_sMCCampaign
Definition: TauEfficiencyCorrectionsTool.h:120
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iMu
unsigned int m_iMu
Definition: TauEfficiencyCorrectionsTool.h:124
TauAnalysisTools::TauEfficiencyCorrectionsTool::isSupportedRunNumber
virtual bool isSupportedRunNumber(int) const
check if run number is supported in recommendations
Definition: TauEfficiencyCorrectionsTool.h:71
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sRecommendationTag
std::string m_sRecommendationTag
Definition: TauEfficiencyCorrectionsTool.h:110
TauAnalysisTools::TauEfficiencyCorrectionsTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
Definition: TauEfficiencyCorrectionsTool.cxx:283
TauAnalysisTools::TauEfficiencyCorrectionsTool::initializeTools_2022_prerec
StatusCode initializeTools_2022_prerec()
Definition: TauEfficiencyCorrectionsTool.cxx:310
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathDecayModeHadTau
std::string m_sInputFilePathDecayModeHadTau
Definition: TauEfficiencyCorrectionsTool.h:99
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameDecayModeHadTau
std::string m_sVarNameDecayModeHadTau
Definition: TauEfficiencyCorrectionsTool.h:108
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
TauAnalysisTools::TauEfficiencyCorrectionsTool::applyEfficiencyScaleFactor
virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::TauJet &xTau, unsigned int iRunNumber=0, unsigned int iMu=0)
Decorate the tau with its efficiency scale factor.
Definition: TauEfficiencyCorrectionsTool.cxx:231
AsgMetadataTool.h
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iJetIDLevel
int m_iJetIDLevel
Definition: TauEfficiencyCorrectionsTool.h:118
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
TauAnalysisTools::TauEfficiencyCorrectionsTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
Definition: TauEfficiencyCorrectionsTool.cxx:271
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathRecoHadTau
std::string m_sInputFilePathRecoHadTau
Definition: TauEfficiencyCorrectionsTool.h:97
TauAnalysisTools::TauEfficiencyCorrectionsTool::firstEvent
StatusCode firstEvent()
Definition: TauEfficiencyCorrectionsTool.cxx:115
TauAnalysisTools::ITauEfficiencyCorrectionsTool
Definition: ITauEfficiencyCorrectionsTool.h:31
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarNameRecoHadTau
std::string m_sVarNameRecoHadTau
Definition: TauEfficiencyCorrectionsTool.h:104
TauAnalysisTools::TauEfficiencyCorrectionsTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
Definition: TauEfficiencyCorrectionsTool.cxx:294
TauAnalysisTools::TauEfficiencyCorrectionsTool::ConvertJetIDToString
std::string ConvertJetIDToString(const int iLevel) const
Definition: TauEfficiencyCorrectionsTool.cxx:478
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_useFastSim
bool m_useFastSim
Definition: TauEfficiencyCorrectionsTool.h:121
TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bIsData
bool m_bIsData
Definition: TauEfficiencyCorrectionsTool.h:115