Warning, /tutorial-developing-benchmarks/files/Snakefile_prefinal is written in an unsupported language. File is not indexed.
0001 import os
0002 from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider
0003 from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
0004
0005 S3 = S3RemoteProvider(
0006 endpoint_url="https://dtn01.sdcc.bnl.gov:9000",
0007 access_key_id=os.environ["S3_ACCESS_KEY"],
0008 secret_access_key=os.environ["S3_SECRET_KEY"],
0009 )
0010
0011 rule your_benchmark_campaign_reco_get:
0012 input:
0013 lambda wildcards: S3.remote(f"eictest/EPIC/RECO/24.07.0/epic_craterlake/EXCLUSIVE/UCHANNEL_RHO/10x100/rho_10x100_uChannel_Q2of0to10_hiDiv.{wildcards.INDEX}.eicrecon.tree.edm4eic.root"),
0014 output:
0015 "../../sim_output/campaign_24.07.0_rho_10x100_uChannel_Q2of0to10_hiDiv_{INDEX}_eicrecon.edm4eic.root",
0016 shell:
0017 """
0018 echo "Getting file for INDEX {wildcards.INDEX}"
0019 ln {input} {output}
0020 """
0021
0022 rule your_benchmark_analysis:
0023 input:
0024 #uncomment below when running on eicweb CI
0025 #script="benchmarks/your_benchmark/analysis/uchannelrho.cxx",
0026 #uncomment below when running locally
0027 script="analysis/uchannelrho.cxx",
0028 data="../../sim_output/campaign_24.07.0_rho_10x100_uChannel_Q2of0to10_hiDiv_{INDEX}_eicrecon.edm4eic.root",
0029 output:
0030 plots="../../sim_output/campaign_24.07.0_{INDEX}_eicrecon.edm4eic/plots.root",
0031 shell:
0032 """
0033 mkdir -p $(dirname "{output.plots}")
0034 root -l -b -q '{input.script}+("{input.data}","{output.plots}")'
0035 """
0036
0037 rule your_benchmark_combine:
0038 input:
0039 lambda wildcards: expand(
0040 "../../sim_output/campaign_24.07.0_{INDEX:04d}_eicrecon.edm4eic/plots.root",
0041 INDEX=range(int(wildcards.N)),
0042 ),
0043 wildcard_constraints:
0044 N="\d+",
0045 output:
0046 "../../sim_output/campaign_24.07.0_combined_{N}files_eicrecon.edm4eic.plots.root",
0047 shell:
0048 """
0049 hadd {output} {input}
0050 """
0051
0052 rule your_benchmark_plots:
0053 input:
0054 #uncomment below when running on eicweb CI
0055 #script="benchmarks/your_benchmark/macros/plot_rho_physics_benchmark.C",
0056 #uncomment below when running locally
0057 script="macros/plot_rho_physics_benchmark.C",
0058 plots="../../sim_output/campaign_24.07.0_combined_{N}files_eicrecon.edm4eic.plots.root",
0059 output:
0060 "../../sim_output/campaign_24.07.0_combined_{N}files_eicrecon.edm4eic.plots_figures/benchmark_rho_mass.pdf",
0061 shell:
0062 """
0063 if [ ! -d "{input.plots}_figures" ]; then
0064 mkdir "{input.plots}_figures"
0065 echo "{input.plots}_figures directory created successfully."
0066 else
0067 echo "{input.plots}_figures directory already exists."
0068 fi
0069 root -l -b -q '{input.script}("{input.plots}")'
0070 """