ATLAS Offline Software
Loading...
Searching...
No Matches
IsolationSelectionConfig Namespace Reference

Functions

 IsolationSelectionToolCfg (flags, name="IsolationSelectionTool", **kwargs)
 MuonPhysValIsolationSelCfg (flags, **kwargs)
 IsoCloseByCorrectionToolCfg (flags, name="IsoCloseByCorrectionTool", ttva_wp="", **kwargs)
 IsoCloseByCorrSkimmingAlgCfg (flags, suff="", name="IsoCloseByCorrSkimmingAlg", ttva_wp='Nonprompt_All_MaxWeight', **kwargs)
 IsoCloseByCorrAlgCfg (flags, name="IsoCloseByCorrAlg", suff="", isPhysLite=False, containerNames=["Muons", "Electrons", "Photons"], useSelTools=False, isoDecSuffix="CloseByCorr", caloDecSuffix="", hasLRT=False, **kwargs)
 IsoCloseByCaloDecorCfg (flags, name="IsoCloseByCaloDecor", suff="", containers=[], **kwargs)
 TestIsoCloseByCorrectionCfg (flags, name="TestIsoCloseByAlg", suff="", **kwargs)
 IsoCloseByAlgsCfg (flags, suff="", isPhysLite=False, containerNames=["Muons", "Electrons", "Photons"], stream_name="", ttva_wp="Nonprompt_All_MaxWeight", useSelTools=False, isoDecSuffix="CloseByCorr", caloDecSuffix="", hasLRT=False)
 setupIsoCloseBySlimmingVariables (slimmingHelper, isLLP1=False)

Function Documentation

◆ IsoCloseByAlgsCfg()

IsolationSelectionConfig.IsoCloseByAlgsCfg ( flags,
suff = "",
isPhysLite = False,
containerNames = [ "Muons", "Electrons", "Photons"],
stream_name = "",
ttva_wp = "Nonprompt_All_MaxWeight",
useSelTools = False,
isoDecSuffix = "CloseByCorr",
caloDecSuffix = "",
hasLRT = False )

Definition at line 147 of file IsolationSelectionConfig.py.

147def IsoCloseByAlgsCfg(flags, suff = "", isPhysLite = False, containerNames = [ "Muons", "Electrons", "Photons"], stream_name="", ttva_wp = "Nonprompt_All_MaxWeight", useSelTools = False, isoDecSuffix = "CloseByCorr", caloDecSuffix = "", hasLRT = False):
148
149 # Add in two ways to do IsoCloseBy correction:
150 # - use IsoCloseByCorrAlg to modify the <iso_value>s for close by lepton/photon.
151 # These can be used directly reading a derivation.
152 # - Also add in extra information to run IsolationCloseByTool on the derivation
153 # For closeByIso correction, only one way is needed. The other way can be a cross check.
154 # The second way will be eventually deprecated and is not used for PhysLite to minimize the
155 # information on PhysLite.
156 acc = ComponentAccumulator()
157
158 # REMOVING THE FOLLOWING UNTIL THE CLASH BETWEEN THESE ALGS AND THE CLOSEBY CORRECTION IS FIXED
159 # ## Temporarily comment out for parent/child augmentation tests
160 # # Add additional information to derivation output to be able to run IsoCloseByCorrectionTool on it
161 # if not isPhysLite:
162 # from IsolationSelection.IsolationSelectionConfig import IsoCloseByCorrSkimmingAlgCfg, IsoCloseByCaloDecorCfg
163 # ### Add the tracks that potentially pollute the isolation cones of others to the collection.
164 # ### Question: Is the list of recommended TTVA working points used for isolation available somewhere?
165 # acc.merge(IsoCloseByCorrSkimmingAlgCfg(flags, suff = suff, ttva_wp = "Nonprompt_All_MaxWeight",
166 # OutputStream = stream_name))
167
168 # ### Associate the close-by pflow objects and the calorimeter clusters
169 # acc.merge(IsoCloseByCaloDecorCfg(flags, suff = suff,
170 # containers = containerNames ))
171
172 # Setup the isolation close-by correction algorithm sequence to correct the isolation of near-by el, mu, ph
173 from IsolationSelection.IsolationSelectionConfig import IsoCloseByCorrAlgCfg
174 acc.merge(IsoCloseByCorrAlgCfg(flags, suff = suff, isPhysLite = isPhysLite, containerNames = containerNames, useSelTools = useSelTools, isoDecSuffix = isoDecSuffix, caloDecSuffix = caloDecSuffix, hasLRT = hasLRT))
175 return acc
176

◆ IsoCloseByCaloDecorCfg()

IsolationSelectionConfig.IsoCloseByCaloDecorCfg ( flags,
name = "IsoCloseByCaloDecor",
suff = "",
containers = [],
** kwargs )

Definition at line 112 of file IsolationSelectionConfig.py.

112def IsoCloseByCaloDecorCfg(flags, name="IsoCloseByCaloDecor", suff = "", containers =[], **kwargs):
113 result = ComponentAccumulator()
114
116 kwargs.setdefault("IsoCloseByCorrectionTool", result.popToolsAndMerge(
117 IsoCloseByCorrectionToolCfg(flags,
118 CaloCorrectionModel = -1
119 )))
120 for cont in containers:
121 result.addEventAlgo(CompFactory.CP.IsoCloseByCaloDecorAlg(name = name + cont + suff,
122 PrimaryContainer = cont,
123 **kwargs))
124 return result
125

◆ IsoCloseByCorrAlgCfg()

IsolationSelectionConfig.IsoCloseByCorrAlgCfg ( flags,
name = "IsoCloseByCorrAlg",
suff = "",
isPhysLite = False,
containerNames = [ "Muons", "Electrons", "Photons"],
useSelTools = False,
isoDecSuffix = "CloseByCorr",
caloDecSuffix = "",
hasLRT = False,
** kwargs )

Definition at line 56 of file IsolationSelectionConfig.py.

56def IsoCloseByCorrAlgCfg(flags, name="IsoCloseByCorrAlg", suff = "", isPhysLite = False, containerNames = [ "Muons", "Electrons", "Photons"], useSelTools = False, isoDecSuffix = "CloseByCorr", caloDecSuffix = "", hasLRT = False, **kwargs):
57
58 result = ComponentAccumulator()
59
60 # Configure the CloseBy isolation correction alg - only need two WPs each for all iso variables
61 elIsoWPs = [ "Loose_VarRad", "TightTrackOnly_FixedRad" ]
62 muIsoWPs = [ "PflowLoose_VarRad", "Loose_VarRad" ]
63 phIsoWPs = [ "FixedCutLoose", "TightCaloOnly" ]
64
65 isoTool = result.popToolsAndMerge( IsolationSelectionToolCfg( flags,
66 ElectronWPVec = elIsoWPs,
67 MuonWPVec = muIsoWPs,
68 PhotonWPVec = phIsoWPs))
69 # Set suffix for writing corrected isolation values
70 selectionDecorator = "isoSelIsOK" + suff
71 kwargs.setdefault("IsoCloseByCorrectionTool",
72 result.popToolsAndMerge(IsoCloseByCorrectionToolCfg(flags,
73 IsolationSelectionTool = isoTool,
74 SelectionDecorator = selectionDecorator,
75 IsoDecSuffix = isoDecSuffix,
76 CaloDecSuffix = caloDecSuffix,
77 EleContainers = [ x for x in containerNames if x.find("Ele") != -1],
78 MuoContainers = [ x for x in containerNames if x.find("Muo") != -1],
79 PhoContainers = [ x for x in containerNames if x.find("Pho") != -1])))
80
81 # Need muon selection tool to apply Loose - no pt cuts
82 from MuonSelectorTools.MuonSelectorToolsConfig import MuonSelectionToolCfg
83 kwargs.setdefault("MuonSelectionTool", result.popToolsAndMerge(MuonSelectionToolCfg(flags,
84 MaxEta = 2.7,
85 DisablePtCuts = True,
86 MuQuality = 2,
87 UseLRT = hasLRT,
88 )))
89
90 # Define selectors for electron and photon - different for LLP1 as compared to PHYS and PHYSLITE
91 kwargs.setdefault("PhotSelectionKey", "Photons.DFCommonPhotonsIsEMLoose")
92 if hasLRT:
93 kwargs.setdefault("ElecSelectionKey", "Electrons.DFCommonElectronsLHVeryLooseNoPix")
94 else:
95 kwargs.setdefault("ElecSelectionKey", "Electrons.DFCommonElectronsLHVeryLoose")
96
97 # Set selection for muons, electrons and photons to contribute to overlap
98 kwargs.setdefault("ParticleContainerKeys", containerNames)
99
100 # No default pt cuts for the moment
101 kwargs.setdefault("MinElecPt", 0.)
102 kwargs.setdefault("MinMuonPt", 0.)
103 kwargs.setdefault("MinPhotPt", 0.)
104
105
106 the_alg = CompFactory.CP.IsoCloseByCorrectionAlg(name + suff,
107 SelectionDecorator = selectionDecorator,
108 **kwargs)
109 result.addEventAlgo(the_alg)
110 return result
111

◆ IsoCloseByCorrectionToolCfg()

IsolationSelectionConfig.IsoCloseByCorrectionToolCfg ( flags,
name = "IsoCloseByCorrectionTool",
ttva_wp = "",
** kwargs )

Definition at line 14 of file IsolationSelectionConfig.py.

14def IsoCloseByCorrectionToolCfg(flags, name="IsoCloseByCorrectionTool", ttva_wp = "", **kwargs):
15 acc = ComponentAccumulator()
16 kwargs.setdefault("IsolationSelectionTool", acc.popToolsAndMerge(MuonPhysValIsolationSelCfg(flags)))
17 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
18 isoTrackSelectionToolCfg)
19 kwargs.setdefault("TrackSelectionTool", acc.popToolsAndMerge(isoTrackSelectionToolCfg(flags, minPt=500)) )
20 if len(ttva_wp):
21 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import isoTTVAToolCfg
22 kwargs.setdefault("TTVASelectionTool", acc.popToolsAndMerge(isoTTVAToolCfg(flags, WorkingPoint = ttva_wp)))
23 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
24 kwargs.setdefault("ParticleCaloExtensionTool", acc.popToolsAndMerge(ParticleCaloExtensionToolCfg(flags)))
25 the_tool = CompFactory.CP.IsolationCloseByCorrectionTool(name, **kwargs)
26 acc.setPrivateTools(the_tool)
27 return acc
28
29

◆ IsoCloseByCorrSkimmingAlgCfg()

IsolationSelectionConfig.IsoCloseByCorrSkimmingAlgCfg ( flags,
suff = "",
name = "IsoCloseByCorrSkimmingAlg",
ttva_wp = 'Nonprompt_All_MaxWeight',
** kwargs )

Definition at line 30 of file IsolationSelectionConfig.py.

30def IsoCloseByCorrSkimmingAlgCfg(flags, suff = "", name="IsoCloseByCorrSkimmingAlg", ttva_wp = 'Nonprompt_All_MaxWeight', **kwargs):
31 result = ComponentAccumulator()
32 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import AsgElectronLikelihoodToolCfg
33 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import electronLHmenu
34 from ElectronPhotonSelectorTools.LikelihoodEnums import LikeEnum
35 from AthenaConfiguration.Enums import LHCPeriod
36 kwargs.setdefault("ElectronSelectionTool", result.popToolsAndMerge(AsgElectronLikelihoodToolCfg(flags,
37 name= "ElectronSelTool",
38 quality = LikeEnum.VeryLoose,
39 menu=electronLHmenu.offlineMC21 if flags.GeoModel.Run >= LHCPeriod.Run3 else electronLHmenu.offlineMC20)))
40
41 from MuonSelectorTools.MuonSelectorToolsConfig import MuonSelectionToolCfg
42 kwargs.setdefault("MuonSelectionTool", result.popToolsAndMerge(MuonSelectionToolCfg(flags,
43 MaxEta=2.7,
44 DisablePtCuts=True,
45 MuQuality=2,
46 )))
47 kwargs.setdefault("IsoCloseByCorrectionTool", result.popToolsAndMerge(IsoCloseByCorrectionToolCfg(flags)))
48
49
51 kwargs.setdefault("PhotContainer", "")
52 the_alg = CompFactory.CP.IsoCloseByCorrectionTrkSelAlg(name+ttva_wp+suff, **kwargs)
53 result.addEventAlgo(the_alg, primary = True)
54 return result
55

◆ IsolationSelectionToolCfg()

IsolationSelectionConfig.IsolationSelectionToolCfg ( flags,
name = "IsolationSelectionTool",
** kwargs )

Definition at line 6 of file IsolationSelectionConfig.py.

6def IsolationSelectionToolCfg(flags, name="IsolationSelectionTool", **kwargs):
7 acc = ComponentAccumulator()
8 acc.setPrivateTools(CompFactory.CP.IsolationSelectionTool(name, **kwargs))
9 return acc
10

◆ MuonPhysValIsolationSelCfg()

IsolationSelectionConfig.MuonPhysValIsolationSelCfg ( flags,
** kwargs )

Definition at line 11 of file IsolationSelectionConfig.py.

11def MuonPhysValIsolationSelCfg(flags, **kwargs):
12 return IsolationSelectionToolCfg(flags,MuonWP="PflowTight_FixedRad")
13

◆ setupIsoCloseBySlimmingVariables()

IsolationSelectionConfig.setupIsoCloseBySlimmingVariables ( slimmingHelper,
isLLP1 = False )

Definition at line 177 of file IsolationSelectionConfig.py.

177def setupIsoCloseBySlimmingVariables(slimmingHelper, isLLP1 = False):
178
179
181 iso_corr_vars = [ "IsoCloseByCorr_assocClustEta", "IsoCloseByCorr_assocClustPhi", "IsoCloseByCorr_assocClustEnergy",
182 "IsoCloseByCorr_assocClustDecor", "IsoCloseByCorr_assocPflowEta", "IsoCloseByCorr_assocPflowPhi", "IsoCloseByCorr_assocPflowEnergy",
183 "IsoCloseByCorr_assocPflowDecor"]
184
185 if isLLP1:
186 slimmingHelper.ExtraVariables += ["Electrons."+(".".join(iso_corr_vars)),
187 "LRTElectrons."+(".".join(iso_corr_vars)),
188 "Muons."+(".".join(iso_corr_vars)),
189 "MuonsLRT."+(".".join(iso_corr_vars)) ]
190 else:
191 slimmingHelper.ExtraVariables += ["Electrons."+(".".join(iso_corr_vars)),
192 "Muons."+(".".join(iso_corr_vars)) ]

◆ TestIsoCloseByCorrectionCfg()

IsolationSelectionConfig.TestIsoCloseByCorrectionCfg ( flags,
name = "TestIsoCloseByAlg",
suff = "",
** kwargs )

Definition at line 126 of file IsolationSelectionConfig.py.

126def TestIsoCloseByCorrectionCfg(flags, name="TestIsoCloseByAlg", suff = "", **kwargs):
127 result = ComponentAccumulator()
128 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import AsgElectronLikelihoodToolCfg
129 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import electronLHmenu
130 from ElectronPhotonSelectorTools.LikelihoodEnums import LikeEnum
131 from AthenaConfiguration.Enums import LHCPeriod
132 kwargs.setdefault("ElectronSelectionTool", result.popToolsAndMerge(AsgElectronLikelihoodToolCfg(flags,
133 name= "ElectronSelTool",
134 quality = LikeEnum.VeryLoose,
135 menu=electronLHmenu.offlineMC21 if flags.GeoModel.Run >= LHCPeriod.Run3 else electronLHmenu.offlineMC20)))
136
137 from MuonSelectorTools.MuonSelectorToolsConfig import MuonSelectionToolCfg
138 kwargs.setdefault("MuonSelectionTool", result.popToolsAndMerge(MuonSelectionToolCfg(flags,
139 MaxEta=2.7,
140 DisablePtCuts=True,
141 MuQuality=2,
142 )))
143 the_alg = CompFactory.CP.TestIsolationCloseByCorrAlg(name + suff, **kwargs)
144 result.addEventAlgo(the_alg, primary = True)
145 return result
146