Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CommonTrackFitterConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 # Configuration of common interface with various track fitters
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from TrkConfig.TrkConfigFlags import TrackFitterType
5 
6 
9 
10 def InDetTrackFitterCfg(flags, name='InDetTrackFitter', **kwargs) :
11  from TrkConfig.TrkDistributedKalmanFilterConfig import (
12  DistributedKalmanFilterCfg)
13  from TrkConfig.TrkGlobalChi2FitterConfig import InDetGlobalChi2FitterCfg
14  from TrkConfig.TrkGaussianSumFilterConfig import GaussianSumFitterCfg
15  return {
16  TrackFitterType.DistributedKalmanFilter : DistributedKalmanFilterCfg,
17  TrackFitterType.GlobalChi2Fitter : InDetGlobalChi2FitterCfg,
18  TrackFitterType.GaussianSumFilter : GaussianSumFitterCfg
19  }[flags.Tracking.trackFitterType](flags, name, **kwargs)
20 
21 # Config to be called outside of loops over tracking passes in main reco
22 # Will configure subtools based on MainPass
23 def InDetStandaloneTrackFitterCfg(flags, name='InDetTrackFitter', **kwargs) :
24  primaryFlags = flags.cloneAndReplace(
25  "Tracking.ActiveConfig",
26  f"Tracking.{flags.Tracking.PrimaryPassConfig.value}Pass")
27  return InDetTrackFitterCfg(primaryFlags, name, **kwargs)
28 
29 def InDetTrackFitterHoleSearchCfg(flags, name='InDetTrackFitterHoleSearch', **kwargs) :
30  acc = ComponentAccumulator()
31 
32  if "BoundaryCheckTool" not in kwargs:
33  from InDetConfig.InDetBoundaryCheckToolConfig import (
34  InDetBoundaryCheckToolCfg)
35  kwargs.setdefault("BoundaryCheckTool", acc.popToolsAndMerge(
37 
38  kwargs.setdefault("DoHoleSearch", True)
39 
40  acc.setPrivateTools(acc.popToolsAndMerge(
41  InDetTrackFitterCfg(flags, name, **kwargs)))
42  return acc
43 
44 def InDetTrackFitterAmbiCfg(flags, name='InDetTrackFitterAmbi', **kwargs) :
45  acc = ComponentAccumulator()
46 
47  InDetTrackFitter = acc.popToolsAndMerge(
48  InDetTrackFitterHoleSearchCfg(flags, name, **kwargs))
49  ClusterSplitProbabilityName = ("InDetAmbiguityProcessorSplitProb" +
50  flags.Tracking.ActiveConfig.extension)
51 
52  if flags.Tracking.trackFitterType==TrackFitterType.DistributedKalmanFilter:
53  InDetTrackFitter.RecalibratorHandle.BroadPixelClusterOnTrackTool.ClusterSplitProbabilityName = ClusterSplitProbabilityName
54 
55  elif flags.Tracking.trackFitterType==TrackFitterType.GlobalChi2Fitter:
56  InDetTrackFitter.ClusterSplitProbabilityName = ClusterSplitProbabilityName
57  InDetTrackFitter.RotCreatorTool.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
58  InDetTrackFitter.BroadRotCreatorTool.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
59 
60  elif flags.Tracking.trackFitterType==TrackFitterType.GaussianSumFilter:
61  InDetTrackFitter.ToolForROTCreation.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
62 
63  acc.setPrivateTools(InDetTrackFitter)
64  return acc
65 
66 def InDetTrackFitterTRTCfg(flags, name='InDetTrackFitterTRT', **kwargs) :
67  if flags.Tracking.trackFitterType==TrackFitterType.GlobalChi2Fitter:
68  from TrkConfig.TrkGlobalChi2FitterConfig import (
69  InDetGlobalChi2FitterTRTCfg)
70  TrackFitterTRTCfg = InDetGlobalChi2FitterTRTCfg
71  else:
72  TrackFitterTRTCfg = InDetTrackFitterCfg
73  return TrackFitterTRTCfg(flags, name, **kwargs)
74 
75 def InDetTrackFitterLowPtCfg(flags, name='InDetTrackFitter', **kwargs) :
76  if flags.Tracking.trackFitterType==TrackFitterType.GlobalChi2Fitter:
77  from TrkConfig.TrkGlobalChi2FitterConfig import (
78  InDetGlobalChi2FitterLowPtCfg)
79  TrackFitterLowPtCfg = InDetGlobalChi2FitterLowPtCfg
80  else:
81  TrackFitterLowPtCfg = InDetTrackFitterCfg
82  return TrackFitterLowPtCfg(flags, name, **kwargs)
83 
84 def InDetTrackFitterLowPtHoleSearchCfg(flags, name='InDetTrackFitterHoleSearch', **kwargs) :
85  acc = ComponentAccumulator()
86 
87  if "BoundaryCheckTool" not in kwargs:
88  from InDetConfig.InDetBoundaryCheckToolConfig import (
89  InDetBoundaryCheckToolCfg)
90  kwargs.setdefault("BoundaryCheckTool", acc.popToolsAndMerge(
92 
93  kwargs.setdefault("DoHoleSearch", True)
94 
95  acc.setPrivateTools(acc.popToolsAndMerge(
96  InDetTrackFitterLowPtCfg(flags, name, **kwargs)))
97  return acc
98 
99 def InDetTrackFitterLowPtAmbiCfg(flags, name='InDetTrackFitterAmbi', **kwargs) :
100  acc = ComponentAccumulator()
101 
102  if flags.Tracking.trackFitterType == TrackFitterType.GlobalChi2Fitter:
103  from TrkConfig.TrkGlobalChi2FitterConfig import (
104  InDetGlobalChi2FitterLowPtCfg)
105  InDetGlobalChi2FitterLowPt = acc.popToolsAndMerge(
106  InDetGlobalChi2FitterLowPtCfg(flags, name, **kwargs))
107 
108  ClusterSplitProbabilityName = ("InDetAmbiguityProcessorSplitProb" +
109  flags.Tracking.ActiveConfig.extension)
110  InDetGlobalChi2FitterLowPt.RotCreatorTool.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
111  InDetGlobalChi2FitterLowPt.BroadRotCreatorTool.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
112  acc.setPrivateTools(InDetGlobalChi2FitterLowPt)
113 
114  else:
115  acc.setPrivateTools(acc.popToolsAndMerge(
116  InDetTrackFitterAmbiCfg(flags, name, **kwargs)))
117 
118  return acc
119 
120 def InDetTrackFitterBTCfg(flags, name='InDetTrackFitterBT', **kwargs) :
121  if flags.Tracking.trackFitterType==TrackFitterType.GlobalChi2Fitter:
122  from TrkConfig.TrkGlobalChi2FitterConfig import (
123  InDetGlobalChi2FitterBTCfg)
124  TrackFitterBTCfg = InDetGlobalChi2FitterBTCfg
125  else:
126  TrackFitterBTCfg = InDetTrackFitterCfg
127  return TrackFitterBTCfg(flags, name, **kwargs)
128 
129 
130 
133 
134 def ITkTrackFitterCfg(flags, name='ITkTrackFitter', **kwargs) :
135  from TrkConfig.TrkDistributedKalmanFilterConfig import (
136  ITkDistributedKalmanFilterCfg)
137  from TrkConfig.TrkGlobalChi2FitterConfig import ITkGlobalChi2FitterCfg
138  from TrkConfig.TrkGaussianSumFilterConfig import ITkGaussianSumFitterCfg
139  return {
140  TrackFitterType.DistributedKalmanFilter : ITkDistributedKalmanFilterCfg,
141  TrackFitterType.GlobalChi2Fitter : ITkGlobalChi2FitterCfg,
142  TrackFitterType.GaussianSumFilter : ITkGaussianSumFitterCfg
143  }[flags.Tracking.trackFitterType](flags, name, **kwargs)
144 
145 # Config to be called outside of loops over tracking passes in main reco
146 # Will configure subtools based on MainPass
147 def ITkStandaloneTrackFitterCfg(flags, name='ITkTrackFitter', **kwargs) :
148  primaryFlags = flags.cloneAndReplace(
149  "Tracking.ActiveConfig",
150  f"Tracking.{flags.Tracking.ITkPrimaryPassConfig.value}Pass")
151  return ITkTrackFitterCfg(primaryFlags, name, **kwargs)
152 
153 def ITkTrackFitterAmbiCfg(flags, name='ITkTrackFitterAmbi', **kwargs) :
154  acc = ComponentAccumulator()
155 
156  if "BoundaryCheckTool" not in kwargs:
157  from InDetConfig.InDetBoundaryCheckToolConfig import (
158  ITkBoundaryCheckToolCfg)
159  kwargs.setdefault("BoundaryCheckTool", acc.popToolsAndMerge(
160  ITkBoundaryCheckToolCfg(flags)))
161 
162  kwargs.setdefault("DoHoleSearch", True)
163 
164  ITkTrackFitter = acc.popToolsAndMerge(
165  ITkTrackFitterCfg(flags, name, **kwargs))
166  ClusterSplitProbabilityName = ("ITkAmbiguityProcessorSplitProb" +
167  flags.Tracking.ActiveConfig.extension)
168 
169  if flags.Tracking.trackFitterType==TrackFitterType.DistributedKalmanFilter:
170  ITkTrackFitter.RecalibratorHandle.BroadPixelClusterOnTrackTool.ClusterSplitProbabilityName = ClusterSplitProbabilityName
171 
172  elif flags.Tracking.trackFitterType==TrackFitterType.GlobalChi2Fitter:
173  ITkTrackFitter.ClusterSplitProbabilityName = ClusterSplitProbabilityName
174  ITkTrackFitter.RotCreatorTool.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
175  ITkTrackFitter.BroadRotCreatorTool.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
176 
177  elif flags.Tracking.trackFitterType==TrackFitterType.GaussianSumFilter:
178  ITkTrackFitter.ToolForROTCreation.ToolPixelCluster.ClusterSplitProbabilityName = ClusterSplitProbabilityName
179 
180  acc.setPrivateTools(ITkTrackFitter)
181  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetBoundaryCheckToolConfig.ITkBoundaryCheckToolCfg
def ITkBoundaryCheckToolCfg(flags, name='ITkBoundaryCheckTool', **kwargs)
Definition: InDetBoundaryCheckToolConfig.py:102
python.CommonTrackFitterConfig.ITkTrackFitterCfg
def ITkTrackFitterCfg(flags, name='ITkTrackFitter', **kwargs)
ITk configs #####.
Definition: CommonTrackFitterConfig.py:134
python.CommonTrackFitterConfig.InDetTrackFitterBTCfg
def InDetTrackFitterBTCfg(flags, name='InDetTrackFitterBT', **kwargs)
Definition: CommonTrackFitterConfig.py:120
python.CommonTrackFitterConfig.InDetTrackFitterLowPtAmbiCfg
def InDetTrackFitterLowPtAmbiCfg(flags, name='InDetTrackFitterAmbi', **kwargs)
Definition: CommonTrackFitterConfig.py:99
python.CommonTrackFitterConfig.InDetTrackFitterCfg
def InDetTrackFitterCfg(flags, name='InDetTrackFitter', **kwargs)
InDet configs #####.
Definition: CommonTrackFitterConfig.py:10
python.CommonTrackFitterConfig.InDetTrackFitterTRTCfg
def InDetTrackFitterTRTCfg(flags, name='InDetTrackFitterTRT', **kwargs)
Definition: CommonTrackFitterConfig.py:66
python.CommonTrackFitterConfig.InDetTrackFitterLowPtHoleSearchCfg
def InDetTrackFitterLowPtHoleSearchCfg(flags, name='InDetTrackFitterHoleSearch', **kwargs)
Definition: CommonTrackFitterConfig.py:84
python.CommonTrackFitterConfig.InDetTrackFitterLowPtCfg
def InDetTrackFitterLowPtCfg(flags, name='InDetTrackFitter', **kwargs)
Definition: CommonTrackFitterConfig.py:75
python.InDetBoundaryCheckToolConfig.InDetBoundaryCheckToolCfg
def InDetBoundaryCheckToolCfg(flags, name='InDetBoundarySearchTool', **kwargs)
Definition: InDetBoundaryCheckToolConfig.py:7
python.CommonTrackFitterConfig.InDetTrackFitterAmbiCfg
def InDetTrackFitterAmbiCfg(flags, name='InDetTrackFitterAmbi', **kwargs)
Definition: CommonTrackFitterConfig.py:44
python.CommonTrackFitterConfig.ITkStandaloneTrackFitterCfg
def ITkStandaloneTrackFitterCfg(flags, name='ITkTrackFitter', **kwargs)
Definition: CommonTrackFitterConfig.py:147
python.TrkGlobalChi2FitterConfig.InDetGlobalChi2FitterLowPtCfg
def InDetGlobalChi2FitterLowPtCfg(flags, name='InDetGlobalChi2FitterLowPt', **kwargs)
Definition: TrkGlobalChi2FitterConfig.py:156
python.CommonTrackFitterConfig.ITkTrackFitterAmbiCfg
def ITkTrackFitterAmbiCfg(flags, name='ITkTrackFitterAmbi', **kwargs)
Definition: CommonTrackFitterConfig.py:153
python.CommonTrackFitterConfig.InDetTrackFitterHoleSearchCfg
def InDetTrackFitterHoleSearchCfg(flags, name='InDetTrackFitterHoleSearch', **kwargs)
Definition: CommonTrackFitterConfig.py:29
python.CommonTrackFitterConfig.InDetStandaloneTrackFitterCfg
def InDetStandaloneTrackFitterCfg(flags, name='InDetTrackFitter', **kwargs)
Definition: CommonTrackFitterConfig.py:23