ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ParticleJetTools
python
ParentDecoratorConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 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
TruthParentDecoratorCfg
(flags, name="TruthParentDecoratorAlg", **kwargs):
8
cfg = ComponentAccumulator()
9
10
kwargs.setdefault(
"parents"
,
"TruthBosonsWithDecayParticles"
)
11
kwargs.setdefault(
"vetoSoftLeptonCascade"
,
True
)
12
kwargs.setdefault(
"vetoSoftCharmCascade"
,
True
)
13
kwargs.setdefault(
"matchDeltaR"
, 0.3)
14
15
# Jets
16
if
"AntiKt"
in
kwargs.get(
"targetContainer"
,
""
):
17
kwargs.setdefault(
"cascades"
, [
"TruthBottom"
,
"TruthCharm"
,
18
"TruthHFWithDecayParticles"
])
19
kwargs.setdefault(
"cascadePdgIds"
, [-5, 5])
20
21
kwargs.setdefault(
"addBsToCascade"
,
True
)
22
kwargs.setdefault(
"addCsToCascade"
,
True
)
23
# Other objects
24
else
:
25
kwargs.setdefault(
"cascades"
, [
"TruthBoson"
,
"TruthBosonsWithDecayParticles"
,
26
"TruthTaus"
,
"TruthMuons"
,
"TruthElectrons"
,
27
"TruthNeutrinos"
])
28
# add in leptonic tau decay via a W to neutrino and other lepton+nu
29
decay_pdgIds = [24, 11, 12, 13, 14, 15, 16]
30
kwargs.setdefault(
"cascadePdgIds"
, [-x
for
x
in
decay_pdgIds] + decay_pdgIds)
31
32
cfg.addEventAlgo(CompFactory.TruthParentDecoratorAlg(name, **kwargs))
33
return
cfg
34
35
36
def
HiggsParentDecoratorCfg
(flags, name="HiggsParentDecoratorAlg", **kwargs):
37
kwargs.setdefault(
"decoratorPrefix"
,
"parentHiggs"
)
38
kwargs.setdefault(
"parentPdgIds"
, [25])
39
return
TruthParentDecoratorCfg
(flags, name, **kwargs)
40
41
42
def
ZParentDecoratorCfg
(flags, name="ZParentDecoratorAlg", **kwargs):
43
kwargs.setdefault(
"decoratorPrefix"
,
"parentZ"
)
44
kwargs.setdefault(
"parentPdgIds"
, [23])
45
return
TruthParentDecoratorCfg
(flags, name, **kwargs)
46
47
48
def
ScalarParentDecoratorCfg
(flags, name="ScalarParentDecoratorAlg", **kwargs):
49
kwargs.setdefault(
"parents"
,
"TruthBSMWithDecayParticles"
)
50
kwargs.setdefault(
"decoratorPrefix"
,
"parentScalar"
)
51
kwargs.setdefault(
"parentPdgIds"
, [35])
52
return
TruthParentDecoratorCfg
(flags, name, **kwargs)
53
54
55
def
TopParentDecoratorCfg
(flags, name="TopParentDecoratorAlg", **kwargs):
56
kwargs.setdefault(
"parents"
,
"TruthTop"
)
57
kwargs.setdefault(
"decoratorPrefix"
,
"parentTop"
)
58
kwargs.setdefault(
"parentPdgIds"
, [-6, 6])
59
60
kwargs.setdefault(
"cascades"
, [
"TruthBoson"
,
"TruthBosonsWithDecayParticles"
,
61
"TruthBottom"
,
"TruthCharm"
,
62
"TruthTaus"
,
"TruthElectrons"
,
63
"TruthForwardProtons"
,
"TruthHFWithDecayParticles"
])
64
# not really clear why, but sometimes the electron decay products
65
# of a top have missing children. The 'missing' list will throw a
66
# warning on every entry. This can can be silenced by moving these
67
# values to the "allow" list below.
68
kwargs.setdefault(
"warnMissingChildrenPdgIds"
,
set
())
69
kwargs.setdefault(
"allowMissingChildrenPdgIds"
, {-11, 11})
70
kwargs.setdefault(
"missingChildrenFractionWarningThreshold"
, 0.001)
71
72
# Jets
73
if
"AntiKt"
in
kwargs.get(
"targetContainer"
,
""
):
74
# we want to label any jet coming via a W to a quark, tau, or electron
75
decay_pdgids = [24, 5, 4, 3, 2, 1, 11, 15]
76
kwargs.setdefault(
"cascadePdgIds"
, [-x
for
x
in
decay_pdgids] + decay_pdgids)
77
78
kwargs.setdefault(
"countChildrenInCascadeWithPdgIds"
,
79
{
"nTopToWChildren"
: [-24, 24],
80
"nTopToBChildren"
: [-5, 5]})
81
else
:
82
kwargs.setdefault(
"countChildrenInCascadeWithPdgIds"
,
83
{
"nTopToWChildren"
: [-24, 24]})
84
kwargs.setdefault(
"vetoSoftLeptonCascade"
,
False
)
85
kwargs.setdefault(
"vetoSoftCharmCascade"
,
False
)
86
87
return
TruthParentDecoratorCfg
(flags, name, **kwargs)
set
STL class.
ParentDecoratorConfig.ZParentDecoratorCfg
ZParentDecoratorCfg(flags, name="ZParentDecoratorAlg", **kwargs)
Definition
ParentDecoratorConfig.py:42
ParentDecoratorConfig.TopParentDecoratorCfg
TopParentDecoratorCfg(flags, name="TopParentDecoratorAlg", **kwargs)
Definition
ParentDecoratorConfig.py:55
ParentDecoratorConfig.ScalarParentDecoratorCfg
ScalarParentDecoratorCfg(flags, name="ScalarParentDecoratorAlg", **kwargs)
Definition
ParentDecoratorConfig.py:48
ParentDecoratorConfig.TruthParentDecoratorCfg
TruthParentDecoratorCfg(flags, name="TruthParentDecoratorAlg", **kwargs)
Definition
ParentDecoratorConfig.py:7
ParentDecoratorConfig.HiggsParentDecoratorCfg
HiggsParentDecoratorCfg(flags, name="HiggsParentDecoratorAlg", **kwargs)
Definition
ParentDecoratorConfig.py:36
Generated on
for ATLAS Offline Software by
1.17.0