Warning, /detector_benchmarks/Snakefile is written in an unsupported language. File is not indexed.
0001 configfile: "config.yaml"
0002
0003 if config["remote"] == "S3":
0004 from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider
0005 provider = S3RemoteProvider(
0006 endpoint_url="https://eics3.sdcc.bnl.gov:9000",
0007 access_key_id=os.environ["S3_ACCESS_KEY"],
0008 secret_access_key=os.environ["S3_SECRET_KEY"],
0009 )
0010 remote_path = lambda path: f"eictest/{path}"
0011 elif config["remote"] == "XRootD":
0012 from snakemake.remote.XRootD import RemoteProvider as XRootDRemoteProvider
0013 provider = XRootDRemoteProvider(
0014 stay_on_remote=False,
0015 )
0016 remote_path = lambda path: f"root://dtn-eic.jlab.org//work/eic2/{path}"
0017 else:
0018 raise ValueError(f"Unexpected config[\"remote\"] = {config['remote']}")
0019
0020 include: "benchmarks/backgrounds/Snakefile"
0021 include: "benchmarks/barrel_ecal/Snakefile"
0022 include: "benchmarks/ecal_gaps/Snakefile"
0023 include: "benchmarks/material_scan/Snakefile"
0024
0025
0026 rule warmup_run:
0027 output:
0028 "warmup/{DETECTOR_CONFIG}.edm4hep.root",
0029 message: "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}"
0030 shell: """
0031 ddsim \
0032 --runType batch \
0033 --numberOfEvents 1 \
0034 --compactFile "$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml" \
0035 --outputFile "{output}" \
0036 --enableGun
0037 """
0038
0039
0040 rule matplotlibrc:
0041 output:
0042 ".matplotlibrc",
0043 run:
0044 with open(output[0], "wt") as fp:
0045 fp.write("backend: Agg\n")
0046 # interactive mode prevents plt.show() from blocking
0047 fp.write("interactive : True\n")
0048
0049
0050 rule org2py:
0051 input:
0052 notebook=workflow.basedir + "/{NOTEBOOK}.org",
0053 converter=workflow.source_path("benchmarks/common/org2py.awk"),
0054 output:
0055 "{NOTEBOOK}.py"
0056 shell:
0057 """
0058 awk -f {input.converter} {input.notebook} > {output}
0059 """