Commit 8ac27271 authored by Nils Erik Krumnack's avatar Nils Erik Krumnack
Browse files

Merge branch '21.2-AnalysisTop-ElectronChargeMisIDSF' into '21.2'

AnalysisTop: Do not setup the ChargeMisID tool when unsupported WPs are requested

See merge request atlas/athena!48267
parents 2b02c17d f66e0c7f
......@@ -508,10 +508,10 @@ namespace top {
// Charge ID cannot use maps at the moment so we default to the old method
if (m_config->useElectronChargeIDSelection()
&& electronIsolation != "PLVTight"
&& electronIsolation != "PLVLoose"
&& electronIsolationLoose != "PLVTight"
&& electronIsolationLoose != "PLVLoose" ) { // We need to update the implementation according to new
&& electronIsolation != "PLVTight"
&& electronIsolation != "PLVLoose"
&& electronIsolationLoose != "PLVTight"
&& electronIsolationLoose != "PLVLoose" ) { // We need to update the implementation according to new
// recommendations
ATH_MSG_INFO("Setting up Electrons ChargeID SF tool");
// Charge ID file (no maps)
......@@ -530,19 +530,22 @@ namespace top {
m_electronEffSFChargeID = setupElectronSFTool(elSFPrefix + "ChargeID", inChargeID, dataType);
m_electronEffSFChargeIDLoose = setupElectronSFTool(elSFPrefix + "ChargeIDLoose", inChargeIDLoose, dataType);
}
// Charge flip correction: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EgammaChargeMisIdentificationTool
CP::ElectronChargeEfficiencyCorrectionTool* ChargeMisIDCorrections = new CP::ElectronChargeEfficiencyCorrectionTool(
"ElectronChargeEfficiencyCorrection");
CP::ElectronChargeEfficiencyCorrectionTool* ChargeMisIDCorrectionsLoose =
new CP::ElectronChargeEfficiencyCorrectionTool("ElectronChargeEfficiencyCorrectionLoose");
m_electronEffSFChargeMisIDFile = electronSFFilePath("ChargeMisID", electronID, electronIsolation);
m_electronEffSFChargeMisIDLooseFile = electronSFFilePath("ChargeMisID", electronIDLoose, electronIsolationLoose);
top::check(ChargeMisIDCorrections->setProperty("CorrectionFileName",
m_electronEffSFChargeMisIDFile), "Failed to setProperty");
top::check(ChargeMisIDCorrections->initialize(), "Failed to setProperty");
top::check(ChargeMisIDCorrectionsLoose->setProperty("CorrectionFileName",
m_electronEffSFChargeMisIDLooseFile), "Failed to setProperty");
top::check(ChargeMisIDCorrectionsLoose->initialize(), "Failed to setProperty");
if (electronIsolation != "PLVTight" && electronIsolation != "PLVLoose" &&
electronIsolationLoose != "PLVTight" && electronIsolationLoose != "PLVLoose") {
// Charge flip correction: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EgammaChargeMisIdentificationTool
CP::ElectronChargeEfficiencyCorrectionTool* ChargeMisIDCorrections = new CP::ElectronChargeEfficiencyCorrectionTool(
"ElectronChargeEfficiencyCorrection");
CP::ElectronChargeEfficiencyCorrectionTool* ChargeMisIDCorrectionsLoose =
new CP::ElectronChargeEfficiencyCorrectionTool("ElectronChargeEfficiencyCorrectionLoose");
m_electronEffSFChargeMisIDFile = electronSFFilePath("ChargeMisID", electronID, electronIsolation);
m_electronEffSFChargeMisIDLooseFile = electronSFFilePath("ChargeMisID", electronIDLoose, electronIsolationLoose);
top::check(ChargeMisIDCorrections->setProperty("CorrectionFileName",
m_electronEffSFChargeMisIDFile), "Failed to setProperty");
top::check(ChargeMisIDCorrections->initialize(), "Failed to setProperty");
top::check(ChargeMisIDCorrectionsLoose->setProperty("CorrectionFileName",
m_electronEffSFChargeMisIDLooseFile), "Failed to setProperty");
top::check(ChargeMisIDCorrectionsLoose->initialize(), "Failed to setProperty");
}
return StatusCode::SUCCESS;
}
......
......@@ -352,10 +352,8 @@ namespace top {
id *= electronSF_ID(*elPtr, electronID, SFSyst, retrieveLoose);
isol *= electronSF_Isol(*elPtr, electronIso, SFSyst, retrieveLoose);
chargeid *= electronSF_ChargeID(*elPtr, electronID, electronIso, SFSyst, retrieveLoose);
// Charge MisID is not supported for PLVTight/Loose, we already printed a warning message in TopEgammaCPTools
if (electronIso != "PLVTight" && electronIso != "PLVLoose") {
chargemisid *= electronSF_ChargeMisID(*elPtr, electronID, electronIso, SFSyst, retrieveLoose);
}
// we can add charge misID SF since it defaults to 1. for the unsupported WPs
chargemisid *= electronSF_ChargeMisID(*elPtr, electronID, electronIso, SFSyst, retrieveLoose);
}
sf = reco * id * isol; // *chargeid*chargemisid; // let the charge id scale factors out until further tested by
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment