Commit 9b4066fb authored by Baptiste Ravina's avatar Baptiste Ravina
Browse files

setup EGamma tools with PLV

parent 52edb14b
......@@ -283,12 +283,31 @@ namespace top {
m_electronEffSFIDFile = electronSFMapFilePath("ID");
m_electronEffSFTriggerFile = electronSFMapFilePath("trigger");
m_electronEffTriggerFile = electronSFMapFilePath("trigger");
m_electronEffSFIsoFile = electronSFMapFilePath("isolation");
std::vector<std::string> inPLViso;
if (electronIsolation == "PLVTight" ||
electronIsolation == "PLVLoose") {
std::cout << " BAPTISTE - PLV isolation!" << std::endl;
m_electronEffSFIsoFile = electronSFFilePath("PLV", electronID, electronIsolation);
inPLViso.push_back(m_electronEffSFIsoFile);
}
else {
std::cout << " BAPTISTE - isolation is " << electronIsolation << std::endl;
m_electronEffSFIsoFile = electronSFMapFilePath("isolation");
}
// - Loose
m_electronEffSFIDLooseFile = electronSFMapFilePath("ID");
m_electronEffSFTriggerLooseFile = electronSFMapFilePath("trigger");
m_electronEffTriggerLooseFile = electronSFMapFilePath("trigger");
m_electronEffSFIsoLooseFile = electronSFMapFilePath("isolation");
std::vector<std::string> inPLVisoLoose;
if (electronIsolationLoose == "PLVTight" ||
electronIsolationLoose == "PLVLoose") {
std::cout << " BAPTISTE - PLV isolation!" << std::endl;
m_electronEffSFIsoLooseFile = electronSFFilePath("PLV", electronID, electronIsolationLoose);
inPLVisoLoose.push_back(m_electronEffSFIsoLooseFile);
}
else {
m_electronEffSFIsoLooseFile = electronSFMapFilePath("isolation");
}
// Define the trigger string for scale factors
const std::string trigger_string = "SINGLE_E_2015_e24_lhmedium_L1EM20VH_"
......@@ -329,11 +348,19 @@ namespace top {
"", electronIDLoose, electronIsolationLoose,
"Eff_" + trigger_string, dataType, "TOTAL", "", "");
// Isolation SFs
m_electronEffSFIso = setupElectronSFToolWithMap(elSFPrefix + "Iso", m_electronEffSFIsoFile, "", electronID,
electronIsolation, "", dataType, "TOTAL", "", "");
m_electronEffSFIsoLoose = setupElectronSFToolWithMap(elSFPrefix + "IsoLoose", m_electronEffSFIsoLooseFile, "",
electronID, electronIsolationLoose, "", dataType, "TOTAL", "",
"");
if (electronIsolation == "PLVTight" ||
electronIsolation == "PLVLoose") {
std::cout << " BAPTISTE - PLV isolation!" << std::endl;
m_electronEffSFIso = setupElectronSFTool(elSFPrefix + "Iso", inPLViso, dataType);
m_electronEffSFIsoLoose = setupElectronSFTool(elSFPrefix + "IsoLoose", inPLVisoLoose, dataType);
}
else {
m_electronEffSFIso = setupElectronSFToolWithMap(elSFPrefix + "Iso", m_electronEffSFIsoFile, "", electronID,
electronIsolation, "", dataType, "TOTAL", "", "");
m_electronEffSFIsoLoose = setupElectronSFToolWithMap(elSFPrefix + "IsoLoose", m_electronEffSFIsoLooseFile, "",
electronID, electronIsolationLoose, "", dataType, "TOTAL", "",
"");
}
ATH_MSG_INFO(
"Requested Electrons SF tool for " << m_config->electronEfficiencySystematicModel() << " correlation model");
......@@ -421,7 +448,11 @@ namespace top {
// Charge ID cannot use maps at the moment so we default to the old method
if (m_config->useElectronChargeIDSelection()) { // We need to update the implementation according to new
if (m_config->useElectronChargeIDSelection()
&& 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)
......@@ -512,10 +543,15 @@ namespace top {
IAsgElectronEfficiencyCorrectionTool*
EgammaCPTools::setupElectronSFToolWithMap(const std::string& name, const std::string& map_path,
const std::string& reco_key, const std::string& ID_key,
const std::string& iso_key, const std::string& trigger_key,
const std::string& ISO_key, const std::string& trigger_key,
const int& data_type, const std::string& correlation_model,
const std::string& correlationModelEtaBinning,
const std::string& correlationModelEtBinning) {
std::string iso_key = ISO_key;
// https://twiki.cern.ch/twiki/bin/view/AtlasProtected/LatestRecommendationsElectronIDRun2#PLV_scale_factors_for_central_el
// If isolation WP is PLVTight or PLVLoose, switch to no isolation to trick this function.
if (iso_key == "PLVTight" || iso_key == "PLVLoose") iso_key = "";
std::string infoStr = "Configuring : name=" + name + " map=" + map_path + " reco_key=" + reco_key + " ID_key=" +
ID_key + " iso_key=" + iso_key + " trigger_key=" + trigger_key + "data_type=" +
std::to_string(data_type) +
......@@ -590,6 +626,22 @@ namespace top {
file_path += ISO;
file_path += "_ECIDSloose.root";
file_path = el_calib_path + file_path;
} else if (type == "PLV") {
if (ID != "MediumLLH" && ID != "TightLLH")
ATH_MSG_ERROR(
"The requested ID WP (" + ID +
") is not supported for PLV SFs! try TightLH or MediumLH instead."
);
file_path = "/ElectronEfficiencyCorrection/2015_2018/rel21.2/Precision_Summer2020_v1/isolation/";
file_path += "efficiencySF.Isolation.MediumLHorTightLH_d0z0_v13_isol";
file_path += ISO;
if (ISO == "PLVTight" && m_config->useElectronChargeIDSelection()) {
ATH_MSG_INFO(
"ECIDS tool and PLVTight isolation detected, switching to combined isolation SFs."
);
file_path += "ECIDS";
}
file_path += ".root";
} else if (type == "ChargeMisID") {
// Protect against "None" Iso key
std::string iso = ISO;
......@@ -600,7 +652,7 @@ namespace top {
file_path += "chargeEfficiencySF.";
file_path += ID;
file_path += "_d0z0_v13";
if (iso != "") file_path += "_" + iso;
if (iso != "" && iso != "PLVTight" && iso != "PLVLoose") file_path += "_" + iso;
if (m_config->useElectronChargeIDSelection()) {
if (ID != "MediumLLH" && ID != "TightLLH") ATH_MSG_WARNING("The requested ID WP (" + ID + ") is not supported for electron ECIDS+ChargeMisID SFs! Try TightLH or MediumLH instead. Will now switch to regular ChargeMisID SFs.");
else if (iso != "FCTight" && iso != "Gradient") ATH_MSG_WARNING("The requested ISO WP (" + iso + ") is not supported for electron ECIDS+ChargeMisID SFs! Try FCTight or Gradient instead. Will now switch to regular ChargeMisID SFs.");
......@@ -670,7 +722,7 @@ namespace top {
if (type == "HighPtCaloOnly") working_point = "FCHighPtCaloOnly";
if (type == "TightTrackOnly") working_point = "Gradient";
if (type == "TightTrackOnly_FixedRad") working_point = "Gradient";
if (type == "FCTight" || type == "FCLoose" || type == "FCHighPtCaloOnly" || type == "Gradient") working_point = type;
if (type == "FCTight" || type == "FCLoose" || type == "FCHighPtCaloOnly" || type == "Gradient" || type == "PLVTight" || type == "PLVLoose") working_point = type;
return working_point;
}
......
Supports Markdown
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