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