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

ci(gx2f): add physmon truth tracking for the GX2F #2966

Merged
merged 16 commits into from
Feb 22, 2024
48 changes: 48 additions & 0 deletions CI/physmon/gx2f.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
checks:
"*":
Chi2Test:
threshold: 0.01
KolmogorovTest:
threshold: 0.68
RatioCheck:
threshold: 3
ResidualCheck:
threshold: 3
IntegralCheck:
threshold: 3

"nStates_*":
KolmogorovTest: null
"nMeasurements_*":
KolmogorovTest: null

pullmean_phi_vs_eta:
IntegralCheck:
threshold: 4
pullmean_theta_vs_eta:
IntegralCheck: null
pullmean_z0_vs_eta:
IntegralCheck: null

pullwidth_phi_vs_eta:
IntegralCheck:
threshold: 4.3
reswidth_d0_vs_eta:
IntegralCheck:
threshold: 4
resmean_d0_vs_eta:
IntegralCheck:
threshold: 4

pullwidth_*:
Chi2Test: null
KolmogorovTest: null
pullmean_*:
Chi2Test: null
KolmogorovTest: null
reswidth_*:
Chi2Test: null
KolmogorovTest: null
resmean_*:
Chi2Test: null
KolmogorovTest: null
12 changes: 12 additions & 0 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ fi
if [[ "$mode" == "all" || "$mode" == "gsf" ]]; then
run_physmon_gen "Truth Tracking GSF" "truth_tracking_gsf"
fi
if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then
run_physmon_gen "Truth Tracking GX2F" "truth_tracking_gx2f"
fi
if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
run_physmon_gen "CKF Tracking" "ckf_tracking"
run_physmon_gen "Track finding ttbar" "track_finding_ttbar"
Expand Down Expand Up @@ -340,6 +343,15 @@ if [[ "$mode" == "all" || "$mode" == "kalman" ]]; then
-c CI/physmon/truth_tracking.yml
fi

if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then
run_histcmp \
$outdir/performance_gx2f.root \
$refdir/performance_gx2f.root \
"Truth tracking (GX2F)" \
gx2f \
-c CI/physmon/gx2f.yml
fi

if [[ "$mode" == "all" || "$mode" == "vertexing" ]]; then
Examples/Scripts/vertex_mu_scan.py \
$outdir/performance_vertexing_*mu*.root \
Expand Down
Binary file added CI/physmon/reference/performance_gx2f.root
Binary file not shown.
34 changes: 34 additions & 0 deletions CI/physmon/workflows/physmon_truth_tracking_gx2f.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_gx2f import runTruthTrackingGx2f

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)
runTruthTrackingGx2f(
trackingGeometry=setup.trackingGeometry,
field=setup.field,
outputDir=tp,
digiConfigFile=setup.digiConfig,
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_gx2f.root")
22 changes: 11 additions & 11 deletions Examples/Scripts/Python/truth_tracking_gx2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def runTruthTrackingGx2f(
inputSimHits="simhits",
inputMeasurementParticlesMap="measurement_particles_map",
inputMeasurementSimHitsMap="measurement_simhits_map",
filePath=str(outputDir / "trackstates_fitter.root"),
filePath=str(outputDir / "trackstates_gx2f.root"),
)
)

Expand All @@ -118,7 +118,7 @@ def runTruthTrackingGx2f(
inputTracks="tracks",
inputParticles="truth_seeds_selected",
inputMeasurementParticlesMap="measurement_particles_map",
filePath=str(outputDir / "tracksummary_fitter.root"),
filePath=str(outputDir / "tracksummary_gx2f.root"),
writeGx2fSpecific=True,
)
)
Expand All @@ -134,15 +134,15 @@ def runTruthTrackingGx2f(
# )
# )
#
# s.addWriter(
# acts.examples.TrackFitterPerformanceWriter(
# level=acts.logging.INFO,
# inputTracks="tracks",
# inputParticles="truth_seeds_selected",
# inputMeasurementParticlesMap="measurement_particles_map",
# filePath=str(outputDir / "performance_track_fitter.root"),
# )
# )
s.addWriter(
acts.examples.TrackFitterPerformanceWriter(
level=acts.logging.INFO,
inputTracks="tracks",
inputParticles="truth_seeds_selected",
inputMeasurementParticlesMap="measurement_particles_map",
filePath=str(outputDir / "performance_gx2f.root"),
)
)

return s

Expand Down
Loading