Skip to content
Snippets Groups Projects
Commit 3a329732 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: Snakefile: tab -> spaces

parent 0d0bc49c
Branches
Tags
1 merge request!170fix: Snakefile: tab -> spaces
This commit is part of merge request !170. Comments created here will be created in the context of that merge request.
...@@ -15,7 +15,7 @@ rule lfhcal_sim: ...@@ -15,7 +15,7 @@ rule lfhcal_sim:
"sim_output/lfhcal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root.log", "sim_output/lfhcal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root.log",
wildcard_constraints: wildcard_constraints:
ENERGY="[0-9]+[kMG]eV", ENERGY="[0-9]+[kMG]eV",
PARTICLE="(neutron|pi-|gamma)", PARTICLE="(neutron|pi-|gamma)",
PHASE_SPACE="3to50deg", PHASE_SPACE="3to50deg",
INDEX="\d{4}", INDEX="\d{4}",
params: params:
...@@ -95,18 +95,18 @@ rule lfhcal_summary_at_eta: ...@@ -95,18 +95,18 @@ rule lfhcal_summary_at_eta:
shell: shell:
""" """
if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then
set +e set +e
EPIC_VERSION="${{DETECTOR_VERSION:-}}" EPIC_VERSION="${{DETECTOR_VERSION:-}}"
EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')" EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')"
# Legacy detection # Legacy detection
: ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}} : ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}}
set -e set -e
echo "ePIC version: $EPIC_VERSION" echo "ePIC version: $EPIC_VERSION"
echo "EICrecon version: $EICRECON_VERSION" echo "EICrecon version: $EICRECON_VERSION"
EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION" EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION"
else else
EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}" EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}"
fi fi
cd {wildcards.CAMPAIGN} cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script}'("{wildcards.PARTICLE}", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")' root -l -b -q ../{input.script}'("{wildcards.PARTICLE}", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")'
...@@ -118,11 +118,11 @@ rule lfhcal: ...@@ -118,11 +118,11 @@ rule lfhcal:
input: input:
lambda wildcards: expand( lambda wildcards: expand(
[ [
"{{CAMPAIGN}}/Final_Results/{PARTICLE}/mom/lfhcal_mom_resol_{PARTICLE}_{ETA_BIN}.png", "{{CAMPAIGN}}/Final_Results/{PARTICLE}/mom/lfhcal_mom_resol_{PARTICLE}_{ETA_BIN}.png",
"{{CAMPAIGN}}/Final_Results/{PARTICLE}/mom/lfhcal_mom_resol_{PARTICLE}_{ETA_BIN}.root", "{{CAMPAIGN}}/Final_Results/{PARTICLE}/mom/lfhcal_mom_resol_{PARTICLE}_{ETA_BIN}.root",
], ],
ETA_BIN=[f"{eta_min:.1f}_eta_{eta_max:.1f}" for eta_min, eta_max in zip(LFHCAL_ETA_BINS[:-1], LFHCAL_ETA_BINS[1:])], ETA_BIN=[f"{eta_min:.1f}_eta_{eta_max:.1f}" for eta_min, eta_max in zip(LFHCAL_ETA_BINS[:-1], LFHCAL_ETA_BINS[1:])],
PARTICLE=["neutron", "pi-", "gamma"] if wildcards.CAMPAIGN == "local" else ["pi-"], PARTICLE=["neutron", "pi-", "gamma"] if wildcards.CAMPAIGN == "local" else ["pi-"],
) )
output: output:
directory("results/lfhcal/{CAMPAIGN}/") directory("results/lfhcal/{CAMPAIGN}/")
......
...@@ -141,18 +141,18 @@ rule tracking_performance_summary_at_eta: ...@@ -141,18 +141,18 @@ rule tracking_performance_summary_at_eta:
shell: shell:
""" """
if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then
set +e set +e
EPIC_VERSION="${{DETECTOR_VERSION:-}}" EPIC_VERSION="${{DETECTOR_VERSION:-}}"
EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')" EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')"
# Legacy detection # Legacy detection
: ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}} : ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}}
set -e set -e
echo "ePIC version: $EPIC_VERSION" echo "ePIC version: $EPIC_VERSION"
echo "EICrecon version: $EICRECON_VERSION" echo "EICrecon version: $EICRECON_VERSION"
EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION" EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION"
else else
EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}" EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}"
fi fi
cd {wildcards.CAMPAIGN} cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script_mom}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")' root -l -b -q ../{input.script_mom}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")'
......
rule zdc_lambda_generate: rule zdc_lambda_generate:
input: input:
script="benchmarks/zdc_lambda/analysis/gen_lambda_decay.cxx", script="benchmarks/zdc_lambda/analysis/gen_lambda_decay.cxx",
params: params:
NEVENTS_GEN=1000, NEVENTS_GEN=1000,
output: output:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc" GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc"
shell: shell:
""" """
root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})' root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
""" """
rule zdc_lambda_simulate: rule zdc_lambda_simulate:
input: input:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc", GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params: params:
PHYSICS_LIST="FTFP_BERT" PHYSICS_LIST="FTFP_BERT"
output: output:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root"
shell: shell:
""" """
NEVENTS_SIM=200 NEVENTS_SIM=200
# Running simulation # Running simulation
npsim \ npsim \
...@@ -43,17 +43,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil ...@@ -43,17 +43,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
""" """
rule zdc_lambda_analysis: rule zdc_lambda_analysis:
input: input:
expand("sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root", expand("sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275], P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5), INDEX=range(5),
), ),
script="benchmarks/zdc_lambda/analysis/lambda_plots.py", script="benchmarks/zdc_lambda/analysis/lambda_plots.py",
output: output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"), results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
shell: shell:
""" """
mkdir -p {output.results_dir} mkdir -p {output.results_dir}
python {input.script} {output.results_dir} python {input.script} {output.results_dir}
""" """
...@@ -58,8 +58,8 @@ rule zdc_lyso_analysis: ...@@ -58,8 +58,8 @@ rule zdc_lyso_analysis:
PARTICLE=["gamma"], PARTICLE=["gamma"],
BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"], BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"],
THETA_MIN=["0"], THETA_MIN=["0"],
THETA_MAX=["0.3"]), THETA_MAX=["0.3"]),
script="benchmarks/zdc_lyso/analysis/analysis.py", script="benchmarks/zdc_lyso/analysis/analysis.py",
output: output:
"results/{DETECTOR_CONFIG}/zdc_lyso/plots.pdf", "results/{DETECTOR_CONFIG}/zdc_lyso/plots.pdf",
shell: shell:
......
rule zdc_photon_generate: rule zdc_photon_generate:
input: input:
script="benchmarks/zdc_photon/analysis/gen_particles.cxx", script="benchmarks/zdc_photon/analysis/gen_particles.cxx",
params: params:
th_max=0.23, th_max=0.23,
th_min=0 th_min=0
output: output:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc" GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc"
shell: shell:
""" """
NEVENTS_GEN=200 NEVENTS_GEN=200
mkdir -p sim_output/zdc_photon mkdir -p sim_output/zdc_photon
root -l -b -q '{input.script}('$NEVENTS_GEN',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' root -l -b -q '{input.script}('$NEVENTS_GEN',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
""" """
rule zdc_photon_simulate: rule zdc_photon_simulate:
input: input:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc", GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params: params:
PHYSICS_LIST="FTFP_BERT" PHYSICS_LIST="FTFP_BERT"
output: output:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root"
shell: shell:
""" """
# Running simulation # Running simulation
NEVENTS_SIM=200 NEVENTS_SIM=200
npsim \ npsim \
...@@ -46,17 +46,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil ...@@ -46,17 +46,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
""" """
rule zdc_photon_analysis: rule zdc_photon_analysis:
input: input:
expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root", expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
P=[20, 30, 50, 70, 100, 150, 200, 275], P=[20, 30, 50, 70, 100, 150, 200, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5), INDEX=range(5),
), ),
script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py", script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py",
output: output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"), results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
shell: shell:
""" """
mkdir -p {output.results_dir} mkdir -p {output.results_dir}
python {input.script} {output.results_dir} python {input.script} {output.results_dir}
""" """
rule zdc_pi0_generate: rule zdc_pi0_generate:
input: input:
script="benchmarks/zdc_pi0/analysis/gen_pi0_decay.cxx", script="benchmarks/zdc_pi0/analysis/gen_pi0_decay.cxx",
params: params:
NEVENTS_GEN=1000, NEVENTS_GEN=1000,
output: output:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc" GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc"
shell: shell:
""" """
mkdir -p sim_output/zdc_pi0 mkdir -p sim_output/zdc_pi0
root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})' root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
""" """
rule zdc_pi0_simulate: rule zdc_pi0_simulate:
input: input:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc", GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params: params:
PHYSICS_LIST="FTFP_BERT" PHYSICS_LIST="FTFP_BERT"
output: output:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root"
shell: shell:
""" """
NEVENTS_SIM=200 NEVENTS_SIM=200
# Running simulation # Running simulation
npsim \ npsim \
...@@ -44,17 +44,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil ...@@ -44,17 +44,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
""" """
rule zdc_pi0_analysis: rule zdc_pi0_analysis:
input: input:
expand("sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root", expand("sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
P=[60, 80, 100, 130, 160], P=[60, 80, 100, 130, 160],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5), INDEX=range(5),
), ),
script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py", script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py",
output: output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"), results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"),
shell: shell:
""" """
mkdir -p {output.results_dir} mkdir -p {output.results_dir}
python {input.script} {output.results_dir} python {input.script} {output.results_dir}
""" """
rule zdc_sigma_generate: rule zdc_sigma_generate:
input: input:
script="benchmarks/zdc_sigma/analysis/gen_sigma_decay.cxx", script="benchmarks/zdc_sigma/analysis/gen_sigma_decay.cxx",
params: params:
NEVENTS_GEN=100000, NEVENTS_GEN=100000,
output: output:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc" GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc"
shell: shell:
""" """
root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})' root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
""" """
rule zdc_sigma_simulate: rule zdc_sigma_simulate:
input: input:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc", GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params: params:
PHYSICS_LIST="FTFP_BERT" PHYSICS_LIST="FTFP_BERT"
output: output:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root"
shell: shell:
""" """
NEVENTS_SIM=200 NEVENTS_SIM=200
# Running simulation # Running simulation
npsim \ npsim \
...@@ -43,17 +43,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil ...@@ -43,17 +43,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
""" """
rule zdc_sigma_analysis: rule zdc_sigma_analysis:
input: input:
expand("sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root", expand("sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275], P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5), INDEX=range(5),
), ),
script="benchmarks/zdc_sigma/analysis/sigma_plots.py", script="benchmarks/zdc_sigma/analysis/sigma_plots.py",
output: output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"), results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"),
shell: shell:
""" """
mkdir -p {output.results_dir} mkdir -p {output.results_dir}
python {input.script} {output.results_dir} python {input.script} {output.results_dir}
""" """
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment