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=workflow.source_path("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 P=lambda wildcards: wildcards.P,
0009 SEED=lambda wildcards: stable_seed("zdc_lambda", wildcards.P),
0010 singularity: EIC_SINGULARITY_CONTAINER,
0011 shell:
0012 """
0013 root -l -b -q '{input.script}({params.N_EVENTS},{params.SEED},"{output.GEN_FILE}",{params.P},{params.P})'
0014 """
0015
0016 rule zdc_lambda_simulate:
0017 input:
0018 GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
0019 warmup="warmup.edm4hep.root",
0020 geometry_lib=find_epic_libraries(),
0021 output:
0022 SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.rnt.root",
0023 params:
0024 N_EVENTS=200,
0025 INDEX=lambda wildcards: wildcards.INDEX,
0026 SEED=lambda wildcards: "1" + wildcards.INDEX,
0027 PHYSICS_LIST="FTFP_BERT",
0028 DETECTOR_PATH=config["DETECTOR_PREFIX"] + "/share/epic",
0029 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0030 DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0031 NPSIM_HASH=get_spack_package_hash("npsim"),
0032 cache: True
0033 singularity: EIC_SINGULARITY_CONTAINER,
0034 shell:
0035 """
0036 exec npsim \
0037 --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0038 --random.seed {params.SEED} \
0039 --skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
0040 --numberOfEvents {params.N_EVENTS} \
0041 --physicsList {params.PHYSICS_LIST} \
0042 --inputFiles {input.GEN_FILE} \
0043 --outputConfig.useRNTuple true \
0044 --outputFile {output.SIM_FILE}
0045 """
0046
0047 rule zdc_lambda_recon:
0048 input:
0049 SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.rnt.root",
0050 warmup="warmup.edm4hep.root",
0051 output:
0052 REC_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
0053 params:
0054 N_EVENTS=200,
0055 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0056 EICRECON_HASH=get_spack_package_hash("eicrecon"),
0057 cache: True
0058 singularity: EIC_SINGULARITY_CONTAINER,
0059 shell:
0060 """
0061 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0062 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits,ReconstructedFarForwardZDCLambdas,ReconstructedFarForwardZDCLambdaDecayProductsCM -Pjana:nevents={params.N_EVENTS}
0063 """
0064
0065 rule zdc_lambda_analysis:
0066 input:
0067 expand("sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
0068 P=[100, 125, 150,175, 200, 225, 250, 275],
0069 DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0070 INDEX=range(5),
0071 ),
0072 script=workflow.source_path("analysis/lambda_plots.py"),
0073 output:
0074 results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
0075 singularity: EIC_SINGULARITY_CONTAINER,
0076 shell:
0077 """
0078 mkdir -p {output.results_dir}
0079 python {input.script} {output.results_dir}
0080 """