Skip to content

Commit

Permalink
add benchmarks/backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Dec 19, 2023
1 parent 7992c35 commit 98ffba5
Show file tree
Hide file tree
Showing 5 changed files with 539 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ get_data:
- runner_system_failure

include:
- local: 'benchmarks/backgrounds/config.yml'
- local: 'benchmarks/tracking_detectors/config.yml'
- local: 'benchmarks/barrel_ecal/config.yml'
- local: 'benchmarks/barrel_hcal/config.yml'
Expand Down
67 changes: 67 additions & 0 deletions benchmarks/backgrounds/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import os

from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider


S3 = S3RemoteProvider(
endpoint_url="https://dtn01.sdcc.bnl.gov:9000",
access_key_id=os.environ["S3_ACCESS_KEY"],
secret_access_key=os.environ["S3_SECRET_KEY"],
)


rule backgrounds_get:
input:
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_10Mevt_vtx.hepmc"),
S3.remote("eictest/EPIC/RECO/23.12.0/epic_craterlake/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_5.0000.eicrecon.tree.edm4eic.root"),
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/ProtonBeamGasEvents/100GeV/100GeV_1.hepmc"),
output:
"input/backgrounds/beam_gas_electron.hepmc",
"reco/epic_craterlake/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_5.0000.eicrecon.tree.edm4eic.root",
"input/backgrounds/beam_gas_proton.hepmc",
run:
for src, dst in zip(input, output):
os.link(src, dst)


rule backgrounds_sim:
input:
"input/backgrounds/beam_gas_{BEAM}.hepmc",
output:
"sim/{DETECTOR_CONFIG}/beam_gas_{BEAM}.edm4hep.root",
log:
"sim/{DETECTOR_CONFIG}/beam_gas_{BEAM}.edm4hep.root.log",
params:
N_EVENTS=10000
shell:
"""
ddsim \
--runType batch \
--part.minimalKineticEnergy 100*GeV \
--filter.tracker edep0 \
-v WARNING \
--numberOfEvents {params.N_EVENTS} \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
--inputFiles {input} \
--outputFile {output}
"""


rule backgrounds_org2py:
input:
"ecal_backwards.org"
output:
"ecal_backwards.py"
shell:
"""
awk -f ./org2py.awk {input} > {output}
"""


rule backgrounds_ecal_backwards:
input:
script="ecal_backwards.py",
shell:
"""
python {input.script}
"""
22 changes: 22 additions & 0 deletions benchmarks/backgrounds/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
sim:backgrounds:
extends: .det_benchmark
stage: simulate
script:
- snakemake --cores 1 backgrounds_get
- snakemake sim/$DETECTOR_CONFIG/beam_gas_{electron,proton}.edm4hep.root

bench:backgrounds_emcal_backwards:
extends: .det_benchmark
stage: benchmarks
needs:
- ["sim:backgrounds"]
script:
- echo bench

collect_results:backgrounds:
extends: .det_benchmark
stage: collect
needs:
- "bench:backgrounds_emcal_backwards"
script:
- ls -lrht
Loading

0 comments on commit 98ffba5

Please sign in to comment.