Skip to content

Commit

Permalink
Add support to electron LooseBL PID (#1581)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jbossios authored Nov 29, 2022
1 parent f267bdd commit 408205b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Root/ElectronEfficiencyCorrector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 4 additions & 10 deletions Root/ElectronSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) );


Expand All @@ -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 {
Expand Down Expand Up @@ -991,7 +985,7 @@ int ElectronSelector :: passCuts( const xAOD::Electron* electron, const xAOD::Ve

if ( m_readIDFlagsFromDerivation ) {

const static SG::AuxElement::ConstAccessor<char> acc_EG_Loose("DFCommonElectronsLHLoose");
const static SG::AuxElement::ConstAccessor<char> acc_EG_Loose("DFCommonElectronsLHLooseBL");
const static SG::AuxElement::ConstAccessor<char> acc_EG_Medium("DFCommonElectronsLHMedium");
const static SG::AuxElement::ConstAccessor<char> acc_EG_Tight("DFCommonElectronsLHTight");

Expand All @@ -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 ); }
}
Expand All @@ -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 ); }
}
Expand Down

0 comments on commit 408205b

Please sign in to comment.