ATLAS Offline Software
Loading...
Searching...
No Matches
JetResponseToolConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3"""
4
5 JetResponseToolsConfig: A helper module for configuring jet moment
6 tools, in support of JetRecConfig.JetModConfig.
7 Author: TJ Khoo
8
9
10IMPORTANT : all the getXYZTool(jetdef, modspec) functions are meant to be used as callback from the main JetRecConfig module
11when we need to convert definitions of tools into the actual tools. At this point the functions are invoked as
12 func(jetdef, modspec)
13Hence they have jetdef and modspec arguments even if not needed in every case.
14"""
15
16from AthenaConfiguration.ComponentFactory import CompFactory
17
18def getJetResponseTool(jetdef, modspec=''):
19
20 from JetRecConfig.JetDefinition import buildJetAlgName
21
22 label = modspec
23 prefix, suffix = {
24 'R4TruthLabel': ('',''),
25 'R4TruthDressedWZLabel': ('','DressedWZ'),
26 'R4InTimeTruthLabel': ('InTime','')
27 }[modspec]
28 truthJetAlg = prefix+buildJetAlgName(jetdef.algorithm, jetdef.radius)+'Truth'+suffix+'Jets'
29
30 jetPtAssociation = CompFactory.JetResponseTool(
31 'jetResponse',
32 JetMatchedTruthJetName = f'{label}_MatchedTruthJet',
33 TruthJetContainer = truthJetAlg,
34 )
35
36 return jetPtAssociation
getJetResponseTool(jetdef, modspec='')