ATLAS Offline Software
Loading...
Searching...
No Matches
ActsConfigFlags.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.AthConfigFlags import AthConfigFlags
4from AthenaConfiguration.Enums import FlagEnum, LHCPeriod
5
6class SeedingStrategy(FlagEnum):
7 GridTriplet = "GridTriplet"
8 Gbts = "Gbts"
9 GbtsFtf = "GbtsFtf"
10 F150 = "F150"
11 Gnn = "Gnn"
12
14 Greedy = "GreedySolver"
15 ScoreBased = "ScoreBasedAmbiguitySolver"
16
17# Which implementation to use for space point formation
18# ActsTrk : the Athena implementation
19# ActsCore : the ACTS space point builders, and the only one supporting cosmics
20class SpacePointStrategy(FlagEnum):
21 ActsTrk = "ActsTrk"
22 ActsCore = "ActsCore"
23
24# Define the Ambiguity resolution strategy modes
25# OUTSIDE_TF : run the ambiguity resolution in a separate algorithm
26# END_OF_TF : run the ambiguity resolution at the end of the track finding, on the track candidate container
27# DURING_TF : remove the tracks that share too many hits during track finding, when deciding good candidates
28class AmbiguitySolverMode(FlagEnum):
29 OUTSIDE_TF = 0
30 END_OF_TF = 1
31 DURING_TF = 2
32
33# Define the Pixel cluster calibration error strategy modes (the errors that will be used for filtering)
34# CALIBRATED : load the calibration constants from database
35# PITCH : if we used broad clusters during clustering (so the error is the cluster width) rescale it by the number of pixels
36# to assign the pitch as error to the cluster
37class PixelErrorStrategy(FlagEnum):
38 CALIBRATED = 0
39 PITCH = 1
40
41# Define the Strip clustering errors assigned to the measurements during clustering
42# These errors will be used during track finding
43# PITCH : assign the pitch as cluster error
44# WIDTH : use the cluster width as cluster error
45# TUNED : use an error 1.05 x pitch for 1strip clusters, a 0.27 x width for 2strip clusters and width for >=3strip clusters
47 PITCH = 0
48 WIDTH = 1
49 TUNED = 2
50
51# Define the Strip cluster calibration error strategy modes (the errors that will be used for filtering)
52# CLUSTERING : Use directly the clustering errors
53# PITCH : if we used broad clusters during clustering (so the error is the cluster width) rescale it by the number of pixels
54# to assign the pitch as error to the cluster
55class StripErrorStrategy(FlagEnum):
56 CLUSTERING = 0
57 PITCH = 1
58
59class TrackFitterType(FlagEnum):
60 KalmanFitter = 'KalmanFitter' # default ACTS fitter to choose
61 GaussianSumFitter = 'GaussianSumFitter' # new experimental implementation
62 GlobalChiSquareFitter = 'GlobalChiSquareFitter' # new experimental implementation
63
64# Flag for pixel calibration strategy during track finding
65# - use cluster as is (Uncalibrated)
66# - perform AnalogueClustering either before selecting
67# measurements for extending tracks (AnalogueClusteringBeforeSelection)
68# - or only apply the AnalogueClustering to selected measurements
69# (AnalogueClustering)
70# - or add NN corrections, again either on the selected measurements
71# (NNClustering) or on all candidates (NNClusteringBeforeSelection)
73 Uncalibrated = "Uncalibrated"
74 AnalogueClusteringBeforeSelection = "AnalogueClusteringBeforeSelection"
75 AnalogueClustering = "AnalogueClustering"
76 NNClusteringBeforeSelection = "NNClusteringBeforeSelection"
77 NNClustering = "NNClustering"
78
79 def usesCalibration(self):
80 """whether a calibrator is needed at all"""
81 return self is not PixelCalibrationStrategy.Uncalibrated
82
83 def usesNN(self):
84 """whether NN corrections are applied on top"""
85 return self in (PixelCalibrationStrategy.NNClustering,
86 PixelCalibrationStrategy.NNClusteringBeforeSelection)
87
89 """whether only the selected measurements are calibrated"""
90 return self in (PixelCalibrationStrategy.AnalogueClusteringBeforeSelection,
91 PixelCalibrationStrategy.NNClustering)
92
93# Flag for strip calibration strategy during track finding
94# - use cluster as is (Uncalibrated)
95# - use strip pitch / sqrt(12) as error either before selecting
96# measurements for extending tracks (DigitalCalibrationBeforeSelection)
97# - or only apply it to selected measurements (DigitalCalibration)
99 Uncalibrated = "Uncalibrated"
100 DigitalCalibrationBeforeSelection = "DigitalCalibrationBeforeSelection"
101 DigitalCalibration = "DigitalCalibration"
102
104 """whether a calibrator is needed at all"""
105 return self is not StripCalibrationStrategy.Uncalibrated
106
108 """whether only the selected measurements are calibrated"""
109 return self is StripCalibrationStrategy.DigitalCalibrationBeforeSelection
110
111# Define which space points of a seed are used for the track parameter estimation
112# FirstThree : the first 3 SPs
113# FirstThreeLongMomentum : the first 3 SPs, with q/p from the first, middle and last SPs
114# FirstMiddleLast : the first, middle and last SPs
115# MinDeltaR : the first 3 SPs, that are separated by more than Acts.minDeltaRParameterEstimation
117 FirstThree = 0
118 FirstThreeLongMomentum = 1
119 FirstMiddleLast = 2
120 MinDeltaR = 3
121
122
124 actscf = AthConfigFlags()
125
126 # General Flags
127 actscf.addFlag('Acts.EDM.PersistifyClusters', lambda pcf: pcf.Acts.EDM.PersistifySpacePoints and not pcf.Tracking.StoreSlimmedDataPreparation)
128 actscf.addFlag('Acts.EDM.PersistifySpacePoints', lambda pcf: pcf.Tracking.StoreSlimmedDataPreparation)
129 actscf.addFlag('Acts.EDM.PersistifyTracks', False)
130 # set to True to use the PhaseII pixel and strip RAW data EDM
131 actscf.addFlag('Acts.EDM.PhaseII', False)
132 actscf.addFlag('Acts.useCache', False)
133 # special persistifications
134 actscf.addFlag('Acts.EDM.SlimContent', lambda pcf: pcf.Tracking.StoreSlimmedDataPreparation)
135
136 # Scheduling
137 from InDetConfig.ITkActsHelpers import primaryPassUsesActs
138 actscf.addFlag('Acts.doITkConversion', lambda pcf: (
139 pcf.Detector.EnableCalo and primaryPassUsesActs(pcf)))
140 actscf.addFlag('Acts.doLargeRadius', True)
141 actscf.addFlag('Acts.doLowPt', False)
142
143 # Geometry Flags
144
145 # MaterialSource can be:
146 # a path to a local JSON file
147 # 'Default' : material map source is evaluated from the geometry tag
148 # 'None' : no material map is provided
149 actscf.addFlag('Acts.TrackingGeometry.MaterialSource', 'Default')
150 actscf.addFlag('Acts.TrackingGeometry.MaterialCalibrationFolder', 'ACTS/MaterialMaps/ITk')
151 actscf.addFlag('Acts.TrackingGeometry.MaterialFileExtension', '')
152 actscf.addFlag('Acts.TrackingGeometry.UseBlueprint', False)
153 actscf.addFlag('Acts.TrackingGeometry.ObjDebugOutput', False)
154 actscf.addFlag('Acts.TrackingGeometry.KeepGoingOnMaterialMergeFailure', False)
155 # ITkMaterialSource can be:
156 # a path to a local file
157 # 'Default' : material map source is evaluated from the geometry tag
158 # 'None' : no material map is provided
159 actscf.addFlag('Acts.TrackingGeometry.ITkHgtdMaterialSource', 'None')
160 actscf.addFlag('Acts.TrackingGeometry.ITkHgtdMaterialMapPath', 'ACTS/MaterialMaps/gen3')
161
162
163 actscf.addFlag('Acts.TrackingGeometry.InsertITkPassiveMaterialLayers', False)
164 actscf.addFlag('Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerRadii', [70.])
165 actscf.addFlag('Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerHalflengthZ', [240.])
166 actscf.addFlag('Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerThickness', [1.])
167 actscf.addFlag('Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerRadii', [195., 260.])
168 actscf.addFlag('Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerHalflengthZ', [370., 370.])
169 actscf.addFlag('Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerThickness', [1., 1.])
170 actscf.addFlag('Acts.TrackingGeometry.PassiveITkStripBarrelLayerRadii', [480., 665., 880.])
171 actscf.addFlag('Acts.TrackingGeometry.PassiveITkStripBarrelLayerHalflengthZ', [1370., 1370., 1370.])
172 actscf.addFlag('Acts.TrackingGeometry.PassiveITkStripBarrelLayerThickness', [1., 1., 1.])
173 # Monitoring
174 actscf.addFlag('Acts.doMonitoring', False)
175 actscf.addFlag('Acts.doAnalysis', False)
176 actscf.addFlag('Acts.doAnalysisNtuples', lambda pcf: pcf.Acts.doAnalysis)
177 actscf.addFlag('Acts.Clusters.doAnalysis', lambda pcf: pcf.Acts.doAnalysis)
178 actscf.addFlag('Acts.Seeds.doAnalysis', lambda pcf: pcf.Acts.doAnalysis)
179 actscf.addFlag('Acts.Tracks.doAnalysis', lambda pcf: pcf.Acts.doAnalysis)
180 actscf.addFlag('Acts.Particles.doAnalysis', lambda pcf: pcf.Acts.doAnalysis)
181 actscf.addFlag('Acts.storeTrackStateInfo', False)
182 actscf.addFlag('Acts.doTruthInspection', False)
183 # Save Trk::Track link for combined muon reconstruction, temporary
184 actscf.addFlag('Acts.doxAODToTrkConversion', True)
185
186 # Cluster
187 actscf.addFlag("Acts.Clusters.UseWeightedPosition", False)
188 actscf.addFlag("Acts.Clusters.RetrieveChargeInformation", True)
189 actscf.addFlag("Acts.Clusters.StripClusteringErrorMode", StripClusteringErrorMode.PITCH,type=StripClusteringErrorMode)
190 actscf.addFlag("Acts.Clusters.UsePixelBroadErrors", False)
191
192 # SpacePoint
193 actscf.addFlag('Acts.SpacePoints.useBeamSpotConstraintStrips', True)
194 actscf.addFlag('Acts.SpacePoints.doPixel', lambda pcf: pcf.Detector.EnableITkPixel)
195 actscf.addFlag('Acts.SpacePoints.doStrip', lambda pcf: (
196 pcf.Detector.EnableITkStrip and (
197 not pcf.Tracking.doITkFastTracking or
198 pcf.Acts.doLargeRadius or pcf.Acts.doLowPt or
199 pcf.Acts.doITkConversion)))
200 actscf.addFlag('Acts.SpacePoints.doAnalysis', lambda pcf: pcf.Acts.doAnalysis)
201
202 # Strip and pixel are chosen separately so that either can be validated on its own
203 actscf.addFlag('Acts.SpacePointStrategy', SpacePointStrategy.ActsTrk, type=SpacePointStrategy)
204 actscf.addFlag('Acts.PixelSpacePointStrategy', SpacePointStrategy.ActsTrk, type=SpacePointStrategy)
205
206 # Seeding
207 actscf.addFlag("Acts.Gbts.connectionTable", 'binTables_ITK_RUN4.txt')
208 actscf.addFlag("Acts.Gbts.connectionTableLrt", 'binTables_ITK_RUN4_LRT.txt')
209 actscf.addFlag("Acts.Gbts.dumpGbtsGeometry", False)
210 actscf.addFlag("Acts.Gbts.geometryDump", 'gbts_layer_geometry.txt') # for gbts training tool
211
212 # GBTS Training
213
214 actscf.addFlag("Acts.Gbts.Training.enable", False)
215 actscf.addFlag("Acts.Gbts.Training.outputConnectionTable", "gbts_connection_table.txt")
216 actscf.addFlag("Acts.Gbts.Training.doSymmetrization", False)
217 actscf.addFlag("Acts.Gbts.Training.useOldFormatting", False)
218 actscf.addFlag("Acts.Gbts.Training.probThreshold", -1.0)
219
220 actscf.addFlag("Acts.Gbts.Training.usePixelClusters", True)
221 actscf.addFlag("Acts.Gbts.Training.useStripClusters", True)
222
223 # Track finding
224 actscf.addFlag('Acts.PixelCalibrationStrategy', PixelCalibrationStrategy.Uncalibrated, type=PixelCalibrationStrategy)
225 actscf.addFlag('Acts.StripCalibrationStrategy', StripCalibrationStrategy.Uncalibrated, type=StripCalibrationStrategy)
226 actscf.addFlag('Acts.doRotCorrection', True)
227 actscf.addFlag('Acts.doPrintTrackStates', False)
228 actscf.addFlag('Acts.skipDuplicateSeeds', True)
229 actscf.addFlag('Acts.doTwoWayCKF', True) # run CKF twice, first with forward propagation with smoothing, then with backward propagation
230 actscf.addFlag('Acts.useStripSeedsFirst', False) # switch order of seed collections
231 actscf.addFlag('Acts.useHGTDClusterInTrackFinding', False) # use HGTD cluster in track finding
232 actscf.addFlag('Acts.branchStopperMeasCutReduce', 2)
233 actscf.addFlag('Acts.branchStopperAbsEtaMeasCut', 1.2)
234 actscf.addFlag('Acts.SeedRefitOutlierChi2Cut', float('inf')) # OutlierChi2Cut for the seed refit Kalman fitter, applied whenever a seed refit is scheduled. inf == disabled.
235 actscf.addFlag('Acts.LrtStripSeedRefit', True) # Toggle the LRT strip-seed refit (KF on strip seeds before CKF).
236 actscf.addFlag('Acts.stripCalibrationIterations', 1) # Strip-SP calibration iterations in TrackParamsEstimationTool (all passes).
237 actscf.addFlag('Acts.parameterEstimationMode', lambda pcf:
238 ParameterEstimationMode.MinDeltaR if pcf.Acts.GNN.Enable else ParameterEstimationMode.FirstMiddleLast,
239 type=ParameterEstimationMode) # SPs of a seed used in TrackParamsEstimationTool (MinDeltaR for the full GNN chain)
240 actscf.addFlag('Acts.minDeltaRParameterEstimation', 15.0) # Minimum separation (mm) of the SPs used in TrackParamsEstimationTool for ParameterEstimationMode.MinDeltaR
241 actscf.addFlag('Acts.forceTrackOnSeed', True) # force track to use the seed measurements; steer from the outside if a setup needs it disabled
242 actscf.addFlag('Acts.PixelNNCalibrationModelsFolder', 'ITkPixelClusterization/nn-01-01-01/') # location of models for pixel ONNX files, extpected content of the foder are: number.onnx, pos1.onnx, pos2.onnx, pos3.onnx
243 # the files are located in /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/
244 # this flag is used only if PixelCalibrationStrategy is one of the NN strategies
245 actscf.addFlag('Acts.refitSeeds', False) # refit seeds for CKF initial parameters
246 actscf.addFlag('Acts.initialVarInflation', [1., 1., 1., 1., 1., 1.]) # inflate variances after track parameter estimation
247
248 # Ambiguity resolution
249 actscf.addFlag('Acts.doAmbiguityResolution', False)
250 actscf.addFlag('Acts.AmbiguitySolverStrategy', AmbiguitySolverStrategy.Greedy, type=AmbiguitySolverStrategy) # Define Ambiguity Solver Strategy
251 actscf.addFlag('Acts.AmbiguitySolverMode', lambda pcf: AmbiguitySolverMode.OUTSIDE_TF if pcf.Acts.doAmbiguityResolution else AmbiguitySolverMode.DURING_TF, type=AmbiguitySolverMode)
252
253 # Calibrations
254 actscf.addFlag('Acts.OnTrackCalibration.performCovarianceCalibration', True) # perform calibration of covariance during on track analogue cluster calibration
255
256 # Track fitting
257 actscf.addFlag('Acts.writeTrackCollection', False) # save to file (ESD, AOD) the Resolved and Refitted track collections
258 actscf.addFlag('Acts.fitFromPRD', False) # Acts.writeTrackCollection needs to be True for either cases. If Acts.fitFromPRD is False, fit from ROT; else, fit from PRD
259 actscf.addFlag('Acts.trackFitterType', TrackFitterType.KalmanFitter, type=TrackFitterType) # Define Tracking algorithm for refitting
260
261 # GSF specific flags
262 actscf.addFlag("Acts.GsfRefitLegacyTrk", False) # Refit Legacy tracks using ACTS GSF
263 actscf.addFlag("Acts.GsfRefitActs", lambda pcf:
264 pcf.GeoModel.Run >= LHCPeriod.Run4) # Refit ACTS tracks using ACTS GSF
265 actscf.addFlag("Acts.GsfMaxComponents", 12)
266 actscf.addFlag("Acts.GsfComponentMergeMethod", 'MaxWeight')
267 actscf.addFlag("Acts.GsfDirectNavigation", lambda pcf:
268 pcf.GeoModel.Run >= LHCPeriod.Run4)
269 actscf.addFlag("Acts.GsfOutlierChi2Cut", 1e4) # Effectively no cut. Compatible with legacy
270 actscf.addFlag("Acts.extrapolateElectronsLegacy", lambda pcf:
271 not pcf.Acts.TrackingGeometry.UseBlueprint) # Use legacy calo extrapolation with ACTS tracks
272
273 # Decorations
274 actscf.addFlag('Acts.decoratePRD.sdoSiHit', lambda pcf: pcf.Tracking.doTIDE_AmbiTrackMonitoring)
275
276 # GPU track reconstruction
277 actscf.addFlag("Acts.Device.doCellSorting", True)
278 actscf.addFlag("Acts.Device.doClusterization", False)
279 actscf.addFlag("Acts.Device.doSpacePointFormation", False)
280 actscf.addFlag("Acts.Device.doSeeding", False)
281 actscf.addFlag("Acts.Device.seedingStrategy", SeedingStrategy.GridTriplet, type=SeedingStrategy)
282 actscf.addFlag("Acts.Device.doTrackReconstruction", False)
283 actscf.addFlag("Acts.Device.doLargeRadiusPass", False)
284
285 # GNN specific flags (scoped)
286 actscf.addFlag("Acts.GNN.Enable", False)
287 actscf.addFlag("Acts.GNN.ModuleMapPath", "<default>")
288 actscf.addFlag("Acts.GNN.ModelPath", "<default>")
289 actscf.addFlag("Acts.GNN.NumTrtContexts", 1)
290 actscf.addFlag("Acts.GNN.MaxGpuInstances", 1)
291 actscf.addFlag("Acts.GNN.VarianceInflation", 1.0)
292 actscf.addFlag("Acts.GNN.TightSeeds", False)
293 actscf.addFlag("Acts.GNN.MinCandidateMeasurements", 7)
294 actscf.addFlag("Acts.GNN.EdgeCut", 0.5)
295 actscf.addFlag("Acts.GNN.NumFeatures", 12) # input features per spacepoint, 4 for pixel-only models
296 actscf.addFlag("Acts.GNN.RelaxCentralHoleSel", False)
297 actscf.addFlag("Acts.GNN.RelaxMeasurementSel", True)
298 actscf.addFlag("Acts.GNN.OfflineZ0Sel", False)
299
300 return actscf