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