Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
reconstruction_benchmarks
Commits
a5f76dd8
Commit
a5f76dd8
authored
1 year ago
by
Christopher Dilks
Committed by
Wouter Deconinck
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
ci: enable dRICH benchmarks and run 3 fixed-eta tests
parent
a9393c70
Branches
Branches containing commit
No related tags found
1 merge request
!306
ci: enable dRICH benchmarks and run 3 fixed-eta tests
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
benchmarks/rich/config.yml
+22
-4
22 additions, 4 deletions
benchmarks/rich/config.yml
benchmarks/rich/run_benchmark.rb
+63
-30
63 additions, 30 deletions
benchmarks/rich/run_benchmark.rb
with
86 additions
and
34 deletions
.gitlab-ci.yml
+
1
−
0
View file @
a5f76dd8
...
@@ -112,6 +112,7 @@ include:
...
@@ -112,6 +112,7 @@ include:
-
local
:
'
benchmarks/imaging_ecal/config.yml'
-
local
:
'
benchmarks/imaging_ecal/config.yml'
-
local
:
'
benchmarks/imaging_shower_ML/config.yml'
-
local
:
'
benchmarks/imaging_shower_ML/config.yml'
-
local
:
'
benchmarks/far_forward/config.yml'
-
local
:
'
benchmarks/far_forward/config.yml'
-
local
:
'
benchmarks/rich/config.yml'
final_report
:
final_report
:
stage
:
finish
stage
:
finish
...
...
This diff is collapsed.
Click to expand it.
benchmarks/rich/config.yml
+
22
−
4
View file @
a5f76dd8
rich_job_x
:
rich_compile
:
stage
:
compile
extends
:
.compile_benchmark
script
:
-
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=.local
-
cmake --build build -j2
-
cmake --install build
drich_fixed_eta
:
extends
:
.rec_benchmark
extends
:
.rec_benchmark
timeout
:
2
4
hours
timeout
:
2 hours
stage
:
run
stage
:
run
needs
:
-
rich_compile
script
:
script
:
-
bash benchmarks/rich/forward_hadrons.sh
-
|
for mode in fixedEtaIdeal fixedEtaMin fixedEtaMax ; do
ruby benchmarks/rich/run_benchmark.rb --ci -s $mode --num-events 50
done
rich_collect
:
stage
:
collect
needs
:
-
drich_fixed_eta
script
:
-
echo "Done collecting artifacts."
This diff is collapsed.
Click to expand it.
benchmarks/rich/run_benchmark.rb
+
63
−
30
View file @
a5f76dd8
...
@@ -4,11 +4,16 @@
...
@@ -4,11 +4,16 @@
require
'optparse'
require
'optparse'
require
'ostruct'
require
'ostruct'
require
'fileutils'
###################################
###################################
# constants:
# constants:
IdealTheta
=
23.5
# [degrees]
EtaTestValues
=
{
IdealEnergy
=
20.0
# [GeV]
:ideal
=>
2.0
,
:min
=>
1.6
,
:max
=>
3.5
,
}
IdealEnergy
=
12.0
# [GeV]
IdealParticle
=
'pi+'
IdealParticle
=
'pi+'
###################################
###################################
...
@@ -17,7 +22,7 @@ IdealParticle = 'pi+'
...
@@ -17,7 +22,7 @@ IdealParticle = 'pi+'
# default opt
# default opt
opt
=
OpenStruct
.
new
opt
=
OpenStruct
.
new
opt
.
evgen
=
''
opt
.
sim_mode
=
''
opt
.
sim_file
=
'out/sim.edm4hep.root'
opt
.
sim_file
=
'out/sim.edm4hep.root'
opt
.
rec_file
=
'out/rec.edm4hep.root'
opt
.
rec_file
=
'out/rec.edm4hep.root'
opt
.
ana_file
=
'out/ana.edm4hep.root'
opt
.
ana_file
=
'out/ana.edm4hep.root'
...
@@ -32,12 +37,13 @@ opt.algos = Array.new
...
@@ -32,12 +37,13 @@ opt.algos = Array.new
opt
.
plots
=
Array
.
new
opt
.
plots
=
Array
.
new
opt
.
verbosity
=
0
opt
.
verbosity
=
0
opt
.
dry_run
=
false
opt
.
dry_run
=
false
opt
.
using_ci
=
false
# available
event gener
ation modes
# available
simul
ation modes
avail_
evgen
s
=
[
avail_
sim_mode
s
=
[
'
idealAngle
'
,
'
fixedEtaIdeal
'
,
'
minTheta
'
,
'
fixedEtaMin
'
,
'
maxTheta
'
,
'
fixedEtaMax
'
,
]
]
# parse options
# parse options
...
@@ -57,16 +63,16 @@ OptionParser.new do |o|
...
@@ -57,16 +63,16 @@ OptionParser.new do |o|
required_set
=
true
required_set
=
true
end
end
o
.
separator
''
o
.
separator
''
o
.
on
(
"-
e
"
,
"--
evgen [EVGE
N_MODE]"
,
"Run the
event gener
ation, reconstruction, and analysis"
,
o
.
on
(
"-
s
"
,
"--
sim-mode [SIMULATIO
N_MODE]"
,
"Run the
simul
ation, reconstruction, and analysis"
,
"[
EVGE
N_MODE] must be one of:"
)
do
|
a
|
"[
SIMULATIO
N_MODE] must be one of:"
)
do
|
a
|
unless
avail_
evgen
s
.
include?
a
unless
avail_
sim_mode
s
.
include?
a
$stderr
.
puts
"ERROR: unknown
event gener
ation mode '
#{
a
}
'"
$stderr
.
puts
"ERROR: unknown
simul
ation mode '
#{
a
}
'"
exit
1
exit
1
end
end
opt
.
evgen
=
a
opt
.
sim_mode
=
a
required_set
=
true
required_set
=
true
end
end
avail_
evgen
s
.
each
{
|
it
|
o
.
separator
' '
*
40
+
it
}
avail_
sim_mode
s
.
each
{
|
it
|
o
.
separator
' '
*
40
+
it
}
o
.
separator
''
o
.
separator
''
o
.
separator
'optional options:'
.
upcase
o
.
separator
'optional options:'
.
upcase
o
.
separator
''
o
.
separator
''
...
@@ -90,6 +96,7 @@ OptionParser.new do |o|
...
@@ -90,6 +96,7 @@ OptionParser.new do |o|
o
.
separator
''
o
.
separator
''
o
.
on
(
"-v"
,
"--verbose"
,
"Increase verbosity (-vv for more verbose)"
)
{
|
a
|
opt
.
verbosity
+=
1
}
o
.
on
(
"-v"
,
"--verbose"
,
"Increase verbosity (-vv for more verbose)"
)
{
|
a
|
opt
.
verbosity
+=
1
}
o
.
on
(
"-d"
,
"--dry-run"
,
"Dry run (just print commands)"
)
{
|
a
|
opt
.
dry_run
=
true
}
o
.
on
(
"-d"
,
"--dry-run"
,
"Dry run (just print commands)"
)
{
|
a
|
opt
.
dry_run
=
true
}
o
.
on
(
"--ci"
,
"output plots to ./results, for CI artifact collection"
)
{
|
a
|
opt
.
using_ci
=
true
}
o
.
separator
''
o
.
separator
''
o
.
on_tail
(
"-h"
,
"--help"
,
"Show this message"
)
do
o
.
on_tail
(
"-h"
,
"--help"
,
"Show this message"
)
do
puts
o
puts
o
...
@@ -131,36 +138,53 @@ end
...
@@ -131,36 +138,53 @@ end
compact_file
=
"
#{
ENV
[
'DETECTOR_PATH'
]
}
/
#{
ENV
[
'DETECTOR_CONFIG'
]
}
.xml"
compact_file
=
"
#{
ENV
[
'DETECTOR_PATH'
]
}
/
#{
ENV
[
'DETECTOR_CONFIG'
]
}
.xml"
#
event generator
command generators
#
simulation
command generators
# ---------------------------------------------------
# ---------------------------------------------------
def
theta2xyz
(
theta
)
def
theta2xyz
(
theta
)
rad
=
theta
*
Math
::
PI
/
180
[
Math
.
sin
(
theta
),
0.0
,
Math
.
cos
(
theta
)
]
[
Math
.
sin
(
rad
),
0.0
,
Math
.
cos
(
rad
)
]
end
end
def
eta2theta
(
eta
)
2
*
Math
.
atan
(
Math
.
exp
(
-
eta
))
end
# fixed angle particle gun
# fixed angle particle gun
evgen
_fixed_angle
=
Proc
.
new
do
|
theta
,
energy
,
particle
|
simulate
_fixed_angle
=
Proc
.
new
do
|
theta
,
energy
,
particle
|
[
[
"npsim"
,
"npsim"
,
"--runType batch"
,
"--runType batch"
,
"--compactFile
#{
compact_file
}
"
,
"--compactFile
#{
compact_file
}
"
,
"--outputFile
#{
opt
.
sim_file
}
"
,
"--outputFile
#{
opt
.
sim_file
}
"
,
"--part.userParticleHandler=''"
,
"--part.userParticleHandler=''"
,
# allow opticalphotons in MC particles
"--enableGun"
,
"--enableGun"
,
"--numberOfEvents
#{
opt
.
num_events
}
"
,
"--numberOfEvents
#{
opt
.
num_events
}
"
,
"--gun.particle
#{
particle
}
"
,
"--gun.particle
#{
particle
}
"
,
"--gun.energy
#{
energy
}
*GeV"
,
"--gun.energy
#{
energy
}
*GeV"
,
"--gun.direction (
#{
theta2xyz
(
theta
).
join
", "
}
)"
,
"--gun.direction
'
(
#{
theta2xyz
(
theta
).
join
", "
}
)
'
"
,
]
]
end
end
# define
event generator
command
# define
simulation
command
# ---------------------------------------------------
# ---------------------------------------------------
evgen_cmd
=
Array
.
new
sim_cmd
=
Array
.
new
case
opt
.
evgen
case
opt
.
sim_mode
when
'idealAngle'
when
/^fixedEta/
evgen_cmd
=
evgen_fixed_angle
.
call
IdealTheta
,
IdealEnergy
,
IdealParticle
key
=
opt
.
sim_mode
.
sub
(
'fixedEta'
,
''
).
downcase
.
to_sym
fixed_eta
=
EtaTestValues
[
key
]
if
fixed_eta
.
nil?
$stderr
.
puts
"ERROR: EtaTestValues[
#{
key
}
] is not defined"
exit
1
end
fixed_theta
=
eta2theta
fixed_eta
puts
"""Simulating fixed-eta events:
- eta =
#{
fixed_eta
}
- theta =
#{
180.0
*
fixed_theta
/
Math
::
PI
}
degrees
- energy =
#{
IdealEnergy
}
GeV
- particle =
#{
IdealParticle
}
"""
sim_cmd
=
simulate_fixed_angle
.
call
fixed_theta
,
IdealEnergy
,
IdealParticle
else
else
exit
1
if
run_step
[
:sim
]
exit
1
if
run_step
[
:sim
]
end
end
...
@@ -187,6 +211,7 @@ recon_cmd = [
...
@@ -187,6 +211,7 @@ recon_cmd = [
'-Pjana:debug_plugin_loading="1"'
,
'-Pjana:debug_plugin_loading="1"'
,
'-Pacts:MaterialMap="calibrations/materials-map.cbor"'
,
'-Pacts:MaterialMap="calibrations/materials-map.cbor"'
,
"-Ppodio:output_file=
\"
#{
opt
.
rec_file
}
\"
"
,
"-Ppodio:output_file=
\"
#{
opt
.
rec_file
}
\"
"
,
'-PDRICH:DRICHIrtCherenkovParticleID:cheatPhotonVertex=true'
,
# allow knowledge of true photons, for accurate residual determination
opt
.
sim_file
,
opt
.
sim_file
,
]
]
...
@@ -206,7 +231,7 @@ analysis_cmd.append '-' + 'v'*opt.verbosity if opt.verbosity > 0
...
@@ -206,7 +231,7 @@ analysis_cmd.append '-' + 'v'*opt.verbosity if opt.verbosity > 0
draw_cmd
=
[
draw_cmd
=
[
"
#{
__dir__
}
/draw_benchmark.py"
,
"
#{
__dir__
}
/draw_benchmark.py"
,
"-i
#{
opt
.
ana_file
}
"
,
"-i
#{
opt
.
ana_file
}
"
,
"-o
#{
opt
.
ana_file
.
gsub
(
/edm4hep.root$/
,
"plots"
)
}
"
"-o
#{
opt
.
using_ci
?
"results/
#{
opt
.
sim_mode
}
"
:
opt
.
ana_file
.
gsub
(
/edm4hep.root$/
,
"plots"
)
}
"
]
]
# execute commands
# execute commands
...
@@ -215,6 +240,14 @@ draw_cmd = [
...
@@ -215,6 +240,14 @@ draw_cmd = [
# proc: execute a command; raise runtime exception if failure (exit nonzero)
# proc: execute a command; raise runtime exception if failure (exit nonzero)
exe
=
Proc
.
new
do
|
cmd_args
,
name
,
step
|
exe
=
Proc
.
new
do
|
cmd_args
,
name
,
step
|
if
run_step
[
step
]
if
run_step
[
step
]
case
step
when
:sim
FileUtils
.
mkdir_p
File
.
dirname
(
opt
.
sim_file
)
when
:rec
FileUtils
.
mkdir_p
File
.
dirname
(
opt
.
rec_file
)
when
:ana
FileUtils
.
mkdir_p
File
.
dirname
(
opt
.
ana_file
)
end
cmd
=
cmd_args
.
join
' '
cmd
=
cmd_args
.
join
' '
puts
"benchmark
#{
name
}
command:"
.
upcase
puts
"benchmark
#{
name
}
command:"
.
upcase
cmd_args
.
each_with_index
do
|
arg
,
i
|
cmd_args
.
each_with_index
do
|
arg
,
i
|
...
@@ -234,7 +267,7 @@ end
...
@@ -234,7 +267,7 @@ end
puts
'-'
*
50
puts
'-'
*
50
# execute the commands
# execute the commands
exe
.
call
evgen
_cmd
,
'event gener
ation'
,
:sim
exe
.
call
sim
_cmd
,
'simul
ation'
,
:sim
exe
.
call
recon_cmd
,
'reconstruction'
,
:rec
exe
.
call
recon_cmd
,
'reconstruction'
,
:rec
exe
.
call
analysis_cmd
,
'analysis'
,
:ana
exe
.
call
analysis_cmd
,
'analysis'
,
:ana
exe
.
call
draw_cmd
,
'draw'
,
:ana
exe
.
call
draw_cmd
,
'draw'
,
:ana
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