ATLAS Offline Software
Loading...
Searching...
No Matches
python.InDetGNNHardScatterSelectionConfig Namespace Reference

Functions

 AsgPtEtaSelectionToolCfg (flags, name="AsgPtEtaSelectionTool", **kwargs)
 AsgPtEtaSelectionToolGapCfg (flags, name="AsgPtEtaSelectionTool", **kwargs)
 AsgViewFromSelectionAlgCfg (flags, name="AsgViewFromSelectionAlg", **kwargs)
 GNNHSSelectionAlgCfg (flags, input, minPt)
 GNNHSOverlapRemovalToolCfg (flags, name="GNNHS_OverlapRemovalToolCfg", **kwargs)
 GNNHSOverlapRemovalAlgCfg (flags, name="GNNHS_OverlapRemovalAlg", overlapInputNames=None, overlapOutputNames=None, **kwargs)
 GNNToolCfg (flags, name="HardScatterSelectionGNNTool", **kwargs)
 GNNHSVertexDecoratorAlgCfg (flags, name="GNNHS_VertexDecoratorAlg", **kwargs)
 GNNSequenceCfg (flags, doOverlapRemoval=True)

Variables

 flags = initConfigFlags()
 Files
 MaxEvents
 top_acc = MainServicesCfg(flags)
 OutputLevel
 withDetails
 True
 summariseProps
 sc = top_acc.run(1)

Function Documentation

◆ AsgPtEtaSelectionToolCfg()

python.InDetGNNHardScatterSelectionConfig.AsgPtEtaSelectionToolCfg ( flags,
name = "AsgPtEtaSelectionTool",
** kwargs )

Definition at line 11 of file InDetGNNHardScatterSelectionConfig.py.

11def AsgPtEtaSelectionToolCfg(flags, name="AsgPtEtaSelectionTool", **kwargs):
12 cfg = ComponentAccumulator()
13 kwargs.setdefault("maxEta", 2.5)
14 cfg.setPrivateTools(CompFactory.CP.AsgPtEtaSelectionTool(name, **kwargs))
15 return cfg
16

◆ AsgPtEtaSelectionToolGapCfg()

python.InDetGNNHardScatterSelectionConfig.AsgPtEtaSelectionToolGapCfg ( flags,
name = "AsgPtEtaSelectionTool",
** kwargs )

Definition at line 17 of file InDetGNNHardScatterSelectionConfig.py.

17def AsgPtEtaSelectionToolGapCfg(flags, name="AsgPtEtaSelectionTool", **kwargs):
18 kwargs.setdefault("etaGapLow", 1.37)
19 kwargs.setdefault("etaGapHigh", 1.52)
20 return AsgPtEtaSelectionToolCfg(flags, name, **kwargs)
21

◆ AsgViewFromSelectionAlgCfg()

python.InDetGNNHardScatterSelectionConfig.AsgViewFromSelectionAlgCfg ( flags,
name = "AsgViewFromSelectionAlg",
** kwargs )

Definition at line 22 of file InDetGNNHardScatterSelectionConfig.py.

22def AsgViewFromSelectionAlgCfg(flags, name="AsgViewFromSelectionAlg", **kwargs):
23 cfg = ComponentAccumulator()
24 kwargs.setdefault("selection", "selectPtEta")
25 kwargs.setdefault("deepCopy", False)
26 cfg.addEventAlgo(CompFactory.CP.AsgViewFromSelectionAlg(name, **kwargs))
27 return cfg
28

◆ GNNHSOverlapRemovalAlgCfg()

python.InDetGNNHardScatterSelectionConfig.GNNHSOverlapRemovalAlgCfg ( flags,
name = "GNNHS_OverlapRemovalAlg",
overlapInputNames = None,
overlapOutputNames = None,
** kwargs )

Definition at line 93 of file InDetGNNHardScatterSelectionConfig.py.

94 overlapInputNames = None, overlapOutputNames = None, **kwargs):
95 cfg = ComponentAccumulator()
96
97 kwargs.setdefault("OutputLabel", "passesOR")
98 kwargs.setdefault("affectingSystematicsFilter", ".*")
99
100 for obj in overlapInputNames:
101 kwargs.setdefault(obj, overlapInputNames[obj])
102 kwargs.setdefault(obj+"Decoration", kwargs["OutputLabel"] + ",as_char")
103
104 extraInputs = set(kwargs.get("ExtraInputs", set()))
105 for inputContainer in overlapInputNames.values():
106 extraInputs.add(("xAOD::IParticleContainer", f"StoreGateSvc+{inputContainer}.selectPtEta"))
107 kwargs["ExtraInputs"] = list(extraInputs)
108
109 overlap_outputs = [
110 ("SG::AuxVectorBase", f"StoreGateSvc+{overlapInputNames['jets']}.passesOR"),
111 ("xAOD::IParticleContainer", f"StoreGateSvc+{overlapInputNames['jets']}.passesOR"),
112 ("SG::AuxVectorBase", f"StoreGateSvc+{overlapInputNames['electrons']}.passesOR"),
113 ("xAOD::IParticleContainer", f"StoreGateSvc+{overlapInputNames['electrons']}.passesOR"),
114 ("SG::AuxVectorBase", f"StoreGateSvc+{overlapInputNames['muons']}.passesOR"),
115 ("xAOD::IParticleContainer", f"StoreGateSvc+{overlapInputNames['muons']}.passesOR"),
116 ("SG::AuxVectorBase", f"StoreGateSvc+{overlapInputNames['photons']}.passesOR"),
117 ("xAOD::IParticleContainer", f"StoreGateSvc+{overlapInputNames['photons']}.passesOR"),
118 ]
119
120 kwargs.setdefault("overlapTool", cfg.popToolsAndMerge(GNNHSOverlapRemovalToolCfg(flags)))
121
122 cfg.addEventAlgo(CompFactory.CP.OverlapRemovalAlg(name, ExtraOutputs=overlap_outputs, **kwargs))
123
124 or_container_types = {
125 "jets": ["xAOD::JetContainer", "xAOD::IParticleContainer"],
126 "electrons": ["xAOD::ElectronContainer", "xAOD::IParticleContainer"],
127 "muons": ["xAOD::MuonContainer", "xAOD::IParticleContainer"],
128 "photons": ["xAOD::PhotonContainer", "xAOD::EgammaContainer", "xAOD::IParticleContainer"],
129 }
130
131 for obj in overlapInputNames:
132 output_name = overlapOutputNames[obj]
133 view_outputs = [("xAOD::AuxContainerBase", f"StoreGateSvc+{output_name}Aux.")]
134 for out_type in or_container_types[obj]:
135 view_outputs.append((out_type, f"StoreGateSvc+{output_name}"))
136 view_outputs.extend([
137 ("SG::AuxVectorBase", f"StoreGateSvc+{output_name}.passesOR"),
138 ("xAOD::IParticleContainer", f"StoreGateSvc+{output_name}.passesOR"),
139 ("SG::AuxVectorBase", f"StoreGateSvc+{output_name}.selectPtEta"),
140 ("xAOD::IParticleContainer", f"StoreGateSvc+{output_name}.selectPtEta"),
141 ])
142
143 cfg.addEventAlgo(CompFactory.CP.AsgViewFromSelectionAlg(
144 name = "GNNHS_"+obj+"_ORSelectionAlg",
145 input = overlapInputNames[obj],
146 output = output_name,
147 selection = [kwargs["OutputLabel"]+",as_char"],
148 deepCopy = True,
149 ExtraOutputs = view_outputs))
150
151 return cfg
152
153
154# GNNTool + VertexDecoratorAlg configs
155
STL class.

◆ GNNHSOverlapRemovalToolCfg()

python.InDetGNNHardScatterSelectionConfig.GNNHSOverlapRemovalToolCfg ( flags,
name = "GNNHS_OverlapRemovalToolCfg",
** kwargs )

Definition at line 60 of file InDetGNNHardScatterSelectionConfig.py.

60def GNNHSOverlapRemovalToolCfg(flags, name="GNNHS_OverlapRemovalToolCfg", **kwargs):
61 cfg = ComponentAccumulator()
62
63 kwargs.setdefault("InputLabel", "selectPtEta")
64 kwargs.setdefault("OutputLabel", "passesOR")
65 kwargs.setdefault("OutputPassValue", True)
66
67 subtool_kwargs={}
68 for prop in ["InputLabel", "OutputLabel", "OutputPassValue"]:
69 subtool_kwargs[prop] = kwargs[prop]
70
71 kwargs.setdefault("EleEleORT", CompFactory.ORUtils.EleEleOverlapTool(**subtool_kwargs))
72 kwargs.setdefault("EleMuORT", CompFactory.ORUtils.EleMuSharedTrkOverlapTool(**subtool_kwargs))
73 kwargs.setdefault("EleJetORT", CompFactory.ORUtils.EleJetOverlapTool(**subtool_kwargs))
74 kwargs.setdefault(
75 "MuJetORT",
76 CompFactory.ORUtils.MuJetOverlapTool(
77 PVContainerName=(
78 "PrimaryVertices_initial"
79 if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.GNNSorting
80 else "PrimaryVertices"
81 ),
82 AllowNoPV=True,
83 **subtool_kwargs
84 )
85 )
86 kwargs.setdefault("PhoEleORT", CompFactory.ORUtils.DeltaROverlapTool(**subtool_kwargs))
87 kwargs.setdefault("PhoMuORT", CompFactory.ORUtils.DeltaROverlapTool(**subtool_kwargs))
88 kwargs.setdefault("PhoJetORT", CompFactory.ORUtils.DeltaROverlapTool(**subtool_kwargs))
89
90 cfg.setPrivateTools(CompFactory.ORUtils.OverlapRemovalTool(name, **kwargs))
91 return cfg
92

◆ GNNHSSelectionAlgCfg()

python.InDetGNNHardScatterSelectionConfig.GNNHSSelectionAlgCfg ( flags,
input,
minPt )

Definition at line 29 of file InDetGNNHardScatterSelectionConfig.py.

29def GNNHSSelectionAlgCfg(flags, input, minPt):
30 cfg = ComponentAccumulator()
31
32 selectionTool = None
33 jetContainer = (
34 "AntiKt4EMTopoCustomVtxGNNJets"
35 if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.GNNSorting
36 else "AntiKt4EMTopoJets"
37 )
38 if input in ["Electrons", "Photons", jetContainer]:
39 selectionTool = cfg.popToolsAndMerge(
40 AsgPtEtaSelectionToolGapCfg(flags, minPt = minPt))
41 elif input in ["Muons"]:
42 selectionTool = cfg.popToolsAndMerge(
43 AsgPtEtaSelectionToolCfg(flags, minPt = minPt))
44
45 selection_outputs = [
46 ("SG::AuxVectorBase", f"StoreGateSvc+{input}.selectPtEta"),
47 ("xAOD::IParticleContainer", f"StoreGateSvc+{input}.selectPtEta"),
48 ]
49
50 cfg.addEventAlgo(CompFactory.CP.AsgSelectionAlg(
51 name = "GNNHS_"+input+"_SelectionAlg",
52 selectionTool = selectionTool,
53 selectionDecoration = "selectPtEta,as_char",
54 particles = input,
55 ExtraOutputs = selection_outputs))
56
57 return cfg
58
59

◆ GNNHSVertexDecoratorAlgCfg()

python.InDetGNNHardScatterSelectionConfig.GNNHSVertexDecoratorAlgCfg ( flags,
name = "GNNHS_VertexDecoratorAlg",
** kwargs )

Definition at line 162 of file InDetGNNHardScatterSelectionConfig.py.

162def GNNHSVertexDecoratorAlgCfg(flags, name="GNNHS_VertexDecoratorAlg", **kwargs):
163 cfg = ComponentAccumulator()
164
165 kwargs.setdefault("photonsIn", "Photons")
166
167 if "gnnTool" not in kwargs:
168 kwargs.setdefault("gnnTool", cfg.popToolsAndMerge(GNNToolCfg(flags)))
169
170 if "TrackVertexAssociationTool" not in kwargs:
171 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import GNNHS_TTVAToolCfg
172 kwargs.setdefault("TrackVertexAssociationTool", cfg.popToolsAndMerge(
173 GNNHS_TTVAToolCfg(flags)))
174
175 vertex_extra_inputs = set(kwargs.get("ExtraInputs", set()))
176 for cont in ["electronsIn", "muonsIn", "photonsIn", "jetsIn"]:
177 if cont in kwargs:
178 vertex_extra_inputs.add(("xAOD::IParticleContainer", f"StoreGateSvc+{kwargs[cont]}"))
179 if "photonsIn" in kwargs:
180 photons_key = kwargs["photonsIn"]
181 vertex_extra_inputs.update({
182 ("xAOD::IParticleContainer", f"StoreGateSvc+{photons_key}.zCommon"),
183 ("xAOD::IParticleContainer", f"StoreGateSvc+{photons_key}.caloPointingZ"),
184 ("xAOD::IParticleContainer", f"StoreGateSvc+{photons_key}.zCommonError"),
185 })
186 kwargs["ExtraInputs"] = list(vertex_extra_inputs)
187
188 cfg.addEventAlgo(CompFactory.InDetGNNHardScatterSelection.VertexDecoratorAlg(name, **kwargs))
189 return cfg
190
191
192# Global Sequence

◆ GNNSequenceCfg()

python.InDetGNNHardScatterSelectionConfig.GNNSequenceCfg ( flags,
doOverlapRemoval = True )

Definition at line 193 of file InDetGNNHardScatterSelectionConfig.py.

193def GNNSequenceCfg(flags, doOverlapRemoval=True):
194 cfg = ComponentAccumulator()
195
196 selectionSvc = CompFactory.CP.SelectionNameSvc("SelectionNameSvc")
197 cfg.addService(selectionSvc)
198
199 inputCollections = {
200 "jets": (
201 "AntiKt4EMTopoCustomVtxGNNJets"
202 if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.GNNSorting
203 else "AntiKt4EMTopoJets"
204 ),
205 "electrons": "Electrons",
206 "muons": "Muons",
207 "photons": "Photons",
208 }
209
210 ptThresholds = {
211 "jets": 15000,
212 "electrons": 4500,
213 "muons": 3000,
214 "photons": 10000,
215 }
216
217 for obj in inputCollections:
218 cfg.merge(GNNHSSelectionAlgCfg(flags, input = inputCollections[obj],
219 minPt = ptThresholds[obj]))
220
221 if doOverlapRemoval:
222 # OverlapRemovalAlg is configured with affectingSystematicsFilter,
223 # so the CP systematics service is only needed in this branch.
224 cfg.addService(CompFactory.CP.SystematicsSvc("SystematicsSvc"))
225 overlapOutputNames = {
226 "muons": f'{inputCollections["muons"]}_OR',
227 "electrons": f'{inputCollections["electrons"]}_OR',
228 "photons": f'{inputCollections["photons"]}_OR',
229 "jets": f'{inputCollections["jets"]}_OR',
230 }
231 cfg.merge(GNNHSOverlapRemovalAlgCfg(flags, overlapInputNames = inputCollections,
232 overlapOutputNames = overlapOutputNames))
233 else:
234 # If overlap removal is disabled, use original containers
235 overlapOutputNames = inputCollections
236
237 from PhotonVertexSelection.PhotonVertexSelectionConfig import DecoratePhotonPointingAlgCfg
238 photon_key = overlapOutputNames["photons"]
239 cfg.merge(
240 DecoratePhotonPointingAlgCfg(
241 flags,
242 PhotonContainerKey=photon_key,
243 ExtraInputs=[
244 ("xAOD::EgammaContainer", f"StoreGateSvc+{photon_key}"),
245 ],
246 ExtraOutputs=[
247 ("xAOD::IParticleContainer", f"StoreGateSvc+{photon_key}.zCommon"),
248 ("xAOD::IParticleContainer", f"StoreGateSvc+{photon_key}.caloPointingZ"),
249 ("xAOD::IParticleContainer", f"StoreGateSvc+{photon_key}.zCommonError"),
250 ],
251 )
252 )
253
254 cfg.merge(
255 GNNHSVertexDecoratorAlgCfg(
256 flags,
257 vertexIn=(
258 "PrimaryVertices_initial"
259 if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.GNNSorting
260 else "PrimaryVertices"
261 ),
262 electronsIn=overlapOutputNames["electrons"],
263 muonsIn=overlapOutputNames["muons"],
264 photonsIn=overlapOutputNames["photons"],
265 jetsIn=overlapOutputNames["jets"],
266 )
267 )
268
269 return cfg
270
271

◆ GNNToolCfg()

python.InDetGNNHardScatterSelectionConfig.GNNToolCfg ( flags,
name = "HardScatterSelectionGNNTool",
** kwargs )

Definition at line 156 of file InDetGNNHardScatterSelectionConfig.py.

156def GNNToolCfg(flags, name="HardScatterSelectionGNNTool", **kwargs):
157 acc = ComponentAccumulator()
158 kwargs.setdefault("nnFile", flags.Tracking.PriVertex.HSGNN.nnFile)
159 acc.setPrivateTools(CompFactory.InDetGNNHardScatterSelection.GNNTool(name, **kwargs))
160 return acc
161

Variable Documentation

◆ Files

python.InDetGNNHardScatterSelectionConfig.Files

Definition at line 278 of file InDetGNNHardScatterSelectionConfig.py.

◆ flags

python.InDetGNNHardScatterSelectionConfig.flags = initConfigFlags()

Definition at line 274 of file InDetGNNHardScatterSelectionConfig.py.

◆ MaxEvents

python.InDetGNNHardScatterSelectionConfig.MaxEvents

Definition at line 279 of file InDetGNNHardScatterSelectionConfig.py.

◆ OutputLevel

python.InDetGNNHardScatterSelectionConfig.OutputLevel

Definition at line 295 of file InDetGNNHardScatterSelectionConfig.py.

◆ sc

python.InDetGNNHardScatterSelectionConfig.sc = top_acc.run(1)

Definition at line 301 of file InDetGNNHardScatterSelectionConfig.py.

◆ summariseProps

python.InDetGNNHardScatterSelectionConfig.summariseProps

Definition at line 296 of file InDetGNNHardScatterSelectionConfig.py.

◆ top_acc

python.InDetGNNHardScatterSelectionConfig.top_acc = MainServicesCfg(flags)

Definition at line 283 of file InDetGNNHardScatterSelectionConfig.py.

◆ True

python.InDetGNNHardScatterSelectionConfig.True

Definition at line 296 of file InDetGNNHardScatterSelectionConfig.py.

◆ withDetails

python.InDetGNNHardScatterSelectionConfig.withDetails

Definition at line 296 of file InDetGNNHardScatterSelectionConfig.py.