ATLAS Offline Software
TrkTrackSummaryToolConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 # Configuration of TrkTrackSummaryTool package
4 # In the current workflow, we need to add information
5 # to the Trk::Track(s) as we build them.
6 #
7 # Given the set of measurement and parametersin a Trk::Track
8 # We always add
9 # - The number of hits Pixel/SCT/TRT (default)
10 # We optionally can add
11 # - Holes in the measurement set (default False)
12 # the fitted perigee parameters (default False)
13 # - Muon specific additional information
14 #
15 # Note that we try to avoid the Hole search if
16 # is not absolutely needed as is expensive.
17 
18 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
19 from AthenaConfiguration.ComponentFactory import CompFactory
20 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
21 
22 def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool', **kwargs):
23  if flags.Detector.GeometryITk:
24  name = name.replace("InDet", "ITk")
25  return ITkTrackSummaryToolCfg(flags, name, **kwargs)
26 
27  acc = ComponentAccumulator()
28 
29  kwargs.setdefault("doHolesInDet", True)
30 
31  if 'InDetSummaryHelperTool' not in kwargs:
32  if kwargs["doHolesInDet"]:
33  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
34  InDetTrackSummaryHelperToolCfg)
35  InDetSummaryHelperTool = acc.popToolsAndMerge(
37  else:
38  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
39  InDetSummaryHelperNoHoleSearchCfg)
40  InDetSummaryHelperTool = acc.popToolsAndMerge(
42  kwargs.setdefault("InDetSummaryHelperTool", InDetSummaryHelperTool)
43 
44  acc.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name, **kwargs))
45  return acc
46 
48  flags, name='InDetTrackSummaryToolNoHoleSearch', **kwargs):
49  kwargs.setdefault('doHolesInDet', False)
50  return InDetTrackSummaryToolCfg(flags, name, **kwargs)
51 
52 
54  flags,name="InDetTrigTrackSummaryTool",**kwargs):
55  """
56  instance with hole search
57  """
58  acc = ComponentAccumulator()
59 
60  kwargs.setdefault("doHolesInDet", True)
61 
62  if 'InDetSummaryHelperTool' not in kwargs:
63  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
64  TrigTrackSummaryHelperToolCfg)
65  kwargs.setdefault("InDetSummaryHelperTool", acc.popToolsAndMerge(
67 
68  acc.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name, **kwargs))
69  return acc
70 
72  flags, name="InDetTrigFastTrackSummaryTool", **kwargs):
73  """
74  faster instance without hole search and TRT
75  """
76 
77  acc = ComponentAccumulator()
78 
79  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
80  TrigTrackSummaryHelperToolSiOnlyCfg)
81 
82  kwargs.setdefault("doHolesInDet", False)
83 
84  acc.setPrivateTools(acc.popToolsAndMerge(
86  flags, name,
87  # Prevents summary helper tool to be incorrectly set to something
88  # else through kwargs
89  InDetSummaryHelperTool = acc.popToolsAndMerge(
91  **kwargs)))
92  return acc
93 
94 def ITkTrackSummaryToolCfg(flags, name='ITkTrackSummaryTool', **kwargs):
95  acc = ComponentAccumulator()
96 
97  kwargs.setdefault("doHolesInDet", not flags.Tracking.doITkFastTracking)
98 
99  if 'InDetSummaryHelperTool' not in kwargs:
100  if kwargs["doHolesInDet"]:
101  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
102  ITkTrackSummaryHelperToolCfg)
103  ITkSummaryHelperTool = acc.popToolsAndMerge(
105  else:
106  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
107  ITkSummaryHelperNoHoleSearchCfg)
108  ITkSummaryHelperTool = acc.popToolsAndMerge(
110  kwargs.setdefault("InDetSummaryHelperTool", ITkSummaryHelperTool)
111 
112  acc.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name, **kwargs))
113  return acc
114 
116  flags, name='ITkTrackSummaryToolNoHoleSearch', **kwargs):
117  kwargs.setdefault('doHolesInDet', False)
118  return ITkTrackSummaryToolCfg(flags, name, **kwargs)
119 
120 
122  flags, name="GSFTrackSummaryTool", **kwargs):
123  """ The Track Summary for the GSF refitted Tracks/TrackParticles"""
124 
125  acc = ComponentAccumulator()
126 
127  if "InDetSummaryHelperTool" not in kwargs:
128  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
129  InDetTrackSummaryHelperToolCfg)
130  kwargs["InDetSummaryHelperTool"] = acc.popToolsAndMerge(
132  flags,
133  name="GSFBuildTrackSummaryHelperTool",
134  HoleSearch=None))
135 
136  kwargs.setdefault("doHolesInDet", False)
137 
138  # Particle creator needs a public one
139  acc.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name, **kwargs))
140  return acc
141 
142 @AccumulatorCache
143 def MuonTrackSummaryToolCfg(flags, name="MuonTrackSummaryTool", **kwargs):
144  result = ComponentAccumulator()
145  from MuonConfig.MuonRecToolsConfig import MuonTrackSummaryHelperToolCfg
146  kwargs.setdefault("MuonSummaryHelperTool", result.popToolsAndMerge(
148  kwargs.setdefault("AddDetailedMuonSummary", True)
149  result.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name, **kwargs))
150  return result
151 
152 @AccumulatorCache
154  flags, name="CombinedMuonTrackSummary", **kwargs):
155 
156  result = ComponentAccumulator()
157 
158  if "InDetSummaryHelperTool" not in kwargs:
159  from InDetConfig.InDetTrackSummaryHelperToolConfig import (
160  CombinedMuonIDSummaryHelperToolCfg)
161  kwargs.setdefault("InDetSummaryHelperTool", result.popToolsAndMerge(
163 
164  if "MuonSummaryHelperTool" not in kwargs:
165  from MuonConfig.MuonRecToolsConfig import MuonTrackSummaryHelperToolCfg
166  kwargs.setdefault("MuonSummaryHelperTool", result.popToolsAndMerge(
168 
169  kwargs.setdefault("doHolesInDet", True)
170  kwargs.setdefault("doHolesMuon", False)
171  kwargs.setdefault("AddDetailedMuonSummary", True)
172  kwargs.setdefault("PixelExists", True)
173 
174  result.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name, **kwargs))
175  return result
python.TrkTrackSummaryToolConfig.InDetTrigTrackSummaryToolCfg
def InDetTrigTrackSummaryToolCfg(flags, name="InDetTrigTrackSummaryTool", **kwargs)
Definition: TrkTrackSummaryToolConfig.py:53
python.MuonRecToolsConfig.MuonTrackSummaryHelperToolCfg
def MuonTrackSummaryHelperToolCfg(flags, name="MuonTrackSummaryHelperTool", **kwargs)
Definition: MuonRecToolsConfig.py:123
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetTrackSummaryHelperToolConfig.TrigTrackSummaryHelperToolSiOnlyCfg
def TrigTrackSummaryHelperToolSiOnlyCfg(flags, name="InDetTrigSummaryHelperSiOnly", **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:76
python.TrkTrackSummaryToolConfig.InDetTrigFastTrackSummaryToolCfg
def InDetTrigFastTrackSummaryToolCfg(flags, name="InDetTrigFastTrackSummaryTool", **kwargs)
Definition: TrkTrackSummaryToolConfig.py:71
python.TrkTrackSummaryToolConfig.MuonTrackSummaryToolCfg
def MuonTrackSummaryToolCfg(flags, name="MuonTrackSummaryTool", **kwargs)
Definition: TrkTrackSummaryToolConfig.py:143
python.InDetTrackSummaryHelperToolConfig.TrigTrackSummaryHelperToolCfg
def TrigTrackSummaryHelperToolCfg(flags, name="InDetTrigSummaryHelper", **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:38
python.TrkTrackSummaryToolConfig.MuonCombinedTrackSummaryToolCfg
def MuonCombinedTrackSummaryToolCfg(flags, name="CombinedMuonTrackSummary", **kwargs)
Definition: TrkTrackSummaryToolConfig.py:153
python.TrkTrackSummaryToolConfig.InDetTrackSummaryToolCfg
def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:22
python.InDetTrackSummaryHelperToolConfig.InDetSummaryHelperNoHoleSearchCfg
def InDetSummaryHelperNoHoleSearchCfg(flags, name='InDetSummaryHelperNoHoleSearch', **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:32
python.TrkTrackSummaryToolConfig.ITkTrackSummaryToolCfg
def ITkTrackSummaryToolCfg(flags, name='ITkTrackSummaryTool', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:94
python.InDetTrackSummaryHelperToolConfig.ITkSummaryHelperNoHoleSearchCfg
def ITkSummaryHelperNoHoleSearchCfg(flags, name='ITkSummaryHelperNoHoleSearch', **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:103
python.InDetTrackSummaryHelperToolConfig.CombinedMuonIDSummaryHelperToolCfg
def CombinedMuonIDSummaryHelperToolCfg(flags, name='CombinedMuonIDSummaryHelper', **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:109
python.TrkTrackSummaryToolConfig.GSFTrackSummaryToolCfg
def GSFTrackSummaryToolCfg(flags, name="GSFTrackSummaryTool", **kwargs)
Definition: TrkTrackSummaryToolConfig.py:121
python.TrkTrackSummaryToolConfig.InDetTrackSummaryToolNoHoleSearchCfg
def InDetTrackSummaryToolNoHoleSearchCfg(flags, name='InDetTrackSummaryToolNoHoleSearch', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:47
python.InDetTrackSummaryHelperToolConfig.ITkTrackSummaryHelperToolCfg
def ITkTrackSummaryHelperToolCfg(flags, name='ITkSummaryHelper', **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:84
python.InDetTrackSummaryHelperToolConfig.InDetTrackSummaryHelperToolCfg
def InDetTrackSummaryHelperToolCfg(flags, name='InDetSummaryHelper', **kwargs)
Definition: InDetTrackSummaryHelperToolConfig.py:7
python.TrkTrackSummaryToolConfig.ITkTrackSummaryToolNoHoleSearchCfg
def ITkTrackSummaryToolNoHoleSearchCfg(flags, name='ITkTrackSummaryToolNoHoleSearch', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:115