From e5fcd27526ab87f150e8c6ae2d1b1b802a897c95 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 11 Oct 2024 19:16:17 -0400 Subject: [PATCH 1/9] Add .pre-commit-config.yaml with snakefmt --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..7c4259df --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/snakemake/snakefmt + rev: v0.10.2 + hooks: + - id: snakefmt From 2788f58a9ed11dce7e22dde0a61b623e439c31d5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 11 Oct 2024 19:32:57 -0400 Subject: [PATCH 2/9] lfhcal: consistent use of spaces --- benchmarks/lfhcal/Snakefile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/benchmarks/lfhcal/Snakefile b/benchmarks/lfhcal/Snakefile index 459392c0..24e12d0c 100644 --- a/benchmarks/lfhcal/Snakefile +++ b/benchmarks/lfhcal/Snakefile @@ -8,7 +8,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: @@ -88,18 +88,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"'")' @@ -111,11 +111,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}/") From 00313eabbcde0bf0343b8c467a2f368fe7dffb7b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:33:02 +0000 Subject: [PATCH 3/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- benchmarks/barrel_ecal/Snakefile | 64 ++++++++++++++++++------- benchmarks/ecal_gaps/Snakefile | 12 +++-- benchmarks/femc_electron/Snakefile | 71 +++++++++++++++------------- benchmarks/femc_photon/Snakefile | 71 +++++++++++++++------------- benchmarks/femc_pi0/Snakefile | 71 +++++++++++++++------------- benchmarks/insert_muon/Snakefile | 76 ++++++++++++++++-------------- benchmarks/lfhcal/Snakefile | 75 +++++++++++++++++++---------- benchmarks/material_scan/Snakefile | 12 +++-- benchmarks/zdc_lambda/Snakefile | 72 +++++++++++++++------------- benchmarks/zdc_sigma/Snakefile | 72 +++++++++++++++------------- 10 files changed, 343 insertions(+), 253 deletions(-) diff --git a/benchmarks/barrel_ecal/Snakefile b/benchmarks/barrel_ecal/Snakefile index 88bfdba2..88fb7958 100644 --- a/benchmarks/barrel_ecal/Snakefile +++ b/benchmarks/barrel_ecal/Snakefile @@ -6,7 +6,7 @@ rule emcal_barrel_particles_gen: workflow.source_path("scripts/emcal_barrel_common_functions.h"), script=workflow.source_path("scripts/emcal_barrel_particles_gen.cxx"), params: - JUGGLER_N_EVENTS = 100, + JUGGLER_N_EVENTS=100, output: "data/emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.hepmc", shell: @@ -19,13 +19,14 @@ env \ rule emcal_barrel_particles: input: - "data/emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.hepmc" + "data/emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.hepmc", params: - JUGGLER_N_EVENTS = 100, + JUGGLER_N_EVENTS=100, output: - "{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root" + "{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root", shell: - """ + ( + """ set -m # monitor mode to prevent lingering processes exec ddsim \ --runType batch \ @@ -33,10 +34,13 @@ exec ddsim \ --part.minimalKineticEnergy 0.5*GeV \ --filter.tracker edep0 \ --numberOfEvents {params.JUGGLER_N_EVENTS} \ - --compactFile """ + DETECTOR_PATH + """/{wildcards.DETECTOR_CONFIG}.xml \ - --inputFiles {input} \ - --outputFile {output} -""" + --compactFile """ + + DETECTOR_PATH + + """/{wildcards.DETECTOR_CONFIG}.xml \ + --inputFiles {input} \ + --outputFile {output} + """ + ) # This is needed to bridge snakemake rule files to "normal" benchmarks @@ -73,7 +77,7 @@ rule emcal_barrel_particles_analysis: script=workflow.source_path("scripts/emcal_barrel_particles_analysis.cxx"), sim="{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}.edm4hep.root", wildcard_constraints: - PARTICLE="(electron|photon|piplus|piminus)", # avoid clash with "pions" + PARTICLE="(electron|photon|piplus|piminus)", # avoid clash with "pions" output: "{DETECTOR_CONFIG}/results/emcal_barrel_{PARTICLE}_calibration.json", "{DETECTOR_CONFIG}/results/emcal_barrel_{PARTICLE}_Ethr.png", @@ -123,7 +127,7 @@ rule emcal_barrel_pi0_analysis: var_name=["Ethr", "nhits", "Esim", "dE_rel"], extension=["pdf", "png"], ), - "{DETECTOR_CONFIG}/results/Barrel_emcal_pi0.json" + "{DETECTOR_CONFIG}/results/Barrel_emcal_pi0.json", shell: """ cd {wildcards.DETECTOR_CONFIG} @@ -131,11 +135,16 @@ root -l -b -q '{input.script}+("../{input.sim}")' """ -ENERGY_SCAN_ENERGIES = [0.5, 1., 2., 5., 10.] +ENERGY_SCAN_ENERGIES = [0.5, 1.0, 2.0, 5.0, 10.0] + + rule emcal_energy_scan: input: # Require all simulations produced for this rule - expand("{{DETECTOR_CONFIG}}/sim_output/energy_scan/{energy}/sim_emcal_barrel_{{PARTICLE}}.edm4hep.root", energy=ENERGY_SCAN_ENERGIES), + expand( + "{{DETECTOR_CONFIG}}/sim_output/energy_scan/{energy}/sim_emcal_barrel_{{PARTICLE}}.edm4hep.root", + energy=ENERGY_SCAN_ENERGIES, + ), output: "{DETECTOR_CONFIG}/sim_output/emcal_barrel_energy_scan_points_{PARTICLE}.txt", run: @@ -154,7 +163,15 @@ rule emcal_barrel_particles_energy_scan_analysis: expand( "{{DETECTOR_CONFIG}}/results/energy_scan/{energy}/emcal_barrel_{{PARTICLE}}_{plot}.png", energy=ENERGY_SCAN_ENERGIES, - plot=["Esim_layer", "Layer_nodep", "Layer_Esim_mean", "Ethr", "nhits", "Esim", "fsam"], + plot=[ + "Esim_layer", + "Layer_nodep", + "Layer_Esim_mean", + "Ethr", + "nhits", + "Esim", + "fsam", + ], ), shell: """ @@ -174,7 +191,16 @@ rule emcal_barrel_pion_rejection_analysis: "{DETECTOR_CONFIG}/results/Barrel_emcal_pion_rej.json", expand( "{{DETECTOR_CONFIG}}/results/emcal_barrel_pion_rej_uncut_comb_{var_save}.png", - var_save=["Esim", "EsimTot", "EDep6", "EDep6OverP", "pT", "eta", "EsimScFi", "EsimScFiOverP"], + var_save=[ + "Esim", + "EsimTot", + "EDep6", + "EDep6OverP", + "pT", + "eta", + "EsimScFi", + "EsimScFiOverP", + ], ), expand( "{{DETECTOR_CONFIG}}/results/emcal_barrel_pion_rej_uncut_comb_E{i}Eta{j}.png", @@ -187,7 +213,13 @@ rule emcal_barrel_pion_rejection_analysis: eta_bin=range(2, 4), tag=( ["cut_mom_ele", "cut_mom_pim", "cut_ratio_pim"] - + sum([[f"cut_{var}_ele", f"cut_{var}_pim", f"cut_{var}_comb"] for var in ["pT", "EDep6OverP"]], []) + + sum( + [ + [f"cut_{var}_ele", f"cut_{var}_pim", f"cut_{var}_comb"] + for var in ["pT", "EDep6OverP"] + ], + [], + ) ), extension=["pdf", "png"], ), diff --git a/benchmarks/ecal_gaps/Snakefile b/benchmarks/ecal_gaps/Snakefile index df6107a5..233d5766 100644 --- a/benchmarks/ecal_gaps/Snakefile +++ b/benchmarks/ecal_gaps/Snakefile @@ -3,7 +3,9 @@ import os rule ecal_gaps_sim: input: - steering_file=ancient("EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer"), + steering_file=ancient( + "EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer" + ), warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", output: "sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root", @@ -15,7 +17,7 @@ rule ecal_gaps_sim: PHASE_SPACE="(3to50|45to135|130to177)deg", INDEX="\d{4}", params: - N_EVENTS=1000 + N_EVENTS=1000, shell: """ set -m # monitor mode to prevent lingering processes @@ -41,7 +43,8 @@ rule ecal_gaps_recon: "sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log", wildcard_constraints: INDEX="\d{4}", - shell: """ + shell: + """ set -m # monitor mode to prevent lingering processes exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ eicrecon {input} -Ppodio:output_file={output} \ @@ -49,7 +52,8 @@ exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ """ -DETECTOR_CONFIG=os.environ["DETECTOR_CONFIG"] +DETECTOR_CONFIG = os.environ["DETECTOR_CONFIG"] + rule ecal_gaps: input: diff --git a/benchmarks/femc_electron/Snakefile b/benchmarks/femc_electron/Snakefile index 0e8dd084..ce5e9c7c 100644 --- a/benchmarks/femc_electron/Snakefile +++ b/benchmarks/femc_electron/Snakefile @@ -1,27 +1,28 @@ rule femc_electron_generate: - input: - script="benchmarks/femc_electron/analysis/gen_particles.cxx", - params: - NEVENTS_GEN=1000, - th_max=28, - th_min=2.0 - output: - GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc" - shell: - """ + input: + script="benchmarks/femc_electron/analysis/gen_particles.cxx", + params: + NEVENTS_GEN=1000, + th_max=28, + th_min=2.0, + output: + GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc", + shell: + """ mkdir -p sim_output/femc_electron root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "e-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' """ + rule femc_electron_simulate: - input: - GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc" - params: - PHYSICS_LIST="FTFP_BERT" - output: - SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root" - shell: - """ + input: + GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc", + params: + PHYSICS_LIST="FTFP_BERT", + output: + SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root", + shell: + """ NEVENTS_SIM=1000 # Running simulation npsim \ @@ -32,27 +33,31 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule femc_electron_recon: - input: - SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root" - output: - REC_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_rec_e-_{P}GeV.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root", + output: + REC_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_rec_e-_{P}GeV.edm4eic.root", + shell: + """ NEVENTS_REC=1000 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents=$NEVENTS_REC """ + rule femc_electron_analysis: - input: - expand("sim_output/femc_electron/{DETECTOR_CONFIG}_rec_e-_{P}GeV.edm4eic.root", - P=[10, 20, 30, 40, 50, 60, 70, 80], - DETECTOR_CONFIG=["{DETECTOR_CONFIG}"]), - script="benchmarks/femc_electron/analysis/femc_electron_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/femc_electron"), - shell: - """ + input: + expand( + "sim_output/femc_electron/{DETECTOR_CONFIG}_rec_e-_{P}GeV.edm4eic.root", + P=[10, 20, 30, 40, 50, 60, 70, 80], + DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], + ), + script="benchmarks/femc_electron/analysis/femc_electron_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/femc_electron"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ diff --git a/benchmarks/femc_photon/Snakefile b/benchmarks/femc_photon/Snakefile index 40524365..ffb3aa3d 100644 --- a/benchmarks/femc_photon/Snakefile +++ b/benchmarks/femc_photon/Snakefile @@ -1,27 +1,28 @@ rule femc_photon_generate: - input: - script="benchmarks/femc_photon/analysis/gen_particles.cxx", - params: - NEVENTS_GEN=1000, - th_max=28, - th_min=2.0 - output: - GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc" - shell: - """ + input: + script="benchmarks/femc_photon/analysis/gen_particles.cxx", + params: + NEVENTS_GEN=1000, + th_max=28, + th_min=2.0, + output: + GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc", + shell: + """ mkdir -p sim_output/femc_photon root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' """ + rule femc_photon_simulate: - input: - GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc" - params: - PHYSICS_LIST="FTFP_BERT" - output: - SIM_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_sim_photon_{P}GeV.edm4hep.root" - shell: - """ + input: + GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc", + params: + PHYSICS_LIST="FTFP_BERT", + output: + SIM_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_sim_photon_{P}GeV.edm4hep.root", + shell: + """ NEVENTS_SIM=1000 # Running simulation npsim \ @@ -32,27 +33,31 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule femc_photon_recon: - input: - SIM_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_sim_photon_{P}GeV.edm4hep.root" - output: - REC_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_rec_photon_{P}GeV.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_sim_photon_{P}GeV.edm4hep.root", + output: + REC_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_rec_photon_{P}GeV.edm4eic.root", + shell: + """ NEVENTS_REC=1000 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents=$NEVENTS_REC """ + rule femc_photon_analysis: - input: - expand("sim_output/femc_photon/{DETECTOR_CONFIG}_rec_photon_{P}GeV.edm4eic.root", - P=[10, 20, 30, 40, 50, 60, 70, 80], - DETECTOR_CONFIG=["{DETECTOR_CONFIG}"]), - script="benchmarks/femc_photon/analysis/femc_photon_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/femc_photon"), - shell: - """ + input: + expand( + "sim_output/femc_photon/{DETECTOR_CONFIG}_rec_photon_{P}GeV.edm4eic.root", + P=[10, 20, 30, 40, 50, 60, 70, 80], + DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], + ), + script="benchmarks/femc_photon/analysis/femc_photon_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/femc_photon"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ diff --git a/benchmarks/femc_pi0/Snakefile b/benchmarks/femc_pi0/Snakefile index 4936040c..636840dc 100644 --- a/benchmarks/femc_pi0/Snakefile +++ b/benchmarks/femc_pi0/Snakefile @@ -1,27 +1,28 @@ rule femc_pi0_generate: - input: - script="benchmarks/femc_pi0/analysis/gen_particles.cxx", - params: - NEVENTS_GEN=1000, - th_max=28, - th_min=2.0 - output: - GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc" - shell: - """ + input: + script="benchmarks/femc_pi0/analysis/gen_particles.cxx", + params: + NEVENTS_GEN=1000, + th_max=28, + th_min=2.0, + output: + GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc", + shell: + """ mkdir -p sim_output/femc_pi0 root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "pi0", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' """ + rule femc_pi0_simulate: - input: - GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc" - params: - PHYSICS_LIST="FTFP_BERT" - output: - SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root" - shell: - """ + input: + GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc", + params: + PHYSICS_LIST="FTFP_BERT", + output: + SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root", + shell: + """ NEVENTS_SIM=1000 # Running simulation npsim \ @@ -32,27 +33,31 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule femc_pi0_recon: - input: - SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root" - output: - REC_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_rec_pi0_{P}GeV.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root", + output: + REC_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_rec_pi0_{P}GeV.edm4eic.root", + shell: + """ NEVENTS_REC=1000 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents=$NEVENTS_REC """ + rule femc_pi0_analysis: - input: - expand("sim_output/femc_pi0/{DETECTOR_CONFIG}_rec_pi0_{P}GeV.edm4eic.root", - P=[10, 20, 30, 40, 50, 60, 70, 80], - DETECTOR_CONFIG=["{DETECTOR_CONFIG}"]), - script="benchmarks/femc_pi0/analysis/femc_pi0_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/femc_pi0"), - shell: - """ + input: + expand( + "sim_output/femc_pi0/{DETECTOR_CONFIG}_rec_pi0_{P}GeV.edm4eic.root", + P=[10, 20, 30, 40, 50, 60, 70, 80], + DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], + ), + script="benchmarks/femc_pi0/analysis/femc_pi0_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/femc_pi0"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ diff --git a/benchmarks/insert_muon/Snakefile b/benchmarks/insert_muon/Snakefile index a9a32168..ee2edbae 100644 --- a/benchmarks/insert_muon/Snakefile +++ b/benchmarks/insert_muon/Snakefile @@ -1,27 +1,28 @@ rule insert_muon_generate: - input: - script="benchmarks/insert_muon/analysis/gen_particles.cxx", - params: - NEVENTS_GEN=5000, - th_max=7.0, - th_min=1.7 - output: - GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc" - shell: - """ + input: + script="benchmarks/insert_muon/analysis/gen_particles.cxx", + params: + NEVENTS_GEN=5000, + th_max=7.0, + th_min=1.7, + output: + GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc", + shell: + """ root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "mu-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' """ + rule insert_muon_simulate: - input: - GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc", - warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", - params: - PHYSICS_LIST="FTFP_BERT" - output: - SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root" - shell: - """ + input: + GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc", + warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", + params: + PHYSICS_LIST="FTFP_BERT", + output: + SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root", + shell: + """ NEVENTS_SIM=1000 # Running simulation npsim \ @@ -33,29 +34,32 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule insert_muon_recon: - input: - SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root" - output: - REC_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_rec_mu-_{P}GeV_{INDEX}.edm4hep.root" - shell: - """ + input: + SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root", + output: + REC_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_rec_mu-_{P}GeV_{INDEX}.edm4hep.root", + shell: + """ NEVENTS_REC=1000 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC """ + rule insert_muon_analysis: - input: - expand("sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root", - P=[50], - DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], - INDEX=range(5), - ), - script="benchmarks/insert_muon/analysis/muon_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/insert_muon"), - shell: - """ + input: + expand( + "sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root", + P=[50], + DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], + INDEX=range(5), + ), + script="benchmarks/insert_muon/analysis/muon_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/insert_muon"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ diff --git a/benchmarks/lfhcal/Snakefile b/benchmarks/lfhcal/Snakefile index 24e12d0c..88720971 100644 --- a/benchmarks/lfhcal/Snakefile +++ b/benchmarks/lfhcal/Snakefile @@ -12,7 +12,7 @@ rule lfhcal_sim: PHASE_SPACE="3to50deg", INDEX="\d{4}", params: - N_EVENTS=1000 + N_EVENTS=1000, shell: """ ddsim \ @@ -37,32 +37,45 @@ rule lfhcal_recon: "sim_output/lfhcal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log", wildcard_constraints: INDEX="\d{4}", - shell: """ + shell: + """ env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ eicrecon {input} -Ppodio:output_file={output} \ -Ppodio:output_collections=MCParticles,ReconstructedParticles,LFHCALTruthClusters,LFHCALClusters,LFHCALHits,EcalEndcapPTruthClusters,EcalEndcapPClusters,EcalEndcapPHits """ + rule lfhcal_at_momentum: input: script="benchmarks/lfhcal/LFHCAL_Performance.C", # TODO pass as a file list? - sim=lambda wildcards: - expand( - "sim_output/lfhcal/{DETECTOR_CONFIG}/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", - DETECTOR_CONFIG="epic_craterlake", - ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV", - PHASE_SPACE=["3to50deg"], - INDEX=range(1), - ) - if wildcards.CAMPAIGN == "local" else - ancient(expand( - "EPIC/RECO/{{CAMPAIGN}}/epic_craterlake/SINGLE/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", - DETECTOR_CONFIG="epic_craterlake", - ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV", - PHASE_SPACE=["3to50deg"], - INDEX=range(1), - )), + sim=lambda wildcards: ( + expand( + "sim_output/lfhcal/{DETECTOR_CONFIG}/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", + DETECTOR_CONFIG="epic_craterlake", + ENERGY=( + f"{float(wildcards.MOMENTUM):.0f}GeV" + if float(wildcards.MOMENTUM) >= 1 + else f"{float(wildcards.MOMENTUM)*1000:.0f}MeV" + ), + PHASE_SPACE=["3to50deg"], + INDEX=range(1), + ) + if wildcards.CAMPAIGN == "local" + else ancient( + expand( + "EPIC/RECO/{{CAMPAIGN}}/epic_craterlake/SINGLE/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", + DETECTOR_CONFIG="epic_craterlake", + ENERGY=( + f"{float(wildcards.MOMENTUM):.0f}GeV" + if float(wildcards.MOMENTUM) >= 1 + else f"{float(wildcards.MOMENTUM)*1000:.0f}MeV" + ), + PHASE_SPACE=["3to50deg"], + INDEX=range(1), + ) + ) + ), output: "{CAMPAIGN}/{PARTICLE}/mom/lfhcal_mom_{MOMENTUM}_mom_resol_{PARTICLE}.root", combined_root=temp("{CAMPAIGN}/lfhcal_sim_{MOMENTUM}_{PARTICLE}.root"), @@ -73,6 +86,7 @@ cd {wildcards.CAMPAIGN} root -l -b -q ../{input.script}'("../{output.combined_root}", "{wildcards.PARTICLE}", {wildcards.MOMENTUM}, 0.15)' """ + rule lfhcal_summary_at_eta: input: expand( @@ -105,20 +119,29 @@ cd {wildcards.CAMPAIGN} root -l -b -q ../{input.script}'("{wildcards.PARTICLE}", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")' """ -LFHCAL_ETA_BINS = [1.2,1.5,2,2.5,3,3.5] + +LFHCAL_ETA_BINS = [1.2, 1.5, 2, 2.5, 3, 3.5] + 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:]) ], - 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: - directory("results/lfhcal/{CAMPAIGN}/") + directory("results/lfhcal/{CAMPAIGN}/"), shell: """ mkdir {output} @@ -142,4 +165,4 @@ rule lfhcal_campaigns: "24.03.1", "24.04.0", ], - ) + ), diff --git a/benchmarks/material_scan/Snakefile b/benchmarks/material_scan/Snakefile index b295715a..b5f8f354 100644 --- a/benchmarks/material_scan/Snakefile +++ b/benchmarks/material_scan/Snakefile @@ -1,10 +1,12 @@ rule material_scan_fetch_script: output: - "material_scan.py", - shell: """ + "material_scan.py", + shell: + """ curl -L --output {output} https://github.com/eic/epic/raw/main/scripts/subdetector_tests/material_scan.py """ + rule material_scan: input: script="material_scan.py", @@ -14,8 +16,10 @@ rule material_scan: "{DETECTOR_CONFIG}/results/material_scan_details.pdf", log: "{DETECTOR_CONFIG}/results/material_scan.log", - shadow: "full" # avoid putting calibrations/fieldmaps to results - shell: """ + shadow: + "full" # avoid putting calibrations/fieldmaps to results + shell: + """ cd {wildcards.DETECTOR_CONFIG}/results python ../../{input.script} $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml """ diff --git a/benchmarks/zdc_lambda/Snakefile b/benchmarks/zdc_lambda/Snakefile index 9ffd1701..554c2f06 100644 --- a/benchmarks/zdc_lambda/Snakefile +++ b/benchmarks/zdc_lambda/Snakefile @@ -1,25 +1,26 @@ rule zdc_lambda_generate: - 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: - """ + 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: + """ root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})' """ + rule zdc_lambda_simulate: - 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: - """ + 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: + """ NEVENTS_SIM=200 # Running simulation npsim \ @@ -31,29 +32,32 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule zdc_lambda_recon: - input: - SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root" - output: - REC_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root", + output: + REC_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root", + shell: + """ NEVENTS_REC=200 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 zdc_lambda_analysis: - 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], - 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: - """ + 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], + 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: + """ 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..f03bd7e2 100644 --- a/benchmarks/zdc_sigma/Snakefile +++ b/benchmarks/zdc_sigma/Snakefile @@ -1,25 +1,26 @@ rule zdc_sigma_generate: - 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: - """ + 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: + """ root -l -b -q '{input.script}({params.NEVENTS_GEN},0,"{output.GEN_FILE}",{wildcards.P},{wildcards.P})' """ + rule zdc_sigma_simulate: - 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: - """ + 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: + """ NEVENTS_SIM=200 # Running simulation npsim \ @@ -31,29 +32,32 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule zdc_sigma_recon: - input: - SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root" - output: - REC_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root", + output: + REC_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root", + shell: + """ NEVENTS_REC=200 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 zdc_sigma_analysis: - 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}"], - INDEX=range(5), - ), - script="benchmarks/zdc_sigma/analysis/sigma_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"), - shell: - """ + 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}"], + INDEX=range(5), + ), + script="benchmarks/zdc_sigma/analysis/sigma_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ From 000d9b007b3ef18f549809aedc3ff4de85df2f6e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 11 Oct 2024 19:36:35 -0400 Subject: [PATCH 4/9] zdc_lyso: fix tabs --- benchmarks/zdc_lyso/Snakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/zdc_lyso/Snakefile b/benchmarks/zdc_lyso/Snakefile index a0b6cbfc..4e79e227 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: From 95371a6c04cbd557362490583dc4b0aa0198351c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:36:40 +0000 Subject: [PATCH 5/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- benchmarks/zdc_photon/Snakefile | 74 +++++++++++++++++---------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/benchmarks/zdc_photon/Snakefile b/benchmarks/zdc_photon/Snakefile index 2ca2ad3d..56c82b92 100644 --- a/benchmarks/zdc_photon/Snakefile +++ b/benchmarks/zdc_photon/Snakefile @@ -1,28 +1,29 @@ rule zdc_photon_generate: - 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: - """ + 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: + """ 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: - 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: - """ + 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: + """ # Running simulation NEVENTS_SIM=200 npsim \ @@ -34,29 +35,32 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule zdc_photon_recon: - input: - SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root" - output: - REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root", + output: + REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root", + shell: + """ NEVENTS_REC=200 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits -Pjana:nevents=$NEVENTS_REC """ + rule zdc_photon_analysis: - 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], - 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: - """ + 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], + 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: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ From 3ea24cf1f723c8ce7cb78f4a3edf9521c68dd89a Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 11 Oct 2024 19:39:29 -0400 Subject: [PATCH 6/9] tracking_performances_dis: consistent spaces --- benchmarks/tracking_performances_dis/Snakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/tracking_performances_dis/Snakefile b/benchmarks/tracking_performances_dis/Snakefile index 7774f2a1..fe2d6ead 100644 --- a/benchmarks/tracking_performances_dis/Snakefile +++ b/benchmarks/tracking_performances_dis/Snakefile @@ -65,7 +65,7 @@ rule trk_dis_analysis: PREFIX= ".*", EBEAM="\d+", PBEAM="\d+", - MINQ2="\d+", + MINQ2="\d+", INDEX="\d+", shell: """ @@ -93,7 +93,7 @@ rule trk_dis_combine: PREFIX= ".*", EBEAM="\d+", PBEAM="\d+", - MINQ2="\d+", + MINQ2="\d+", NUM_FILES="\d+", shell: """ @@ -123,7 +123,7 @@ rule trk_dis_plots: PREFIX= ".*", EBEAM="\d+", PBEAM="\d+", - MINQ2="\d+", + MINQ2="\d+", NUM_FILES="\d+", shell: """ From 8a41f707d9ee9ade0afea7c646f39c78499a0bb6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:39:35 +0000 Subject: [PATCH 7/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Snakefile | 37 +++++--- benchmarks/backgrounds/Snakefile | 17 +++- benchmarks/backwards_ecal/Snakefile | 46 ++++++--- benchmarks/barrel_ecal/Snakefile | 6 +- benchmarks/insert_neutron/Snakefile | 76 ++++++++------- benchmarks/tracking_performances/Snakefile | 95 ++++++++++++------- .../tracking_performances_dis/Snakefile | 34 ++++--- benchmarks/zdc_lyso/Snakefile | 31 +++--- benchmarks/zdc_pi0/Snakefile | 72 +++++++------- 9 files changed, 248 insertions(+), 166 deletions(-) diff --git a/Snakefile b/Snakefile index 1390e867..d8ee42a1 100644 --- a/Snakefile +++ b/Snakefile @@ -1,5 +1,6 @@ configfile: "snakemake.yml" + include: "benchmarks/backgrounds/Snakefile" include: "benchmarks/backwards_ecal/Snakefile" include: "benchmarks/barrel_ecal/Snakefile" @@ -19,6 +20,7 @@ include: "benchmarks/femc_electron/Snakefile" include: "benchmarks/femc_photon/Snakefile" include: "benchmarks/femc_pi0/Snakefile" + use_s3 = config["remote_provider"].lower() == "s3" use_xrootd = config["remote_provider"].lower() == "xrootd" @@ -29,32 +31,45 @@ def get_remote_path(path): elif use_xrootd: return f"root://dtn-eic.jlab.org//work/eic2/{path}" else: - raise runtime_exception('Unexpected value for config["remote_provider"]: {config["remote_provider"]}') + raise runtime_exception( + 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' + ) rule fetch_epic: output: - filepath="EPIC/{PATH}" + filepath="EPIC/{PATH}", params: # wildcards are not included in hash for caching, we need to add them as params - PATH=lambda wildcards: wildcards.PATH + PATH=lambda wildcards: wildcards.PATH, cache: True retries: 3 - shell: """ + shell: + ( + """ xrdcp --debug 2 root://dtn-eic.jlab.org//work/eic2/{output.filepath} {output.filepath} -""" if use_xrootd else """ +""" + if use_xrootd + else ( + """ mc cp S3/eictest/{output.filepath} {output.filepath} -""" if use_s3 else f""" -echo 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' -exit 1 """ + if use_s3 + else f""" + echo 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' + exit 1 + """ + ) + ) rule warmup_run: output: "warmup/{DETECTOR_CONFIG}.edm4hep.root", - message: "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}" - shell: """ + message: + "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}" + shell: + """ set -m # monitor mode to prevent lingering processes exec ddsim \ --runType batch \ @@ -80,7 +95,7 @@ rule org2py: notebook=workflow.basedir + "/{NOTEBOOK}.org", converter=workflow.source_path("benchmarks/common/org2py.awk"), output: - "{NOTEBOOK}.py" + "{NOTEBOOK}.py", shell: """ awk -f {input.converter} {input.notebook} > {output} diff --git a/benchmarks/backgrounds/Snakefile b/benchmarks/backgrounds/Snakefile index 7aac8808..ffd0c859 100644 --- a/benchmarks/backgrounds/Snakefile +++ b/benchmarks/backgrounds/Snakefile @@ -27,17 +27,24 @@ exec ddsim \ """ -DETECTOR_CONFIG=os.environ["DETECTOR_CONFIG"] +DETECTOR_CONFIG = os.environ["DETECTOR_CONFIG"] + rule backgrounds_ecal_backwards: input: matplotlibrc=".matplotlibrc", script="benchmarks/backgrounds/ecal_backwards.py", - electron_beam_gas_sim="sim_output/" + DETECTOR_CONFIG + "/backgrounds/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/GETaLM1.0.0-1.0/10GeV/GETaLM1.0.0-1.0_ElectronBeamGas_10GeV_foam_emin10keV_run001.edm4hep.root", - physics_signal_sim="sim_output/" + DETECTOR_CONFIG + "/backgrounds/EPIC/EVGEN/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.edm4hep.root", - proton_beam_gas_sim="sim_output/" + DETECTOR_CONFIG + "/backgrounds/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run001.edm4hep.root", + electron_beam_gas_sim="sim_output/" + + DETECTOR_CONFIG + + "/backgrounds/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/GETaLM1.0.0-1.0/10GeV/GETaLM1.0.0-1.0_ElectronBeamGas_10GeV_foam_emin10keV_run001.edm4hep.root", + physics_signal_sim="sim_output/" + + DETECTOR_CONFIG + + "/backgrounds/EPIC/EVGEN/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.edm4hep.root", + proton_beam_gas_sim="sim_output/" + + DETECTOR_CONFIG + + "/backgrounds/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run001.edm4hep.root", output: - directory("results/backgrounds/backwards_ecal") + directory("results/backgrounds/backwards_ecal"), threads: workflow.cores shell: """ diff --git a/benchmarks/backwards_ecal/Snakefile b/benchmarks/backwards_ecal/Snakefile index 003d0ab7..3f25a274 100644 --- a/benchmarks/backwards_ecal/Snakefile +++ b/benchmarks/backwards_ecal/Snakefile @@ -1,13 +1,15 @@ def get_n_events(wildcards): energy = float(wildcards.ENERGY.replace("GeV", "").replace("MeV", "e-3")) n_events = 1000 if wildcards.PARTICLE == "e-" else 2000 - n_events = int(n_events // (energy ** 0.5)) + n_events = int(n_events // (energy**0.5)) return n_events rule backwards_ecal_sim: input: - steering_file=ancient("EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer"), + steering_file=ancient( + "EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer" + ), warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", output: "sim_output/backwards_ecal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root", @@ -19,7 +21,7 @@ rule backwards_ecal_sim: PHASE_SPACE="(3to50|45to135|130to177)deg", INDEX="\d{4}", params: - N_EVENTS=get_n_events + N_EVENTS=get_n_events, shell: """ set -m # monitor mode to prevent lingering processes @@ -45,7 +47,8 @@ rule backwards_ecal_recon: "sim_output/backwards_ecal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log", wildcard_constraints: INDEX="\d{4}", - shell: """ + shell: + """ set -m # monitor mode to prevent lingering processes exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ eicrecon {input} -Ppodio:output_file={output} \ @@ -60,15 +63,20 @@ rule backwards_ecal_recon_many: INDEX=range(20), ), output: - touch("sim_output/backwards_ecal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/flag"), + touch( + "sim_output/backwards_ecal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/flag" + ), -DETECTOR_CONFIG=os.environ["DETECTOR_CONFIG"] +DETECTOR_CONFIG = os.environ["DETECTOR_CONFIG"] + rule backwards_ecal: input: expand( - "sim_output/backwards_ecal/" + DETECTOR_CONFIG + "/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/flag", + "sim_output/backwards_ecal/" + + DETECTOR_CONFIG + + "/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/flag", PARTICLE=["pi-", "e-"], ENERGY=[ "100MeV", @@ -85,14 +93,22 @@ rule backwards_ecal: matplotlibrc=".matplotlibrc", script="benchmarks/backwards_ecal/backwards_ecal.py", output: - directory("results/backwards_ecal") + directory("results/backwards_ecal"), shell: - """ + ( + """ env \ MATPLOTLIBRC={input.matplotlibrc} \ -DETECTOR_CONFIG=""" + DETECTOR_CONFIG + """ \ -PLOT_TITLE=""" + DETECTOR_CONFIG + """ \ -INPUT_PATH_FORMAT=sim_output/backwards_ecal/""" + DETECTOR_CONFIG + """/{{particle}}/{{energy}}/130to177deg/{{particle}}_{{energy}}_130to177deg.{{ix:04d}}.eicrecon.tree.edm4eic.root \ -OUTPUT_DIR={output} \ -python {input.script} -""" +DETECTOR_CONFIG=""" + + DETECTOR_CONFIG + + """ \ + PLOT_TITLE=""" + + DETECTOR_CONFIG + + """ \ + INPUT_PATH_FORMAT=sim_output/backwards_ecal/""" + + DETECTOR_CONFIG + + """/{{particle}}/{{energy}}/130to177deg/{{particle}}_{{energy}}_130to177deg.{{ix:04d}}.eicrecon.tree.edm4eic.root \ + OUTPUT_DIR={output} \ + python {input.script} + """ + ) diff --git a/benchmarks/barrel_ecal/Snakefile b/benchmarks/barrel_ecal/Snakefile index 88fb7958..161de6ff 100644 --- a/benchmarks/barrel_ecal/Snakefile +++ b/benchmarks/barrel_ecal/Snakefile @@ -37,9 +37,9 @@ exec ddsim \ --compactFile """ + DETECTOR_PATH + """/{wildcards.DETECTOR_CONFIG}.xml \ - --inputFiles {input} \ - --outputFile {output} - """ + --inputFiles {input} \ + --outputFile {output} + """ ) diff --git a/benchmarks/insert_neutron/Snakefile b/benchmarks/insert_neutron/Snakefile index 136c56e2..19947959 100644 --- a/benchmarks/insert_neutron/Snakefile +++ b/benchmarks/insert_neutron/Snakefile @@ -1,28 +1,29 @@ rule insert_neutron_generate: - input: - script="benchmarks/insert_neutron/analysis/gen_particles.cxx", - params: - NEVENTS_GEN=1000, - th_max=5.7, - th_min=2.0 - output: - GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc" - shell: - """ + input: + script="benchmarks/insert_neutron/analysis/gen_particles.cxx", + params: + NEVENTS_GEN=1000, + th_max=5.7, + th_min=2.0, + output: + GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc", + shell: + """ mkdir -p sim_output/insert_neutron root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "neutron", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' """ + rule insert_neutron_simulate: - input: - GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc", - warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", - params: - PHYSICS_LIST="FTFP_BERT" - output: - SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root" - shell: - """ + input: + GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc", + warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", + params: + PHYSICS_LIST="FTFP_BERT", + output: + SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root", + shell: + """ NEVENTS_SIM=200 # Running simulation npsim \ @@ -34,29 +35,32 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule insert_neutron_recon: - input: - SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root" - output: - REC_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_rec_neutron_{P}GeV_{INDEX}.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root", + output: + REC_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_rec_neutron_{P}GeV_{INDEX}.edm4eic.root", + shell: + """ NEVENTS_REC=200 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC """ + rule insert_neutron_analysis: - input: - expand("sim_output/insert_neutron/{DETECTOR_CONFIG}_rec_neutron_{P}GeV_{INDEX}.edm4eic.root", - P=[20, 30, 40, 50, 60, 70, 80], - DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], - INDEX=range(5), - ), - script="benchmarks/insert_neutron/analysis/neutron_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/insert_neutron"), - shell: - """ + input: + expand( + "sim_output/insert_neutron/{DETECTOR_CONFIG}_rec_neutron_{P}GeV_{INDEX}.edm4eic.root", + P=[20, 30, 40, 50, 60, 70, 80], + DETECTOR_CONFIG=["{DETECTOR_CONFIG}"], + INDEX=range(5), + ), + script="benchmarks/insert_neutron/analysis/neutron_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/insert_neutron"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ diff --git a/benchmarks/tracking_performances/Snakefile b/benchmarks/tracking_performances/Snakefile index a197d8a7..59ebfa35 100644 --- a/benchmarks/tracking_performances/Snakefile +++ b/benchmarks/tracking_performances/Snakefile @@ -1,6 +1,8 @@ rule tracking_performance_sim: input: - steering_file=ancient("EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer"), + steering_file=ancient( + "EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer" + ), warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", output: "sim_output/tracking_performance/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root", @@ -12,7 +14,7 @@ rule tracking_performance_sim: PHASE_SPACE="(3to50|45to135|130to177)deg", INDEX="\d{4}", params: - N_EVENTS=10000 + N_EVENTS=10000, shell: """ set -m # monitor mode to prevent lingering processes @@ -38,7 +40,8 @@ rule tracking_performance_recon: "sim_output/tracking_performance/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log", wildcard_constraints: INDEX="\d{4}", - shell: """ + shell: + """ set -m # monitor mode to prevent lingering processes exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ eicrecon {input} -Ppodio:output_file={output} \ @@ -50,26 +53,39 @@ rule tracking_performance_at_momentum: input: script="benchmarks/tracking_performances/Tracking_Performances.C", # TODO pass as a file list? - sim=lambda wildcards: - expand( - "sim_output/tracking_performance/{DETECTOR_CONFIG}/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", - DETECTOR_CONFIG="epic_craterlake_tracking_only", - ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV", - PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"], - INDEX=range(1), - ) - if wildcards.CAMPAIGN == "local" else - ancient(expand( - "EPIC/RECO/{{CAMPAIGN}}/epic_craterlake/SINGLE/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", - DETECTOR_CONFIG="epic_craterlake", - ENERGY=f"{float(wildcards.MOMENTUM):.0f}GeV" if float(wildcards.MOMENTUM) >= 1 else f"{float(wildcards.MOMENTUM) * 1000:.0f}MeV", - PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"], - INDEX=range(1), - )), + sim=lambda wildcards: ( + expand( + "sim_output/tracking_performance/{DETECTOR_CONFIG}/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", + DETECTOR_CONFIG="epic_craterlake_tracking_only", + ENERGY=( + f"{float(wildcards.MOMENTUM):.0f}GeV" + if float(wildcards.MOMENTUM) >= 1 + else f"{float(wildcards.MOMENTUM)*1000:.0f}MeV" + ), + PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"], + INDEX=range(1), + ) + if wildcards.CAMPAIGN == "local" + else ancient( + expand( + "EPIC/RECO/{{CAMPAIGN}}/epic_craterlake/SINGLE/{{PARTICLE}}/{ENERGY}/{PHASE_SPACE}/{{PARTICLE}}_{ENERGY}_{PHASE_SPACE}.{INDEX:04d}.eicrecon.tree.edm4eic.root", + DETECTOR_CONFIG="epic_craterlake", + ENERGY=( + f"{float(wildcards.MOMENTUM):.0f}GeV" + if float(wildcards.MOMENTUM) >= 1 + else f"{float(wildcards.MOMENTUM)*1000:.0f}MeV" + ), + PHASE_SPACE=["3to50deg", "45to135deg", "130to177deg"], + INDEX=range(1), + ) + ) + ), output: "{CAMPAIGN}/{SEEDING}/pi-/mom/Performances_mom_{MOMENTUM}_mom_resol_{SEEDING_IGNORE}_{PARTICLE}.root", "{CAMPAIGN}/{SEEDING}/pi-/dca/Performances_dca_{MOMENTUM}_dca_resol_{SEEDING_IGNORE}_{PARTICLE}.root", - combined_root=temp("{CAMPAIGN}/sim_{SEEDING}_{MOMENTUM}_{SEEDING_IGNORE}_{PARTICLE}.root"), + combined_root=temp( + "{CAMPAIGN}/sim_{SEEDING}_{MOMENTUM}_{SEEDING_IGNORE}_{PARTICLE}.root" + ), shell: """ if [[ "{wildcards.SEEDING}" == "truthseed" ]]; then @@ -106,18 +122,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}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")' @@ -144,18 +160,25 @@ ls {output} TRACKING_PERFORMANCE_ETA_BINS = [-3.5, -2.5, -1.0, 1.0, 2.5, 3.5] + rule tracking_performance: input: expand( [ "{{CAMPAIGN}}/Final_Results/pi-/mom/mom_resol_{ETA_BIN}.png", - "{{CAMPAIGN}}/Final_Results/pi-/mom/mom_resol_{ETA_BIN}.root", - "{{CAMPAIGN}}/Debug_Plots/pi-/mom/mom_resol_debug_{ETA_BIN}.png", + "{{CAMPAIGN}}/Final_Results/pi-/mom/mom_resol_{ETA_BIN}.root", + "{{CAMPAIGN}}/Debug_Plots/pi-/mom/mom_resol_debug_{ETA_BIN}.png", + ], + ETA_BIN=[ + f"{eta_min:.1f}_eta_{eta_max:.1f}" + for eta_min, eta_max in zip( + TRACKING_PERFORMANCE_ETA_BINS[:-1], + TRACKING_PERFORMANCE_ETA_BINS[1:], + ) ], - ETA_BIN=[f"{eta_min:.1f}_eta_{eta_max:.1f}" for eta_min, eta_max in zip(TRACKING_PERFORMANCE_ETA_BINS[:-1], TRACKING_PERFORMANCE_ETA_BINS[1:])], ), output: - directory("results/tracking_performances/{CAMPAIGN}/") + directory("results/tracking_performances/{CAMPAIGN}/"), shell: """ mkdir {output} @@ -179,4 +202,4 @@ rule tracking_performance_campaigns: "24.03.1", "24.04.0", ], - ) + ), diff --git a/benchmarks/tracking_performances_dis/Snakefile b/benchmarks/tracking_performances_dis/Snakefile index fe2d6ead..5676aed3 100644 --- a/benchmarks/tracking_performances_dis/Snakefile +++ b/benchmarks/tracking_performances_dis/Snakefile @@ -1,5 +1,6 @@ import os + rule compile_analysis: input: "{path}/{filename}.cxx", @@ -12,10 +13,12 @@ rule compile_analysis: root -l -b -q -e '.L {input}+' """ + 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/trk_dis_plots_cxx.so", + # Process the generated HepMC files through the simulation rule trk_dis_sim: @@ -38,6 +41,7 @@ ddsim \ --outputFile {output} """ + # Process the files produced in the previous step through EICRecon rule trk_dis_reco: input: @@ -52,6 +56,7 @@ exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ -Ppodio:output_collections=MCParticles,ReconstructedChargedParticles,ReconstructedTruthSeededChargedParticles,CentralCKFTrackAssociations,CentralCKFTruthSeededTrackAssociations """ + # Process the files -- either from the campaign or local running -- through the analysis script rule trk_dis_analysis: input: @@ -62,7 +67,7 @@ rule trk_dis_analysis: config="results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_{INDEX}/config.json", hists="results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_{INDEX}/hists.root", wildcard_constraints: - PREFIX= ".*", + PREFIX=".*", EBEAM="\d+", PBEAM="\d+", MINQ2="\d+", @@ -82,15 +87,19 @@ EOF root -l -b -q '{input.script}+("{output.config}")' """ -#Merge all the files produced in the previous step + +# Merge all the files produced in the previous step rule trk_dis_combine: input: - lambda wildcards: [f"results/tracking_performances_dis/{wildcards.DETECTOR_CONFIG}/{wildcards.PREFIX}pythia8NCDIS_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}_{ix}/hists.root" for ix in range(1,int(wildcards.NUM_FILES)+1)], + lambda wildcards: [ + f"results/tracking_performances_dis/{wildcards.DETECTOR_CONFIG}/{wildcards.PREFIX}pythia8NCDIS_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}_{ix}/hists.root" + for ix in range(1, int(wildcards.NUM_FILES) + 1) + ], output: config="results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/config.json", hists="results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/hists.root", wildcard_constraints: - PREFIX= ".*", + PREFIX=".*", EBEAM="\d+", PBEAM="\d+", MINQ2="\d+", @@ -111,16 +120,17 @@ EOF hadd {output.hists} {input} """ -#Process the merged file through the plotting script + +# Process the merged file through the plotting script rule trk_dis_plots: input: script="benchmarks/tracking_performances_dis/analysis/trk_dis_plots.cxx", script_compiled="benchmarks/tracking_performances_dis/analysis/trk_dis_plots_cxx.so", config="results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/config.json", output: - "results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/plots.pdf" + "results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/plots.pdf", wildcard_constraints: - PREFIX= ".*", + PREFIX=".*", EBEAM="\d+", PBEAM="\d+", MINQ2="\d+", @@ -131,10 +141,12 @@ root -l -b -q '{input.script}+("{input.config}")' """ -#Examples of invocation +# Examples of invocation rule trk_dis_run_locally: input: - "results/tracking_performances_dis/" + os.environ["DETECTOR_CONFIG"] + "/pythia8NCDIS_18x275_minQ2=1_combined_5/plots.pdf", + "results/tracking_performances_dis/" + + os.environ["DETECTOR_CONFIG"] + + "/pythia8NCDIS_18x275_minQ2=1_combined_5/plots.pdf", message: "See output in {input[0]}" @@ -144,5 +156,3 @@ rule trk_dis_run_locally_trk_only: "results/tracking_performances_dis/epic_craterlake_tracking_only/pythia8NCDIS_18x275_minQ2=1_combined_5/plots.pdf", message: "See output in {input[0]}" - - diff --git a/benchmarks/zdc_lyso/Snakefile b/benchmarks/zdc_lyso/Snakefile index 4e79e227..a7b13d75 100644 --- a/benchmarks/zdc_lyso/Snakefile +++ b/benchmarks/zdc_lyso/Snakefile @@ -3,7 +3,7 @@ import os rule zdc_lyso_sim_hepmc: input: - script = "benchmarks/zdc_lyso/gen_particles.cxx", + script="benchmarks/zdc_lyso/gen_particles.cxx", output: hepmcfile="data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc", log: @@ -54,11 +54,13 @@ mv podio_output.root {output} rule zdc_lyso_analysis: input: - expand("sim_output/zdc_lyso/{{DETECTOR_CONFIG}}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root", - PARTICLE=["gamma"], - BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"], - THETA_MIN=["0"], - THETA_MAX=["0.3"]), + expand( + "sim_output/zdc_lyso/{{DETECTOR_CONFIG}}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root", + 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", output: "results/{DETECTOR_CONFIG}/zdc_lyso/plots.pdf", @@ -71,16 +73,17 @@ python {input.script} # Examples of invocation rule zdc_lyso_hepmc: input: - expand("data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc", - PARTICLE=["gamma"], - BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"], - THETA_MIN=["0"], - THETA_MAX=["0.3"]) + expand( + "data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc", + PARTICLE=["gamma"], + BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"], + THETA_MIN=["0"], + THETA_MAX=["0.3"], + ), rule zdc_lyso_local: - input: + input: "results/" + os.environ["DETECTOR_CONFIG"] + "/zdc_lyso/plots.pdf", - message: + message: "See output in {input[0]}" - diff --git a/benchmarks/zdc_pi0/Snakefile b/benchmarks/zdc_pi0/Snakefile index c2a67993..7905bede 100644 --- a/benchmarks/zdc_pi0/Snakefile +++ b/benchmarks/zdc_pi0/Snakefile @@ -1,26 +1,27 @@ rule zdc_pi0_generate: - 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: - """ + 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: + """ 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: - 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: - """ + 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: + """ NEVENTS_SIM=200 # Running simulation npsim \ @@ -32,29 +33,32 @@ npsim \ --outputFile {output.SIM_FILE} """ + rule zdc_pi0_recon: - input: - SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root" - output: - REC_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root" - shell: - """ + input: + SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root", + output: + REC_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root", + shell: + """ NEVENTS_REC=200 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits -Pjana:nevents=$NEVENTS_REC """ + rule zdc_pi0_analysis: - 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}"], - INDEX=range(5), - ), - script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py", - output: - results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"), - shell: - """ + 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}"], + INDEX=range(5), + ), + script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py", + output: + results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"), + shell: + """ mkdir -p {output.results_dir} python {input.script} {output.results_dir} """ From ec0b53d004565d2657554cc4a6cbce5dca36d393 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:40:34 +0000 Subject: [PATCH 8/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Snakefile | 6 +++--- benchmarks/backwards_ecal/Snakefile | 10 +++++----- benchmarks/barrel_ecal/Snakefile | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Snakefile b/Snakefile index d8ee42a1..b3687b24 100644 --- a/Snakefile +++ b/Snakefile @@ -56,9 +56,9 @@ mc cp S3/eictest/{output.filepath} {output.filepath} """ if use_s3 else f""" - echo 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' - exit 1 - """ + echo 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' + exit 1 + """ ) ) diff --git a/benchmarks/backwards_ecal/Snakefile b/benchmarks/backwards_ecal/Snakefile index 3f25a274..7a501b5e 100644 --- a/benchmarks/backwards_ecal/Snakefile +++ b/benchmarks/backwards_ecal/Snakefile @@ -102,13 +102,13 @@ MATPLOTLIBRC={input.matplotlibrc} \ DETECTOR_CONFIG=""" + DETECTOR_CONFIG + """ \ - PLOT_TITLE=""" + PLOT_TITLE=""" + DETECTOR_CONFIG + """ \ - INPUT_PATH_FORMAT=sim_output/backwards_ecal/""" + INPUT_PATH_FORMAT=sim_output/backwards_ecal/""" + DETECTOR_CONFIG + """/{{particle}}/{{energy}}/130to177deg/{{particle}}_{{energy}}_130to177deg.{{ix:04d}}.eicrecon.tree.edm4eic.root \ - OUTPUT_DIR={output} \ - python {input.script} - """ + OUTPUT_DIR={output} \ + python {input.script} + """ ) diff --git a/benchmarks/barrel_ecal/Snakefile b/benchmarks/barrel_ecal/Snakefile index 161de6ff..3637544e 100644 --- a/benchmarks/barrel_ecal/Snakefile +++ b/benchmarks/barrel_ecal/Snakefile @@ -37,9 +37,9 @@ exec ddsim \ --compactFile """ + DETECTOR_PATH + """/{wildcards.DETECTOR_CONFIG}.xml \ - --inputFiles {input} \ - --outputFile {output} - """ + --inputFiles {input} \ + --outputFile {output} + """ ) From ade1e4c9430a8e73e4f132be29aea44ecd07e132 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:41:30 +0000 Subject: [PATCH 9/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Snakefile | 6 +++--- benchmarks/backwards_ecal/Snakefile | 10 +++++----- benchmarks/barrel_ecal/Snakefile | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Snakefile b/Snakefile index b3687b24..3baf152b 100644 --- a/Snakefile +++ b/Snakefile @@ -56,9 +56,9 @@ mc cp S3/eictest/{output.filepath} {output.filepath} """ if use_s3 else f""" - echo 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' - exit 1 - """ + echo 'Unexpected value for config["remote_provider"]: {config["remote_provider"]}' + exit 1 + """ ) ) diff --git a/benchmarks/backwards_ecal/Snakefile b/benchmarks/backwards_ecal/Snakefile index 7a501b5e..351006c3 100644 --- a/benchmarks/backwards_ecal/Snakefile +++ b/benchmarks/backwards_ecal/Snakefile @@ -102,13 +102,13 @@ MATPLOTLIBRC={input.matplotlibrc} \ DETECTOR_CONFIG=""" + DETECTOR_CONFIG + """ \ - PLOT_TITLE=""" + PLOT_TITLE=""" + DETECTOR_CONFIG + """ \ - INPUT_PATH_FORMAT=sim_output/backwards_ecal/""" + INPUT_PATH_FORMAT=sim_output/backwards_ecal/""" + DETECTOR_CONFIG + """/{{particle}}/{{energy}}/130to177deg/{{particle}}_{{energy}}_130to177deg.{{ix:04d}}.eicrecon.tree.edm4eic.root \ - OUTPUT_DIR={output} \ - python {input.script} - """ + OUTPUT_DIR={output} \ + python {input.script} + """ ) diff --git a/benchmarks/barrel_ecal/Snakefile b/benchmarks/barrel_ecal/Snakefile index 3637544e..5378592f 100644 --- a/benchmarks/barrel_ecal/Snakefile +++ b/benchmarks/barrel_ecal/Snakefile @@ -37,9 +37,9 @@ exec ddsim \ --compactFile """ + DETECTOR_PATH + """/{wildcards.DETECTOR_CONFIG}.xml \ - --inputFiles {input} \ - --outputFile {output} - """ + --inputFiles {input} \ + --outputFile {output} + """ )