Back to home page

EIC code displayed by LXR

 
 

    


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

0001 rule zdc_photon_generate:
0002     input:
0003         script=workflow.source_path("analysis/gen_particles.cxx"),
0004     output:
0005         GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
0006     params:
0007         th_max=0.23,
0008         th_min=0,
0009         N_EVENTS=1000,
0010         P=lambda wildcards: wildcards.P,
0011         SEED=lambda wildcards: stable_seed("zdc_photon", wildcards.P),
0012     singularity: EIC_SINGULARITY_CONTAINER,
0013     shell:
0014         """
0015 mkdir -p sim_output/zdc_photon
0016 root -l -b -q '{input.script}('{params.N_EVENTS}',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {params.P}, 0, 1, {params.SEED})'
0017 """
0018 
0019 rule zdc_photon_simulate:
0020     input:
0021         GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
0022         warmup="warmup.edm4hep.root",
0023         geometry_lib=find_epic_libraries(),
0024     output:
0025         SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.rnt.root",
0026     params:
0027         N_EVENTS=200,
0028         INDEX=lambda wildcards: wildcards.INDEX,
0029         SEED=lambda wildcards: "1" + wildcards.INDEX,
0030         PHYSICS_LIST="FTFP_BERT",
0031         DETECTOR_PATH=config["DETECTOR_PREFIX"] + "/share/epic",
0032         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0033         DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0034         NPSIM_HASH=get_spack_package_hash("npsim"),
0035     cache: True
0036     singularity: EIC_SINGULARITY_CONTAINER,
0037     shell:
0038         """
0039 exec npsim \
0040    --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0041    --random.seed {params.SEED} \
0042    --physicsList {params.PHYSICS_LIST} \
0043    --skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
0044    --numberOfEvents {params.N_EVENTS} \
0045    --inputFiles {input.GEN_FILE} \
0046    --outputConfig.useRNTuple true \
0047    --outputFile {output.SIM_FILE}
0048 """
0049 
0050 rule zdc_photon_recon:
0051     input:
0052         SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.rnt.root",
0053         warmup="warmup.edm4hep.root",
0054     output:
0055         REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
0056     params:
0057         N_EVENTS=200,
0058         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0059         EICRECON_HASH=get_spack_package_hash("eicrecon"),
0060     cache: True
0061     singularity: EIC_SINGULARITY_CONTAINER,
0062     shell:
0063         """
0064 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0065   eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits,ReconstructedFarForwardZDCNeutrals -Pjana:nevents={params.N_EVENTS}
0066 """
0067 
0068 rule zdc_photon_analysis:
0069     input:
0070         expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
0071             P=[20, 30, 50, 70, 100, 150, 200, 275],
0072             DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0073             INDEX=range(5),
0074         ),
0075         script=workflow.source_path("analysis/zdc_photon_plots.py"),
0076     output:
0077         results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
0078     singularity: EIC_SINGULARITY_CONTAINER,
0079     shell:
0080         """
0081 mkdir -p {output.results_dir}
0082 python {input.script} {output.results_dir}
0083 """