00001
00002 #ifndef TAUANALYSISTOOLS_TAUEFFICIENCYTOOL_H
00003 #define TAUANALYSISTOOLS_TAUEFFICIENCYTOOL_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "AsgTools/AsgMetadataTool.h"
00017
00018
00019 #include "TauAnalysisTools/ITauEfficiencyCorrectionsTool.h"
00020 #include "TauAnalysisTools/TauSelectionTool.h"
00021 #include "TauAnalysisTools/CommonEfficiencyTool.h"
00022 #include "TauAnalysisTools/TauEfficiencyJetIDTool.h"
00023 #include "TauAnalysisTools/TauEfficiencyContJetIDTool.h"
00024 #include "TauAnalysisTools/TauEfficiencyEleIDTool.h"
00025 #include "TauAnalysisTools/TauEfficiencyTriggerTool.h"
00026
00027 #if __has_include("PileupReweighting/IPileupReweightingTool.h")
00028
00029 #include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
00030 #define TAUANALYSISTOOLS_PRWTOOL_AVAILABLE
00031 #endif
00032
00033 namespace TauAnalysisTools
00034 {
00035
00036 class TauEfficiencyCorrectionsTool
00037 : public virtual ITauEfficiencyCorrectionsTool
00038 , public asg::AsgMetadataTool
00039 {
00041 ASG_TOOL_CLASS( TauEfficiencyCorrectionsTool, TauAnalysisTools::ITauEfficiencyCorrectionsTool )
00042
00043 public:
00045 TauEfficiencyCorrectionsTool( const std::string& sName );
00046
00049 TauEfficiencyCorrectionsTool( const std::string& sName, TauSelectionTool* tTauSelectionTool ) __attribute__ ((deprecated("This function is deprecated. Please pass the TauSelectionTool as a ToolHandle via the property \"TauSelectionTool\". The function will be removed in the future without further notice.\nFor further information please refer to the README:\nhttps://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/TauID/TauAnalysisTools/trunk/doc/README-TauEfficiencyCorrectionsTool.rst")));
00050
00051 ~TauEfficiencyCorrectionsTool();
00052
00054 virtual StatusCode initialize();
00055
00057 virtual void printConfig(bool bAlways = true);
00058
00060 virtual CP::CorrectionCode getEfficiencyScaleFactor( const xAOD::TauJet& xTau,
00061 double& eff );
00063 virtual CP::CorrectionCode applyEfficiencyScaleFactor( const xAOD::TauJet& xTau );
00064
00066 virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const;
00067
00069 virtual CP::SystematicSet affectingSystematics() const;
00070
00072 virtual CP::SystematicSet recommendedSystematics() const;
00073
00074 virtual CP::SystematicCode applySystematicVariation( const CP::SystematicSet& systConfig );
00075
00076 virtual bool isSupportedRunNumber( int iRunNumber )
00077 {
00078 (void) iRunNumber;
00079 return true;
00080 };
00081
00082 private:
00083 StatusCode beginEvent();
00084
00085 std::string ConvertJetIDToString(const int& iLevel);
00086 std::string ConvertEleOLRToString(const int& iLevel);
00087 std::string ConvertTriggerIDToString(const int& iLevel);
00088
00089 StatusCode initializeWithTauSelectionTool();
00090
00091 StatusCode initializeTools_2017_moriond();
00092 StatusCode initializeTools_2016_fall();
00093 StatusCode initializeTools_2016_ichep();
00094 StatusCode initializeTools_mc15_moriond();
00095 StatusCode initializeTools_mc15_pre_recommendations();
00096 StatusCode initializeTools_mc12_final();
00097
00098 private:
00099
00100 std::vector<int> m_vEfficiencyCorrectionTypes;
00101 std::vector< asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* > m_vCommonEfficiencyTools;
00102 std::vector< asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* > m_vTriggerEfficiencyTools;
00103 std::string m_sInputFilePathRecoHadTau;
00104 std::string m_sInputFilePathEleOLRHadTau;
00105 std::string m_sInputFilePathEleOLRElectron;
00106 std::string m_sInputFilePathJetIDHadTau;
00107 std::string m_sInputFilePathContJetIDHadTau;
00108 std::string m_sInputFilePathEleIDHadTau;
00109 std::string m_sInputFilePathTriggerHadTau;
00110 std::string m_sVarNameBase;
00111 std::string m_sVarNameRecoHadTau;
00112 std::string m_sVarNameEleOLRHadTau;
00113 std::string m_sVarNameEleOLRElectron;
00114 std::string m_sVarNameJetIDHadTau;
00115 std::string m_sVarNameContJetIDHadTau;
00116 std::string m_sVarNameEleIDHadTau;
00117 std::string m_sVarNameTriggerHadTau;
00118 std::string m_sRecommendationTag;
00119 std::string m_sTriggerName;
00120 std::string m_sTriggerYear;
00121 bool m_bSkipTruthMatchCheck;
00122
00123 bool m_bUseIDExclusiveSF;
00124 bool m_bUseInclusiveEta;
00125 bool m_bUseTriggerInclusiveEta;
00126 bool m_bUsePtBinnedSF;
00127 bool m_bUseHighPtUncert;
00128 bool m_bIsData;
00129 bool m_bIsConfigured;
00130 int m_iIDLevel;
00131 int m_iEVLevel;
00132 int m_iOLRLevel;
00133 int m_iContSysType;
00134 int m_iTriggerPeriodBinning;
00135
00136 unsigned int m_iRunNumber;
00137
00138 ToolHandle<TauAnalysisTools::ITauSelectionTool> m_tTauSelectionToolHandle;
00139 #ifdef TAUANALYSISTOOLS_PRWTOOL_AVAILABLE
00140 ToolHandle<CP::IPileupReweightingTool> m_tPRWTool;
00141 #endif // TAUANALYSISTOOLS_PRWTOOL_AVAILABLE
00142 TauSelectionTool* m_tTauSelectionTool;
00143
00144 std::string m_sEventInfoName;
00145 };
00146
00147 }
00148
00149 #endif // TAUANALYSISTOOLS_TAUEFFICIENCYTOOL_H