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 params:
0005 th_max=0.23,
0006 th_min=0
0007 output:
0008 GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc"
0009 shell:
0010 """
0011 if [[ {wildcards.P} -gt 140 ]]; then
0012 NEVENTS_GEN=300
0013 else
0014 NEVENTS_GEN=1000
0015 fi
0016 mkdir -p sim_output/zdc_photon
0017 root -l -b -q '{input.script}('$NEVENTS_GEN',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
0018 """
0019
0020 rule zdc_photon_simulate:
0021 input:
0022 GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc"
0023 params:
0024 PHYSICS_LIST="FTFP_BERT"
0025 output:
0026 SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV.edm4hep.root"
0027 shell:
0028 """
0029 # Running simulation
0030 if [[ {wildcards.P} -gt 140 ]]; then
0031 NEVENTS_SIM=300
0032 else
0033 NEVENTS_SIM=1000
0034 fi
0035 npsim \
0036 --compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
0037 --physicsList {params.PHYSICS_LIST} \
0038 --numberOfEvents $NEVENTS_SIM \
0039 --inputFiles {input.GEN_FILE} \
0040 --outputFile {output.SIM_FILE}
0041 """
0042
0043 rule zdc_photon_recon:
0044 input:
0045 SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV.edm4hep.root"
0046 output:
0047 REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV.edm4hep.root"
0048 shell:
0049 """
0050 if [[ {wildcards.P} -gt 140 ]]; then
0051 NEVENTS_REC=300
0052 else
0053 NEVENTS_REC=1000
0054 fi
0055 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits -Pjana:nevents=$NEVENTS_REC
0056 """
0057
0058 rule zdc_photon_analysis:
0059 input:
0060 expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV.edm4hep.root",
0061 P=[20, 30, 50, 70, 100, 150, 200, 275],
0062 DETECTOR_CONFIG=["{DETECTOR_CONFIG}"]),
0063 script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py",
0064 output:
0065 results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
0066 shell:
0067 """
0068 mkdir -p {output.results_dir}
0069 python {input.script} {output.results_dir}
0070 """