|
| 1 | +SIMOUTDIR="sim_output/beamline/" |
| 2 | +ANALYSISDIR=SIMOUTDIR+"analysis/" |
| 3 | + |
| 4 | +rule beamline_steering_sim: |
| 5 | + input: |
| 6 | + macro=workflow.source_path("beamlineGPS.mac"), |
| 7 | + output: |
| 8 | + SIMOUTDIR+"beamlineTest{CAMPAIGN}.edm4hep.root", |
| 9 | + shell: |
| 10 | + """ |
| 11 | + exec npsim \ |
| 12 | + --runType run \ |
| 13 | + --enableG4GPS \ |
| 14 | + --macroFile {input.macro} \ |
| 15 | + --compactFile $DETECTOR_PATH/epic_ip6_extended.xml \ |
| 16 | + --outputFile {output} \ |
| 17 | + """ |
| 18 | + |
| 19 | +rule beamline_steering_analysis: |
| 20 | + params: |
| 21 | + xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml", |
| 22 | + input: |
| 23 | + script=workflow.source_path("beamlineAnalysis.C"), |
| 24 | + header=workflow.source_path("shared_functions.h"), |
| 25 | + data=SIMOUTDIR+"beamlineTest{CAMPAIGN}.edm4hep.root", |
| 26 | + output: |
| 27 | + rootfile=ANALYSISDIR+"beamlineTestAnalysis{CAMPAIGN}.root", |
| 28 | + beamspot_canvas=ANALYSISDIR+"beamspot_{CAMPAIGN}.png", |
| 29 | + x_px_canvas=ANALYSISDIR+"x_px_{CAMPAIGN}.png", |
| 30 | + y_py_canvas=ANALYSISDIR+"y_py_{CAMPAIGN}.png", |
| 31 | + fitted_position_means_stdevs_canvas=ANALYSISDIR+"fitted_position_means_stdevs_{CAMPAIGN}.png", |
| 32 | + fitted_momentum_means_stdevs_canvas=ANALYSISDIR+"fitted_momentum_means_stdevs_{CAMPAIGN}.png", |
| 33 | + pipe_parameter_canvas=ANALYSISDIR+"pipe_parameter_{CAMPAIGN}.png", |
| 34 | + shell: |
| 35 | + """ |
| 36 | + root -l -b -q '{input.script}("{input.data}", "{output.rootfile}", "{params.xml}", |
| 37 | + "{output.beamspot_canvas}", "{output.x_px_canvas}", "{output.y_py_canvas}", |
| 38 | + "{output.fitted_position_means_stdevs_canvas}", "{output.fitted_momentum_means_stdevs_canvas}", |
| 39 | + "{output.pipe_parameter_canvas}")' |
| 40 | + """ |
| 41 | + |
| 42 | +rule beamline: |
| 43 | + input: |
| 44 | + ANALYSISDIR+"beamlineTestAnalysis{CAMPAIGN}.root", |
| 45 | + ANALYSISDIR+"beamspot_{CAMPAIGN}.png", |
| 46 | + ANALYSISDIR+"x_px_{CAMPAIGN}.png", |
| 47 | + ANALYSISDIR+"y_py_{CAMPAIGN}.png", |
| 48 | + ANALYSISDIR+"fitted_position_means_stdevs_{CAMPAIGN}.png", |
| 49 | + ANALYSISDIR+"fitted_momentum_means_stdevs_{CAMPAIGN}.png", |
| 50 | + ANALYSISDIR+"pipe_parameter_{CAMPAIGN}.png", |
| 51 | + output: |
| 52 | + directory("results/beamline/{CAMPAIGN}/") |
| 53 | + shell: |
| 54 | + """ |
| 55 | + mkdir {output} |
| 56 | + cp {input} {output} |
| 57 | + """ |
| 58 | + |
| 59 | +rule beamline_local: |
| 60 | + input: |
| 61 | + "results/beamline/local/" |
0 commit comments