From 408205b9395c34838c07d6aa86b9933e5c7b21f7 Mon Sep 17 00:00:00 2001 From: Jonathan Bossio Date: Tue, 29 Nov 2022 16:37:33 +0100 Subject: [PATCH] Add support to electron LooseBL PID (#1581) * Add support to LooseBL(ayer) Electron LooseBL ID working point is now saved in derivations SF: Loose -> LooseBLayer (==LooseBL) [Loose not supported] * Maintain el LoosePID support when not using daods Delete deprecated lines --- Root/ElectronEfficiencyCorrector.cxx | 4 ++++ Root/ElectronSelector.cxx | 14 ++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Root/ElectronEfficiencyCorrector.cxx b/Root/ElectronEfficiencyCorrector.cxx index 890f36ee4b..03243e0729 100644 --- a/Root/ElectronEfficiencyCorrector.cxx +++ b/Root/ElectronEfficiencyCorrector.cxx @@ -127,6 +127,10 @@ EL::StatusCode ElectronEfficiencyCorrector :: initialize () // if ( !m_WorkingPointPID.empty() ) { + // Loose working point saved as DFCommonElectronsLHLooseBL in derivations + // but SFs provided for LooseBLayer instead (naming mismatch) + if (m_WorkingPointPID == "LooseBL") m_WorkingPointPID = "LooseBLayer"; // protection + ANA_MSG_INFO("Electron ID working point: " << m_WorkingPointPID); m_pidEffSF_tool_name = "ElectronEfficiencyCorrectionTool_effSF_PID_" + m_WorkingPointPID; diff --git a/Root/ElectronSelector.cxx b/Root/ElectronSelector.cxx index d6c3f7d642..6b80271c52 100644 --- a/Root/ElectronSelector.cxx +++ b/Root/ElectronSelector.cxx @@ -268,7 +268,7 @@ EL::StatusCode ElectronSelector :: initialize () if( m_doLHPID ){ // if not using LH PID, make sure all the decorations will be set ... by choosing the loosest WP! - std::string likelihoodWP = ( m_doLHPIDcut ) ? m_LHOperatingPoint : "Loose"; + std::string likelihoodWP = ( m_doLHPIDcut ) ? m_LHOperatingPoint : "LooseBL"; m_el_LH_PIDManager = new ElectronLHPIDManager( likelihoodWP, msgLvl(MSG::DEBUG) ); @@ -280,12 +280,6 @@ EL::StatusCode ElectronSelector :: initialize () } if ( m_readIDFlagsFromDerivation ) { - // LooseBL is not in Derivations, so choose Loose and do BLayer cut locally - if( m_LHOperatingPoint == "LooseBL" ){ - m_LHOperatingPoint = "Loose"; - m_doBLTrackQualityCut = true; - } - ANA_MSG_INFO( "Reading Electron LH ID from DAODs ..." ); ANA_CHECK( m_el_LH_PIDManager->setupWPs( false )); } else { @@ -991,7 +985,7 @@ int ElectronSelector :: passCuts( const xAOD::Electron* electron, const xAOD::Ve if ( m_readIDFlagsFromDerivation ) { - const static SG::AuxElement::ConstAccessor acc_EG_Loose("DFCommonElectronsLHLoose"); + const static SG::AuxElement::ConstAccessor acc_EG_Loose("DFCommonElectronsLHLooseBL"); const static SG::AuxElement::ConstAccessor acc_EG_Medium("DFCommonElectronsLHMedium"); const static SG::AuxElement::ConstAccessor acc_EG_Tight("DFCommonElectronsLHTight"); @@ -1005,7 +999,7 @@ int ElectronSelector :: passCuts( const xAOD::Electron* electron, const xAOD::Ve passSelID = acc_EG_Medium( *electron ) && acc_EG_Tight( *electron ); } else if(m_LHOperatingPoint == "Medium"){ passSelID = ( acc_EG_Loose( *electron ) && acc_EG_Medium( *electron ) ) || acc_EG_Tight( *electron ); - } else if (m_LHOperatingPoint == "Loose") { + } else if (m_LHOperatingPoint == "LooseBL") { passSelID = acc_EG_Medium( *electron ) || acc_EG_Loose( *electron ); } else { passSelID = LHDecision( *electron ); } } @@ -1031,7 +1025,7 @@ int ElectronSelector :: passCuts( const xAOD::Electron* electron, const xAOD::Ve passThisID = acc_EG_Medium( *electron ) && acc_EG_Tight( *electron ); } else if(decorWP == "LHMedium"){ passThisID = ( acc_EG_Loose( *electron ) && acc_EG_Medium( *electron ) ) || acc_EG_Tight( *electron ); - } else if (decorWP == "LHLoose") { + } else if (decorWP == "LHLooseBL" || decorWP == "LHLoose") { passThisID = acc_EG_Medium( *electron ) || acc_EG_Loose( *electron ); } else { passThisID = LHDecisionAll( *electron ); } }