ATLAS Offline Software
Loading...
Searching...
No Matches
TruthTauDecoratorConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6
8 target_jets,
9 ghost_tau_assoc_name='GhostTausFinal',
10 truth_taus='TruthTaus',
11 name_suffix=''):
12 """Decorate jets with their leading/subleading truth-tau kinematics.
13
14 Orders the ghost-associated taus by pT and writes, per jet:
15
16 - total (neutrino-inclusive): ``truthtau_{lead,sublead}_{pt,deta,dphi,m}``
17 - visible: the same with a ``_vis`` suffix
18 - prongness: ``truthtau_{lead,sublead}_numCharged``
19 - charge: ``truthtau_{lead,sublead}_charge``
20 - decay mode: ``truthtau_{lead,sublead}_isHadronic``
21 - multiplicity: ``nGhostTaus``
22
23 The visible quantities come from the matched ``truth_taus`` entry, found via
24 its ``originalTruthParticle`` back-link. Angles are the tau relative to the
25 jet axis (``deta = tau.eta - jet.eta``); pt/m are absolute. Note the ghost
26 association holds all final-state taus, so ``isHadronic`` separates hadronic
27 from leptonic decays. With no tau, pt/m are 0, deta/dphi NaN, numCharged and
28 isHadronic -1 and charge 0; gate on ``nGhostTaus``.
29
30 Fails outright if the ghost-tau association is missing from the jets.
31
32 Parameters
33 ----------
34 target_jets : str
35 Jet collection to decorate.
36 ghost_tau_assoc_name : str
37 Ghost tau association on the jets.
38 truth_taus : str
39 Container providing the visible-tau 4-momenta and numCharged.
40 """
41 ca = ComponentAccumulator()
42 ca.addEventAlgo(
43 CompFactory.ftag.TruthTauDecoratorAlg(
44 f'{target_jets}TruthTauDecoratorAlg{name_suffix}',
45 jets=target_jets,
46 ghostTauAssocName=ghost_tau_assoc_name,
47 truthTaus=truth_taus,
48 )
49 )
50 return ca
TruthTauDecoratorCfg(flags, target_jets, ghost_tau_assoc_name='GhostTausFinal', truth_taus='TruthTaus', name_suffix='')