Skip to content

Commit

Permalink
feat: seeding performance monitoring (#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisFelipeCoelho committed Nov 16, 2022
1 parent 85a6775 commit 7da4880
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 13 deletions.
39 changes: 32 additions & 7 deletions CI/physmon/comment_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@
{% endif %}

[Full report]({{ url }}/)
CKF: {{ make_url("seeded", "ckf_seeded.html") }}, {{ make_url("truth smeared", "ckf_truth_smeared.html") }}, {{ make_url("truth estimated", "ckf_truth_estimated.html") }}
IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "ivf_truth_smeared.html") }}, {{ make_url("truth estimated", "ivf_truth_estimated.html") }}
{{ make_url("Ambiguity resolution", "ambi_seeded.html") }}
{{ make_url("Truth tracking (Kalman Filter)", "truth_tracking.html") }}
CKF: {{ make_url("seeded", "ckf_seeded.html") }}, {{ make_url("truth smeared", "ckf_truth_smeared.html") }}, {{ make_url("truth estimated", "ckf_truth_estimated.html") }}, {{ make_url("orthogonal", "ckf_orthogonal.html") }}
IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "ivf_truth_smeared.html") }}, {{ make_url("truth estimated", "ivf_truth_estimated.html") }}, {{ make_url("orthogonal", "ivf_orthogonal.html") }}
Ambiguity resolution: {{ make_url("seeded", "ambi_seeded.html") }}, , {{ make_url("orthogonal", "ambi_orthogonal.html") }}
{{ make_url("Truth tracking", "truth_tracking.html") }}
{{ make_url("Truth tracking (GSF)", "gsf.html")}}

### Vertexing {{ "" if all_exist(
"vertexing_mu_scan.pdf",
"ivf_seeded_plots",
"ivf_truth_smeared_plots",
"ivf_truth_estimated_plots",
"ivf_orthogonal_plots",
) else ":x: "}}

{% call detail_block("Vertexing vs. mu", "vertexing_mu_scan.pdf") %}
{{ make_image("vertexing_mu_scan.pdf", 350) }}
{% endcall %}

{% for mode in ["seeded", "truth_smeared", "truth_estimated"] %}
{% for mode in ["seeded", "truth_smeared", "truth_estimated", "orthogonal"] %}

{% call detail_block("IVF "+mode, "ivf_"+mode+"_plots") %}

Expand All @@ -41,14 +42,38 @@ IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "

{% endfor %}

### Seeding {{ "" if all_exist(
"seeding_seeded_plots",
"seeding_truth_smeared_plots",
"seeding_truth_estimated_plots",
"seeding_orthogonal_plots",
) else ":x: "}}

{% for mode in ["seeded", "truth_smeared", "truth_estimated", "orthogonal"] %}

{% call detail_block("Seeding "+mode, "seeding_"+mode+"_plots") %}

{% for url in [
"trackeff_vs_eta.pdf",
"trackeff_vs_pT.pdf",
"duplicationRate_vs_eta.pdf",
"duplicationRate_vs_pT.pdf",
] -%}
{{- make_image("seeding_"+mode+"_plots/"+url, "50%") -}}
{%- endfor %}

{% endcall %}

{% endfor %}

### CKF {{ "" if all_exist(
"ckf_seeded_plots",
"ckf_truth_smeared_plots",
"ckf_truth_estimated_plots",
"ckf_orthogonal_plots",
) else ":x: "}}

{% for mode in ["seeded", "truth_smeared", "truth_estimated"] %}
{% for mode in ["seeded", "truth_smeared", "truth_estimated", "orthogonal"] %}

{% call detail_block("CKF "+mode, "ckf_"+mode+"_plots") %}

Expand All @@ -67,7 +92,7 @@ IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "

### Ambiguity resolution {{ "" if exists("ambi_seeded_plots") else ":x: "}}

{% call detail_block("seeded", "ambi_seeded_plots") %}
{% call detail_block("seeded", "ambi_seeded_plots", "orthogonal") %}

{% for url in [
"trackeff_vs_eta.pdf",
Expand Down
13 changes: 12 additions & 1 deletion CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ function full_chain() {
fi
echo $config

if [ $suffix != truth_smeared ]; then
run \
$outdir/performance_seeding_hists_${suffix}.root \
$refdir/performance_seeding_hists_${suffix}.root \
--title "Seeding ${suffix}" \
-c $config \
-o $outdir/seeding_${suffix}.html \
-p $outdir/seeding_${suffix}_plots
fi

run \
$outdir/performance_ckf_${suffix}.root \
$refdir/performance_ckf_${suffix}.root \
Expand Down Expand Up @@ -71,6 +81,7 @@ function full_chain() {
full_chain truth_smeared
full_chain truth_estimated
full_chain seeded
full_chain orthogonal

run \
$outdir/performance_gsf.root \
Expand Down Expand Up @@ -101,7 +112,7 @@ run \
--title "analysis_residuals_and_pulls" \
# -o $outdir/analysis_residuals_and_pulls.html \
# -p $outdir/analysis_residuals_and_pulls

Examples/Scripts/vertex_mu_scan.py \
$outdir/performance_vertexing_*mu*.root \
$outdir/vertexing_mu_scan.pdf
Expand Down
19 changes: 14 additions & 5 deletions CI/physmon/physmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@
(True, False, "truth_smeared"), # if first is true, second is ignored
(False, True, "truth_estimated"),
(False, False, "seeded"),
(False, False, "orthogonal"),
]:
# TODO There seems to be a difference to the reference files when using
# multithreading ActsAnalysisResidualsAndPulls
s = acts.examples.Sequencer(
events=500,
numThreads=1 if label == "seeded" else -1,
numThreads=1 if label in ["seeded", "orthogonal"] else -1,
logLevel=acts.logging.INFO,
)

Expand Down Expand Up @@ -197,7 +198,9 @@
if truthSmearedSeeded
else SeedingAlgorithm.TruthEstimated
if truthEstimatedSeeded
else SeedingAlgorithm.Default,
else SeedingAlgorithm.Default
if label == "seeded"
else SeedingAlgorithm.Orthogonal,
geoSelectionConfigFile=geoSel,
rnd=rnd, # only used by SeedingAlgorithm.TruthSmeared
outputDirRoot=tp,
Expand All @@ -217,7 +220,7 @@
outputDirCsv=None,
)

if label == "seeded":
if label in ["seeded", "orthogonal"]:
addAmbiguityResolution(
s,
AmbiguityResolutionConfig(maximumSharedHits=3),
Expand All @@ -228,7 +231,9 @@
addVertexFitting(
s,
field,
associatedParticles=None if label == "seeded" else "particles_input",
associatedParticles=None
if label in ["seeded", "orthogonal"]
else "particles_input",
vertexFinder=VertexFinder.Iterative,
outputDirRoot=tp,
)
Expand All @@ -237,7 +242,11 @@
del s

for stem in ["performance_ckf", "performance_vertexing"] + (
["performance_ambi"] if label == "seeded" else []
["performance_seeding_hists", "performance_ambi"]
if label in ["seeded", "orthogonal"]
else ["performance_seeding_hists"]
if label == "truth_estimated"
else []
):
perf_file = tp / f"{stem}.root"
assert perf_file.exists(), "Performance file not found"
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.

0 comments on commit 7da4880

Please sign in to comment.