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 kwargs.setdefault("minClusterChargeForNN", 15000.0)
41 from InDetConfig.SiClusterizationToolConfig import OnnxNNCondAlgCfg
42 acc.merge(OnnxNNCondAlgCfg(flags,
43 NumberNetworkPath=flags.Acts.PixelNNCalibrationModelsFolder+'number.onnx',
44 PositionNetwork1Path=flags.Acts.PixelNNCalibrationModelsFolder+'pos1.onnx',
45 PositionNetwork2Path=flags.Acts.PixelNNCalibrationModelsFolder+'pos2.onnx',
46 PositionNetwork3Path=flags.Acts.PixelNNCalibrationModelsFolder+'pos3.onnx'))
47 else:
48 ClusteringToolType = CompFactory.ActsTrk.ITkAnalogueClusteringTool
49
50
51 acc.setPrivateTools(ClusteringToolType(name, **kwargs))
52 return acc
53
55 name: str='ActsStripCalibrationTool',
56 **kwargs) -> ComponentAccumulator:
57
58 if not flags.Detector.GeometryITk:
59 raise Exception("Acts Strip calibration only supports ITk!")
60
61 acc = ComponentAccumulator()
62
63 from ActsConfig.ActsConfigFlags import StripClusteringErrorMode,StripErrorStrategy
64
65 kwargs.setdefault("PerformCovarianceCalibration", True)
66 kwargs.setdefault("errorStrategy", StripErrorStrategy.PITCH.value if flags.Acts.Clusters.StripClusteringErrorMode == StripClusteringErrorMode.WIDTH
67 else StripErrorStrategy.CLUSTERING.value)
68
69 acc.setPrivateTools(CompFactory.ActsTrk.ITkStripCalibrationTool(name, **kwargs))
70 return acc
ComponentAccumulator ActsStripCalibrationToolCfg(flags, str name='ActsStripCalibrationTool', **kwargs)
ComponentAccumulator ActsAnalogueClusteringToolCfg(flags, str name='ActsAnalogueClusteringTool', **kwargs)