ATLAS Offline Software
ActsSeedingConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from ActsConfig.ActsConfigFlags import SeedingStrategy
6 from ActsConfig.ActsUtilities import extractChildKwargs
7 from ActsInterop import UnitConstants
8 from AthenaCommon.Utils.unixtools import find_datafile
9 from AthenaCommon.Constants import WARNING
10 
11 # ACTS tools
13  name: str = "ActsPixelSeedingTool",
14  **kwargs) -> ComponentAccumulator:
15  acc = ComponentAccumulator()
16 
17 
18  kwargs.setdefault("numSeedIncrement" , float("inf"))
19  kwargs.setdefault("deltaZMax" , float("inf"))
20  kwargs.setdefault("maxPtScattering", float("inf"))
21  kwargs.setdefault("useVariableMiddleSPRange", False)
22  kwargs.setdefault("rMax", 320. * UnitConstants.mm)
23  kwargs.setdefault("rBinEdges", [0, kwargs['rMax']])
24  kwargs.setdefault("rRangeMiddleSP", [
25  [0,0],
26  [140, 260],
27  [40, 260],
28  [40, 260],
29  [40, 260],
30  [40, 260],
31  [70, 260],
32  [40, 260],
33  [40, 260],
34  [40, 260],
35  [40, 260],
36  [140, 260],
37  [0, 0]])
38  acc.setPrivateTools(CompFactory.ActsTrk.SeedingTool(name, **kwargs))
39  return acc
40 
42  name: str = "ActsFastPixelSeedingTool",
43  **kwargs) -> ComponentAccumulator:
44 
45  kwargs.setdefault("minPt", 1000 * UnitConstants.MeV)
46  kwargs.setdefault("collisionRegionMin", -150 * UnitConstants.mm)
47  kwargs.setdefault("collisionRegionMax", 150 * UnitConstants.mm)
48  kwargs.setdefault("maxPhiBins", 200)
49  kwargs.setdefault("gridRMax", 250 * UnitConstants.mm)
50  kwargs.setdefault("deltaRMax", 200 * UnitConstants.mm)
51  kwargs.setdefault("zBinsCustomLooping" , [3, 11, 4, 10, 7, 5, 9, 6, 8])
52  kwargs.setdefault("rRangeMiddleSP", [
53  [40.0, 80.0],
54  [40.0, 80.0],
55  [40.0, 200.0],
56  [70.0, 200.0],
57  [70.0, 200.0],
58  [70.0, 250.0],
59  [70.0, 250.0],
60  [70.0, 250.0],
61  [70.0, 200.0],
62  [70.0, 200.0],
63  [40.0, 200.0],
64  [40.0, 80.0],
65  [40.0, 80.0]])
66  kwargs.setdefault("useVariableMiddleSPRange", False)
67  kwargs.setdefault("useExperimentCuts", True)
68  kwargs.setdefault("rMax", 320 * UnitConstants.mm)
69  kwargs.setdefault("rBinEdges", [0, kwargs['rMax']])
70 
71  return ActsPixelSeedingToolCfg(flags, name, **kwargs)
72 
74  name: str = "ActsStripSeedingTool",
75  **kwargs) -> ComponentAccumulator:
76  acc = ComponentAccumulator()
77 
78 
79  kwargs.setdefault("doSeedQualitySelection", False)
80  # For SpacePointGridConfig
81  kwargs.setdefault("gridRMax" , 1000. * UnitConstants.mm)
82  kwargs.setdefault("deltaRMax" , 600. * UnitConstants.mm)
83  kwargs.setdefault("impactMax" , 20. * UnitConstants.mm)
84  # For SeedfinderConfig
85  kwargs.setdefault("rMax" , 1200. * UnitConstants.mm)
86  kwargs.setdefault("deltaRMinTopSP" , 20. * UnitConstants.mm)
87  kwargs.setdefault("deltaRMaxTopSP" , 300. * UnitConstants.mm)
88  kwargs.setdefault("deltaRMinBottomSP" , 20. * UnitConstants.mm)
89  kwargs.setdefault("deltaRMaxBottomSP" , 300. * UnitConstants.mm)
90  kwargs.setdefault("deltaZMax" , 900. * UnitConstants.mm)
91  kwargs.setdefault("interactionPointCut" , False)
92  kwargs.setdefault("zBinsCustomLooping" , [7, 8, 6, 9, 5, 10, 4, 11, 3, 12, 2])
93  kwargs.setdefault("deltaRMiddleMinSPRange" , 30 * UnitConstants.mm)
94  kwargs.setdefault("deltaRMiddleMaxSPRange" , 150 * UnitConstants.mm)
95  kwargs.setdefault("useDetailedDoubleMeasurementInfo" , True)
96  kwargs.setdefault("maxPtScattering", float("inf"))
97  # For SeedFilterConfig
98  kwargs.setdefault("useDeltaRorTopRadius" , False)
99  kwargs.setdefault("seedConfirmationInFilter" , False)
100  kwargs.setdefault("impactWeightFactor" , 1.)
101  kwargs.setdefault("compatSeedLimit" , 4)
102  kwargs.setdefault("numSeedIncrement" , 1.)
103  kwargs.setdefault("seedWeightIncrement" , 10100.)
104  kwargs.setdefault("maxSeedsPerSpMConf" , 100)
105  kwargs.setdefault("maxQualitySeedsPerSpMConf" , 100)
106  # For seeding algorithm
107  kwargs.setdefault("zBinNeighborsBottom" , [(0,0),(0,1),(0,1),(0,1),(0,2),(0,1),(0,0),(-1,0),(-2,0),(-1,0),(-1,0),(-1,0),(0,0)])
108  # Any other
109  kwargs.setdefault("rBinEdges", [0, kwargs['rMax']])
110 
111  acc.setPrivateTools(CompFactory.ActsTrk.SeedingTool(name, **kwargs))
112  return acc
113 
115  name: str = "ActsPixelOrthogonalSeedingTool",
116  **kwargs) -> ComponentAccumulator:
117  acc = ComponentAccumulator()
118 
119  acc.setPrivateTools(CompFactory.ActsTrk.OrthogonalSeedingTool(name, **kwargs))
120  return acc
121 
123  name: str = "ActsFastPixelOrthogonalSeedingTool",
124  **kwargs) -> ComponentAccumulator:
125  acc = ComponentAccumulator()
126 
127 
128 
129  kwargs.setdefault("minPt", 1000 * UnitConstants.MeV)
130  kwargs.setdefault("collisionRegionMin", -150 * UnitConstants.mm)
131  kwargs.setdefault("collisionRegionMax", 150 * UnitConstants.mm)
132  kwargs.setdefault("useExperimentCuts", True)
133 
134  acc.setPrivateTools(CompFactory.ActsTrk.OrthogonalSeedingTool(name, **kwargs))
135  return acc
136 
138  name: str = "ActsStripOrthogonalSeedingTool",
139  **kwargs) -> ComponentAccumulator:
140  acc = ComponentAccumulator()
141 
142 
143  kwargs.setdefault("impactMax" , 20. * UnitConstants.mm)
144  kwargs.setdefault('rMax', 1200. * UnitConstants.mm)
145  kwargs.setdefault("deltaRMinTopSP" , 20. * UnitConstants.mm)
146  kwargs.setdefault("deltaRMaxTopSP" , 300. * UnitConstants.mm)
147  kwargs.setdefault("deltaRMinBottomSP" , 20. * UnitConstants.mm)
148  kwargs.setdefault("deltaRMaxBottomSP" , 300. * UnitConstants.mm)
149  kwargs.setdefault("deltaZMax" , 900. * UnitConstants.mm)
150  kwargs.setdefault("interactionPointCut" , False)
151  kwargs.setdefault("impactWeightFactor" , 1.)
152  kwargs.setdefault("compatSeedLimit" , 4)
153  kwargs.setdefault("seedWeightIncrement" , 10100.)
154  kwargs.setdefault("numSeedIncrement" , 1.)
155  kwargs.setdefault("seedConfirmationInFilter" , False)
156  kwargs.setdefault("maxSeedsPerSpMConf" , 100)
157  kwargs.setdefault("maxQualitySeedsPerSpMConf" , 100)
158  kwargs.setdefault("useDeltaRorTopRadius" , False)
159  kwargs.setdefault("rMinMiddle", 33. * UnitConstants.mm)
160  kwargs.setdefault("rMaxMiddle", 1200. * UnitConstants.mm)
161 
162  acc.setPrivateTools(CompFactory.ActsTrk.OrthogonalSeedingTool(name, **kwargs))
163  return acc
164 
166  name: str = "ActsPixelGbtsSeedingTool",
167  **kwargs) -> ComponentAccumulator:
168  acc = ComponentAccumulator()
169 
171  kwargs.setdefault("connector_input_file" , find_datafile("ActsPatternRecognition/GBTS_EdgeProbabilites_ITKPixels.txt"))
172  acc.setPrivateTools(CompFactory.ActsTrk.GbtsSeedingTool(name = name, **kwargs))
173  return acc
174 
176  name: str = 'ActsSiSpacePointsSeedMakerTool',
177  **kwargs) -> ComponentAccumulator:
178  assert isinstance(name, str)
179 
180  acc = ComponentAccumulator()
181 
182  if flags.Tracking.ActiveConfig.extension == "ActsValidateConversionSeeds":
183  kwargs.setdefault('useOverlapSpCollection', False)
184 
185  # Main properties
186  kwargs.setdefault('usePixel',
187  flags.Tracking.ActiveConfig.useITkPixel and
188  flags.Tracking.ActiveConfig.useITkPixelSeeding)
189  kwargs.setdefault('useStrip',
190  flags.Tracking.ActiveConfig.useITkStrip and
191  flags.Tracking.ActiveConfig.useITkStripSeeding)
192  kwargs.setdefault('useOverlapSpCollection',
193  flags.Tracking.ActiveConfig.useITkStrip and
194  flags.Tracking.ActiveConfig.useITkStripSeeding)
195  kwargs.setdefault('ActsSpacePointsPixelName' , "ITkPixelSpacePoints")
196  kwargs.setdefault('ActsSpacePointsStripName' , "ITkStripSpacePoints")
197  kwargs.setdefault('ActsSpacePointsOverlapName' , "ITkStripOverlapSpacePoints")
198 
199 
200  # The code will need to use Trk::SpacePoint object for downstream Athena tracking
201  # If we run this tool we have two options to retrieve this:
202  # (1) Have the Athena->Acts Space Point Converter scheduled beforehand
203  # (2) Have the Athena->Acts Cluster Converter scheduled beforehand
204  # In case (1) the link xAOD -> Trk Space Point will be used to retrieve the Trk::SpacePoints
205  # In case (2) the link xAOD -> InDet Cluster will be used to create the Trk::SpacePoints
206  # If none of the above conditions are met, it means there is a misconfiguration of the algorithms
207  useClusters = flags.Tracking.ActiveConfig.doAthenaToActsCluster and not flags.Tracking.ActiveConfig.doAthenaToActsSpacePoint
208  kwargs.setdefault('useClustersForSeedConversion', useClusters)
209 
210  if flags.Tracking.ActiveConfig.usePrdAssociationTool:
211  # not all classes have that property !!!
212  kwargs.setdefault('PRDtoTrackMap', (
213  'ITkPRDtoTrackMap' + flags.Tracking.ActiveConfig.extension))
214 
215  # Acts Seed Tools
216  # Do not overwrite if already present in `kwargs`
217  seedTool_pixel = None
218  if 'SeedToolPixel' not in kwargs:
219  if flags.Acts.SeedingStrategy is SeedingStrategy.Orthogonal:
220  if flags.Tracking.doITkFastTracking:
221  seedTool_pixel = acc.popToolsAndMerge(ActsFastPixelOrthogonalSeedingToolCfg(flags))
222  else:
223  seedTool_pixel = acc.popToolsAndMerge(ActsPixelOrthogonalSeedingToolCfg(flags))
224  elif flags.Acts.SeedingStrategy is SeedingStrategy.Gbts:
225  seedTool_pixel = acc.popToolsAndMerge(ActsPixelGbtsSeedingToolCfg(flags))
226  else:
227  if flags.Tracking.doITkFastTracking:
228  kwargs.setdefault("useFastTracking", True)
229  seedTool_pixel = acc.popToolsAndMerge(ActsFastPixelSeedingToolCfg(flags))
230  else:
231  seedTool_pixel = acc.popToolsAndMerge(ActsPixelSeedingToolCfg(flags))
232 
233  seedTool_strip = None
234  if 'SeedToolStrip' not in kwargs:
235  if flags.Acts.SeedingStrategy is SeedingStrategy.Orthogonal:
236  seedTool_strip = acc.popToolsAndMerge(ActsStripOrthogonalSeedingToolCfg(flags))
237  else:
238  seedTool_strip = acc.popToolsAndMerge(ActsStripSeedingToolCfg(flags,
239  rMax=flags.Tracking.ActiveConfig.radMax))
240 
241  kwargs.setdefault('SeedToolPixel', seedTool_pixel)
242  kwargs.setdefault('SeedToolStrip', seedTool_strip)
243 
244  # Validation
245  if flags.Tracking.writeSeedValNtuple:
246  kwargs.setdefault('WriteNtuple', True)
247  HistService = CompFactory.THistSvc(Output = ["valNtuples DATAFILE='SeedMakerValidation.root' OPT='RECREATE'"])
248  acc.addService(HistService)
249 
250  acc.setPrivateTools(CompFactory.ActsTrk.SiSpacePointsSeedMaker(name, **kwargs))
251  return acc
252 
253 
254 # ACTS algorithm using Athena objects upstream
256  name: str = 'ActsPixelSeedingAlg',
257  **kwargs) -> ComponentAccumulator:
258  acc = ComponentAccumulator()
259 
260  # Beam Spot Cond is a requirement
261  from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
262  acc.merge(BeamSpotCondAlgCfg(flags))
263 
264  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
265  acc.merge(AtlasFieldCacheCondAlgCfg(flags))
266 
267  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelReadoutGeometryCfg
268  acc.merge(ITkPixelReadoutGeometryCfg(flags))
269 
270  # Need To add additional tool(s)
271  # Tracking Geometry Tool
272  if 'TrackingGeometryTool' not in kwargs:
273  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
274  geoTool = acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags))
275  acc.addPublicTool(geoTool)
276  kwargs.setdefault('TrackingGeometryTool', acc.getPublicTool(geoTool.name))
277 
278  # ATLAS Converter Tool
279  if 'ATLASConverterTool' not in kwargs:
280  from ActsConfig.ActsEventCnvConfig import ActsToTrkConverterToolCfg
281  kwargs.setdefault('ATLASConverterTool', acc.popToolsAndMerge(ActsToTrkConverterToolCfg(flags)))
282 
283  # Track Param Estimation Tool
284  if 'TrackParamsEstimationTool' not in kwargs:
285  from ActsConfig.ActsTrackParamsEstimationConfig import ActsTrackParamsEstimationToolCfg
286  kwargs.setdefault('TrackParamsEstimationTool', acc.popToolsAndMerge(ActsTrackParamsEstimationToolCfg(flags)))
287 
288  useFastTracking = kwargs.get("useFastTracking", flags.Tracking.doITkFastTracking)
289 
290  if "SeedTool" not in kwargs:
291  if flags.Acts.SeedingStrategy is SeedingStrategy.Orthogonal:
292  if useFastTracking:
293  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsFastPixelOrthogonalSeedingToolCfg(flags)))
294  else:
295  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsPixelOrthogonalSeedingToolCfg(flags)))
296  elif flags.Acts.SeedingStrategy is SeedingStrategy.Gbts:
297  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsPixelGbtsSeedingToolCfg(flags)))
298  else:
299  if useFastTracking:
300  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsFastPixelSeedingToolCfg(flags)))
301  else:
302  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsPixelSeedingToolCfg(flags)))
303 
304  kwargs.setdefault("useFastTracking", useFastTracking)
305  kwargs.setdefault('InputSpacePoints', ['ITkPixelSpacePoints_Cached'] if flags.Acts.useCache else ['ITkPixelSpacePoints'])
306  kwargs.setdefault('OutputSeeds', 'ActsPixelSeeds')
307  kwargs.setdefault('OutputEstimatedTrackParameters', 'ActsPixelEstimatedTrackParams')
308  kwargs.setdefault('DetectorElements', 'ITkPixelDetectorElementCollection')
309  kwargs.setdefault('UsePixel', True)
310 
311  if flags.Acts.doMonitoring and 'MonTool' not in kwargs:
312  from ActsConfig.ActsMonitoringConfig import ActsITkPixelSeedingMonitoringToolCfg
313  kwargs.setdefault('MonTool', acc.popToolsAndMerge(ActsITkPixelSeedingMonitoringToolCfg(flags)))
314 
315  acc.addEventAlgo(CompFactory.ActsTrk.SeedingAlg(name, **kwargs))
316  return acc
317 
318 
320  name: str = 'ActsStripSeedingAlg',
321  **kwargs) -> ComponentAccumulator:
322  acc = ComponentAccumulator()
323 
324  # Beam Spot Cond is a requirement
325  from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
326  acc.merge(BeamSpotCondAlgCfg(flags))
327 
328  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
329  acc.merge(AtlasFieldCacheCondAlgCfg(flags))
330 
331  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
332  acc.merge(ITkStripReadoutGeometryCfg(flags))
333 
334  # Need To add additional tool(s)
335  # Tracking Geometry Tool
336  if 'TrackingGeometryTool' not in kwargs:
337  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
338  geoTool = acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags))
339  acc.addPublicTool(geoTool)
340  kwargs.setdefault('TrackingGeometryTool', acc.getPublicTool(geoTool.name))
341 
342  # ATLAS Converter Tool
343  if 'ATLASConverterTool' not in kwargs:
344  from ActsConfig.ActsEventCnvConfig import ActsToTrkConverterToolCfg
345  kwargs.setdefault('ATLASConverterTool', acc.popToolsAndMerge(ActsToTrkConverterToolCfg(flags)))
346 
347  # Track Param Estimation Tool
348  if 'TrackParamsEstimationTool' not in kwargs:
349  from ActsConfig.ActsTrackParamsEstimationConfig import ActsTrackParamsEstimationToolCfg
350  kwargs.setdefault('TrackParamsEstimationTool', acc.popToolsAndMerge(ActsTrackParamsEstimationToolCfg(flags, useTopSp=flags.Acts.reverseTrackFindingForStrips)))
351 
352  if "SeedTool" not in kwargs:
353  if flags.Acts.SeedingStrategy is SeedingStrategy.Orthogonal:
354  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsStripOrthogonalSeedingToolCfg(flags)))
355  else:
356  kwargs.setdefault('SeedTool', acc.popToolsAndMerge(ActsStripSeedingToolCfg(flags)))
357 
358  kwargs.setdefault('InputSpacePoints', ['ITkStripSpacePoints_Cached', 'ITkStripOverlapSpacePoints_Cached'] if flags.Acts.useCache else ['ITkStripSpacePoints', 'ITkStripOverlapSpacePoints'])
359  kwargs.setdefault('OutputSeeds', 'ActsStripSeeds')
360  kwargs.setdefault('OutputEstimatedTrackParameters', 'ActsStripEstimatedTrackParams')
361  kwargs.setdefault('DetectorElements', 'ITkStripDetectorElementCollection')
362  kwargs.setdefault('UsePixel', False)
363 
364  if flags.Acts.doMonitoring and 'MonTool' not in kwargs:
365  from ActsConfig.ActsMonitoringConfig import ActsITkStripSeedingMonitoringToolCfg
366  kwargs.setdefault('MonTool', acc.popToolsAndMerge(ActsITkStripSeedingMonitoringToolCfg(flags)))
367 
368  kwargs.setdefault('useTopSp', flags.Acts.reverseTrackFindingForStrips)
369 
370  acc.addEventAlgo(CompFactory.ActsTrk.SeedingAlg(name, **kwargs))
371  return acc
372 
373 
375  **kwargs) -> ComponentAccumulator:
376  acc = ComponentAccumulator()
377 
378  kwargs.setdefault('processPixels', flags.Detector.EnableITkPixel)
379  kwargs.setdefault('processStrips', flags.Detector.EnableITkStrip)
380 
381  if kwargs['processPixels']:
382  acc.merge(ActsPixelSeedingAlgCfg(flags, **extractChildKwargs(prefix='PixelSeedingAlg.', **kwargs)))
383  if kwargs['processStrips']:
384  acc.merge(ActsStripSeedingAlgCfg(flags, **extractChildKwargs(prefix='StripSeedingAlg.', **kwargs)))
385 
386  # Analysis extensions
387  if flags.Acts.doAnalysis:
388  if kwargs['processPixels']:
389  from ActsConfig.ActsAnalysisConfig import ActsPixelSeedAnalysisAlgCfg, ActsPixelEstimatedTrackParamsAnalysisAlgCfg
390  acc.merge(ActsPixelSeedAnalysisAlgCfg(flags, **extractChildKwargs(prefix='PixelSeedAnalysisAlg.', **kwargs)))
391  acc.merge(ActsPixelEstimatedTrackParamsAnalysisAlgCfg(flags, **extractChildKwargs(prefix='PixelEstimatedTrackParamsAnalysisAlg.', **kwargs)))
392 
393  if kwargs['processStrips']:
394  from ActsConfig.ActsAnalysisConfig import ActsStripSeedAnalysisAlgCfg, ActsStripEstimatedTrackParamsAnalysisAlgCfg
395  acc.merge(ActsStripSeedAnalysisAlgCfg(flags, **extractChildKwargs(prefix='StripSeedAnalysisAlg.', **kwargs)))
396  acc.merge(ActsStripEstimatedTrackParamsAnalysisAlgCfg(flags, **extractChildKwargs(prefix='StripEstimatedTrackParamsAnalysisAlg.', **kwargs)))
397 
398  return acc
399 
400 def ActsSeedingCfg(flags) -> ComponentAccumulator:
401  acc = ComponentAccumulator()
402  processPixels = flags.Detector.EnableITkPixel
403  processStrips = flags.Detector.EnableITkStrip
404 
405  # For conversion pass we do not process pixels
406  if flags.Tracking.ActiveConfig.extension in ["ActsConversion", "ActsLargeRadius"]:
407  processPixels = False
408  # For main pass disable strips if fast tracking configuration
409  elif flags.Tracking.doITkFastTracking:
410  processStrips = False
411 
412  kwargs = dict()
413  kwargs.setdefault('processPixels', processPixels)
414  kwargs.setdefault('processStrips', processStrips)
415 
416  # TO-DO: refactor this seeding tool configuration
417  if flags.Tracking.ActiveConfig.extension == "ActsHeavyIon" and processPixels:
418  kwargs.setdefault('PixelSeedingAlg.SeedTool', acc.popToolsAndMerge(ActsPixelSeedingToolCfg(flags,
419  name=f'{flags.Tracking.ActiveConfig.extension}PixelSeedingTool',
420  minPt=flags.Tracking.ActiveConfig.minPTSeed)))
421  if processStrips and flags.Acts.SeedingStrategy is SeedingStrategy.Default:
422  kwargs.setdefault('StripSeedingAlg.SeedTool', acc.popToolsAndMerge(ActsStripSeedingToolCfg(flags,
423  name=f'{flags.Tracking.ActiveConfig.extension}StripSeedingTool',
424  rMax=flags.Tracking.ActiveConfig.radMax)))
425 
426  if processPixels:
427  # Seeding algo
428  kwargs.setdefault('PixelSeedingAlg.name', f'{flags.Tracking.ActiveConfig.extension}PixelSeedingAlg')
429  kwargs.setdefault('PixelSeedingAlg.useFastTracking', flags.Tracking.doITkFastTracking)
430  kwargs.setdefault('PixelSeedingAlg.OutputSeeds', f'{flags.Tracking.ActiveConfig.extension}PixelSeeds')
431  kwargs.setdefault('PixelSeedingAlg.OutputEstimatedTrackParameters', f'{flags.Tracking.ActiveConfig.extension}PixelEstimatedTrackParams')
432 
433  pixelSpacePoints = ['ITkPixelSpacePoints_Cached'] if flags.Acts.useCache else ['ITkPixelSpacePoints']
434  if flags.Tracking.ActiveConfig.isSecondaryPass:
435  pixelSpacePoints = [f'ITk{flags.Tracking.ActiveConfig.extension.replace("Acts", "")}PixelSpacePoints_Cached'] if flags.Acts.useCache else [f'ITk{flags.Tracking.ActiveConfig.extension.replace("Acts", "")}PixelSpacePoints']
436  kwargs.setdefault('PixelSeedingAlg.InputSpacePoints', pixelSpacePoints)
437 
438  # Analysis algo(s)
439  if flags.Acts.doAnalysis:
440  kwargs.setdefault('PixelSeedAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}PixelSeedAnalysisAlg')
441  kwargs.setdefault('PixelSeedAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
442  kwargs.setdefault('PixelSeedAnalysisAlg.InputSeedCollection', kwargs['PixelSeedingAlg.OutputSeeds'])
443 
444  kwargs.setdefault('PixelEstimatedTrackParamsAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}PixelEstimatedTrackParamsAnalysisAlg')
445  kwargs.setdefault('PixelEstimatedTrackParamsAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
446  kwargs.setdefault('PixelEstimatedTrackParamsAnalysisAlg.InputTrackParamsCollection', kwargs['PixelSeedingAlg.OutputEstimatedTrackParameters'])
447 
448  if processStrips:
449  # Seeding algo
450  kwargs.setdefault('StripSeedingAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripSeedingAlg')
451  kwargs.setdefault('StripSeedingAlg.OutputSeeds', f'{flags.Tracking.ActiveConfig.extension}StripSeeds')
452  kwargs.setdefault('StripSeedingAlg.OutputEstimatedTrackParameters', f'{flags.Tracking.ActiveConfig.extension}StripEstimatedTrackParams')
453  # Conversion pass does not use overlap space points
454  # Space Point naming is not yet fully connected to tracking passes - this will change
455  if flags.Tracking.ActiveConfig.extension == 'ActsConversion':
456  kwargs.setdefault('StripSeedingAlg.InputSpacePoints', ['ITkConversionStripSpacePoints_Cached'] if flags.Acts.useCache else ['ITkConversionStripSpacePoints'])
457  elif flags.Tracking.ActiveConfig.extension == 'ActsLargeRadius':
458  kwargs.setdefault('StripSeedingAlg.InputSpacePoints', ['ITkLargeRadiusStripSpacePoints_Cached',
459  'ITkLargeRadiusStripOverlapSpacePoints_Cached'] if flags.Acts.useCache else ['ITkLargeRadiusStripSpacePoints',
460  'ITkLargeRadiusStripOverlapSpacePoints'])
461  elif flags.Tracking.ActiveConfig.extension == 'ActsLowPt':
462  kwargs.setdefault('StripSeedingAlg.InputSpacePoints', ['ITkLowPtStripSpacePoints_Cached',
463  'ITkLowPtStripOverlapSpacePoints_Cached'] if flags.Acts.useCache else ['ITkLowPtStripSpacePoints',
464  'ITkLowPtStripOverlapSpacePoints'])
465  else:
466  kwargs.setdefault('StripSeedingAlg.InputSpacePoints', ['ITkStripSpacePoints_Cached',
467  'ITkStripOverlapSpacePoints_Cached'] if flags.Acts.useCache else ['ITkStripSpacePoints',
468  'ITkStripOverlapSpacePoints'])
469 
470  # Analysis algo(s)
471  if flags.Acts.doAnalysis:
472  kwargs.setdefault('StripSeedAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripSeedAnalysisAlg')
473  kwargs.setdefault('StripSeedAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
474  kwargs.setdefault('StripSeedAnalysisAlg.InputSeedCollection', kwargs['StripSeedingAlg.OutputSeeds'])
475 
476  kwargs.setdefault('StripEstimatedTrackParamsAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripEstimatedTrackParamsAnalysisAlg')
477  kwargs.setdefault('StripEstimatedTrackParamsAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
478  kwargs.setdefault('StripEstimatedTrackParamsAnalysisAlg.InputTrackParamsCollection', kwargs['StripSeedingAlg.OutputEstimatedTrackParameters'])
479 
480  acc.merge(ActsMainSeedingCfg(flags, **kwargs))
481 
482  if flags.Tracking.ActiveConfig.storeTrackSeeds:
483  acc.merge(ActsStoreTrackSeedsCfg(flags))
484 
485  return acc
486 
488  **kwargs: dict) -> ComponentAccumulator:
489 
490 
491  acc = ComponentAccumulator()
492 
493  seedKeyPixels = f'{flags.Tracking.ActiveConfig.extension}PixelSeeds'
494  seedKeyStrips = f'{flags.Tracking.ActiveConfig.extension}StripSeeds'
495  trackKeyPixels = f'SiSPTracksSeedSegments{flags.Tracking.ActiveConfig.extension}PixelTracks'
496  trackKeyStrips = f'SiSPTracksSeedSegments{flags.Tracking.ActiveConfig.extension}StripTracks'
497  particleKeyPixels = f'SiSPSeedSegments{flags.Tracking.ActiveConfig.extension}PixelTrackParticles'
498  particleKeyStrips = f'SiSPSeedSegments{flags.Tracking.ActiveConfig.extension}StripTrackParticles'
499 
500  acc.merge(ActsSeedToTrackCnvAlgPixelCfg(flags,
501  name=f"{flags.Tracking.ActiveConfig.extension}PixelSeedToTrackCnvAlg",
502  SeedContainerKey=seedKeyPixels,
503  ACTSTracksLocation=trackKeyPixels))
504 
505  from ActsConfig.ActsTrackFindingConfig import ActsTrackToTrackParticleCnvAlgCfg
506  acc.merge(ActsTrackToTrackParticleCnvAlgCfg(flags,
507  name=f"{flags.Tracking.ActiveConfig.extension}PixelTracksSeedToTrackParticleCnvAlg",
508  TrackParticlesOutKey=particleKeyPixels,
509  ACTSTracksLocation=[trackKeyPixels]))
510 
511 
512 
513 
514 
515  if not flags.Tracking.doITkFastTracking:
516  acc.merge(ActsSeedToTrackCnvAlgStripCfg(flags,
517  name=f"{flags.Tracking.ActiveConfig.extension}StripSeedToTrackCnvAlg",
518  SeedContainerKey=seedKeyStrips,
519  ACTSTracksLocation=trackKeyStrips))
520 
521  acc.merge(ActsTrackToTrackParticleCnvAlgCfg(flags,
522  name=f"{flags.Tracking.ActiveConfig.extension}StripTracksSeedToTrackParticleCnvAlg",
523  TrackParticlesOutKey=particleKeyStrips,
524  ACTSTracksLocation=[trackKeyStrips]))
525 
526 
527  # Schedule the seed tracks truth association and the seed track particles truth decoration
528 
529  if flags.Tracking.doTruth:
530  from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg
531  acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
532  name=f"{trackKeyPixels}TrackToTruthAssociationAlg",
533  ACTSTracksLocation=trackKeyPixels,
534  AssociationMapOut=trackKeyPixels+"ToTruthParticleAssociation"))
535 
536  from ActsConfig.ActsTruthConfig import ActsTrackParticleTruthDecorationAlgCfg
537 
538  # note: Schedule the algorithm with single truth map and always suppress stat dumps
540  flags,
541  name=f'{trackKeyPixels}TruthDecorationAlg',
542  TrackToTruthAssociationMaps = [trackKeyPixels+"ToTruthParticleAssociation"],
543  TrackParticleContainerName = particleKeyPixels,
544  OutputLevel=WARNING,
545  ComputeTrackRecoEfficiency=False
546  ))
547 
548  # Only schedule the SSS if in default tracking
549 
550  if not flags.Tracking.doITkFastTracking:
551  acc.merge(ActsTrackToTruthAssociationAlgCfg(flags,
552  name=f"{trackKeyStrips}TrackToTruthAssociationAlg",
553  ACTSTracksLocation=trackKeyStrips,
554  AssociationMapOut=trackKeyStrips+"ToTruthParticleAssociation"))
555 
557  flags,
558  name=f'{trackKeyStrips}TruthDecorationAlg',
559  TrackToTruthAssociationMaps = [trackKeyStrips+"ToTruthParticleAssociation"],
560  TrackParticleContainerName = particleKeyStrips,
561  OutputLevel=WARNING,
562  ComputeTrackRecoEfficiency=False
563  ))
564 
565  return acc
566 
567 
569  name: str = 'ActsSeedToTrackPixelCnvAlg',
570  **kwargs: dict) -> ComponentAccumulator:
571  acc = ComponentAccumulator()
572  from ActsConfig.ActsGeometryConfig import ActsDetectorElementToActsGeometryIdMappingAlgCfg
574  kwargs.setdefault('DetectorElementToActsGeometryIdMapKey', 'DetectorElementToActsGeometryIdMap')
575 
576  kwargs.setdefault('SeedContainerKey', f'{flags.Tracking.ActiveConfig.extension}PixelSeeds')
577  kwargs.setdefault('EstimatedTrackParametersKey',f'{flags.Tracking.ActiveConfig.extension}PixelEstimatedTrackParams')
578 
579  kwargs.setdefault('ACTSTracksLocation', f'SiSPTracksSeedSegments{flags.Tracking.ActiveConfig.extension}PixelTracks') # This uses the same naming convention than the legacy code
580 
581  if 'TrackingGeometryTool' not in kwargs:
582  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
583  kwargs.setdefault('TrackingGeometryTool', acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags)))
584 
585  acc.addEventAlgo(CompFactory.ActsTrk.SeedToTrackCnvAlg(name, **kwargs), primary=True)
586  return acc
587 
589  name: str = 'ActsSeedToTrackStripCnvAlg',
590  **kwargs: dict) -> ComponentAccumulator:
591  acc = ComponentAccumulator()
592 
593  kwargs.setdefault('SeedContainerKey', f'{flags.Tracking.ActiveConfig.extension}StripSeeds')
594  kwargs.setdefault('EstimatedTrackParametersKey',f'{flags.Tracking.ActiveConfig.extension}StripEstimatedTrackParams')
595 
596  kwargs.setdefault('ACTSTracksLocation', f'SiSPTracksSeedSegments{flags.Tracking.ActiveConfig.extension}StripTracks') # This uses the same naming convention than the legacy code
597 
598  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
599  kwargs.setdefault('TrackingGeometryTool', acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags)))
600 
601  acc.addEventAlgo(CompFactory.ActsTrk.SeedToTrackCnvAlg(name, **kwargs), primary=True)
602  return acc
ActsSeedingConfig.ActsPixelOrthogonalSeedingToolCfg
ComponentAccumulator ActsPixelOrthogonalSeedingToolCfg(flags, str name="ActsPixelOrthogonalSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:114
ActsSeedingConfig.ActsPixelGbtsSeedingToolCfg
ComponentAccumulator ActsPixelGbtsSeedingToolCfg(flags, str name="ActsPixelGbtsSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:165
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ActsUtilities.extractChildKwargs
dict extractChildKwargs(*str prefix, **dict kwargs)
Definition: ActsUtilities.py:3
ActsSeedingConfig.ActsPixelSeedingAlgCfg
ComponentAccumulator ActsPixelSeedingAlgCfg(flags, str name='ActsPixelSeedingAlg', **kwargs)
Definition: ActsSeedingConfig.py:255
python.BeamSpotConditionsConfig.BeamSpotCondAlgCfg
def BeamSpotCondAlgCfg(flags, name="BeamSpotCondAlg", **kwargs)
Definition: BeamSpotConditionsConfig.py:7
ActsAnalysisConfig.ActsPixelEstimatedTrackParamsAnalysisAlgCfg
ComponentAccumulator ActsPixelEstimatedTrackParamsAnalysisAlgCfg(flags, str name='ActsPixelEstimatedTrackParamsAnalysisAlg', str extension="Acts", **kwargs)
Definition: ActsAnalysisConfig.py:568
ActsAnalysisConfig.ActsStripSeedAnalysisAlgCfg
ComponentAccumulator ActsStripSeedAnalysisAlgCfg(flags, str name="ActsStripSeedAnalysisAlg", str extension="Acts", **kwargs)
Definition: ActsAnalysisConfig.py:459
ActsEventCnvConfig.ActsToTrkConverterToolCfg
ComponentAccumulator ActsToTrkConverterToolCfg(flags, str name="ActsToTrkConverterTool", **kwargs)
Definition: ActsEventCnvConfig.py:6
ActsSeedingConfig.ActsSeedToTrackCnvAlgPixelCfg
ComponentAccumulator ActsSeedToTrackCnvAlgPixelCfg(flags, str name='ActsSeedToTrackPixelCnvAlg', **dict kwargs)
Definition: ActsSeedingConfig.py:568
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:39
ActsSeedingConfig.ActsSeedToTrackCnvAlgStripCfg
ComponentAccumulator ActsSeedToTrackCnvAlgStripCfg(flags, str name='ActsSeedToTrackStripCnvAlg', **dict kwargs)
Definition: ActsSeedingConfig.py:588
ActsSeedingConfig.ActsPixelSeedingToolCfg
ComponentAccumulator ActsPixelSeedingToolCfg(flags, str name="ActsPixelSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:12
ActsTruthConfig.ActsTrackToTruthAssociationAlgCfg
ComponentAccumulator ActsTrackToTruthAssociationAlgCfg(flags, str name='ActsTracksToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:50
ITkPixelGeoModelConfig.ITkPixelReadoutGeometryCfg
def ITkPixelReadoutGeometryCfg(flags)
Definition: ITkPixelGeoModelConfig.py:39
ActsAnalysisConfig.ActsPixelSeedAnalysisAlgCfg
ComponentAccumulator ActsPixelSeedAnalysisAlgCfg(flags, str name="ActsPixelSeedAnalysisAlg", str extension="Acts", **kwargs)
Definition: ActsAnalysisConfig.py:441
ActsMonitoringConfig.ActsITkPixelSeedingMonitoringToolCfg
ComponentAccumulator ActsITkPixelSeedingMonitoringToolCfg(flags, str name="ActsITkPixelSeedingMonitoringTool", **kwargs)
Definition: ActsMonitoringConfig.py:120
ActsSeedingConfig.ActsFastPixelOrthogonalSeedingToolCfg
ComponentAccumulator ActsFastPixelOrthogonalSeedingToolCfg(flags, str name="ActsFastPixelOrthogonalSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:122
ActsSeedingConfig.ActsStripSeedingAlgCfg
ComponentAccumulator ActsStripSeedingAlgCfg(flags, str name='ActsStripSeedingAlg', **kwargs)
Definition: ActsSeedingConfig.py:319
Constants
some useful constants -------------------------------------------------—
ActsTrackParamsEstimationConfig.ActsTrackParamsEstimationToolCfg
ComponentAccumulator ActsTrackParamsEstimationToolCfg(ConfigFlags, str name="ActsTrackParamsEstimationTool", **kwargs)
Definition: ActsTrackParamsEstimationConfig.py:6
ActsGeometryConfig.ActsTrackingGeometryToolCfg
ComponentAccumulator ActsTrackingGeometryToolCfg(flags, str name="ActsTrackingGeometryTool")
Definition: ActsGeometryConfig.py:100
ActsAnalysisConfig.ActsStripEstimatedTrackParamsAnalysisAlgCfg
ComponentAccumulator ActsStripEstimatedTrackParamsAnalysisAlgCfg(flags, str name='ActsStripEstimatedTrackParamsAnalysisAlg', str extension="Acts", **kwargs)
Definition: ActsAnalysisConfig.py:581
ActsSeedingConfig.ActsSiSpacePointsSeedMakerToolCfg
ComponentAccumulator ActsSiSpacePointsSeedMakerToolCfg(flags, str name='ActsSiSpacePointsSeedMakerTool', **kwargs)
Definition: ActsSeedingConfig.py:175
ActsSeedingConfig.ActsSeedingCfg
ComponentAccumulator ActsSeedingCfg(flags)
Definition: ActsSeedingConfig.py:400
ActsGeometryConfig.ActsDetectorElementToActsGeometryIdMappingAlgCfg
ComponentAccumulator ActsDetectorElementToActsGeometryIdMappingAlgCfg(flags, str name="ActsDetectorElementToActsGeometryIdMappingAlg", **kwargs)
Definition: ActsGeometryConfig.py:257
ActsSeedingConfig.ActsFastPixelSeedingToolCfg
ComponentAccumulator ActsFastPixelSeedingToolCfg(flags, str name="ActsFastPixelSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:41
ActsMonitoringConfig.ActsITkStripSeedingMonitoringToolCfg
ComponentAccumulator ActsITkStripSeedingMonitoringToolCfg(flags, str name="ActsITkStripSeedingMonitoringTool", **kwargs)
Definition: ActsMonitoringConfig.py:141
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8
python.Utils.unixtools.find_datafile
def find_datafile(fname, pathlist=None, access=os.R_OK)
pathresolver-like helper function --------------------------------------—
Definition: unixtools.py:67
ActsSeedingConfig.ActsStoreTrackSeedsCfg
ComponentAccumulator ActsStoreTrackSeedsCfg(flags, **dict kwargs)
Definition: ActsSeedingConfig.py:487
ActsTruthConfig.ActsTrackParticleTruthDecorationAlgCfg
ComponentAccumulator ActsTrackParticleTruthDecorationAlgCfg(flags, str name='ActsTrackParticleTruthDecorationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:116
readCCLHist.float
float
Definition: readCCLHist.py:83
ActsSeedingConfig.ActsMainSeedingCfg
ComponentAccumulator ActsMainSeedingCfg(flags, **kwargs)
Definition: ActsSeedingConfig.py:374
ActsSeedingConfig.ActsStripSeedingToolCfg
ComponentAccumulator ActsStripSeedingToolCfg(flags, str name="ActsStripSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:73
ActsTrackFindingConfig.ActsTrackToTrackParticleCnvAlgCfg
ComponentAccumulator ActsTrackToTrackParticleCnvAlgCfg(flags, str name="ActsTrackToTrackParticleCnvAlg", **kwargs)
Definition: ActsTrackFindingConfig.py:340
ActsSeedingConfig.ActsStripOrthogonalSeedingToolCfg
ComponentAccumulator ActsStripOrthogonalSeedingToolCfg(flags, str name="ActsStripOrthogonalSeedingTool", **kwargs)
Definition: ActsSeedingConfig.py:137