Warning, /detector_benchmarks/benchmarks/zdc_lyso/Snakefile is written in an unsupported language. File is not indexed.
0001 import os
0002
0003
0004 rule zdc_lyso_sim_hepmc:
0005 input:
0006 script = "benchmarks/zdc_lyso/gen_particles.cxx",
0007 output:
0008 hepmcfile="data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc",
0009 log:
0010 "data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc.log",
0011 params:
0012 num_events=1000,
0013 PARTICLE=lambda wildcards: wildcards.PARTICLE,
0014 BEAM_ENERGY=lambda wildcards: wildcards.BEAM_ENERGY,
0015 THETA_MIN=lambda wildcards: wildcards.THETA_MIN,
0016 THETA_MAX=lambda wildcards: wildcards.THETA_MAX,
0017 shell:
0018 """
0019 root -l -b -q '{input.script}({params.num_events}, "{output.hepmcfile}", "{params.PARTICLE}", {params.THETA_MIN}, {params.THETA_MAX}, 0, 360, {params.BEAM_ENERGY})'
0020 """
0021
0022
0023 rule zdc_lyso_sim:
0024 input:
0025 hepmcfile="data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc",
0026 warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0027 geometry_lib=find_epic_libraries(),
0028 output:
0029 "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.edm4hep.root",
0030 log:
0031 "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.edm4hep.root.log",
0032 params:
0033 num_events=1000,
0034 DETECTOR_PATH=os.environ["DETECTOR_PATH"],
0035 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0036 DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0037 NPSIM_HASH=get_spack_package_hash("npsim"),
0038 cache: True
0039 shell:
0040 """
0041 npsim \
0042 --runType batch \
0043 -v WARNING \
0044 --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0045 --numberOfEvents {params.num_events} \
0046 --inputFiles {input.hepmcfile} \
0047 --outputFile {output}
0048 """
0049
0050
0051 rule zdc_lyso_reco:
0052 input:
0053 "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.edm4hep.root",
0054 output:
0055 "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root",
0056 log:
0057 "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root.log",
0058 params:
0059 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0060 EICRECON_HASH=get_spack_package_hash("eicrecon"),
0061 cache: True
0062 shell:
0063 """
0064 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0065 eicrecon -Ppodio:output_file={output} -Ppodio:output_collections=HcalFarForwardZDCRawHits,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,EcalFarForwardZDCRawHits,EcalFarForwardZDCRecHits,EcalFarForwardZDCClusters,MCParticles {input}
0066 """
0067
0068
0069 rule zdc_lyso_analysis:
0070 input:
0071 expand("sim_output/zdc_lyso/{{DETECTOR_CONFIG}}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root",
0072 PARTICLE=["gamma"],
0073 BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"],
0074 THETA_MIN=["0"],
0075 THETA_MAX=["0.3"]),
0076 script="benchmarks/zdc_lyso/analysis/analysis.py",
0077 output:
0078 "results/{DETECTOR_CONFIG}/zdc_lyso/plots.pdf",
0079 shell:
0080 """
0081 python {input.script}
0082 """
0083
0084
0085 # Examples of invocation
0086 rule zdc_lyso_hepmc:
0087 input:
0088 expand("data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc",
0089 PARTICLE=["gamma"],
0090 BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"],
0091 THETA_MIN=["0"],
0092 THETA_MAX=["0.3"])
0093
0094
0095 rule zdc_lyso_local:
0096 input:
0097 "results/" + os.environ["DETECTOR_CONFIG"] + "/zdc_lyso/plots.pdf",
0098 message:
0099 "See output in {input[0]}"
0100