From 2e0baecaa3403f5af70b49dace6e745e84d4cb31 Mon Sep 17 00:00:00 2001 From: Michael Hank Date: Fri, 18 Oct 2024 15:30:46 -0500 Subject: [PATCH] Allowing electron trigger efficiency tool map to be overwritten separately from other tools --- Root/ElectronEfficiencyCorrector.cxx | 10 ++++++++-- xAODAnaHelpers/ElectronEfficiencyCorrector.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Root/ElectronEfficiencyCorrector.cxx b/Root/ElectronEfficiencyCorrector.cxx index 1ac4dff6e1..af6d346b3c 100644 --- a/Root/ElectronEfficiencyCorrector.cxx +++ b/Root/ElectronEfficiencyCorrector.cxx @@ -314,7 +314,10 @@ EL::StatusCode ElectronEfficiencyCorrector :: initialize () } else { m_asgElEffCorrTool_elSF_Trig = new AsgElectronEfficiencyCorrectionTool(m_TrigEffSF_tool_name); m_asgElEffCorrTool_elSF_Trig->msg().setLevel( MSG::ERROR ); // DEBUG, VERBOSE, INFO - if ( !m_overrideMapFilePath.empty() ) { + if ( !m_overrideMapFilePathTrig.empty() ) { + ANA_MSG_WARNING( "Overriding MapFilePath for trigger SF only to " << m_overrideMapFilePathTrig ); + ANA_CHECK( m_asgElEffCorrTool_elSF_Trig->setProperty("MapFilePath", m_overrideMapFilePathTrig)); + } else if ( !m_overrideMapFilePath.empty() ) { ANA_MSG_WARNING( "Overriding MapFilePath to " << m_overrideMapFilePath ); ANA_CHECK( m_asgElEffCorrTool_elSF_Trig->setProperty("MapFilePath", m_overrideMapFilePath)); } @@ -334,7 +337,10 @@ EL::StatusCode ElectronEfficiencyCorrector :: initialize () } else { m_asgElEffCorrTool_elSF_TrigMCEff = new AsgElectronEfficiencyCorrectionTool(m_TrigMCEff_tool_name); m_asgElEffCorrTool_elSF_TrigMCEff->msg().setLevel( MSG::ERROR ); // DEBUG, VERBOSE, INFO - if ( !m_overrideMapFilePath.empty() ) { + if ( !m_overrideMapFilePathTrig.empty() ) { + ANA_MSG_WARNING( "Overriding MapFilePath for trigger SF only to " << m_overrideMapFilePathTrig ); + ANA_CHECK( m_asgElEffCorrTool_elSF_TrigMCEff->setProperty("MapFilePath", m_overrideMapFilePathTrig)); + } else if ( !m_overrideMapFilePath.empty() ) { ANA_MSG_WARNING( "Overriding MapFilePath to " << m_overrideMapFilePath ); ANA_CHECK( m_asgElEffCorrTool_elSF_TrigMCEff->setProperty("MapFilePath", m_overrideMapFilePath)); } diff --git a/xAODAnaHelpers/ElectronEfficiencyCorrector.h b/xAODAnaHelpers/ElectronEfficiencyCorrector.h index ae5fce8bac..4956aa8434 100644 --- a/xAODAnaHelpers/ElectronEfficiencyCorrector.h +++ b/xAODAnaHelpers/ElectronEfficiencyCorrector.h @@ -87,6 +87,9 @@ class ElectronEfficiencyCorrector : public xAH::Algorithm /// @brief Override corrections map file (not recommended) std::string m_overrideMapFilePath = ""; + /// @brief Override corrections map file for trigger (needed as Run2 R22 Trigger SF use R21 values) + std::string m_overrideMapFilePathTrig = ""; + private: int m_numEvent; //! int m_numObject; //!