From 3a329732145d312bbc51fc3d86a4bda895f77c7b Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 8 Dec 2024 17:41:28 -0600 Subject: [PATCH] fix: Snakefile: tab -> spaces --- benchmarks/lfhcal/Snakefile | 30 ++++++++-------- benchmarks/tracking_performances/Snakefile | 22 ++++++------ benchmarks/zdc_lambda/Snakefile | 40 ++++++++++----------- benchmarks/zdc_lyso/Snakefile | 4 +-- benchmarks/zdc_photon/Snakefile | 42 +++++++++++----------- benchmarks/zdc_pi0/Snakefile | 42 +++++++++++----------- benchmarks/zdc_sigma/Snakefile | 42 +++++++++++----------- 7 files changed, 111 insertions(+), 111 deletions(-) diff --git a/benchmarks/lfhcal/Snakefile b/benchmarks/lfhcal/Snakefile index cef068e5..8f4bd685 100644 --- a/benchmarks/lfhcal/Snakefile +++ b/benchmarks/lfhcal/Snakefile @@ -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: @@ -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"'")' @@ -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}/") diff --git a/benchmarks/tracking_performances/Snakefile b/benchmarks/tracking_performances/Snakefile index 15e7ba5a..454abb33 100644 --- a/benchmarks/tracking_performances/Snakefile +++ b/benchmarks/tracking_performances/Snakefile @@ -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"'")' diff --git a/benchmarks/zdc_lambda/Snakefile b/benchmarks/zdc_lambda/Snakefile index 9ffd1701..08158fb8 100644 --- a/benchmarks/zdc_lambda/Snakefile +++ b/benchmarks/zdc_lambda/Snakefile @@ -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 \ @@ -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} """ diff --git a/benchmarks/zdc_lyso/Snakefile b/benchmarks/zdc_lyso/Snakefile index a0b6cbfc..71d3fe0e 100644 --- a/benchmarks/zdc_lyso/Snakefile +++ b/benchmarks/zdc_lyso/Snakefile @@ -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: diff --git a/benchmarks/zdc_photon/Snakefile b/benchmarks/zdc_photon/Snakefile index 2ca2ad3d..6963ed7f 100644 --- a/benchmarks/zdc_photon/Snakefile +++ b/benchmarks/zdc_photon/Snakefile @@ -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 \ @@ -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} """ diff --git a/benchmarks/zdc_pi0/Snakefile b/benchmarks/zdc_pi0/Snakefile index c2a67993..7c82f743 100644 --- a/benchmarks/zdc_pi0/Snakefile +++ b/benchmarks/zdc_pi0/Snakefile @@ -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 \ @@ -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} """ diff --git a/benchmarks/zdc_sigma/Snakefile b/benchmarks/zdc_sigma/Snakefile index 80e8b25d..1f93e275 100644 --- a/benchmarks/zdc_sigma/Snakefile +++ b/benchmarks/zdc_sigma/Snakefile @@ -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 \ @@ -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} """