Skip to content
Snippets Groups Projects
Commit c46707ed authored by Dmitry Kalinkin's avatar Dmitry Kalinkin
Browse files

tracking_performance: enable running over campaigns

parent 80a8746b
No related branches found
No related tags found
No related merge requests found
Pipeline #98229 passed with warnings
...@@ -121,6 +121,9 @@ get_data: ...@@ -121,6 +121,9 @@ get_data:
- mkdir "${DETECTOR_CONFIG}" - mkdir "${DETECTOR_CONFIG}"
- ln -s "${LOCAL_DATA_PATH}/sim_output" "${DETECTOR_CONFIG}/sim_output" - ln -s "${LOCAL_DATA_PATH}/sim_output" "${DETECTOR_CONFIG}/sim_output"
- ln -s "../results" "${DETECTOR_CONFIG}/results" - ln -s "../results" "${DETECTOR_CONFIG}/results"
# cache downloaded artifacts
- if [ -d /scratch ]; then mkdir -p /scratch/EPIC; ln -sf /scratch/EPIC ./EPIC; fi
- du -hs /scratch/EPIC
- ls -lrtha - ls -lrtha
retry: retry:
max: 2 max: 2
......
...@@ -4,7 +4,16 @@ The scripts can be used to create the debug plots for the momentum resolutions. ...@@ -4,7 +4,16 @@ The scripts can be used to create the debug plots for the momentum resolutions.
To run a full simulation-reconstruction-analysis chain do: To run a full simulation-reconstruction-analysis chain do:
``` ```
snakemake --cores 1 tracking_performance snakemake -c2 results/tracking_performances/local
```
or, referencing it by the rule name:
```
snakemake --cores 1 tracking_performance_local
```
To process an individual campaign do:
```
snakemake -c2 results/tracking_performances/24.04.0
``` ```
It will produce the results with truth/realistic seeding. It will produce the results with truth/realistic seeding.
...@@ -48,27 +48,26 @@ rule tracking_performance_at_momentum: ...@@ -48,27 +48,26 @@ rule tracking_performance_at_momentum:
input: input:
script="benchmarks/tracking_performances/Tracking_Performances.C", script="benchmarks/tracking_performances/Tracking_Performances.C",
# TODO pass as a file list? # TODO pass as a file list?
sim=lambda wildcards: branch( sim=lambda wildcards:
wildcards.CAMPAIGN == "local", expand(
then=expand(
"sim_output/tracking_performance/{DETECTOR_CONFIG}/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", "sim_output/tracking_performance/{DETECTOR_CONFIG}/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root",
DETECTOR_CONFIG="epic_craterlake_tracking_only", DETECTOR_CONFIG="epic_craterlake_tracking_only",
ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV", ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV",
PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"], PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"],
INDEX=range(1), INDEX=range(1),
), )
otherwise=expand( if wildcards.CAMPAIGN == "local" else
expand(
"EPIC/RECO/{{CAMPAIGN}}/epic_craterlake/SINGLE/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", "EPIC/RECO/{{CAMPAIGN}}/epic_craterlake/SINGLE/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root",
DETECTOR_CONFIG="epic_craterlake", DETECTOR_CONFIG="epic_craterlake",
ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV", ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV",
PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"], PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"],
INDEX=range(1), INDEX=range(1),
), ),
),
output: output:
"{SEEDING}/pi-/mom/Performances_mom_{MOMENTUM}_mom_resol_{SEEDING_IGNORE}_{PARTICLE}.root", "{CAMPAIGN}/{SEEDING}/pi-/mom/Performances_mom_{MOMENTUM}_mom_resol_{SEEDING_IGNORE}_{PARTICLE}.root",
"{SEEDING}/pi-/dca/Performances_dca_{MOMENTUM}_dca_resol_{SEEDING_IGNORE}_{PARTICLE}.root", "{CAMPAIGN}/{SEEDING}/pi-/dca/Performances_dca_{MOMENTUM}_dca_resol_{SEEDING_IGNORE}_{PARTICLE}.root",
combined_root=temp("sim_{SEEDING}_{MOMENTUM}_{SEEDING_IGNORE}_{PARTICLE}.root"), combined_root=temp("{CAMPAIGN}/sim_{SEEDING}_{MOMENTUM}_{SEEDING_IGNORE}_{PARTICLE}.root"),
shell: shell:
""" """
if [[ "{wildcards.SEEDING}" == "truthseed" ]]; then if [[ "{wildcards.SEEDING}" == "truthseed" ]]; then
...@@ -77,7 +76,8 @@ elif [[ "{wildcards.SEEDING}" == "realseed" ]]; then ...@@ -77,7 +76,8 @@ elif [[ "{wildcards.SEEDING}" == "realseed" ]]; then
SEEDING="Seeded" SEEDING="Seeded"
fi fi
hadd {output.combined_root} {input.sim} hadd {output.combined_root} {input.sim}
root -l -b -q {input.script}'("{output.combined_root}", "{wildcards.PARTICLE}", {wildcards.MOMENTUM}, 0.15, "'$SEEDING'")' cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script}'("../{output.combined_root}", "{wildcards.PARTICLE}", {wildcards.MOMENTUM}, 0.15, "'$SEEDING'")'
""" """
...@@ -85,25 +85,26 @@ rule tracking_performance_summary_at_eta: ...@@ -85,25 +85,26 @@ rule tracking_performance_summary_at_eta:
input: input:
expand( expand(
[ [
"truthseed/pi-/mom/Performances_mom_{MOMENTUM:.1f}_mom_resol_truth_pi-.root", "{{CAMPAIGN}}/truthseed/pi-/mom/Performances_mom_{MOMENTUM:.1f}_mom_resol_truth_pi-.root",
"truthseed/pi-/dca/Performances_dca_{MOMENTUM:.1f}_dca_resol_truth_pi-.root", "{{CAMPAIGN}}/truthseed/pi-/dca/Performances_dca_{MOMENTUM:.1f}_dca_resol_truth_pi-.root",
"realseed/pi-/mom/Performances_mom_{MOMENTUM:.1f}_mom_resol_realseed_pi-.root", "{{CAMPAIGN}}/realseed/pi-/mom/Performances_mom_{MOMENTUM:.1f}_mom_resol_realseed_pi-.root",
"realseed/pi-/dca/Performances_dca_{MOMENTUM:.1f}_dca_resol_realseed_pi-.root", "{{CAMPAIGN}}/realseed/pi-/dca/Performances_dca_{MOMENTUM:.1f}_dca_resol_realseed_pi-.root",
], ],
MOMENTUM=[0.5, 1.0, 2.0, 5.0, 10.0, 20.0], MOMENTUM=[0.5, 1.0, 2.0, 5.0, 10.0, 20.0],
), ),
script="benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C", script="benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C",
output: output:
expand( expand(
"Debug_Plots/{SEEDING}/pi-/mom/{SEEDING}_mom_resol_mom{MOMENTUM:.1f}_{{ETA_MIN}}_eta_{{ETA_MAX}}.png", "{{CAMPAIGN}}/Debug_Plots/{SEEDING}/pi-/mom/{SEEDING}_mom_resol_mom{MOMENTUM:.1f}_{{ETA_MIN}}_eta_{{ETA_MAX}}.png",
SEEDING=["real", "truth"], SEEDING=["real", "truth"],
MOMENTUM=[0.5, 1.0, 2.0, 5.0, 10.0, 20.0], MOMENTUM=[0.5, 1.0, 2.0, 5.0, 10.0, 20.0],
), ),
"Final_Results/pi-/mom/mom_resol_{ETA_MIN}_eta_{ETA_MAX}.png", "{CAMPAIGN}/Final_Results/pi-/mom/mom_resol_{ETA_MIN}_eta_{ETA_MAX}.png",
"Final_Results/pi-/mom/mom_resol_{ETA_MIN}_eta_{ETA_MAX}.root", "{CAMPAIGN}/Final_Results/pi-/mom/mom_resol_{ETA_MIN}_eta_{ETA_MAX}.root",
shell: shell:
""" """
root -l -b -q {input.script}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1.)' cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1.)'
""" """
...@@ -113,15 +114,34 @@ rule tracking_performance: ...@@ -113,15 +114,34 @@ rule tracking_performance:
input: input:
expand( expand(
[ [
"Final_Results/pi-/mom/mom_resol_{ETA_BIN}.png", "{{CAMPAIGN}}/Final_Results/pi-/mom/mom_resol_{ETA_BIN}.png",
"Final_Results/pi-/mom/mom_resol_{ETA_BIN}.root", "{{CAMPAIGN}}/Final_Results/pi-/mom/mom_resol_{ETA_BIN}.root",
], ],
ETA_BIN=[f"{eta_min:.1f}_eta_{eta_max:.1f}" for eta_min, eta_max in zip(TRACKING_PERFORMANCE_ETA_BINS[:-1], TRACKING_PERFORMANCE_ETA_BINS[1:])], ETA_BIN=[f"{eta_min:.1f}_eta_{eta_max:.1f}" for eta_min, eta_max in zip(TRACKING_PERFORMANCE_ETA_BINS[:-1], TRACKING_PERFORMANCE_ETA_BINS[1:])],
), ),
output: output:
directory("results/tracking_performances") directory("results/tracking_performances/{CAMPAIGN}/")
shell: shell:
""" """
mkdir {output} mkdir {output}
cp {input} {output} cp {input} {output}
""" """
rule tracking_performance_local:
input:
"results/tracking_performances/local",
rule tracking_performance_campaigns:
input:
expand(
"results/tracking_performances/{CAMPAIGN}",
CAMPAIGN=[
"23.10.0",
"23.11.0",
"23.12.0",
"24.03.1",
"24.04.0",
],
)
...@@ -18,7 +18,7 @@ bench:tracking_performance: ...@@ -18,7 +18,7 @@ bench:tracking_performance:
needs: needs:
- ["sim:tracking_performance"] - ["sim:tracking_performance"]
script: script:
- snakemake --cores 1 tracking_performance - snakemake --cores 1 tracking_performance_local
collect_results:tracking_performance: collect_results:tracking_performance:
extends: .det_benchmark extends: .det_benchmark
...@@ -27,3 +27,18 @@ collect_results:tracking_performance: ...@@ -27,3 +27,18 @@ collect_results:tracking_performance:
- "bench:tracking_performance" - "bench:tracking_performance"
script: script:
- ls -lrht - ls -lrht
bench:tracking_performance_campaigns:
extends: .det_benchmark
stage: benchmarks
#when: manual
script:
- snakemake --cores 1 tracking_performance_campaigns
collect_results:tracking_performance_campaigns:
extends: .det_benchmark
stage: collect
needs:
- "bench:tracking_performance_campaigns"
script:
- ls -lrht
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment