Back to home page

EIC code displayed by LXR

 
 

    


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="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                 PHYSICS_LIST="FTFP_BERT",
0026                 DETECTOR_PATH=os.environ["DETECTOR_PATH"],
0027                 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0028                 DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0029                 NPSIM_HASH=get_spack_package_hash("npsim"),
0030         cache: True
0031         shell:
0032                 """
0033 # Running simulation
0034 npsim \
0035    --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0036    --skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
0037    --numberOfEvents {params.N_EVENTS} \
0038    --physicsList {params.PHYSICS_LIST} \
0039    --inputFiles {input.GEN_FILE} \
0040    --outputFile {output.SIM_FILE}
0041 """
0042 
0043 rule zdc_pi0_recon:
0044         input:
0045                 SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root",
0046         output:
0047                 REC_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
0048         params:
0049                 N_EVENTS=200,
0050                 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0051                 EICRECON_HASH=get_spack_package_hash("eicrecon"),
0052         cache: True
0053         shell:
0054                 """
0055 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0056   eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits -Pjana:nevents={params.N_EVENTS}
0057 """
0058 
0059 rule zdc_pi0_analysis:
0060         input:
0061                 expand("sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
0062                     P=[60, 80, 100, 130, 160],
0063                     DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0064                     INDEX=range(5),
0065                 ),
0066                 script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py",
0067         output:
0068                 results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"),
0069         shell:
0070                 """
0071 mkdir -p {output.results_dir}
0072 python {input.script} {output.results_dir}
0073 """