ATLAS Offline Software
Loading...
Searching...
No Matches
ActsMeasurementCalibrationConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
7 name: str='ActsAnalogueClusteringTool',
8 **kwargs) -> ComponentAccumulator:
9
10 if not flags.Detector.GeometryITk:
11 raise Exception("Acts Analogue Clustering calibration only supports ITk!")
12
13 acc = ComponentAccumulator()
14
15 from PixelConditionsAlgorithms.ITkPixelConditionsConfig import ITkPixelOfflineCalibCondAlgCfg
16 acc.merge(ITkPixelOfflineCalibCondAlgCfg(flags))
17
18 from ActsConfig.ActsConfigFlags import PixelErrorStrategy
19
20 kwargs.setdefault("PerformCovarianceCalibration", flags.Acts.OnTrackCalibration.performCovarianceCalibration)
21 kwargs.setdefault("PixelOfflineCalibData", "ITkPixelOfflineCalibData")
22 kwargs.setdefault("errorStrategy", PixelErrorStrategy.PITCH.value if flags.Acts.Clusters.UsePixelBroadErrors
23 else PixelErrorStrategy.CALIBRATED.value)
24
25 # For default configuration we set a lower cap on the calibrated covariance
26 # For FT we have inflated chi2 instead
27 # This applies to all tracking passes, main and secondaries alike
28 if not flags.Tracking.doITkFastTracking:
29 kwargs.setdefault("CalibratedCovarianceLowerBound", 0.75)
30
31 if 'PixelLorentzAngleTool' not in kwargs:
32 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig import ITkPixelLorentzAngleToolCfg
33 kwargs.setdefault("PixelLorentzAngleTool", acc.popToolsAndMerge(ITkPixelLorentzAngleToolCfg(flags)))
34
35
36 from ActsConfig.ActsConfigFlags import PixelCalibrationStrategy
37 ClusteringToolType = None
38 if flags.Acts.PixelCalibrationStrategy is PixelCalibrationStrategy.NNClustering:
39 ClusteringToolType = CompFactory.ActsTrk.ITkNNClusterCalibratorTool
40 from InDetConfig.SiClusterizationToolConfig import OnnxNNCondAlgCfg
41 acc.merge(OnnxNNCondAlgCfg(flags,
42 NumberNetworkPath=flags.Acts.PixelNNCalibrationModelsFolder+'number.onnx',
43 PositionNetwork1Path=flags.Acts.PixelNNCalibrationModelsFolder+'pos1.onnx',
44 PositionNetwork2Path=flags.Acts.PixelNNCalibrationModelsFolder+'pos2.onnx',
45 PositionNetwork3Path=flags.Acts.PixelNNCalibrationModelsFolder+'pos3.onnx'))
46 else:
47 ClusteringToolType = CompFactory.ActsTrk.ITkAnalogueClusteringTool
48
49
50 acc.setPrivateTools(ClusteringToolType(name, **kwargs))
51 return acc
52
54 name: str='ActsStripCalibrationTool',
55 **kwargs) -> ComponentAccumulator:
56
57 if not flags.Detector.GeometryITk:
58 raise Exception("Acts Strip calibration only supports ITk!")
59
60 acc = ComponentAccumulator()
61
62 from ActsConfig.ActsConfigFlags import StripClusteringErrorMode,StripErrorStrategy
63
64 kwargs.setdefault("PerformCovarianceCalibration", True)
65 kwargs.setdefault("errorStrategy", StripErrorStrategy.PITCH.value if flags.Acts.Clusters.StripClusteringErrorMode == StripClusteringErrorMode.WIDTH
66 else StripErrorStrategy.CLUSTERING.value)
67
68 acc.setPrivateTools(CompFactory.ActsTrk.ITkStripCalibrationTool(name, **kwargs))
69 return acc
ComponentAccumulator ActsStripCalibrationToolCfg(flags, str name='ActsStripCalibrationTool', **kwargs)
ComponentAccumulator ActsAnalogueClusteringToolCfg(flags, str name='ActsAnalogueClusteringTool', **kwargs)