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