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=workflow.source_path("analysis/gen_sigma_decay.cxx"),
0004     output:
0005         GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
0006     params:
0007         N_EVENTS=1000,
0008         P=lambda wildcards: wildcards.P,
0009     singularity: EIC_SINGULARITY_CONTAINER,
0010     shell:
0011         """
0012 root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
0013 """
0014 
0015 rule zdc_sigma_simulate:
0016     input:
0017         GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
0018         warmup="warmup.edm4hep.root",
0019         geometry_lib=find_epic_libraries(),
0020     output:
0021         SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{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     singularity: EIC_SINGULARITY_CONTAINER,
0033     shell:
0034         """
0035 exec npsim \
0036    --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0037    --random.seed {params.SEED} \
0038    --skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
0039    --numberOfEvents {params.N_EVENTS} \
0040    --physicsList {params.PHYSICS_LIST} \
0041    --inputFiles {input.GEN_FILE} \
0042    --outputFile {output.SIM_FILE}
0043 """
0044 
0045 rule zdc_sigma_recon:
0046     input:
0047         SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root",
0048         warmup="warmup.edm4hep.root",
0049     output:
0050         REC_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
0051     params:
0052         N_EVENTS=200,
0053         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0054         EICRECON_HASH=get_spack_package_hash("eicrecon"),
0055     cache: True
0056     singularity: EIC_SINGULARITY_CONTAINER,
0057     shell:
0058         """
0059 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0060   eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits -Pjana:nevents={params.N_EVENTS}
0061 """
0062 
0063 rule zdc_sigma_analysis:
0064     input:
0065         expand("sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
0066             P=[100, 125, 150,175, 200, 225, 250, 275],
0067             DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0068             INDEX=range(5),
0069         ),
0070         script=workflow.source_path("analysis/sigma_plots.py"),
0071     output:
0072         results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"),
0073     singularity: EIC_SINGULARITY_CONTAINER,
0074     shell:
0075         """
0076 mkdir -p {output.results_dir}
0077 python {input.script} {output.results_dir}
0078 """