Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(physmon): compare GX2F vs KF truth tracking #3889

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
7 changes: 7 additions & 0 deletions CI/physmon/config/info_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
checks:
"*":
Chi2Test: null
KolmogorovTest: null
RatioCheck: null
ResidualCheck: null
IntegralCheck: null
19 changes: 17 additions & 2 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|refit_kf|refit_gsf|fullchains|simulation) ]]; then
echo "Usage: $0 <all|kf|gsf|gx2f|refit_kf|refit_gsf|fullchains|simulation> (outdir)"
if ! [[ $mode = @(all|kf|gsf|gx2f|refit_kf|refit_gsf|fullchains|simulation|gx2f_vs_kf) ]]; then
echo "Usage: $0 <all|kf|gsf|gx2f|refit_kf|refit_gsf|fullchains|simulation|gx2f_vs_kf> (outdir)"
exit 1
fi

Expand Down Expand Up @@ -163,6 +163,9 @@ if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
run_physmon_gen "CKF muon 50" "trackfinding_4muon_50vertices"
run_physmon_gen "CKF ttbar 200" "trackfinding_ttbar_pu200"
fi
if [[ "$mode" == "all" || "$mode" == "gx2f_vs_kf" ]]; then
run_physmon_gen "Comparison - Truth Tracking GX2F vs KF" "trackfitting_gx2f_vs_kf"
fi
echo "::endgroup::"


Expand Down Expand Up @@ -459,6 +462,18 @@ if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
vertexing "trackfinding | ttbar with 200 pileup | default seeding" trackfinding_ttbar_pu200 CI/physmon/config/vertexing_ttbar_pu200.yml
fi

if [[ "$mode" == "all" || "$mode" == "gx2f_vs_kf" ]]; then
run_histcmp \
$outdir/data/trackfitting_gx2f_vs_kf/performance_trackfitting_gx2f.root \
$outdir/data/trackfitting_gx2f_vs_kf/performance_trackfitting_kf.root \
"Comparison - Truth tracking (GX2F vs KF)" \
trackfitting_gx2f_vs_kf/performance_trackfitting.html \
trackfitting_gx2f_vs_kf/performance_trackfitting_plots \
--config CI/physmon/config/info_only.yml \
--label-reference=KF \
--label-monitored=GX2F
fi

run CI/physmon/summary.py $histcmp_results \
--md $outdir/summary.md \
--html $outdir/summary.html
Expand Down
18 changes: 14 additions & 4 deletions CI/physmon/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@
)

for s in summary:
f.write(
f"""
if s["title"].startswith("Comparison"):
f.write(
f"""
<li>🔵 <a href="{s["path"]}">{s["title"]}</a></li>"""
)
else:
f.write(
f"""
<li>{"✅" if s["total"] else "🔴"} <a href="{s["path"]}">{s["title"]}</a></li>"""
)
)

f.write(
"""
Expand All @@ -74,4 +80,8 @@
)
else:
url = s["path"]
f.write(f" - {'✅' if s['total'] else '🔴'} [{s['title']}]({url})\n")

if s["title"].startswith("Comparison"):
f.write(f" - 🔵️ [{s['title']}]({url})\n")
else:
f.write(f" - {'✅' if s['total'] else '🔴'} [{s['title']}]({url})\n")
68 changes: 68 additions & 0 deletions CI/physmon/workflows/physmon_trackfitting_gx2f_vs_kf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env python3

import tempfile
from pathlib import Path
import shutil

import acts
from truth_tracking_kalman import runTruthTrackingKalman
from truth_tracking_gx2f import runTruthTrackingGx2f

from physmon_common import makeSetup

setup = makeSetup()

digiConfigFile = setup.digiConfig
nSkip = 0
nEvents = 100000
numThreads = -1

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
skip=nSkip,
events=nEvents,
numThreads=numThreads,
logLevel=acts.logging.INFO,
trackFpes=False,
)

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

s.run()
del s

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

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
skip=nSkip,
events=nEvents,
numThreads=numThreads,
logLevel=acts.logging.INFO,
trackFpes=True,
)

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

s.run()
del s

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