Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
2daefa97
Commit
2daefa97
authored
2 months ago
by
Simon Gardner
Browse files
Options
Downloads
Patches
Plain Diff
Prepare for CI testing
parent
0831da38
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/beamline/Snakefile
+39
-12
39 additions, 12 deletions
benchmarks/beamline/Snakefile
benchmarks/beamline/beamlineAnalysis.C
+14
-7
14 additions, 7 deletions
benchmarks/beamline/beamlineAnalysis.C
with
53 additions
and
19 deletions
benchmarks/beamline/Snakefile
+
39
−
12
View file @
2daefa97
rule beamline_sim:
rule beamline_sim:
input:
input:
macro="
{test}
GPS.mac",
macro="
benchmarks/beamline/beamline
GPS.mac",
output:
output:
"/scratch/EIC/G4out/beamline/{test}Test{tag}.edm4hep.root",
"sim_output/beamline/beamlineTest{CAMPAIGN}.edm4hep.root",
log:
"/scratch/EIC/G4out/beamline/{test}Test{tag}.edm4hep.root.log",
shell:
shell:
"""
"""
exec npsim \
exec npsim \
...
@@ -16,17 +14,46 @@ rule beamline_sim:
...
@@ -16,17 +14,46 @@ rule beamline_sim:
"""
"""
rule beamline_analysis:
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:
params:
xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml",
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:
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
This diff is collapsed.
Click to expand it.
benchmarks/beamline/beamlineAnalysis.C
+
14
−
7
View file @
2daefa97
...
@@ -21,7 +21,14 @@ using RNode = ROOT::RDF::RNode;
...
@@ -21,7 +21,14 @@ using RNode = ROOT::RDF::RNode;
void
beamlineAnalysis
(
TString
inFile
=
"/scratch/EIC/G4out/beamline/beamlineTest.edm4hep.root"
,
void
beamlineAnalysis
(
TString
inFile
=
"/scratch/EIC/G4out/beamline/beamlineTest.edm4hep.root"
,
TString
outFile
=
"output.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
//Set ROOT style
gStyle
->
SetPadLeftMargin
(
0
.
1
);
// Set left margin
gStyle
->
SetPadLeftMargin
(
0
.
1
);
// Set left margin
...
@@ -305,9 +312,9 @@ void beamlineAnalysis( TString inFile = "/scratch/EIC/G4out/beamline/b
...
@@ -305,9 +312,9 @@ void beamlineAnalysis( TString inFile = "/scratch/EIC/G4out/beamline/b
}
}
// Save 2D canvases as pngs
// Save 2D canvases as pngs
cXY
->
SaveAs
(
"
beamspot
.png"
);
cXY
->
SaveAs
(
beamspot
CanvasName
);
cX
->
SaveAs
(
"
x_px
.png"
);
cX
->
SaveAs
(
x_px
CanvasName
);
cY
->
SaveAs
(
"
y_py
.png"
);
cY
->
SaveAs
(
y_py
CanvasName
);
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Create histograms showing the fitted means and standard deviations of the positions and momenta
// 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
...
@@ -375,7 +382,7 @@ void beamlineAnalysis( TString inFile = "/scratch/EIC/G4out/beamline/b
cFittedMeans
->
SetGrid
();
cFittedMeans
->
SetGrid
();
cFittedMeans
->
Update
();
cFittedMeans
->
Update
();
// Save the canvas as a PNG file
// Save the canvas as a PNG file
cFittedMeans
->
SaveAs
(
"
fitted
_means_stddevs.png"
);
cFittedMeans
->
SaveAs
(
fitted
PositionMeansCanvasName
);
// Create a canvas for the fitted momentum means and standard deviations
// Create a canvas for the fitted momentum means and standard deviations
TCanvas
*
cFittedMomentumMeans
=
new
TCanvas
(
"cFittedMomentumMeans"
,
"Fitted Momentum Means and Std Deviation"
,
1200
,
800
);
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
...
@@ -391,7 +398,7 @@ void beamlineAnalysis( TString inFile = "/scratch/EIC/G4out/beamline/b
cFittedMomentumMeans
->
SetGrid
();
cFittedMomentumMeans
->
SetGrid
();
cFittedMomentumMeans
->
Update
();
cFittedMomentumMeans
->
Update
();
// Save the canvas as a PNG file
// Save the canvas as a PNG file
cFittedMomentumMeans
->
SaveAs
(
"
fitted
_m
omentum
_m
eans
_stddevs.png"
);
cFittedMomentumMeans
->
SaveAs
(
fitted
M
omentum
M
eans
CanvasName
);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
@@ -432,7 +439,7 @@ void beamlineAnalysis( TString inFile = "/scratch/EIC/G4out/beamline/b
...
@@ -432,7 +439,7 @@ void beamlineAnalysis( TString inFile = "/scratch/EIC/G4out/beamline/b
cPipeParams
->
SetGrid
();
cPipeParams
->
SetGrid
();
cPipeParams
->
Update
();
cPipeParams
->
Update
();
// Save the canvas as a PNG file
// Save the canvas as a PNG file
cPipeParams
->
SaveAs
(
"
pipe
_p
aram
eters.png"
);
cPipeParams
->
SaveAs
(
pipe
P
aram
sCanvasName
);
TFile
*
f
=
new
TFile
(
outFile
,
"RECREATE"
);
TFile
*
f
=
new
TFile
(
outFile
,
"RECREATE"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment