Skip to content

Commit

Permalink
Snakefile: split get to avoid unnecessary downloads/simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Jan 4, 2024
1 parent dddb0d0 commit e4385c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
25 changes: 19 additions & 6 deletions benchmarks/backgrounds/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,31 @@ S3 = S3RemoteProvider(
)


rule backgrounds_get:
rule backgrounds_get_beam_gas_electron:
input:
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_10Mevt_vtx.hepmc"),
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/ProtonBeamGasEvents/100GeV/100GeV_1.hepmc"),
S3.remote("eictest/EPIC/FULL/23.11.0/epic_craterlake/DIS/NC/10x100/minQ2=10/pythia8NCDIS_10x100_minQ2=10_beamEffects_xAngle=-0.025_hiDiv_1.0000.edm4hep.root"),
output:
"input/backgrounds/beam_gas_electron.hepmc",
run:
os.link(input[0], output[0])


rule backgrounds_get_beam_gas_proton:
input:
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/ProtonBeamGasEvents/100GeV/100GeV_1.hepmc"),
output:
"input/backgrounds/beam_gas_proton.hepmc",
run:
os.link(input[0], output[0])


rule backgrounds_get_DIS:
input:
S3.remote("eictest/EPIC/FULL/23.11.0/epic_craterlake/DIS/NC/10x100/minQ2=10/pythia8NCDIS_10x100_minQ2=10_beamEffects_xAngle=-0.025_hiDiv_1.0000.edm4hep.root"),
output:
dis_sim="input/backgrounds/pythia8NCDIS_10x100_minQ2=10_beamEffects_xAngle=-0.025_hiDiv_1.0000.edm4hep.root",
run:
for src, dst in zip(input, output):
os.link(src, dst)
os.link(input[0], output[0])


rule backgrounds_sim:
Expand Down Expand Up @@ -66,7 +79,7 @@ rule backgrounds_ecal_backwards:
script="ecal_backwards.py",
electron_beam_gas_gen="input/backgrounds/beam_gas_electron.hepmc",
electron_beam_gas_sim="sim_output/" + DETECTOR_CONFIG + "/beam_gas_electron.edm4hep.root",
physics_signal_sim=rules.backgrounds_get.output.dis_sim,
physics_signal_sim=rules.backgrounds_get_DIS.output[0],
proton_beam_gas_gen="input/backgrounds/beam_gas_proton.hepmc",
proton_beam_gas_sim="sim_output/" + DETECTOR_CONFIG + "/beam_gas_proton.edm4hep.root",
output:
Expand Down
1 change: 0 additions & 1 deletion benchmarks/backgrounds/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ sim:backgrounds:
extends: .det_benchmark
stage: simulate
script:
- snakemake --cores 1 backgrounds_get
- snakemake --cores 1 sim_output/$DETECTOR_CONFIG/beam_gas_{electron,proton}.edm4hep.root

bench:backgrounds_emcal_backwards:
Expand Down

0 comments on commit e4385c4

Please sign in to comment.