Commit c3ba1070 authored by Philip Sommer's avatar Philip Sommer
Browse files

Configuration for two different electron ID menus in run-2 and run-3

parent b730ce85
......@@ -67,36 +67,41 @@ def makeEGammaDFCommon():
from ElectronPhotonSelectorTools.ConfiguredAsgElectronLikelihoodTools import (
ConfiguredAsgElectronLikelihoodTool)
from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import (
electronLHmenu)
lhMenu = electronLHmenu.offlineMC21
from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags
if geoFlags.Run() == "RUN2" :
lhMenu = electronLHmenu.offlineMC20
# Very Loose
ElectronLHSelectorVeryLoose = ConfiguredAsgElectronLikelihoodTool(
"ElectronLHSelectorVeryLoose", LikeEnum.VeryLoose)
"ElectronLHSelectorVeryLoose", LikeEnum.VeryLoose, lhMenu)
ElectronLHSelectorVeryLoose.primaryVertexContainer = "PrimaryVertices"
ToolSvc += ElectronLHSelectorVeryLoose
# Loose
ElectronLHSelectorLoose = ConfiguredAsgElectronLikelihoodTool(
"ElectronLHSelectorLoose", LikeEnum.Loose)
"ElectronLHSelectorLoose", LikeEnum.Loose, lhMenu)
ElectronLHSelectorLoose.primaryVertexContainer = "PrimaryVertices"
ToolSvc += ElectronLHSelectorLoose
# Medium
ElectronLHSelectorMedium = ConfiguredAsgElectronLikelihoodTool(
"ElectronLHSelectorMedium", LikeEnum.Medium)
"ElectronLHSelectorMedium", LikeEnum.Medium, lhMenu)
ElectronLHSelectorMedium.primaryVertexContainer = "PrimaryVertices"
ToolSvc += ElectronLHSelectorMedium
# Tight
ElectronLHSelectorTight = ConfiguredAsgElectronLikelihoodTool(
"ElectronLHSelectorTight", LikeEnum.Tight)
"ElectronLHSelectorTight", LikeEnum.Tight, lhMenu)
ElectronLHSelectorTight.primaryVertexContainer = "PrimaryVertices"
ToolSvc += ElectronLHSelectorTight
# LooseBL
from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import (
AsgElectronLikelihoodTool)
ElectronLHSelectorLooseBL = AsgElectronLikelihoodTool(
"ElectronLHSelectorLooseBL", WorkingPoint="LooseBLLHElectron")
ElectronLHSelectorLooseBL = ConfiguredAsgElectronLikelihoodTool(
"ElectronLHSelectorLooseBL", LikeEnum.LooseBL, lhMenu)
ElectronLHSelectorLooseBL.primaryVertexContainer = "PrimaryVertices"
ToolSvc += ElectronLHSelectorLooseBL
......
......@@ -32,6 +32,21 @@ const std::map<std::string, std::string> LHPointToConfFile = {
{ "TightLHElectron",
"ElectronPhotonSelectorTools/offline/mc20_20220620/"
"ElectronLikelihoodTightOfflineConfig2018_Smooth.conf" },
{ "VeryLooseLHElectron_Run2",
"ElectronPhotonSelectorTools/offline/mc20_20220620/"
"ElectronLikelihoodVeryLooseOfflineConfig2018_Smooth.conf" },
{ "LooseLHElectron_Run2",
"ElectronPhotonSelectorTools/offline/mc20_20220620/"
"ElectronLikelihoodLooseOfflineConfig2018_Smooth.conf" },
{ "LooseBLLHElectron_Run2",
"ElectronPhotonSelectorTools/offline/mc20_20220620/"
"ElectronLikelihoodLooseOfflineConfig2018_CutBL_Smooth.conf" },
{ "MediumLHElectron_Run2",
"ElectronPhotonSelectorTools/offline/mc20_20220620/"
"ElectronLikelihoodMediumOfflineConfig2018_Smooth.conf" },
{ "TightLHElectron_Run2",
"ElectronPhotonSelectorTools/offline/mc20_20220620/"
"ElectronLikelihoodTightOfflineConfig2018_Smooth.conf" },
};
const std::map<std::string, std::string> PhotonCutPointToConfFile = {
{ "LoosePhoton",
......
......@@ -14,7 +14,7 @@ def AsgElectronLikelihoodToolCfg(
flag,
name,
quality,
menu=electronLHmenu.offlineMC16):
menu=electronLHmenu.offlineMC21):
mlog = logging.getLogger('AsgElectronLikelihoodTool')
mlog.debug('Start configuration')
......
......@@ -19,7 +19,7 @@ from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import (
def ConfiguredAsgElectronLikelihoodTool(
name, quality, menu=electronLHmenu.offlineMC16, **kw):
name, quality, menu=electronLHmenu.offlineMC21, **kw):
"""
Configure the AsgElectronIsEMSelector with the quality cuts
and allow for (re-)setting of all provided cuts.
......
......@@ -33,40 +33,75 @@ def ElectronLikelihoodTightTriggerConfig2015(theTool):
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/trigger/mc15_20150712/ElectronLikelihoodTightTriggerConfig2015.conf"
def ElectronLikelihoodVeryLooseOfflineConfig2016(theTool):
def ElectronLikelihoodVeryLooseOfflineConfigMC20(theTool):
'''
This is for the custom implementation of the VeryLoose offline likelihood for MC16 / Run 2 / Release 21.
This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
This is for the custom implementation of the VeryLoose offline likelihood for MC20 / Run2 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodVeryLooseOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodLooseOfflineConfig2016(theTool):
def ElectronLikelihoodLooseOfflineConfigMC20(theTool):
'''
This is for the custom implementation of the Loose offline likelihood for MC16 / Run 2 / Release 21.
This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
(NOTE: same signal eff as offline Loosepp + 1%)
This is for the custom implementation of the Loose offline likelihood for MC20 / Run2 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodLooseOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodLooseBLOfflineConfigMC20(theTool):
'''
This is for the custom implementation of the Loose + b-layer offline likelihood for MC20 / Run2 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodLooseOfflineConfig2018_CutBL_Smooth.conf"
def ElectronLikelihoodMediumOfflineConfig2016(theTool):
def ElectronLikelihoodMediumOfflineConfigMC20(theTool):
'''
This is for the custom implementation of the Medium offline likelihood for MC16 / Run 2 / Release 21.
This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
This is for the custom implementation of the Medium offline likelihood for MC20 / Run2 / Release 22.
(NOTE: same signal eff as offline Mediumpp + 1%)
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodMediumOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodTightOfflineConfigMC20(theTool):
'''
This is for the custom implementation of the Tight offline likelihood for MC20 / Run2 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodTightOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodVeryLooseOfflineConfigMC21(theTool):
'''
This is for the custom implementation of the VeryLoose offline likelihood for MC21 / Run3 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodVeryLooseOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodLooseOfflineConfigMC21(theTool):
'''
This is for the custom implementation of the Loose offline likelihood for MC21 / Run3 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodLooseOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodLooseBLOfflineConfigMC21(theTool):
'''
This is for the custom implementation of the Loose + b-layer offline likelihood for MC21 / Run3 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodLooseOfflineConfig2018_CutBL_Smooth.conf"
def ElectronLikelihoodMediumOfflineConfigMC21(theTool):
'''
This is for the custom implementation of the Medium offline likelihood for MC21 / Run3 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodMediumOfflineConfig2018_Smooth.conf"
def ElectronLikelihoodTightOfflineConfig2016(theTool):
def ElectronLikelihoodTightOfflineConfigMC21(theTool):
'''
This is for the custom implementation of the Tight offline likelihood for MC16 / Run 2 / Release 21.
This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
(NOTE: same signal eff as offline Tightpp + 1%)
This is for the custom implementation of the Tight offline likelihood for MC21 / Run3 / Release 22.
'''
theTool = GetTool(theTool)
theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc20_20220620/ElectronLikelihoodTightOfflineConfig2018_Smooth.conf"
......@@ -16,7 +16,8 @@ import ElectronPhotonSelectorTools.ElectronLikelihoodMenuDefs as ElectronLikelih
class electronLHmenu:
trigger2015 = 1
offlineMC16 = 3
offlineMC20 = 5
offlineMC21 = 6
# format - key: (mask, function)
......@@ -27,18 +28,28 @@ ElectronLHMapTrigger2015 = {
LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightTriggerConfig2015),
}
ElectronLHMapOffline2016 = {
LikeEnum.VeryLoose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseOfflineConfig2016),
LikeEnum.Loose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseOfflineConfig2016),
LikeEnum.Medium: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumOfflineConfig2016),
LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfig2016),
ElectronLHMapOfflineMC20 = {
LikeEnum.VeryLoose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseOfflineConfigMC20),
LikeEnum.Loose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseOfflineConfigMC20),
LikeEnum.LooseBL: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseBLOfflineConfigMC20),
LikeEnum.Medium: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumOfflineConfigMC20),
LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfigMC20),
}
ElectronLHMapOfflineMC21 = {
LikeEnum.VeryLoose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseOfflineConfigMC21),
LikeEnum.Loose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseOfflineConfigMC21),
LikeEnum.LooseBL: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseBLOfflineConfigMC21),
LikeEnum.Medium: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumOfflineConfigMC21),
LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfigMC21),
}
def ElectronLikelihoodMap(quality, menu):
if menu == electronLHmenu.trigger2015:
return ElectronLHMapTrigger2015[quality]
elif menu == electronLHmenu.offlineMC16:
return ElectronLHMapOffline2016[quality]
elif menu == electronLHmenu.offlineMC20:
return ElectronLHMapOfflineMC20[quality]
elif menu == electronLHmenu.offlineMC21:
return ElectronLHMapOfflineMC21[quality]
else:
raise ValueError("Requested menu is undefined: %d" % menu)
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