Skip to content

Commit 2ce151d

Browse files
simongeveprbl
andauthored
Create Beamline benchmark (#154)
Adds a first round of electron beamline benchmarks which demonstrate the path taken by the electron beam through the outgoing beamline magnets. Plots show the position and shape of the beamspot, correlation between position and momentum. The position, rotation and radius of the detector planes is also output. Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
1 parent 6e5eb79 commit 2ce151d

File tree

7 files changed

+782
-0
lines changed

7 files changed

+782
-0
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ get_data:
126126
include:
127127
- local: 'benchmarks/backgrounds/config.yml'
128128
- local: 'benchmarks/backwards_ecal/config.yml'
129+
- local: 'benchmarks/beamline/config.yml'
129130
- local: 'benchmarks/calo_pid/config.yml'
130131
- local: 'benchmarks/ecal_gaps/config.yml'
131132
- local: 'benchmarks/tracking_detectors/config.yml'
@@ -159,6 +160,7 @@ deploy_results:
159160
- "collect_results:backwards_ecal"
160161
- "collect_results:barrel_ecal"
161162
- "collect_results:barrel_hcal"
163+
- "collect_results:beamline"
162164
- "collect_results:calo_pid"
163165
- "collect_results:ecal_gaps"
164166
- "collect_results:lfhcal"

Snakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def find_epic_libraries():
3333
include: "benchmarks/backgrounds/Snakefile"
3434
include: "benchmarks/backwards_ecal/Snakefile"
3535
include: "benchmarks/barrel_ecal/Snakefile"
36+
include: "benchmarks/beamline/Snakefile"
3637
include: "benchmarks/calo_pid/Snakefile"
3738
include: "benchmarks/ecal_gaps/Snakefile"
3839
include: "benchmarks/material_scan/Snakefile"

benchmarks/beamline/Snakefile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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

Comments
 (0)