diff --git a/benchmarks/beamline/Snakefile b/benchmarks/beamline/Snakefile
index 88de43c1819019fba167682fa4a27d3aef3f45f0..6c5639f385ff816ed10411edc267830482ba6ea4 100644
--- a/benchmarks/beamline/Snakefile
+++ b/benchmarks/beamline/Snakefile
@@ -1,10 +1,8 @@
 rule beamline_sim:
     input:
-        macro="{test}GPS.mac",
+        macro="benchmarks/beamline/beamlineGPS.mac",
     output:
-        "/scratch/EIC/G4out/beamline/{test}Test{tag}.edm4hep.root",
-    log:
-        "/scratch/EIC/G4out/beamline/{test}Test{tag}.edm4hep.root.log",
+        "sim_output/beamline/beamlineTest{CAMPAIGN}.edm4hep.root",
     shell:
         """
             exec npsim \
@@ -16,17 +14,46 @@ rule beamline_sim:
         """
 
 rule beamline_analysis:
-    input:
-        data="/scratch/EIC/G4out/beamline/{test}Test{tag}.edm4hep.root",
-        script="{test}Analysis.C",
-    output:
-        "/scratch/EIC/ReconOut/beamline/{test}TestAnalysis{tag}.root"
-    log:
-        "/scratch/EIC/ReconOut/beamline/{test}TestAnalysis{tag}.root.log"
     params:
         xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml",
+    input:
+        script="benchmarks/beamline/beamlineAnalysis.C",
+        data="sim_output/beamline/beamlineTest{CAMPAIGN}.edm4hep.root",
+    output:
+        rootfile="sim_output/beamline/analysis/beamlineTestAnalysis{CAMPAIGN}.root",
+        beamspot_canvas="sim_output/beamline/analysis/beamspot_{CAMPAIGN}.png",
+        x_px_canvas="sim_output/beamline/analysis/x_px_{CAMPAIGN}.png",
+        y_py_canvas="sim_output/beamline/analysis/y_py_{CAMPAIGN}.png",
+        fitted_position_means_stdevs_canvas="sim_output/beamline/analysis/fitted_position_means_stdevs_{CAMPAIGN}.png",
+        fitted_momentum_means_stdevs_canvas="sim_output/beamline/analysis/fitted_momentum_means_stdevs_{CAMPAIGN}.png",
+        pipe_parameter_canvas="sim_output/beamline/analysis/pipe_parameter_{CAMPAIGN}.png",
     shell:
         """
-            root -l -b -q 'analysis.C("{input.data}", "{output}", "{params.xml}")'
+            root -l -b -q '{input.script}("{input.data}", "{output.rootfile}", "{params.xml}",
+            "{output.beamspot_canvas}", "{output.x_px_canvas}", "{output.y_py_canvas}",
+            "{output.fitted_position_means_stdevs_canvas}", "{output.fitted_momentum_means_stdevs_canvas}",
+            "{output.pipe_parameter_canvas}")'
         """
 
+rule beamline:
+    input:
+        [
+            "sim_output/beamline/analysis/beamlineTestAnalysis{CAMPAIGN}.root",
+            "sim_output/beamline/analysis/beamspot_{CAMPAIGN}.png",
+            "sim_output/beamline/analysis/x_px_{CAMPAIGN}.png",
+            "sim_output/beamline/analysis/y_py_{CAMPAIGN}.png",
+            "sim_output/beamline/analysis/fitted_position_means_stdevs_{CAMPAIGN}.png",
+            "sim_output/beamline/analysis/fitted_momentum_means_stdevs_{CAMPAIGN}.png",
+            "sim_output/beamline/analysis/pipe_parameter_{CAMPAIGN}.png",
+        ],
+    output:
+        directory("results/beamline/{CAMPAIGN}/")
+    shell:
+        """
+            mkdir {output}        
+            cp {input} {output}
+        """
+
+rule beamline_local:
+    input:
+        "results/beamline/local/"
\ No newline at end of file
diff --git a/benchmarks/beamline/beamlineAnalysis.C b/benchmarks/beamline/beamlineAnalysis.C
index 32cd51cdce877c5fe9c70f7e755ba27e67d609d3..64b251b2e26b86856497fc71ad170f5df13953c7 100644
--- a/benchmarks/beamline/beamlineAnalysis.C
+++ b/benchmarks/beamline/beamlineAnalysis.C
@@ -21,7 +21,14 @@ using RNode       = ROOT::RDF::RNode;
 
 void beamlineAnalysis(  TString inFile          = "/scratch/EIC/G4out/beamline/beamlineTest.edm4hep.root",
                         TString outFile         = "output.root",
-                        std::string compactName = "/home/simong/EIC/epic/install/share/epic/epic_ip6_extended.xml"){
+                        std::string compactName = "/home/simong/EIC/epic/install/share/epic/epic_ip6_extended.xml",
+                        TString beamspotCanvasName = "beamspot_canvas.png",
+                        TString x_pxCanvasName = "x_px_canvas.png",
+                        TString y_pyCanvasName = "y_py_canvas.png",
+                        TString fittedPositionMeansCanvasName = "fitted_means_stddevs.png",
+                        TString fittedMomentumMeansCanvasName = "fitted_momentum_means_stddevs.png",
+                        TString pipeParamsCanvasName = "pipe_parameters.png"
+                    ){
 
     //Set ROOT style    
     gStyle->SetPadLeftMargin(0.1);  // Set left margin
@@ -305,9 +312,9 @@ void beamlineAnalysis(  TString inFile          = "/scratch/EIC/G4out/beamline/b
     }
 
     // Save 2D canvases as pngs
-    cXY->SaveAs("beamspot.png");
-    cX->SaveAs("x_px.png");
-    cY->SaveAs("y_py.png");
+    cXY->SaveAs(beamspotCanvasName);
+    cX->SaveAs(x_pxCanvasName);
+    cY->SaveAs(y_pyCanvasName);
 
     // ---------------------------------------------------------------------------
     // Create histograms showing the fitted means and standard deviations of the positions and momenta
@@ -375,7 +382,7 @@ void beamlineAnalysis(  TString inFile          = "/scratch/EIC/G4out/beamline/b
     cFittedMeans->SetGrid();
     cFittedMeans->Update();
     // Save the canvas as a PNG file
-    cFittedMeans->SaveAs("fitted_means_stddevs.png");
+    cFittedMeans->SaveAs(fittedPositionMeansCanvasName);
 
     // Create a canvas for the fitted momentum means and standard deviations
     TCanvas *cFittedMomentumMeans = new TCanvas("cFittedMomentumMeans", "Fitted Momentum Means and Std Deviation", 1200, 800);
@@ -391,7 +398,7 @@ void beamlineAnalysis(  TString inFile          = "/scratch/EIC/G4out/beamline/b
     cFittedMomentumMeans->SetGrid();
     cFittedMomentumMeans->Update();
     // Save the canvas as a PNG file
-    cFittedMomentumMeans->SaveAs("fitted_momentum_means_stddevs.png");
+    cFittedMomentumMeans->SaveAs(fittedMomentumMeansCanvasName);
 
 
     // -----------------------------------------------------------------------------
@@ -432,7 +439,7 @@ void beamlineAnalysis(  TString inFile          = "/scratch/EIC/G4out/beamline/b
     cPipeParams->SetGrid();
     cPipeParams->Update();
     // Save the canvas as a PNG file
-    cPipeParams->SaveAs("pipe_parameters.png");
+    cPipeParams->SaveAs(pipeParamsCanvasName);
 
 
     TFile *f = new TFile(outFile,"RECREATE");