ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ParticleJetTools
python
TruthVertexDecoratorConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
7
def
TruthVertexDecoratorCfg
(flags, name="TruthVertexDecoratorAlg", **kwargs):
8
"""Configure TruthVertexDecoratorAlg.
9
10
Decorates tracks and truth particles with truth vertex labels
11
(vertex ID, vertex type, PV distance, etc.) using the FatVertex
12
classification.
13
"""
14
acc = ComponentAccumulator()
15
16
from
InDetTrackSystematicsTools.InDetTrackSystematicsToolsConfig
import
(
17
InDetTrackTruthOriginToolCfg,
18
)
19
kwargs.setdefault(
20
"trackTruthOriginTool"
,
21
acc.popToolsAndMerge(InDetTrackTruthOriginToolCfg(flags)),
22
)
23
24
acc.addEventAlgo(
25
CompFactory.ParticleJetTools.TruthVertexDecoratorAlg(name, **kwargs)
26
)
27
return
acc
28
29
30
def
JetTruthVertexSummaryDecoratorCfg
(
31
flags, name="JetTruthVertexSummaryDecoratorAlg", **kwargs
32
):
33
"""Configure JetTruthVertexSummaryDecoratorAlg.
34
35
Decorates jets with counts of associated truth vertices by type
36
(b, c, tau, strange, pion, material interaction, other).
37
Reads truth particle decorations produced by TruthVertexDecoratorAlg.
38
"""
39
acc = ComponentAccumulator()
40
acc.addEventAlgo(
41
CompFactory.ParticleJetTools.JetTruthVertexSummaryDecoratorAlg(
42
name, **kwargs
43
)
44
)
45
return
acc
46
47
48
def
TruthVertexDecoratorsCfg
(flags, jetCollections=None, **kwargs):
49
"""Convenience: schedule truth vertex decorator + one summary alg per jet collection.
50
51
TruthVertexDecoratorAlg runs first (decorates truth particles once), then
52
one JetTruthVertexSummaryDecoratorAlg is scheduled per entry in
53
``jetCollections`` (reads the TP decorations, writes per-jet summary
54
decorations keyed to that jet container).
55
56
Args:
57
flags: Athena ConfigFlags.
58
jetCollections: list of ``(jetContainer, drThreshold)`` tuples. Each
59
entry schedules a summary alg reading the given jet container and
60
matching truth vertices to those jets within ``drThreshold``.
61
Defaults to ``[("AntiKt4EMPFlowJets", 0.4)]``.
62
**kwargs: forwarded to ``TruthVertexDecoratorCfg`` (the TP decorator).
63
"""
64
if
jetCollections
is
None
:
65
jetCollections = [(
"AntiKt4EMPFlowJets"
, 0.4)]
66
acc = ComponentAccumulator()
67
acc.merge(
TruthVertexDecoratorCfg
(flags, **kwargs))
68
for
(jet_container, dr)
in
jetCollections:
69
acc.merge(
JetTruthVertexSummaryDecoratorCfg
(
70
flags,
71
name=f
"JetTruthVertexSummaryDecoratorAlg_{jet_container}"
,
72
jetContainer=jet_container,
73
drThreshold=dr,
74
))
75
return
acc
TruthVertexDecoratorConfig.JetTruthVertexSummaryDecoratorCfg
JetTruthVertexSummaryDecoratorCfg(flags, name="JetTruthVertexSummaryDecoratorAlg", **kwargs)
Definition
TruthVertexDecoratorConfig.py:32
TruthVertexDecoratorConfig.TruthVertexDecoratorCfg
TruthVertexDecoratorCfg(flags, name="TruthVertexDecoratorAlg", **kwargs)
Definition
TruthVertexDecoratorConfig.py:7
TruthVertexDecoratorConfig.TruthVertexDecoratorsCfg
TruthVertexDecoratorsCfg(flags, jetCollections=None, **kwargs)
Definition
TruthVertexDecoratorConfig.py:48
Generated on
for ATLAS Offline Software by
1.17.0