Back to home page

EIC code displayed by LXR

 
 

    


Warning, /detector_benchmarks/benchmarks/zdc_sigma/Snakefile is written in an unsupported language. File is not indexed.

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