Skip to content

Commit

Permalink
**/Snakefile: fix some tab/spaces mixing
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Dec 19, 2024
1 parent 73128ee commit 9c993f4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 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
8 changes: 4 additions & 4 deletions benchmarks/tracking_performances_dis/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rule trk_dis_compile:
input:
"benchmarks/tracking_performances_dis/analysis/trk_dis_analysis_cxx.so",
"benchmarks/tracking_performances_dis/analysis/trk_dis_plots_cxx.so"
"benchmarks/tracking_performances_dis/analysis/vtx_dis_analysis_cxx.so",
"benchmarks/tracking_performances_dis/analysis/vtx_dis_analysis_cxx.so",
"benchmarks/tracking_performances_dis/analysis/vtx_dis_plots_cxx.so"

# Process the generated HepMC files through the simulation
Expand Down Expand Up @@ -114,7 +114,7 @@ rule dis_combine:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
MINQ2="\d+",
NUM_FILES="\d+",
shell:
"""
Expand Down Expand Up @@ -157,7 +157,7 @@ rule trk_dis_plots:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
MINQ2="\d+",
NUM_FILES="\d+",
shell:
"""
Expand All @@ -175,7 +175,7 @@ rule vtx_dis_plots:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
MINQ2="\d+",
NUM_FILES="\d+",
shell:
"""
Expand Down
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

0 comments on commit 9c993f4

Please sign in to comment.