Skip to content

Commit

Permalink
cache safety
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Jan 31, 2025
1 parent a8f4974 commit c27f699
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 12 deletions.
2 changes: 2 additions & 0 deletions benchmarks/calo_pid/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ rule calo_pid_sim:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
ENERGY_MIN=lambda wildcards: format_energy_for_dd4hep(wildcards.ENERGY_MIN),
ENERGY_MAX=lambda wildcards: format_energy_for_dd4hep(wildcards.ENERGY_MAX),
THETA_MIN=lambda wildcards: wildcards.THETA_MIN,
THETA_MAX=lambda wildcards: wildcards.THETA_MAX,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/femc_electron/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ rule femc_electron_generate:
N_EVENTS=get_n_events,
th_max=28,
th_min=2.0,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/femc_electron
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "e-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "e-", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule femc_electron_simulate:
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/femc_photon/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ rule femc_photon_generate:
N_EVENTS=get_n_events,
th_max=28,
th_min=2.0,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/femc_photon
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule femc_photon_simulate:
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/femc_pi0/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ rule femc_pi0_generate:
N_EVENTS=get_n_events,
th_max=28,
th_min=2.0,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/femc_pi0
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "pi0", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "pi0", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule femc_pi0_simulate:
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/insert_muon/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ rule insert_muon_generate:
NEVENTS_GEN=5000,
th_max=7.0,
th_min=1.7,
P=lambda wildcards: wildcards.P,
shell:
"""
root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "mu-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "mu-", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule insert_muon_simulate:
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/insert_neutron/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ rule insert_neutron_generate:
NEVENTS_GEN=1000,
th_max=5.7,
th_min=2.0,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/insert_neutron
root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "neutron", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "neutron", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule insert_neutron_simulate:
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/insert_tau/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ rule insert_tau_generate:
N_EVENTS=get_n_events,
th_max=7.0,
th_min=1.7,
P=lambda wildcards: wildcards.P,
shell:
"""
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "tau-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "tau-", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule insert_tau_simulate:
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/tracking_performances/Snakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rule tracking_performance_sim:
input:
steering_file=ancient("EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer"),
steering_file="EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
"sim_output/tracking_performance/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/zdc_lambda/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ rule zdc_lambda_generate:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
params:
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
"""

rule zdc_lambda_simulate:
Expand Down
6 changes: 5 additions & 1 deletion benchmarks/zdc_lyso/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ rule zdc_lyso_sim_hepmc:
"data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc.log",
params:
num_events=1000,
PARTICLE=lambda wildcards: wildcards.PARTICLE,
BEAM_ENERGY=lambda wildcards: wildcards.BEAM_ENERGY,
THETA_MIN=lambda wildcards: wildcards.THETA_MIN,
THETA_MAX=lambda wildcards: wildcards.THETA_MAX,
shell:
"""
root -l -b -q '{input.script}({params.num_events}, "{output.hepmcfile}", "{wildcards.PARTICLE}", {wildcards.THETA_MIN}, {wildcards.THETA_MAX}, 0, 360, {wildcards.BEAM_ENERGY})'
root -l -b -q '{input.script}({params.num_events}, "{output.hepmcfile}", "{params.PARTICLE}", {params.THETA_MIN}, {params.THETA_MAX}, 0, 360, {params.BEAM_ENERGY})'
"""


Expand Down
3 changes: 2 additions & 1 deletion benchmarks/zdc_photon/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ rule zdc_photon_generate:
th_max=0.23,
th_min=0,
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/zdc_photon
root -l -b -q '{input.script}('{params.N_EVENTS}',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
root -l -b -q '{input.script}('{params.N_EVENTS}',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""

rule zdc_photon_simulate:
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/zdc_pi0/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rule zdc_pi0_generate:
shell:
"""
mkdir -p sim_output/zdc_pi0
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
"""

rule zdc_pi0_simulate:
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/zdc_sigma/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rule zdc_sigma_generate:
P=lambda wildcards: wildcards.P,
shell:
"""
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
"""

rule zdc_sigma_simulate:
Expand Down

0 comments on commit c27f699

Please sign in to comment.