Skip to content

Commit

Permalink
fix: Snakefile: tab -> spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc committed Dec 8, 2024
1 parent 0d0bc49 commit 3a32973
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 111 deletions.
30 changes: 15 additions & 15 deletions benchmarks/lfhcal/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rule lfhcal_sim:
"sim_output/lfhcal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root.log",
wildcard_constraints:
ENERGY="[0-9]+[kMG]eV",
PARTICLE="(neutron|pi-|gamma)",
PARTICLE="(neutron|pi-|gamma)",
PHASE_SPACE="3to50deg",
INDEX="\d{4}",
params:
Expand Down Expand Up @@ -95,18 +95,18 @@ rule lfhcal_summary_at_eta:
shell:
"""
if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then
set +e
EPIC_VERSION="${{DETECTOR_VERSION:-}}"
EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')"
# Legacy detection
: ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}}
set -e
set +e
EPIC_VERSION="${{DETECTOR_VERSION:-}}"
EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')"
# Legacy detection
: ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}}
set -e
echo "ePIC version: $EPIC_VERSION"
echo "EICrecon version: $EICRECON_VERSION"
EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION"
echo "ePIC version: $EPIC_VERSION"
echo "EICrecon version: $EICRECON_VERSION"
EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION"
else
EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}"
EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}"
fi
cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script}'("{wildcards.PARTICLE}", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")'
Expand All @@ -118,11 +118,11 @@ rule lfhcal:
input:
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}.root",
"{{CAMPAIGN}}/Final_Results/{PARTICLE}/mom/lfhcal_mom_resol_{PARTICLE}_{ETA_BIN}.png",
"{{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:])],
PARTICLE=["neutron", "pi-", "gamma"] if wildcards.CAMPAIGN == "local" else ["pi-"],
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-"],
)
output:
directory("results/lfhcal/{CAMPAIGN}/")
Expand Down
22 changes: 11 additions & 11 deletions benchmarks/tracking_performances/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ rule tracking_performance_summary_at_eta:
shell:
"""
if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then
set +e
EPIC_VERSION="${{DETECTOR_VERSION:-}}"
EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')"
# Legacy detection
: ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}}
set -e
echo "ePIC version: $EPIC_VERSION"
echo "EICrecon version: $EICRECON_VERSION"
EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION"
set +e
EPIC_VERSION="${{DETECTOR_VERSION:-}}"
EICRECON_VERSION="$(eicrecon -v | sed -n -e 's/.*\(v[0-9\.]\+\).*/\\1/p')"
# Legacy detection
: ${{EPIC_VERSION:="$(echo $DETECTOR_PATH | sed -n -e 's/.*epic-\([^-/]\+\).*/\\1/p')"}}
set -e
echo "ePIC version: $EPIC_VERSION"
echo "EICrecon version: $EICRECON_VERSION"
EXTRA_LEGEND="ePIC $EPIC_VERSION / EICrecon $EICRECON_VERSION"
else
EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}"
EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}"
fi
cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script_mom}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")'
Expand Down
40 changes: 20 additions & 20 deletions benchmarks/zdc_lambda/Snakefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
rule zdc_lambda_generate:
input:
input:
script="benchmarks/zdc_lambda/analysis/gen_lambda_decay.cxx",
params:
NEVENTS_GEN=1000,
output:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc"
shell:
"""
params:
NEVENTS_GEN=1000,
output:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc"
shell:
"""
root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
"""

rule zdc_lambda_simulate:
input:
input:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
NEVENTS_SIM=200
# Running simulation
npsim \
Expand All @@ -43,17 +43,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
"""

rule zdc_lambda_analysis:
input:
input:
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}"],
INDEX=range(5),
),
script="benchmarks/zdc_lambda/analysis/lambda_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
shell:
"""
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
4 changes: 2 additions & 2 deletions benchmarks/zdc_lyso/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ rule zdc_lyso_analysis:
PARTICLE=["gamma"],
BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"],
THETA_MIN=["0"],
THETA_MAX=["0.3"]),
script="benchmarks/zdc_lyso/analysis/analysis.py",
THETA_MAX=["0.3"]),
script="benchmarks/zdc_lyso/analysis/analysis.py",
output:
"results/{DETECTOR_CONFIG}/zdc_lyso/plots.pdf",
shell:
Expand Down
42 changes: 21 additions & 21 deletions benchmarks/zdc_photon/Snakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
rule zdc_photon_generate:
input:
input:
script="benchmarks/zdc_photon/analysis/gen_particles.cxx",
params:
th_max=0.23,
th_min=0
output:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc"
shell:
"""
params:
th_max=0.23,
th_min=0
output:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc"
shell:
"""
NEVENTS_GEN=200
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})'
"""

rule zdc_photon_simulate:
input:
input:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
# Running simulation
NEVENTS_SIM=200
npsim \
Expand All @@ -46,17 +46,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
"""

rule zdc_photon_analysis:
input:
input:
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}"],
INDEX=range(5),
),
script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
shell:
"""
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
42 changes: 21 additions & 21 deletions benchmarks/zdc_pi0/Snakefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
rule zdc_pi0_generate:
input:
input:
script="benchmarks/zdc_pi0/analysis/gen_pi0_decay.cxx",
params:
NEVENTS_GEN=1000,
output:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc"
shell:
"""
params:
NEVENTS_GEN=1000,
output:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc"
shell:
"""
mkdir -p sim_output/zdc_pi0
root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
"""

rule zdc_pi0_simulate:
input:
input:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
NEVENTS_SIM=200
# Running simulation
npsim \
Expand All @@ -44,17 +44,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
"""

rule zdc_pi0_analysis:
input:
input:
expand("sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
P=[60, 80, 100, 130, 160],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
P=[60, 80, 100, 130, 160],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"),
shell:
"""
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
42 changes: 21 additions & 21 deletions benchmarks/zdc_sigma/Snakefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
rule zdc_sigma_generate:
input:
input:
script="benchmarks/zdc_sigma/analysis/gen_sigma_decay.cxx",
params:
NEVENTS_GEN=100000,
output:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc"
shell:
"""
params:
NEVENTS_GEN=100000,
output:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc"
shell:
"""
root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})'
"""

rule zdc_sigma_simulate:
input:
input:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
params:
PHYSICS_LIST="FTFP_BERT"
output:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root"
shell:
"""
NEVENTS_SIM=200
# Running simulation
npsim \
Expand All @@ -43,17 +43,17 @@ eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_fil
"""

rule zdc_sigma_analysis:
input:
input:
expand("sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_sigma/analysis/sigma_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"),
shell:
"""
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""

0 comments on commit 3a32973

Please sign in to comment.