Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lambda/Snakefile: adjust output paths, don't upload edm4hep files to artifacts #21

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions benchmarks/lambda/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rule lambda_generate:
params:
NEVENTS_GEN=100000,
output:
GEN_FILE="results/lambda/lambda_decay_{P}GeV.hepmc"
GEN_FILE="sim_output/lambda/lambda_decay_{P}GeV.hepmc"
shell:
"""
mkdir -p results/lambda
Expand All @@ -13,11 +13,11 @@ root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildca

rule lambda_simulate:
input:
GEN_FILE="results/lambda/lambda_decay_{P}GeV.hepmc"
GEN_FILE="sim_output/lambda/lambda_decay_{P}GeV.hepmc"
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="results/lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV.edm4hep.root"
SIM_FILE="sim_output/lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV.edm4hep.root"
shell:
"""
if [[ {wildcards.P} -gt 225 ]]; then
Expand All @@ -36,27 +36,27 @@ npsim \

rule lambda_recon:
input:
SIM_FILE="results/lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV.edm4hep.root"
SIM_FILE="sim_output/lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV.edm4hep.root"
output:
REC_FILE="results/lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV.edm4hep.root"
REC_FILE="sim_output/lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV.edm4hep.root"
shell:
"""
if [[ {wildcards.P} -gt 225 ]]; then
NEVENTS_REC=1000
else
NEVENTS_REC=1000
fi
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_include_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits -Pjana:nevents=$NEVENTS_REC
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits -Pjana:nevents=$NEVENTS_REC
"""

rule lambda_analysis:
input:
expand("results/lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV.edm4hep.root",
expand("sim_output/lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV.edm4hep.root",
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"]),
script="benchmarks/lambda/analysis/lambda_plots.py",
output:
results_dir=directory("results/lambda/results_{DETECTOR_CONFIG}_lambda_dec"),
results_dir=directory("results/{DETECTOR_CONFIG}/lambda"),
shell:
"""
mkdir -p {output.results_dir}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/lambda/analysis/lambda_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
arrays_sim={}
momenta=100, 125, 150, 175,200,225,250,275
for p in momenta:
filename=f'results/lambda/epic_zdc_sipm_on_tile_only_rec_lambda_dec_{p}GeV.edm4hep.root'
filename=f'sim_output/lambda/epic_zdc_sipm_on_tile_only_rec_lambda_dec_{p}GeV.edm4hep.root'
print("opening file", filename)
events = ur.open(filename+':events')
arrays_sim[p] = events.arrays()[:-1] #remove last event, which for some reason is blank
Expand Down
14 changes: 10 additions & 4 deletions benchmarks/lambda/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

lambda:simulate:
stage: simulate
extends: .phy_benchmark
Expand All @@ -15,14 +14,21 @@ lambda:simulate:
- P: 275
timeout: 6 hours
script:
- snakemake --cores 1 results/lambda/epic_zdc_sipm_on_tile_only_rec_lambda_dec_${P}GeV.edm4hep.root
- snakemake --cores 1 sim_output/lambda/epic_zdc_sipm_on_tile_only_rec_lambda_dec_${P}GeV.edm4hep.root
retry:
max: 2
when:
- runner_system_failure

lambda:analyze:
stage: analyze
extends: .phy_benchmark
needs: ["lambda:simulate"]
script:
- snakemake --cores 1 results/epic_zdc_sipm_on_tile_only/lambda

lambda:results:
stage: collect
needs: ["lambda:simulate"]
needs: ["lambda:analyze"]
script:
- python benchmarks/lambda/analysis/lambda_plots.py results/lambda/results_epic_zdc_sipm_on_tile_only_lambda_dec
- ls -al