3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 acc.setPrivateTools(CompFactory.CP.IsolationSelectionTool(name, **kwargs))
17 from InDetConfig.InDetTrackSelectionToolConfig
import isoTrackSelectionToolCfg
20 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig
import isoTTVAToolCfg
21 kwargs.setdefault(
"TTVASelectionTool", acc.popToolsAndMerge(
isoTTVAToolCfg(flags, WorkingPoint = ttva_wp)))
22 from TrackToCalo.TrackToCaloConfig
import ParticleCaloExtensionToolCfg
24 the_tool = CompFactory.CP.IsolationCloseByCorrectionTool(name, **kwargs)
25 acc.setPrivateTools(the_tool)
31 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig
import AsgElectronLikelihoodToolCfg
32 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping
import electronLHmenu
33 from ElectronPhotonSelectorTools.LikelihoodEnums
import LikeEnum
34 from AthenaConfiguration.Enums
import LHCPeriod
36 name=
"ElectronSelTool",
37 quality = LikeEnum.VeryLoose,
38 menu=electronLHmenu.offlineMC21
if flags.GeoModel.Run >= LHCPeriod.Run3
else electronLHmenu.offlineMC20)))
40 from MuonSelectorTools.MuonSelectorToolsConfig
import MuonSelectionToolCfg
50 kwargs.setdefault(
"PhotContainer",
"")
51 the_alg = CompFactory.CP.IsoCloseByCorrectionTrkSelAlg(name+ttva_wp+suff, **kwargs)
52 result.addEventAlgo(the_alg, primary =
True)
55 def IsoCloseByCorrAlgCfg(flags, name="IsoCloseByCorrAlg", suff = "", isPhysLite = False, containerNames = [ "Muons", "Electrons", "Photons"], useSelTools = False, **kwargs):
59 isLLP1 = suff ==
"_LLP1"
62 elIsoWPs = [
"Loose_VarRad",
"TightTrackOnly_FixedRad" ]
63 muIsoWPs = [
"PflowLoose_VarRad",
"Loose_VarRad" ]
64 phIsoWPs = [
"FixedCutLoose",
"TightCaloOnly" ]
67 ElectronWPVec = elIsoWPs,
69 PhotonWPVec = phIsoWPs))
71 isoDecSuffix =
"CloseByCorr"
72 selectionDecorator =
"isoSelIsOK"
73 kwargs.setdefault(
"IsoCloseByCorrectionTool",
75 IsolationSelectionTool = isoTool,
76 SelectionDecorator = selectionDecorator,
77 IsoDecSuffix = isoDecSuffix,
78 EleContainers = [ x
for x
in containerNames
if x.find(
"Ele") != -1],
79 MuoContainers = [ x
for x
in containerNames
if x.find(
"Muo") != -1],
80 PhoContainers = [ x
for x
in containerNames
if x.find(
"Pho") != -1])))
83 from MuonSelectorTools.MuonSelectorToolsConfig
import MuonSelectionToolCfg
92 kwargs.setdefault(
"ElecSelectionKey",
"Electrons.DFCommonElectronsLHVeryLooseNoPix")
93 kwargs.setdefault(
"PhotSelectionKey",
"Photons.DFCommonPhotonsIsEMMedium")
95 kwargs.setdefault(
"ElecSelectionKey",
"Electrons.DFCommonElectronsLHVeryLoose")
96 kwargs.setdefault(
"PhotSelectionKey",
"Photons.DFCommonPhotonsIsEMLoose")
99 kwargs.setdefault(
"ParticleContainerKeys", containerNames)
102 kwargs.setdefault(
"MinElecPt", 0.)
103 kwargs.setdefault(
"MinMuonPt", 0.)
104 kwargs.setdefault(
"MinPhotPt", 0.)
107 the_alg = CompFactory.CP.IsoCloseByCorrectionAlg(name + suff, **kwargs)
108 result.addEventAlgo(the_alg)
115 kwargs.setdefault(
"IsoCloseByCorrectionTool", result.popToolsAndMerge(
117 CaloCorrectionModel = -1
119 for cont
in containers:
120 result.addEventAlgo(CompFactory.CP.IsoCloseByCaloDecorAlg(name = name + cont + suff,
121 PrimaryContainer = cont,
127 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig
import AsgElectronLikelihoodToolCfg
128 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping
import electronLHmenu
129 from ElectronPhotonSelectorTools.LikelihoodEnums
import LikeEnum
130 from AthenaConfiguration.Enums
import LHCPeriod
132 name=
"ElectronSelTool",
133 quality = LikeEnum.VeryLoose,
134 menu=electronLHmenu.offlineMC21
if flags.GeoModel.Run >= LHCPeriod.Run3
else electronLHmenu.offlineMC20)))
136 from MuonSelectorTools.MuonSelectorToolsConfig
import MuonSelectionToolCfg
142 the_alg = CompFactory.CP.TestIsolationCloseByCorrAlg(name + suff, **kwargs)
143 result.addEventAlgo(the_alg, primary =
True)
146 def IsoCloseByAlgsCfg(flags, suff = "", isPhysLite = False, containerNames = [ "Muons", "Electrons", "Photons"], stream_name="", ttva_wp = "Nonprompt_All_MaxWeight", useSelTools = False):
172 from IsolationSelection.IsolationSelectionConfig
import IsoCloseByCorrAlgCfg
173 acc.merge(
IsoCloseByCorrAlgCfg(flags, suff = suff, isPhysLite = isPhysLite, containerNames = containerNames, useSelTools = useSelTools))
182 iso_corr_vars = [
"IsoCloseByCorr_assocClustEta",
"IsoCloseByCorr_assocClustPhi",
"IsoCloseByCorr_assocClustEnergy",
183 "IsoCloseByCorr_assocClustDecor",
"IsoCloseByCorr_assocPflowEta",
"IsoCloseByCorr_assocPflowPhi",
"IsoCloseByCorr_assocPflowEnergy",
184 "IsoCloseByCorr_assocPflowDecor"]
187 slimmingHelper.ExtraVariables += [
"Electrons."+(
".".
join(iso_corr_vars)),
188 "LRTElectrons."+(
".".
join(iso_corr_vars)),
189 "Muons."+(
".".
join(iso_corr_vars)),
190 "MuonsLRT."+(
".".
join(iso_corr_vars)) ]
192 slimmingHelper.ExtraVariables += [
"Electrons."+(
".".
join(iso_corr_vars)),
193 "Muons."+(
".".
join(iso_corr_vars)) ]