Warning, /detector_benchmarks/benchmarks/beamline/Snakefile is written in an unsupported language. File is not indexed.
0001 SIMOUTDIR="sim_output/beamline/"
0002 ANALYSISDIR=SIMOUTDIR+"analysis/"
0003
0004 rule beamline_steering_sim:
0005 input:
0006 macro=workflow.source_path("beamlineGPS.mac"),
0007 output:
0008 SIMOUTDIR+"beamlineTest{CAMPAIGN}.edm4hep.root",
0009 shell:
0010 """
0011 exec npsim \
0012 --runType run \
0013 --enableG4GPS \
0014 --macroFile {input.macro} \
0015 --compactFile $DETECTOR_PATH/epic_ip6_extended.xml \
0016 --printLevel WARNING \
0017 --outputFile {output} \
0018 --physics.rangecut 100*m
0019 """
0020
0021 rule beamline_acceptance_sim:
0022 input:
0023 macro=workflow.source_path("acceptanceGPS.mac"),
0024 output:
0025 SIMOUTDIR+"acceptanceTest{CAMPAIGN}.edm4hep.root",
0026 shell:
0027 """
0028 exec npsim \
0029 --runType run \
0030 --enableG4GPS \
0031 --macroFile {input.macro} \
0032 --compactFile $DETECTOR_PATH/epic_ip6_extended.xml \
0033 --printLevel WARNING \
0034 --outputFile {output} \
0035 --physics.rangecut 100*m
0036 """
0037
0038 rule beamline_steering_analysis:
0039 params:
0040 xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml",
0041 input:
0042 script=workflow.source_path("beamlineAnalysis.C"),
0043 header=workflow.source_path("shared_functions.h"),
0044 data=SIMOUTDIR+"beamlineTest{CAMPAIGN}.edm4hep.root",
0045 output:
0046 rootfile=ANALYSISDIR+"beamlineTestAnalysis{CAMPAIGN}.root",
0047 beamspot_canvas=ANALYSISDIR+"beamspot_{CAMPAIGN}.png",
0048 x_px_canvas=ANALYSISDIR+"x_px_{CAMPAIGN}.png",
0049 y_py_canvas=ANALYSISDIR+"y_py_{CAMPAIGN}.png",
0050 fitted_position_means_stdevs_canvas=ANALYSISDIR+"fitted_position_means_stdevs_{CAMPAIGN}.png",
0051 fitted_momentum_means_stdevs_canvas=ANALYSISDIR+"fitted_momentum_means_stdevs_{CAMPAIGN}.png",
0052 pipe_parameter_canvas=ANALYSISDIR+"pipe_parameter_{CAMPAIGN}.png",
0053 shell:
0054 """
0055 root -l -b -q '{input.script}("{input.data}", "{output.rootfile}", "{params.xml}",
0056 "{output.beamspot_canvas}", "{output.x_px_canvas}", "{output.y_py_canvas}",
0057 "{output.fitted_position_means_stdevs_canvas}", "{output.fitted_momentum_means_stdevs_canvas}",
0058 "{output.pipe_parameter_canvas}")'
0059 """
0060
0061 rule beamline_acceptance_analysis:
0062 params:
0063 xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml",
0064 input:
0065 script=workflow.source_path("acceptanceAnalysis.C"),
0066 header=workflow.source_path("shared_functions.h"),
0067 data=SIMOUTDIR+"acceptanceTest{CAMPAIGN}.edm4hep.root",
0068 output:
0069 rootfile=ANALYSISDIR+"acceptanceTestAnalysis{CAMPAIGN}.root",
0070 beampipe_canvas=ANALYSISDIR+"acceptance_in_beampipe_{CAMPAIGN}.png",
0071 etheta_canvas=ANALYSISDIR+"acceptance_energy_theta_{CAMPAIGN}.png",
0072 etheta_acceptance_canvas=ANALYSISDIR+"acceptance_energy_theta_acceptance_{CAMPAIGN}.png",
0073 entries_canvas=ANALYSISDIR+"acceptance_entries_{CAMPAIGN}.png",
0074 shell:
0075 """
0076 root -l -b -q '{input.script}("{input.data}", "{output.rootfile}", "{params.xml}", "{output.beampipe_canvas}","{output.etheta_canvas}","{output.etheta_acceptance_canvas}",
0077 "{output.entries_canvas}")'
0078 """
0079
0080 rule beamline:
0081 input:
0082 ANALYSISDIR+"beamlineTestAnalysis{CAMPAIGN}.root",
0083 ANALYSISDIR+"beamspot_{CAMPAIGN}.png",
0084 ANALYSISDIR+"x_px_{CAMPAIGN}.png",
0085 ANALYSISDIR+"y_py_{CAMPAIGN}.png",
0086 ANALYSISDIR+"fitted_position_means_stdevs_{CAMPAIGN}.png",
0087 ANALYSISDIR+"fitted_momentum_means_stdevs_{CAMPAIGN}.png",
0088 ANALYSISDIR+"pipe_parameter_{CAMPAIGN}.png",
0089 ANALYSISDIR+"acceptanceTestAnalysis{CAMPAIGN}.root",
0090 ANALYSISDIR+"acceptance_in_beampipe_{CAMPAIGN}.png",
0091 ANALYSISDIR+"acceptance_energy_theta_{CAMPAIGN}.png",
0092 ANALYSISDIR+"acceptance_energy_theta_acceptance_{CAMPAIGN}.png",
0093 ANALYSISDIR+"acceptance_entries_{CAMPAIGN}.png",
0094 output:
0095 directory("results/beamline/{CAMPAIGN}/")
0096 shell:
0097 """
0098 mkdir {output}
0099 cp {input} {output}
0100 """
0101
0102 rule beamline_local:
0103 input:
0104 "results/beamline/local/"