Skip to content

Commit

Permalink
Merge branch 'main' into path-seeder-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ssdetlab authored Oct 20, 2024
2 parents 7619345 + c83597c commit bd2d1bd
Show file tree
Hide file tree
Showing 228 changed files with 2,871 additions and 1,634 deletions.
62 changes: 48 additions & 14 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ shopt -s extglob


mode=${1:-all}
if ! [[ $mode = @(all|kf|gsf|gx2f|fullchains|simulation) ]]; then
echo "Usage: $0 <all|kf|gsf|gx2f|fullchains|simulation> (outdir)"
if ! [[ $mode = @(all|kf|gsf|gx2f|refit_kf|refit_gsf|fullchains|simulation) ]]; then
echo "Usage: $0 <all|kf|gsf|gx2f|refit_kf|refit_gsf|fullchains|simulation> (outdir)"
exit 1
fi

Expand Down Expand Up @@ -152,6 +152,12 @@ fi
if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then
run_physmon_gen "Truth Tracking GX2F" "trackfitting_gx2f"
fi
if [[ "$mode" == "all" || "$mode" == "refit_kf" ]]; then
run_physmon_gen "Truth Tracking KF refit" "trackrefitting_kf"
fi
if [[ "$mode" == "all" || "$mode" == "refit_gsf" ]]; then
run_physmon_gen "Truth Tracking GSF refit" "trackrefitting_gsf"
fi
if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
run_physmon_gen "CKF single muon" "trackfinding_1muon"
run_physmon_gen "CKF muon 50" "trackfinding_4muon_50vertices"
Expand Down Expand Up @@ -217,11 +223,19 @@ function trackfinding() {
fi

run_histcmp \
$outdir/data/$path/performance_ckf.root \
$refdir/$path/performance_ckf.root \
"CKF | ${name}" \
$path/performance_ckf.html \
$path/performance_ckf_plots \
$outdir/data/$path/performance_finding_ckf.root \
$refdir/$path/performance_finding_ckf.root \
"CKF finding performance | ${name}" \
$path/performance_finding_ckf.html \
$path/performance_finding_ckf_plots \
--config $default_config

run_histcmp \
$outdir/data/$path/performance_fitting_ckf.root \
$refdir/$path/performance_fitting_ckf.root \
"CKF fitting performance | ${name}" \
$path/performance_fitting_ckf.html \
$path/performance_fitting_ckf_plots \
--config $default_config

run Examples/Scripts/generic_plotter.py \
Expand All @@ -238,17 +252,17 @@ function trackfinding() {
run_histcmp \
$outdir/data/$path/tracksummary_ckf_hist.root \
$refdir/$path/tracksummary_ckf_hist.root \
"Track Summary CKF | ${name}" \
"CKF track summary | ${name}" \
$path/tracksummary_ckf.html \
$path/tracksummary_ckf_plots

if [ -f $refdir/$path/performance_ckf_ambi.root ]; then
if [ -f $refdir/$path/performance_finding_ckf_ambi.root ]; then
run_histcmp \
$outdir/data/$path/performance_ckf_ambi.root \
$refdir/$path/performance_ckf_ambi.root \
"Ambisolver | ${name}" \
$path/performance_ckf_ambi.html \
$path/performance_ckf_ambi
$outdir/data/$path/performance_finding_ckf_ambi.root \
$refdir/$path/performance_finding_ckf_ambi.root \
"Ambisolver finding performance | ${name}" \
$path/performance_finding_ckf_ambi.html \
$path/performance_finding_ckf_ambi
fi
}

Expand Down Expand Up @@ -411,6 +425,26 @@ if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then
--config CI/physmon/config/trackfitting_gx2f.yml
fi

if [[ "$mode" == "all" || "$mode" == "kf_refit" ]]; then
run_histcmp \
$outdir/data/trackrefitting_kf/performance_trackrefitting.root \
$refdir/trackrefitting_kf/performance_trackrefitting.root \
"Truth tracking (KF refit)" \
trackrefitting_kf/performance_trackrefitting.html \
trackrefitting_kf/performance_trackrefitting_plots \
--config CI/physmon/config/trackfitting_kf.yml
fi

if [[ "$mode" == "all" || "$mode" == "gsf_refit" ]]; then
run_histcmp \
$outdir/data/trackrefitting_gsf/performance_trackrefitting.root \
$refdir/trackrefitting_gsf/performance_trackrefitting.root \
"Truth tracking (GSF refit)" \
trackrefitting_gsf/performance_trackrefitting.html \
trackrefitting_gsf/performance_trackrefitting_plots \
--config CI/physmon/config/trackfitting_gsf.yml
fi

if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
trackfinding "trackfinding | single muon | truth smeared seeding" trackfinding_1muon/truth_smeared
trackfinding "trackfinding | single muon | truth estimated seeding" trackfinding_1muon/truth_estimated
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 10 additions & 5 deletions CI/physmon/workflows/physmon_trackfinding_1muon.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
EtaConfig,
PhiConfig,
ParticleConfig,
ParticleSelectorConfig,
addFatras,
addDigitization,
)

from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
ParticleSmearingSigmas,
SeedFinderConfigArg,
SeedFinderOptionsArg,
Expand Down Expand Up @@ -72,6 +72,11 @@ def run_ckf_tracking(label, seeding):
setup.field,
enableInteractions=True,
rnd=rnd,
postSelectParticles=ParticleSelectorConfig(
pt=(0.9 * u.GeV, None),
measurements=(9, None),
removeNeutral=True,
),
)

addDigitization(
Expand All @@ -86,7 +91,6 @@ def run_ckf_tracking(label, seeding):
s,
setup.trackingGeometry,
setup.field,
TruthSeedRanges(pt=(500 * u.MeV, None), nHits=(9, None)),
ParticleSmearingSigmas( # only used by SeedingAlgorithm.TruthSmeared
# zero eveything so the CKF has a chance to find the measurements
d0=0,
Expand All @@ -108,7 +112,7 @@ def run_ckf_tracking(label, seeding):
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T),
Expand All @@ -134,7 +138,7 @@ def run_ckf_tracking(label, seeding):
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.9 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand All @@ -159,8 +163,9 @@ def run_ckf_tracking(label, seeding):
if seeding != SeedingAlgorithm.TruthSmeared
else []
) + [
"performance_ckf.root",
"tracksummary_ckf.root",
"performance_finding_ckf.root",
"performance_fitting_ckf.root",
]:
perf_file = tp / file
assert perf_file.exists(), f"Performance file not found {perf_file}"
Expand Down
26 changes: 18 additions & 8 deletions CI/physmon/workflows/physmon_trackfinding_4muon_50vertices.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
EtaConfig,
PhiConfig,
ParticleConfig,
ParticleSelectorConfig,
addFatras,
addDigitization,
)
from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
SeedFinderConfigArg,
SeedFinderOptionsArg,
SeedingAlgorithm,
Expand Down Expand Up @@ -69,6 +69,11 @@
setup.trackingGeometry,
setup.field,
rnd=rnd,
postSelectParticles=ParticleSelectorConfig(
pt=(0.9 * u.GeV, None),
measurements=(9, None),
removeNeutral=True,
),
)

addDigitization(
Expand All @@ -83,7 +88,6 @@
s,
setup.trackingGeometry,
setup.field,
TruthSeedRanges(pt=(500.0 * u.MeV, None), nHits=(9, None)),
SeedFinderConfigArg(
r=(33 * u.mm, 200 * u.mm),
deltaR=(1 * u.mm, 60 * u.mm),
Expand All @@ -92,7 +96,7 @@
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T, beamPos=(0.0, 0.0)),
Expand All @@ -116,7 +120,7 @@
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.9 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand Down Expand Up @@ -192,8 +196,12 @@
s.run()

shutil.move(
tp / "performance_ambi.root",
tp / "performance_ckf_ambi.root",
tp / "performance_finding_ambi.root",
tp / "performance_finding_ckf_ambi.root",
)
shutil.move(
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)
for vertexing in ["ivf_notime", "amvf_gauss_notime", "amvf_grid_time"]:
shutil.move(
Expand All @@ -204,8 +212,10 @@
for file in [
"performance_seeding.root",
"tracksummary_ckf.root",
"performance_ckf.root",
"performance_ckf_ambi.root",
"performance_finding_ckf.root",
"performance_fitting_ckf.root",
"performance_finding_ckf_ambi.root",
"performance_fitting_ckf_ambi.root",
"performance_vertexing_ivf_notime.root",
"performance_vertexing_amvf_gauss_notime.root",
"performance_vertexing_amvf_grid_time.root",
Expand Down
25 changes: 17 additions & 8 deletions CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
SeedFinderConfigArg,
SeedFinderOptionsArg,
SeedingAlgorithm,
Expand Down Expand Up @@ -68,6 +67,11 @@
rho=(0.0, 24 * u.mm),
absZ=(0.0, 1.0 * u.m),
),
postSelectParticles=ParticleSelectorConfig(
pt=(0.5 * u.GeV, None),
measurements=(9, None),
removeNeutral=True,
),
)

addDigitization(
Expand All @@ -82,7 +86,6 @@
s,
setup.trackingGeometry,
setup.field,
TruthSeedRanges(pt=(500.0 * u.MeV, None), nHits=(9, None)),
SeedFinderConfigArg(
r=(33 * u.mm, 200 * u.mm),
deltaR=(1 * u.mm, 60 * u.mm),
Expand All @@ -91,7 +94,7 @@
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T, beamPos=(0.0, 0.0)),
Expand All @@ -115,7 +118,7 @@
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.5 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand Down Expand Up @@ -177,8 +180,12 @@
s.run()

shutil.move(
tp / "performance_ambi.root",
tp / "performance_ckf_ambi.root",
tp / "performance_finding_ambi.root",
tp / "performance_finding_ckf_ambi.root",
)
shutil.move(
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)
for vertexing in ["amvf_gauss_notime", "amvf_grid_time"]:
shutil.move(
Expand All @@ -189,8 +196,10 @@
for file in [
"performance_seeding.root",
"tracksummary_ckf.root",
"performance_ckf.root",
"performance_ckf_ambi.root",
"performance_finding_ckf.root",
"performance_fitting_ckf.root",
"performance_finding_ckf_ambi.root",
"performance_fitting_ckf_ambi.root",
"performance_vertexing_amvf_gauss_notime.root",
"performance_vertexing_amvf_grid_time.root",
]:
Expand Down
34 changes: 34 additions & 0 deletions CI/physmon/workflows/physmon_trackrefitting_gsf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3

import tempfile
from pathlib import Path
import shutil

import acts
from truth_tracking_gsf_refitting import runRefittingGsf

from physmon_common import makeSetup

setup = makeSetup()

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
)

tp = Path(temp)
runRefittingGsf(
trackingGeometry=setup.trackingGeometry,
field=setup.field,
digiConfigFile=setup.digiConfig,
outputDir=tp,
s=s,
)

s.run()

perf_file = tp / "performance_gsf_refit.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, setup.outdir / "performance_trackrefitting.root")
34 changes: 34 additions & 0 deletions CI/physmon/workflows/physmon_trackrefitting_kf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3

import tempfile
from pathlib import Path
import shutil

import acts
from truth_tracking_kalman_refitting import runRefittingKf

from physmon_common import makeSetup

setup = makeSetup()

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
)

tp = Path(temp)
runRefittingKf(
trackingGeometry=setup.trackingGeometry,
field=setup.field,
digiConfigFile=setup.digiConfig,
outputDir=tp,
s=s,
)

s.run()

perf_file = tp / "performance_kf_refit.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, setup.outdir / "performance_trackrefitting.root")
Loading

0 comments on commit bd2d1bd

Please sign in to comment.