Warning, /detector_benchmarks/benchmarks/zdc_photon/Snakefile is written in an unsupported language. File is not indexed.
0001 rule zdc_photon_generate:
0002 input:
0003 script="benchmarks/zdc_photon/analysis/gen_particles.cxx",
0004 output:
0005 GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
0006 params:
0007 th_max=0.23,
0008 th_min=0,
0009 N_EVENTS=1000,
0010 P=lambda wildcards: wildcards.P,
0011 shell:
0012 """
0013 mkdir -p sim_output/zdc_photon
0014 root -l -b -q '{input.script}('{params.N_EVENTS}',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
0015 """
0016
0017 rule zdc_photon_simulate:
0018 input:
0019 GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
0020 warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0021 geometry_lib=find_epic_libraries(),
0022 output:
0023 SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root",
0024 params:
0025 N_EVENTS=200,
0026 INDEX=lambda wildcards: wildcards.INDEX,
0027 SEED=lambda wildcards: "1" + wildcards.INDEX,
0028 PHYSICS_LIST="FTFP_BERT",
0029 DETECTOR_PATH=os.environ["DETECTOR_PATH"],
0030 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0031 DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0032 NPSIM_HASH=get_spack_package_hash("npsim"),
0033 cache: True
0034 shell:
0035 """
0036 exec npsim \
0037 --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0038 --random.seed {params.SEED} \
0039 --physicsList {params.PHYSICS_LIST} \
0040 --skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
0041 --numberOfEvents {params.N_EVENTS} \
0042 --inputFiles {input.GEN_FILE} \
0043 --outputFile {output.SIM_FILE}
0044 """
0045
0046 rule zdc_photon_recon:
0047 input:
0048 SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root",
0049 warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0050 output:
0051 REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
0052 params:
0053 N_EVENTS=200,
0054 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0055 EICRECON_HASH=get_spack_package_hash("eicrecon"),
0056 cache: True
0057 shell:
0058 """
0059 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0060 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits,ReconstructedFarForwardZDCNeutrals -Pjana:nevents={params.N_EVENTS}
0061 """
0062
0063 rule zdc_photon_analysis:
0064 input:
0065 expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
0066 P=[20, 30, 50, 70, 100, 150, 200, 275],
0067 DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0068 INDEX=range(5),
0069 ),
0070 script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py",
0071 output:
0072 results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
0073 shell:
0074 """
0075 mkdir -p {output.results_dir}
0076 python {input.script} {output.results_dir}
0077 """