Commit 07d5ffb2 authored by Bjoern Wendland's avatar Bjoern Wendland Committed by Nils Erik Krumnack
Browse files

AT: Adding configurable parameter for testing custom electron ID SF files

parent c6b0f965
......@@ -682,6 +682,15 @@ int main(int argc, char** argv) {
<< " TO USE DEFAULT MODEL, REMOVE 'EGammaCalibrationModel' FROM CONFIG FILE \n"
<< "*************************************************************************\n\n");
}
if (topConfig->printEIDFileWarning()) {
ATH_MSG_WARNING(
"\n*************************************************************************\n"
<< " YOU ARE USING THIS CUSTOM PATH TO THE ELECTRON ID SF FILE: \n\n"
<< topConfig->electronIDSFFilePath() << "\n\n"
<< " INSTEAD OF THE MOST RECENT RECOMMENDED MAP \n"
<< " YOU MANY NOT BE USING THE LATEST ELECTRON ID RECOMMENDATIONS \n"
<< "*************************************************************************\n\n");
}
const unsigned int entries = xaodEvent.getEntries();
totalEventsInFiles += entries;
......
......@@ -286,6 +286,11 @@ namespace top {
m_electronEffSFRecoFile = electronSFMapFilePath("reco");
// - Tight
m_electronEffSFIDFile = electronSFMapFilePath("ID");
std::vector<std::string> inExpID;
if(m_config->electronIDSFFilePath() !="Default"){
m_config->setPrintEIDFileWarning(true);
inExpID.push_back(electronSFFilePath("EXPID", electronID, electronIsolation));
}
m_electronEffSFTriggerFile = electronSFMapFilePath("trigger");
m_electronEffTriggerFile = electronSFMapFilePath("trigger");
std::vector<std::string> inPLViso;
......@@ -330,8 +335,9 @@ namespace top {
m_electronEffSFReco = setupElectronSFToolWithMap(elSFPrefix + "Reco", m_electronEffSFRecoFile, "Reconstruction", "",
"", "", dataType, "TOTAL", "", "");
// ID SFs
m_electronEffSFID = setupElectronSFToolWithMap(elSFPrefix + "ID", m_electronEffSFIDFile, "", electronID, "", "",
if(m_config->electronIDSFFilePath() =="Default") m_electronEffSFID = setupElectronSFToolWithMap(elSFPrefix + "ID", m_electronEffSFIDFile, "", electronID, "", "",
dataType, "TOTAL", "", "");
else m_electronEffSFID = setupElectronSFTool(elSFPrefix + "ID", inExpID, dataType);
m_electronEffSFIDLoose = setupElectronSFToolWithMap(elSFPrefix + "IDLoose", m_electronEffSFIDLooseFile, "",
electronIDLoose, "", "", dataType, "TOTAL", "", "");
// Trigger SFs
......@@ -382,11 +388,15 @@ namespace top {
m_config->electronEfficiencySystematicModelEtaBinning(),
m_config->electronEfficiencySystematicModelEtBinning());
// ID SFs
m_electronEffSFIDCorrModel = setupElectronSFToolWithMap(elSFPrefixCorrModel + "ID", m_electronEffSFIDFile, "",
if(m_config->electronIDSFFilePath() =="Default") m_electronEffSFIDCorrModel = setupElectronSFToolWithMap(elSFPrefixCorrModel + "ID", m_electronEffSFIDFile, "",
electronID, "", "", dataType,
m_config->electronEfficiencySystematicModel(),
m_config->electronEfficiencySystematicModelEtaBinning(),
m_config->electronEfficiencySystematicModelEtBinning());
else m_electronEffSFIDCorrModel = setupElectronSFTool(elSFPrefixCorrModel + "ID", inExpID, dataType,
m_config->electronEfficiencySystematicModel(),
m_config->electronEfficiencySystematicModelEtaBinning(),
m_config->electronEfficiencySystematicModelEtBinning());
m_electronEffSFIDLooseCorrModel = setupElectronSFToolWithMap(elSFPrefixCorrModel + "IDLoose",
m_electronEffSFIDLooseFile, "", electronIDLoose, "",
"", dataType,
......@@ -694,6 +704,8 @@ namespace top {
}
file_path += ".root";
file_path = el_calib_path + file_path;
} else if (type == "EXPID"){
file_path = m_config->electronIDSFFilePath();
} else {
ATH_MSG_ERROR("Unknown electron SF type");
}
......
......@@ -62,6 +62,8 @@ namespace top {
registerParameter("ElectronIDLoose",
"Type of electron for background. Likelihood LooseAndBLayerLH, MediumLH, TightLH", "MediumLH");
registerParameter("ElectronPt", "Electron pT cut for object selection (in MeV). Default 25 GeV.", "25000.");
registerParameter("ElectronIDSFFilePath", "EXPERIMENTAL! Path to a root file containing custom electron ID SFs, e.g. dev/ElectronEfficiencyCorrection/2015_2018/rel21.2/Precision_Summer2020_v1/offline/efficiencySF.offline.TightLLH_d0z0_v13.root."
"This should only be used by experts for testing SFs! Default: Using the most recent recommended map.", "Default");
registerParameter("EgammaSystematicModel", "Egamma Calibration Systematic model : FULL_v1 , 1NP_v1 (default)",
"1NP_v1");
registerParameter("ElectronEfficiencySystematicModel",
......
......@@ -1247,6 +1247,8 @@ namespace top {
this->fwdElectronBCIDCleaningMinRun(fwdElectronBCIDCleaningMinRun);
this->fwdElectronBCIDCleaningMaxRun(fwdElectronBCIDCleaningMaxRun);
m_electronIDSFFile_path = settings->value("ElectronIDSFFilePath");
// Photon configuration
this->photonPtcut(std::stof(settings->value("PhotonPt")));
this->photonEtacut(std::stof(settings->value("PhotonEta")));
......
......@@ -899,6 +899,13 @@ namespace top {
inline virtual int fwdElectronBCIDCleaningMinRun() const {return m_fwdElectronBCIDCleaningMinRun;}
inline virtual int fwdElectronBCIDCleaningMaxRun() const {return m_fwdElectronBCIDCleaningMaxRun;}
const std::string electronIDSFFilePath() const
{return m_electronIDSFFile_path;}
bool printEIDFileWarning() const
{return m_eid_path_warning;}
void setPrintEIDFileWarning(bool flag)
{m_eid_path_warning = flag;}
// Photon configuration
inline virtual void photonPtcut(const float pt) {
if (!m_configFixed) {
......@@ -2337,6 +2344,10 @@ namespace top {
bool m_useEgammaPileupCorrection;
bool m_enablePromptLeptonImprovedVetoStudies;
// experimental electronID map path
std::string m_electronIDSFFile_path = "Default";
bool m_eid_path_warning = false;
//Fwd electron configuration
float m_fwdElectronPtcut;
float m_fwdElectronMinEtacut;
......
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