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