Back to home page

EIC code displayed by LXR

 
 

    


Warning, /physics_benchmarks/benchmarks/Exclusive-Diffraction-Tagging/tcs/Snakefile is written in an unsupported language. File is not indexed.

0001 import os
0002 
0003 # Compile the analysis scripts
0004 rule tcs_compile:
0005     input:
0006         ROOT_BUILD_DIR_PREFIX + "benchmarks/Exclusive-Diffraction-Tagging/tcs/analysis/tcs_tests_cxx.so",
0007 
0008 # Simulation rule with parameterization
0009 rule tcs_sim:
0010     input:
0011         warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0012         geometry_lib=find_epic_libraries(),
0013     output:
0014         "sim/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}.edm4hep.root",
0015     params:
0016         N_EVENTS=os.getenv("JUGGLER_N_EVENTS", 100),
0017         DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0018         NPSIM_HASH=get_spack_package_hash("npsim"),
0019     wildcard_constraints:
0020         EBEAM=r"\d+",
0021         PBEAM=r"\d+",
0022         TAG=r"s\d+",
0023     cache: True
0024     shell:
0025         """
0026 npsim \
0027   --runType batch \
0028   --part.minimalKineticEnergy 1000*GeV  \
0029   --filter.tracker edep0 \
0030   -v ERROR \
0031   --numberOfEvents {params.N_EVENTS} \
0032   --compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
0033   --inputFiles root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/EXCLUSIVE/TCS_ABCONV/{wildcards.EBEAM}x{wildcards.PBEAM}/hel_minus/TCS_gen_ab_hiAcc_{wildcards.EBEAM}x{wildcards.PBEAM}m_{wildcards.TAG}.hepmc3.tree.root \
0034   --outputFile {output}
0035 """
0036 
0037 # Reconstruction rule
0038 rule tcs_reco:
0039     input:
0040         "sim/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}.edm4hep.root",
0041     output:
0042         "reco/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}.edm4eic.root",
0043     params:
0044         EICRECON_HASH=get_spack_package_hash("eicrecon"),
0045     wildcard_constraints:
0046         EBEAM=r"\d+",
0047         PBEAM=r"\d+",
0048         TAG=r"s\d+",
0049     cache: True
0050     shell:
0051         """
0052 DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} eicrecon {input} -Ppodio:output_file={output}
0053 """
0054 
0055 # Analysis rule - runs from repo root, script writes to results/tcs/
0056 # TCS analysis is currently disabled because the analysis code accesses
0057 # "ReconstructedFFParticles" collection which no longer exists in the
0058 # reconstruction output. The analysis code needs to be updated before
0059 # this rule can be enabled.
0060 #
0061 # rule tcs_analysis:
0062 #     input:
0063 #         script="benchmarks/Exclusive-Diffraction-Tagging/tcs/analysis/tcs_tests.cxx",
0064 #         script_compiled=ROOT_BUILD_DIR_PREFIX + "benchmarks/Exclusive-Diffraction-Tagging/tcs/analysis/tcs_tests_cxx.so",
0065 #         data="reco/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}.edm4eic.root",
0066 #     output:
0067 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/Q2.png",
0068 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/Q2.pdf",
0069 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/n_parts.png",
0070 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/n_parts.pdf",
0071 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/ff.png",
0072 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/ff.pdf",
0073 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/ff_theta.png",
0074 #         "results/{DETECTOR_CONFIG}/tcs_{EBEAM}x{PBEAM}m_{TAG}/ff_theta.pdf",
0075 #     wildcard_constraints:
0076 #         EBEAM=r"\d+",
0077 #         PBEAM=r"\d+",
0078 #         TAG=r"s\d+",
0079 #     shell:
0080 #         """
0081 # mkdir -p results/tcs results/{wildcards.DETECTOR_CONFIG}/tcs_{wildcards.EBEAM}x{wildcards.PBEAM}m_{wildcards.TAG}
0082 # root -l -b -q '{input.script}+("{input.data}")'
0083 # # Move plots to detector-specific directory since script outputs to results/tcs/
0084 # mv results/tcs/*.png results/tcs/*.pdf results/{wildcards.DETECTOR_CONFIG}/tcs_{wildcards.EBEAM}x{wildcards.PBEAM}m_{wildcards.TAG}/
0085 # """