ATLAS Offline Software
Loading...
Searching...
No Matches
ParentDecoratorConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6
7def 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
36def HiggsParentDecoratorCfg(flags, name="HiggsParentDecoratorAlg", **kwargs):
37 kwargs.setdefault("decoratorPrefix", "parentHiggs")
38 kwargs.setdefault("parentPdgIds", [25])
39 return TruthParentDecoratorCfg(flags, name, **kwargs)
40
41
42def ZParentDecoratorCfg(flags, name="ZParentDecoratorAlg", **kwargs):
43 kwargs.setdefault("decoratorPrefix", "parentZ")
44 kwargs.setdefault("parentPdgIds", [23])
45 return TruthParentDecoratorCfg(flags, name, **kwargs)
46
47
48def 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
55def 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)
STL class.
ScalarParentDecoratorCfg(flags, name="ScalarParentDecoratorAlg", **kwargs)
ZParentDecoratorCfg(flags, name="ZParentDecoratorAlg", **kwargs)
TopParentDecoratorCfg(flags, name="TopParentDecoratorAlg", **kwargs)
HiggsParentDecoratorCfg(flags, name="HiggsParentDecoratorAlg", **kwargs)
TruthParentDecoratorCfg(flags, name="TruthParentDecoratorAlg", **kwargs)