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