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

Functions

None _add_ftag_content (AthConfigFlags flags, ComponentAccumulator acc, SlimmingHelper slimming_helper, bool keep_truth_collections=True, bool tau_as_smart_collection=False)
None _add_jet_content (AthConfigFlags flags, SlimmingHelper slimming_helper)
list[str] _drop_track_variables (list[str] item_list, list[str] variables)
ComponentAccumulator HID1KernelCfg (AthConfigFlags flags, str name="HID1Kernel", **Any kwargs)
ComponentAccumulator HID1CoreCfg (AthConfigFlags flags, str name_tag="HID1", list[str]|None extra_SmartCollections=None, list[str]|None extra_AllVariables=None, TriggerListsHelper|None trigger_lists_helper=None, bool keep_truth_collections=True, bool keep_track_covariance_offdiag=True, bool tau_as_smart_collection=False, bool compress_gn3_latent=True)
ComponentAccumulator HID1ExtraContentCfg (AthConfigFlags flags)
ComponentAccumulator HID1Cfg (AthConfigFlags flags, str name_tag="HID1")

Variables

str LARGE_R_JETS = "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"
list POORMAN_IP_VARS
list GN3_LATENT_VARS

Function Documentation

◆ _add_ftag_content()

None _add_ftag_content ( AthConfigFlags flags,
ComponentAccumulator acc,
SlimmingHelper slimming_helper,
bool keep_truth_collections = True,
bool tau_as_smart_collection = False )
protected
Add the flavour-tagging content and augmentations to the slimming helper.

Definition at line 95 of file HID1.py.

101) -> None:
102 """Add the flavour-tagging content and augmentations to the slimming helper."""
103
104 # Baseline content
105 add_baseline_slimming_smartcollections(slimming_helper=slimming_helper)
106 add_baseline_slimming_allvariables(slimming_helper=slimming_helper)
107 add_truth_to_slimming_helper(slimming_helper=slimming_helper)
108
109 # Common FTAG augmentations
110 add_common_augmentation(
111 flags=flags,
112 acc=acc,
113 slimming_helper=slimming_helper,
114 )
115
116 # Truth vertex labeling for Maskformer (see https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/docs/TruthVertexLabelling.md?ref_type=heads)
117 # The VR jets are summarised at their Rmax, which over-associates the high-pT jets whose
118 # real radius has shrunk to Rmin; a shrinking-cone-aware summary is left to a follow-up.
119 add_truth_vertex_decorations(
120 flags=flags,
121 acc=acc,
122 slimming_helper=slimming_helper,
123 large_r_jet_collection=LARGE_R_JETS,
124 extra_jet_collections=[(VR_JETS, VR_JET_TRUTH_VERTEX_DR)],
125 )
126
127 add_vr_jet_truth_augmentation(
128 flags=flags,
129 acc=acc,
130 slimming_helper=slimming_helper,
131 )
132
133 slimming_helper.SmartCollections += [
134 LARGE_R_JETS,
135 "AntiKt4LCTopoJets",
136 ]
137
138 slimming_helper.AllVariables += [
139 "AntiKt4EMPFlowJets",
140 VR_JETS,
141 "CaloCalFwdTopoTowers",
142 LARGE_R_JETS,
143 "UFOCSSK",
144 "GlobalChargedParticleFlowObjects",
145 "GlobalNeutralParticleFlowObjects",
146 "CHSGChargedParticleFlowObjects",
147 "CHSGNeutralParticleFlowObjects",
148 "CSSKGChargedParticleFlowObjects",
149 "CSSKGNeutralParticleFlowObjects",
150 "CaloCalTopoClusters",
151 "JetAssociatedPixelClusters",
152 "JetAssociatedSCTClusters",
153 "PixelClusters",
154 "SCT_Clusters",
155 ]
156
157 if tau_as_smart_collection:
158 slimming_helper.SmartCollections += ["TauJets"]
159 else:
160 slimming_helper.AllVariables += [
161 "TauJets",
162 "TauNeutralParticleFlowObjects",
163 "TauShotParticleFlowObjects",
164 "TauTracks",
165 ]
166 if keep_truth_collections:
167 slimming_helper.AllVariables += [
168 "TruthEvents",
169 "TruthParticles",
170 "TruthVertices",
171 ]
172
173 # Extra variables from e/gamma and common FTAG content
174 slimming_helper.ExtraVariables += ElectronsCPDetailedContent
175 add_extra_variables_to_slimming_helper(
176 flags=flags,
177 slimming_helper=slimming_helper,
178 )
179
180 slimming_helper.ExtraVariables += ["AntiKt4TruthJets.constituentLinks"]
181
182 # Truth labelling for the topo-cluster jets, which are not smart-slimmed here
183 for jet_collection in ["AntiKt4EMTopoJets", "AntiKt4LCTopoJets"]:
184 slimming_helper.ExtraVariables.append(
185 ".".join(
186 [
187 jet_collection,
188 "HadronConeExclTruthLabelID",
189 "HadronGhostTruthLabelID",
190 "GhostBHadronsFinal",
191 "GhostCHadronsFinal",
192 "GhostTausFinal",
193 "ConeExclBHadronsFinal",
194 "ConeExclCHadronsFinal",
195 "ConeExclTausFinal",
196 ]
197 )
198 )
199
200 # Extra ITk, HGTD and EMTopo jet content available with Run-4 inputs
201 if flags.GeoModel.Run >= LHCPeriod.Run4:
202 slimming_helper.SmartCollections += ["MET_Baseline_AntiKt4EMTopo"]
203 slimming_helper.AllVariables += [
204 "AntiKt4EMTopoJets",
205 "AntiKt4TruthJets",
206 "ITkPixelMeasurements",
207 "ITkStripMeasurements",
208 "ITkPixelSpacePoints",
209 "ITkStripSpacePoints",
210 "ITkStripOverlapSpacePoints",
211 ]
212 slimming_helper.ExtraVariables += [
213 ".".join(["InDetTrackParticles"] + TrackingVariablesHGTD)
214 ]
215
216 # Needed for ITk space points
217 acc.merge(InDetPoolReadCfg(flags))
218
219 # Optional pseudotrack content
220 if flags.BTagging.Pseudotrack:
221 slimming_helper.AllVariables += ["InDetPseudoTrackParticles"]
222
223 # Run jet labelling for trigger jets
224 if flags.Trigger.EDMVersion == 3 and flags.Input.isMC:
225 acc.merge(HLTJetFTagDecorationCfg(flags))
226
227

◆ _add_jet_content()

None _add_jet_content ( AthConfigFlags flags,
SlimmingHelper slimming_helper )
protected
Add the jet reconstruction and constituent content to the slimming helper.

Definition at line 228 of file HID1.py.

231) -> None:
232 """Add the jet reconstruction and constituent content to the slimming helper."""
233
234 slimming_helper.SmartCollections += [
235 "EventInfo",
236 "Photons",
237 "AntiKt4EMTopoJets",
238 ]
239
240 # Low-level inputs
241 slimming_helper.ExtraVariables += [
242 ".".join(["CaloCalTopoClusters"] + ClusterVariables),
243 ".".join(["EMOriginTopoClusters"] + ["calM"]),
244 ".".join(
245 ["GlobalChargedParticleFlowObjects"] + FlowElementVariables + ["otherObjectWeights"]
246 ),
247 ".".join(
248 ["GlobalNeutralParticleFlowObjects"] + FlowElementVariables + ["otherObjectWeights"]
249 ),
250 ".".join(["UFOCSSK"] + UFOVariables),
251 ".".join(["InDetTrackParticles"] + TrackingVariables),
252 ]
253
254 # Links of physics objects to FlowElements
255 slimming_helper.ExtraVariables += FELinks
256
257 # Detailed substructure information
258 slimming_helper.ExtraVariables += [".".join([LARGE_R_JETS] + ExtraJSSVariables)]
259
260 slimming_helper.ExtraVariables += [
261 ".".join(
262 [
263 "AntiKt4EMPFlowJets",
264 "GhostTower",
265 "IsoFixedCone5Pt",
266 "IsoFixedCone5PtPUsub",
267 "constituentLinks",
268 ]
269 ),
270 "AntiKt4EMTopoJets.IsoFixedCone5Pt.IsoFixedCone5PtPUsub.constituentLinks",
271 f"{LARGE_R_JETS}.SizeParameter.GhostTrack.constituentLinks",
272 "GSFTrackParticles.particleHypothesis.vx.vy.vz",
273 "PrimaryVertices.x.y.z.covariance.trackWeights",
274 "TauJets.clusterLinks",
275 ".".join(
276 [
277 "Muons",
278 "energyLossType",
279 "EnergyLoss",
280 "ParamEnergyLoss",
281 "MeasEnergyLoss",
282 "EnergyLossSigma",
283 "MeasEnergyLossSigma",
284 "ParamEnergyLossSigmaPlus",
285 "ParamEnergyLossSigmaMinus",
286 "clusterLinks",
287 "FSR_CandidateEnergy",
288 ]
289 ),
290 "MuonSegments.x.y.z.px.py.pz",
291 ]
292
293 addOriginCorrectedClustersToSlimmingTool(slimming_helper, writeLC=True, writeEM=True)
294
295 if flags.Input.isMC:
296 slimming_helper.AllVariables += [
297 "TruthTopQuarkWithDecayParticles",
298 "TruthTopQuarkWithDecayVertices",
299 ]
300
301 slimming_helper.SmartCollections += [
302 "AntiKt4TruthWZJets",
303 "AntiKt10TruthJets",
304 "AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets",
305 ]
306
307 slimming_helper.ExtraVariables += [
308 "AntiKt10TruthSoftDropBeta100Zcut10Jets.SizeParameter.constituentLinks",
309 "AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets.constituentLinks",
310 "AntiKt10TruthDressedWZJets.constituentLinks",
311 "AntiKt10TruthJets.constituentLinks",
312 "AntiKt4TruthWZJets.IsoFixedCone5Pt.constituentLinks",
313 "AntiKt4TruthDressedWZJets.IsoFixedCone5Pt.constituentLinks",
314 ".".join(
315 [
316 LARGE_R_JETS,
317 "GhostTQuarksFinalCount",
318 "GhostHBosonsCount",
319 "GhostZBosonsCount",
320 "GhostWBosonsCount",
321 ]
322 ),
323 ".".join(
324 [
325 LARGE_R_JETS,
326 "GhostTQuarksFinalPt",
327 "GhostHBosonsPt",
328 "GhostZBosonsPt",
329 "GhostWBosonsPt",
330 ]
331 ),
332 f"{LARGE_R_JETS}.GhostBHadronsFinalPt.GhostCHadronsFinalPt",
333 ]
334
335

◆ _drop_track_variables()

list[str] _drop_track_variables ( list[str] item_list,
list[str] variables )
protected
Drop aux variables from the InDetTrackParticles output item.

Definition at line 336 of file HID1.py.

336def _drop_track_variables(item_list: list[str], variables: list[str]) -> list[str]:
337 """Drop aux variables from the InDetTrackParticles output item."""
338 dropped = ".".join("-" + variable for variable in variables)
339
340 def drop(item: str) -> str:
341 if "#InDetTrackParticlesAux." not in item:
342 return item
343 sep = "" if item.endswith("Aux.") else "."
344 return item + sep + dropped
345
346 return [drop(item) for item in item_list]
347
348

◆ HID1Cfg()

ComponentAccumulator HID1Cfg ( AthConfigFlags flags,
str name_tag = "HID1" )
Configure the full HID1 derivation.

Definition at line 508 of file HID1.py.

511) -> ComponentAccumulator:
512 """Configure the full HID1 derivation."""
513 acc = ComponentAccumulator()
514
515 trigger_lists_helper = TriggerListsHelper(flags)
516
517 acc.merge(
518 HID1KernelCfg(
519 flags=flags,
520 name=name_tag + "Kernel",
521 StreamName="StreamDAOD_" + name_tag,
522 trigger_lists_helper=trigger_lists_helper,
523 )
524 )
525
526 acc.merge(
527 HID1CoreCfg(
528 flags=flags,
529 name_tag=name_tag,
530 trigger_lists_helper=trigger_lists_helper,
531 )
532 )
533
534 return acc

◆ HID1CoreCfg()

ComponentAccumulator HID1CoreCfg ( AthConfigFlags flags,
str name_tag = "HID1",
list[str] | None extra_SmartCollections = None,
list[str] | None extra_AllVariables = None,
TriggerListsHelper | None trigger_lists_helper = None,
bool keep_truth_collections = True,
bool keep_track_covariance_offdiag = True,
bool tau_as_smart_collection = False,
bool compress_gn3_latent = True )
Configure HID1 slimming and output content.

Definition at line 372 of file HID1.py.

382) -> ComponentAccumulator:
383 """Configure HID1 slimming and output content."""
384 if extra_SmartCollections is None:
385 extra_SmartCollections = []
386 if extra_AllVariables is None:
387 extra_AllVariables = []
388
389 acc = ComponentAccumulator()
390
391 slimming_helper = SlimmingHelper(
392 inputName=name_tag + "SlimmingHelper",
393 NamesAndTypes=flags.Input.TypedCollections,
394 flags=flags,
395 )
396
397 # Initialise explicit lists
398 slimming_helper.SmartCollections = []
399 slimming_helper.AllVariables = []
400 slimming_helper.ExtraVariables = []
401
402 _add_ftag_content(
403 flags=flags,
404 acc=acc,
405 slimming_helper=slimming_helper,
406 keep_truth_collections=keep_truth_collections,
407 tau_as_smart_collection=tau_as_smart_collection,
408 )
409
410 _add_jet_content(
411 flags=flags,
412 slimming_helper=slimming_helper,
413 )
414
415 # User-provided extras
416 for container in extra_SmartCollections:
417 if container not in slimming_helper.SmartCollections:
418 slimming_helper.SmartCollections.append(container)
419
420 for container in extra_AllVariables:
421 if container not in slimming_helper.AllVariables:
422 slimming_helper.AllVariables.append(container)
423
424 # Append-to-dictionary updates
425 update_append_to_dictionary_in_slimming_helper(
426 flags=flags,
427 slimming_helper=slimming_helper,
428 extra_append_to_dictionary=VR_JET_APPEND_TO_DICTIONARY,
429 )
430
431 # Trigger content
432 trigger_setup(slimming_helper=slimming_helper)
433 trigger_matching(
434 flags=flags,
435 slimming_helper=slimming_helper,
436 trigger_lists_helper=trigger_lists_helper,
437 )
438
439 # Output stream
440 item_list = slimming_helper.GetItemList()
441 item_list = _drop_track_variables(item_list, POORMAN_IP_VARS)
442
443 if not keep_track_covariance_offdiag:
444 item_list = _drop_track_variables(item_list, ["definingParametersCovMatrixOffDiag"])
445
446 gn3_latent_compression = []
447 if compress_gn3_latent:
448 gn3_latent_compression = [
449 "xAOD::AuxContainerBase!#AntiKt4EMPFlowJetsAux." + ".".join(GN3_LATENT_VARS)
450 ]
451
452 acc.merge(
453 OutputStreamCfg(
454 flags=flags,
455 streamName="DAOD_" + name_tag,
456 ItemList=item_list,
457 AcceptAlgs=[name_tag + "Kernel"],
458 CompressionListHigh=gn3_latent_compression,
459 )
460 )
461
462 acc.merge(
463 SetupMetaDataForStreamCfg(
464 flags=flags,
465 streamName="DAOD_" + name_tag,
466 AcceptAlgs=[name_tag + "Kernel"],
467 createMetadata=[
468 MetadataCategory.CutFlowMetaData,
469 MetadataCategory.TruthMetaData,
470 ],
471 )
472 )
473
474 return acc
475
476

◆ HID1ExtraContentCfg()

ComponentAccumulator HID1ExtraContentCfg ( AthConfigFlags flags)
Configure extra reconstructed jet content for HID1.

Definition at line 477 of file HID1.py.

477def HID1ExtraContentCfg(flags: AthConfigFlags) -> ComponentAccumulator:
478 """Configure extra reconstructed jet content for HID1."""
479 acc = ComponentAccumulator()
480
481 jet_list = [AntiKt4LCTopo]
482 if flags.Input.isMC:
483 jet_list += [AntiKt10TruthDressedWZSoftDrop]
484
485 for jet_def in jet_list:
486 acc.merge(JetRecCfg(flags, jet_def))
487
488 # Variable-R EMPFlow jets (low-pT-wide, shrinking to 0.4) + soft-lepton association
489 acc.merge(VRFtagJetsCfg(flags))
490
491 # More detailed truth information
492 if flags.Input.isMC:
493 acc.merge(AddTopQuarkAndDownstreamParticlesCfg(flags))
494 acc.merge(
495 AddTruthCollectionNavigationDecorationsCfg(
496 flags,
497 TruthCollections=[
498 "TruthTopQuarkWithDecayParticles",
499 "TruthBosonsWithDecayParticles",
500 ],
501 prefix="Top",
502 )
503 )
504
505 return acc
506
507

◆ HID1KernelCfg()

ComponentAccumulator HID1KernelCfg ( AthConfigFlags flags,
str name = "HID1Kernel",
**Any kwargs )
Configure the derivation kernel for HID1.

Definition at line 349 of file HID1.py.

353) -> ComponentAccumulator:
354 """Configure the derivation kernel for HID1."""
355 acc = ComponentAccumulator()
356
357 acc.merge(
358 PhysCommonAugmentationsCfg(
359 flags=flags,
360 TriggerListsHelper=kwargs["trigger_lists_helper"],
361 )
362 )
363
364 # Setup the derivation kernel
365 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name=name))
366
367 # Configure extra reconstruction of jets
368 acc.merge(HID1ExtraContentCfg(flags))
369 return acc
370
371

Variable Documentation

◆ GN3_LATENT_VARS

list python.HID1.GN3_LATENT_VARS
Initial value:
= [
"GN3EPCLV01_Latent",
"GN3EPCLV01_Latent128",
"GN3EPCLV01_Latent64",
"GN3EPCLV01_Latent32",
"GN3EPCLV01SimpleFlip_Latent",
"GN3EPCLV01SimpleFlip_Latent128",
"GN3EPCLV01SimpleFlip_Latent64",
"GN3EPCLV01SimpleFlip_Latent32",
]

Definition at line 83 of file HID1.py.

◆ LARGE_R_JETS

str python.HID1.LARGE_R_JETS = "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"

Definition at line 71 of file HID1.py.

◆ POORMAN_IP_VARS

list python.HID1.POORMAN_IP_VARS
Initial value:
= [
"poormanIp_d0Uncertainty",
"poormanIp_z0SinThetaUncertainty",
"poormanIp_trackDisplacement",
"poormanIp_trackMomentum",
"poormanIp_invalidIp",
]

Definition at line 75 of file HID1.py.