From 265f188ed8ba466d700ed39bd3310e52f07ce961 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 18:28:31 +0100 Subject: [PATCH 1/4] test: Use true start params for fitters in Examples Physmon --- Examples/Scripts/Python/truth_tracking_gsf.py | 24 +++++++++++++++++++ .../Scripts/Python/truth_tracking_gx2f.py | 24 +++++++++++++++++++ .../Scripts/Python/truth_tracking_kalman.py | 24 +++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/Examples/Scripts/Python/truth_tracking_gsf.py b/Examples/Scripts/Python/truth_tracking_gsf.py index ae8aca06d6c..3090b5a3d07 100755 --- a/Examples/Scripts/Python/truth_tracking_gsf.py +++ b/Examples/Scripts/Python/truth_tracking_gsf.py @@ -31,6 +31,7 @@ def runTruthTrackingGsf( from acts.examples.reconstruction import ( addSeeding, SeedingAlgorithm, + ParticleSmearingSigmas, addTruthTrackingGsf, ) @@ -100,6 +101,29 @@ def runTruthTrackingGsf( rnd=rnd, inputParticles="particles_input", seedingAlgorithm=SeedingAlgorithm.TruthSmeared, + particleSmearingSigmas=ParticleSmearingSigmas( + # zero eveything so the fitter has a chance to find the measurements + d0=0, + d0PtA=0, + d0PtB=0, + z0=0, + z0PtA=0, + z0PtB=0, + t0=0, + phi=0, + theta=0, + ptRel=0, + ), + initialSigmas=[ + 1 * u.mm, + 1 * u.mm, + 1 * u.degree, + 1 * u.degree, + 0.1 * u.e / u.GeV, + 1 * u.ns, + ], + initialSigmaPtRel=0.01, + initialVarInflation=[1.0] * 6, particleHypothesis=acts.ParticleHypothesis.electron, ) diff --git a/Examples/Scripts/Python/truth_tracking_gx2f.py b/Examples/Scripts/Python/truth_tracking_gx2f.py index 8503dc982f4..7653eade429 100644 --- a/Examples/Scripts/Python/truth_tracking_gx2f.py +++ b/Examples/Scripts/Python/truth_tracking_gx2f.py @@ -30,6 +30,7 @@ def runTruthTrackingGx2f( from acts.examples.reconstruction import ( addSeeding, SeedingAlgorithm, + ParticleSmearingSigmas, addGx2fTracks, ) @@ -97,6 +98,29 @@ def runTruthTrackingGx2f( rnd=rnd, inputParticles="particles_input", seedingAlgorithm=SeedingAlgorithm.TruthSmeared, + particleSmearingSigmas=ParticleSmearingSigmas( + # zero eveything so the fitter has a chance to find the measurements + d0=0, + d0PtA=0, + d0PtB=0, + z0=0, + z0PtA=0, + z0PtB=0, + t0=0, + phi=0, + theta=0, + ptRel=0, + ), + initialSigmas=[ + 1 * u.mm, + 1 * u.mm, + 1 * u.degree, + 1 * u.degree, + 0.1 * u.e / u.GeV, + 1 * u.ns, + ], + initialSigmaPtRel=0.01, + initialVarInflation=[1.0] * 6, particleHypothesis=acts.ParticleHypothesis.muon, ) diff --git a/Examples/Scripts/Python/truth_tracking_kalman.py b/Examples/Scripts/Python/truth_tracking_kalman.py index 91c18f1dd28..db02af3c3e5 100755 --- a/Examples/Scripts/Python/truth_tracking_kalman.py +++ b/Examples/Scripts/Python/truth_tracking_kalman.py @@ -34,6 +34,7 @@ def runTruthTrackingKalman( from acts.examples.reconstruction import ( addSeeding, SeedingAlgorithm, + ParticleSmearingSigmas, addKalmanTracks, ) @@ -115,6 +116,29 @@ def runTruthTrackingKalman( rnd=rnd, inputParticles="particles_input", seedingAlgorithm=SeedingAlgorithm.TruthSmeared, + particleSmearingSigmas=ParticleSmearingSigmas( + # zero eveything so the fitter has a chance to find the measurements + d0=0, + d0PtA=0, + d0PtB=0, + z0=0, + z0PtA=0, + z0PtB=0, + t0=0, + phi=0, + theta=0, + ptRel=0, + ), + initialSigmas=[ + 1 * u.mm, + 1 * u.mm, + 1 * u.degree, + 1 * u.degree, + 0.1 * u.e / u.GeV, + 1 * u.ns, + ], + initialSigmaPtRel=0.01, + initialVarInflation=[1.0] * 6, particleHypothesis=acts.ParticleHypothesis.muon, ) From 28bd3e949bf5dd3e3bd189694c3d45b109cbf43c Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 18:50:15 +0100 Subject: [PATCH 2/4] add zeros shorthand --- .../workflows/physmon_trackfinding_1muon.py | 16 +++------------- .../python/acts/examples/reconstruction.py | 2 ++ Examples/Scripts/Optimization/ckf.py | 16 +++------------- Examples/Scripts/Python/ckf_tracks.py | 16 +++------------- Examples/Scripts/Python/truth_tracking_gsf.py | 15 ++------------- Examples/Scripts/Python/truth_tracking_gx2f.py | 15 ++------------- Examples/Scripts/Python/truth_tracking_kalman.py | 15 ++------------- 7 files changed, 17 insertions(+), 78 deletions(-) diff --git a/CI/physmon/workflows/physmon_trackfinding_1muon.py b/CI/physmon/workflows/physmon_trackfinding_1muon.py index aaa4bc9f71d..1939449c23f 100755 --- a/CI/physmon/workflows/physmon_trackfinding_1muon.py +++ b/CI/physmon/workflows/physmon_trackfinding_1muon.py @@ -91,19 +91,6 @@ def run_ckf_tracking(label, seeding): s, setup.trackingGeometry, setup.field, - ParticleSmearingSigmas( # only used by SeedingAlgorithm.TruthSmeared - # zero eveything so the CKF has a chance to find the measurements - d0=0, - d0PtA=0, - d0PtB=0, - z0=0, - z0PtA=0, - z0PtB=0, - t0=0, - phi=0, - theta=0, - ptRel=0, - ), SeedFinderConfigArg( r=(33 * u.mm, 200 * u.mm), deltaR=(1 * u.mm, 60 * u.mm), @@ -118,6 +105,9 @@ def run_ckf_tracking(label, seeding): SeedFinderOptionsArg(bFieldInZ=2 * u.T), TruthEstimatedSeedingAlgorithmConfigArg(deltaR=(10.0 * u.mm, None)), seedingAlgorithm=seeding, + # only used by SeedingAlgorithm.TruthSmeared + # zero eveything so the fitter has a chance to find the measurements + particleSmearingSigmas=ParticleSmearingSigmas.zeros(), initialSigmas=[ 1 * u.mm, 1 * u.mm, diff --git a/Examples/Python/python/acts/examples/reconstruction.py b/Examples/Python/python/acts/examples/reconstruction.py index bc1b1d4df9d..fc1f2cda086 100644 --- a/Examples/Python/python/acts/examples/reconstruction.py +++ b/Examples/Python/python/acts/examples/reconstruction.py @@ -19,6 +19,8 @@ defaults=[None] * 10, ) +ParticleSmearingSigmas.zeros = lambda: ParticleSmearingSigmas([0] * 10) + SeedFinderConfigArg = namedtuple( "SeedFinderConfig", [ diff --git a/Examples/Scripts/Optimization/ckf.py b/Examples/Scripts/Optimization/ckf.py index ba18291735c..f0345a7ad4a 100755 --- a/Examples/Scripts/Optimization/ckf.py +++ b/Examples/Scripts/Optimization/ckf.py @@ -188,19 +188,6 @@ def runCKFTracks( s, trackingGeometry, field, - ParticleSmearingSigmas( # only used by SeedingAlgorithm.TruthSmeared - # zero eveything so the CKF has a chance to find the measurements - d0=0, - d0PtA=0, - d0PtB=0, - z0=0, - z0PtA=0, - z0PtB=0, - t0=0, - phi=0, - theta=0, - ptRel=0, - ), SeedFinderConfigArg( r=(None, 200 * u.mm), # rMin=default, 33mm deltaR=(DeltaRMin * u.mm, DeltaRMax * u.mm), @@ -225,6 +212,9 @@ def runCKFTracks( else SeedingAlgorithm.Default ) ), + # only used by SeedingAlgorithm.TruthSmeared + # zero eveything so the fitter has a chance to find the measurements + particleSmearingSigmas=ParticleSmearingSigmas.zeros(), initialSigmas=[ 1 * u.mm, 1 * u.mm, diff --git a/Examples/Scripts/Python/ckf_tracks.py b/Examples/Scripts/Python/ckf_tracks.py index 97f56d17ff0..143d43fbdf7 100755 --- a/Examples/Scripts/Python/ckf_tracks.py +++ b/Examples/Scripts/Python/ckf_tracks.py @@ -99,19 +99,6 @@ def runCKFTracks( s, trackingGeometry, field, - ParticleSmearingSigmas( # only used by SeedingAlgorithm.TruthSmeared - # zero eveything so the CKF has a chance to find the measurements - d0=0, - d0PtA=0, - d0PtB=0, - z0=0, - z0PtA=0, - z0PtB=0, - t0=0, - phi=0, - theta=0, - ptRel=0, - ), SeedFinderConfigArg( r=(None, 200 * u.mm), # rMin=default, 33mm deltaR=(1 * u.mm, 60 * u.mm), @@ -134,6 +121,9 @@ def runCKFTracks( else SeedingAlgorithm.Default ) ), + # only used by SeedingAlgorithm.TruthSmeared + # zero eveything so the fitter has a chance to find the measurements + particleSmearingSigmas=ParticleSmearingSigmas.zeros(), initialSigmas=[ 1 * u.mm, 1 * u.mm, diff --git a/Examples/Scripts/Python/truth_tracking_gsf.py b/Examples/Scripts/Python/truth_tracking_gsf.py index 3090b5a3d07..6c203c037f5 100755 --- a/Examples/Scripts/Python/truth_tracking_gsf.py +++ b/Examples/Scripts/Python/truth_tracking_gsf.py @@ -101,19 +101,8 @@ def runTruthTrackingGsf( rnd=rnd, inputParticles="particles_input", seedingAlgorithm=SeedingAlgorithm.TruthSmeared, - particleSmearingSigmas=ParticleSmearingSigmas( - # zero eveything so the fitter has a chance to find the measurements - d0=0, - d0PtA=0, - d0PtB=0, - z0=0, - z0PtA=0, - z0PtB=0, - t0=0, - phi=0, - theta=0, - ptRel=0, - ), + # zero eveything so the fitter has a chance to find the measurements + particleSmearingSigmas=ParticleSmearingSigmas.zeros(), initialSigmas=[ 1 * u.mm, 1 * u.mm, diff --git a/Examples/Scripts/Python/truth_tracking_gx2f.py b/Examples/Scripts/Python/truth_tracking_gx2f.py index 7653eade429..0d2405a5167 100644 --- a/Examples/Scripts/Python/truth_tracking_gx2f.py +++ b/Examples/Scripts/Python/truth_tracking_gx2f.py @@ -98,19 +98,8 @@ def runTruthTrackingGx2f( rnd=rnd, inputParticles="particles_input", seedingAlgorithm=SeedingAlgorithm.TruthSmeared, - particleSmearingSigmas=ParticleSmearingSigmas( - # zero eveything so the fitter has a chance to find the measurements - d0=0, - d0PtA=0, - d0PtB=0, - z0=0, - z0PtA=0, - z0PtB=0, - t0=0, - phi=0, - theta=0, - ptRel=0, - ), + # zero eveything so the fitter has a chance to find the measurements + particleSmearingSigmas=ParticleSmearingSigmas.zeros(), initialSigmas=[ 1 * u.mm, 1 * u.mm, diff --git a/Examples/Scripts/Python/truth_tracking_kalman.py b/Examples/Scripts/Python/truth_tracking_kalman.py index db02af3c3e5..913e4d19603 100755 --- a/Examples/Scripts/Python/truth_tracking_kalman.py +++ b/Examples/Scripts/Python/truth_tracking_kalman.py @@ -116,19 +116,8 @@ def runTruthTrackingKalman( rnd=rnd, inputParticles="particles_input", seedingAlgorithm=SeedingAlgorithm.TruthSmeared, - particleSmearingSigmas=ParticleSmearingSigmas( - # zero eveything so the fitter has a chance to find the measurements - d0=0, - d0PtA=0, - d0PtB=0, - z0=0, - z0PtA=0, - z0PtB=0, - t0=0, - phi=0, - theta=0, - ptRel=0, - ), + # zero eveything so the fitter has a chance to find the measurements + particleSmearingSigmas=ParticleSmearingSigmas.zeros(), initialSigmas=[ 1 * u.mm, 1 * u.mm, From d217c798baf9f3d1798cd5d9347c6ccc6bce06da Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 20:20:21 +0100 Subject: [PATCH 3/4] fix --- .../Python/python/acts/examples/reconstruction.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Examples/Python/python/acts/examples/reconstruction.py b/Examples/Python/python/acts/examples/reconstruction.py index fc1f2cda086..11b0feece91 100644 --- a/Examples/Python/python/acts/examples/reconstruction.py +++ b/Examples/Python/python/acts/examples/reconstruction.py @@ -19,7 +19,18 @@ defaults=[None] * 10, ) -ParticleSmearingSigmas.zeros = lambda: ParticleSmearingSigmas([0] * 10) +ParticleSmearingSigmas.zeros = lambda: ParticleSmearingSigmas( + d0=0.0, + d0PtA=0.0, + d0PtB=0.0, + z0=0.0, + z0PtA=0.0, + z0PtB=0.0, + t0=0.0, + phi=0.0, + theta=0.0, + ptRel=0.0, +) SeedFinderConfigArg = namedtuple( "SeedFinderConfig", From 7662443ca04cdf5df7c8203451894adbf81bbc7e Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 21:31:19 +0100 Subject: [PATCH 4/4] increase stats --- CI/physmon/workflows/physmon_trackfitting_gsf.py | 2 +- CI/physmon/workflows/physmon_trackfitting_gx2f.py | 2 +- CI/physmon/workflows/physmon_trackfitting_kf.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CI/physmon/workflows/physmon_trackfitting_gsf.py b/CI/physmon/workflows/physmon_trackfitting_gsf.py index 694623e2926..e4c471bfe69 100755 --- a/CI/physmon/workflows/physmon_trackfitting_gsf.py +++ b/CI/physmon/workflows/physmon_trackfitting_gsf.py @@ -13,7 +13,7 @@ with tempfile.TemporaryDirectory() as temp: s = acts.examples.Sequencer( - events=10000, + events=100000, numThreads=-1, logLevel=acts.logging.INFO, ) diff --git a/CI/physmon/workflows/physmon_trackfitting_gx2f.py b/CI/physmon/workflows/physmon_trackfitting_gx2f.py index 58ff664e26e..47bb81a10bc 100755 --- a/CI/physmon/workflows/physmon_trackfitting_gx2f.py +++ b/CI/physmon/workflows/physmon_trackfitting_gx2f.py @@ -13,7 +13,7 @@ with tempfile.TemporaryDirectory() as temp: s = acts.examples.Sequencer( - events=10000, + events=100000, numThreads=-1, logLevel=acts.logging.INFO, ) diff --git a/CI/physmon/workflows/physmon_trackfitting_kf.py b/CI/physmon/workflows/physmon_trackfitting_kf.py index 767c2ff5d69..e2d6982ac46 100755 --- a/CI/physmon/workflows/physmon_trackfitting_kf.py +++ b/CI/physmon/workflows/physmon_trackfitting_kf.py @@ -13,7 +13,7 @@ with tempfile.TemporaryDirectory() as temp: s = acts.examples.Sequencer( - events=10000, + events=100000, numThreads=-1, logLevel=acts.logging.INFO, )