Back to home page

EIC code displayed by LXR

 
 

    


Warning, /physics_benchmarks/benchmarks/Inclusive/dis/Snakefile is written in an unsupported language. File is not indexed.

0001 import shutil
0002 
0003 
0004 rule dis_compile:
0005     input:
0006         ROOT_BUILD_DIR_PREFIX + "benchmarks/Inclusive/dis/analysis/dis_electrons_cxx.so",
0007 
0008 
0009 rule dis_sim:
0010     input:
0011         warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0012     output:
0013         "sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4hep.root",
0014     params:
0015         N_EVENTS=100,
0016     shell:
0017         """
0018 ddsim \
0019   --runType batch \
0020   --part.minimalKineticEnergy 1000*GeV  \
0021   --filter.tracker edep0 \
0022   -v WARNING \
0023   --numberOfEvents {params.N_EVENTS} \
0024   --compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
0025   --inputFiles root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/DIS/NC/{wildcards.EBEAM}x{wildcards.PBEAM}/minQ2={wildcards.MINQ2}/pythia8NCDIS_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}_beamEffects_xAngle=-0.025_hiDiv_vtxfix_1.hepmc3.tree.root \
0026   --outputFile {output}
0027 """
0028 
0029 
0030 rule dis_reco_eicrecon:
0031     input:
0032         "sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4hep.root",
0033     output:
0034         "sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4eic.root",
0035     shell:
0036         """
0037 DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} eicrecon {input} -Ppodio:output_file={output}
0038 """
0039 
0040 
0041 rule dis_generate_config:
0042     input:
0043         data="sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4eic.root",
0044     output:
0045         config="results/{DETECTOR_CONFIG}/dis/{EBEAM}on{PBEAM}/minQ2={MINQ2}_config.json",
0046     shell: """
0047 cat > {output.config} <<EOF
0048 {{
0049   "rec_file": "{input.data}",
0050   "detector": "{wildcards.DETECTOR_CONFIG}",
0051   "output_prefix": "results/{wildcards.DETECTOR_CONFIG}/dis/{wildcards.EBEAM}on{wildcards.PBEAM}/minQ2={wildcards.MINQ2}/dis_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}",
0052   "results_path": "results/{wildcards.DETECTOR_CONFIG}/dis/{wildcards.EBEAM}on{wildcards.PBEAM}/minQ2={wildcards.MINQ2}",
0053   "ebeam": {wildcards.EBEAM},
0054   "pbeam": {wildcards.PBEAM},
0055   "minq2": {wildcards.MINQ2},
0056   "plot_tag": "dis_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}",
0057   "test_tag": "dis_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}"
0058 }}
0059 EOF
0060 """
0061 
0062 
0063 rule dis_analysis_electrons:
0064     input:
0065         script="benchmarks/Inclusive/dis/analysis/dis_electrons.cxx",
0066         script_compiled=ROOT_BUILD_DIR_PREFIX + "benchmarks/Inclusive/dis/analysis/dis_electrons_cxx.so",
0067         data="sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4eic.root",
0068         config="results/{DETECTOR_CONFIG}/dis/{EBEAM}on{PBEAM}/minQ2={MINQ2}_config.json",
0069     output:
0070         expand("results/{{DETECTOR_CONFIG}}/dis/{{EBEAM}}on{{PBEAM}}/minQ2={{MINQ2}}/{FILENAME}", FILENAME=[
0071           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_logQ2_panels.png",
0072           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_logQ2_overlays.png",
0073           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_Q2_res_panels.png",
0074           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_Q2_res_overlays.png",
0075           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_x_panels.png",
0076           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_x_overlays.png",
0077           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_x_res_panels.png",
0078           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}_x_res_overlays.png",
0079           "dis_{EBEAM}x{PBEAM}_minQ2={MINQ2}dis_electrons.json"
0080         ]),
0081     shell: """
0082 root -l -b -q '{input.script}+("{input.config}")'
0083 """
0084 
0085 
0086 rule dis_analysis_kinematics_correlations:
0087     input:
0088         data="sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4eic.root",
0089     output:
0090         results_path=directory("results/{DETECTOR_CONFIG}/dis/{EBEAM}on{PBEAM}/minQ2={MINQ2}/kinematics_correlations"),
0091     params:
0092         N_EVENTS=100
0093     wildcard_constraints:
0094         EBEAM="\d+",
0095         PBEAM="\d+",
0096         MINQ2="\d+",
0097     shell: """
0098 mkdir {output.results_path}
0099 python benchmarks/Inclusive/dis/analysis/kinematics_correlations.py --rec_file "{input.data}" --config dis_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}_{wildcards.DETECTOR_CONFIG} --results_path {output.results_path} --nevents {params.N_EVENTS}
0100 """
0101 
0102 
0103 rule dis_analysis_truth_reconstruction:
0104     input:
0105         data="sim_output/{DETECTOR_CONFIG}/pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_beamEffects_xAngle=-0.025_hiDiv_1.edm4eic.root",
0106     output:
0107         results_path=directory("results/{DETECTOR_CONFIG}/dis/{EBEAM}on{PBEAM}/minQ2={MINQ2}/truth_reconstruction"),
0108     params:
0109         N_EVENTS=100
0110     wildcard_constraints:
0111         EBEAM="\d+",
0112         PBEAM="\d+",
0113         MINQ2="\d+",
0114     shell: """
0115 mkdir {output.results_path}
0116 python benchmarks/Inclusive/dis/analysis/truth_reconstruction.py --rec_file "{input.data}" --config dis_{wildcards.EBEAM}x{wildcards.PBEAM}_minQ2={wildcards.MINQ2}_{wildcards.DETECTOR_CONFIG} --results_path $(dirname {output.results_path}) --nevents {params.N_EVENTS}
0117 """