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
Merge requests
!93
CI job to automatically generate ACTS material scans
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
CI job to automatically generate ACTS material scans
acts-material-maps
into
master
Overview
0
Commits
13
Pipelines
0
Changes
4
Merged
CI job to automatically generate ACTS material scans
Wouter Deconinck
requested to merge
acts-material-maps
into
master
Sep 29, 2021
Overview
0
Commits
13
Pipelines
0
Changes
4
0
0
Merge request reports
Compare
master
version 13
38bac42d
Oct 17, 2021
version 12
803815b2
Oct 17, 2021
version 11
83c530b3
Oct 16, 2021
version 10
bc8fb048
Oct 16, 2021
version 9
99f944e2
Oct 6, 2021
version 8
51c294d9
Sep 30, 2021
version 7
2ca3ba06
Sep 30, 2021
version 6
0bd82322
Sep 30, 2021
version 5
f984c47a
Sep 30, 2021
version 4
3c43b8ee
Sep 30, 2021
version 3
4f3efa06
Sep 30, 2021
version 2
8f346aea
Sep 29, 2021
version 1
d746743c
Sep 29, 2021
master (base)
and
version 5
latest version
43fef8ef
13 commits,
Oct 17, 2021
version 13
38bac42d
12 commits,
Oct 17, 2021
version 12
803815b2
11 commits,
Oct 17, 2021
version 11
83c530b3
10 commits,
Oct 16, 2021
version 10
bc8fb048
9 commits,
Oct 16, 2021
version 9
99f944e2
8 commits,
Oct 6, 2021
version 8
51c294d9
8 commits,
Sep 30, 2021
version 7
2ca3ba06
7 commits,
Sep 30, 2021
version 6
0bd82322
6 commits,
Sep 30, 2021
version 5
f984c47a
5 commits,
Sep 30, 2021
version 4
3c43b8ee
4 commits,
Sep 30, 2021
version 3
4f3efa06
3 commits,
Sep 30, 2021
version 2
8f346aea
2 commits,
Sep 29, 2021
version 1
d746743c
1 commit,
Sep 29, 2021
4 files
+
263
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
benchmarks/material_maps/scripts/configureMap.py
0 → 100644
+
101
−
0
View file @ f984c47a
Edit in single-file editor
Open in Web IDE
# This file is part of the Acts project.
#
# Copyright (C) 2020-2021 CERN for the benefit of the Acts project
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import
json
import
sys
# Should be run with Python 3 if possible
# Script that use the json config file to configure the Json surfaces map for the material mapping
# Take two arguments in input : The path to the surfaces map and the path of the json config file
# By default the input is : 'surfaces-map.json' and the output is : 'config-map.json'
# The config file can be used to define a binning for all the surfaces in a given volume
# It can also be used to define the binning for volume mapping
if
sys
.
version_info
[
0
]
<
3
:
print
(
'
Using Python 2
'
)
print
(
'
To obtain the proper ordering in the Json files Python 3 is recomanded
'
)
if
len
(
sys
.
argv
)
<
2
:
inFileName
=
'
geometry-maps.json
'
confFileName
=
'
config-map.json
'
if
len
(
sys
.
argv
)
<
3
:
confFileName
=
'
config-map.json
'
else
:
inFileName
=
sys
.
argv
[
1
]
confFileName
=
sys
.
argv
[
2
]
with
open
(
inFileName
,
'
r+
'
)
as
json_file
:
with
open
(
confFileName
,
'
r
'
)
as
config_file
:
config
=
json
.
load
(
config_file
)
data
=
json
.
load
(
json_file
)
for
entry
in
data
[
'
Surfaces
'
][
'
entries
'
]:
if
'
type
'
not
in
entry
[
'
value
'
][
'
bounds
'
]:
entry
[
'
value
'
][
'
bounds
'
][
'
type
'
]
=
''
if
'
layer
'
in
entry
:
if
'
approach
'
not
in
entry
:
if
'
sensitive
'
not
in
entry
:
for
conf
in
config
[
'
Surfaces
'
][
str
(
entry
[
'
volume
'
])]:
if
'
layer
'
in
conf
and
conf
[
'
layer
'
]
==
'
X
'
and
conf
[
'
value
'
][
'
bounds
'
][
'
type
'
]
==
entry
[
'
value
'
][
'
bounds
'
][
'
type
'
]:
entry
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
entry
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
ibin
=
0
for
bin
in
entry
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
]:
bin
[
'
bins
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
][
ibin
][
'
bins
'
]
ibin
=
ibin
+
1
continue
continue
if
'
boundary
'
in
entry
:
if
'
layer
'
not
in
entry
:
for
conf
in
config
[
'
Surfaces
'
][
str
(
entry
[
'
volume
'
])]:
if
'
boundary
'
in
conf
and
conf
[
'
boundary
'
]
==
entry
[
'
boundary
'
]
and
conf
[
'
value
'
][
'
bounds
'
][
'
type
'
]
==
entry
[
'
value
'
][
'
bounds
'
][
'
type
'
]:
entry
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
entry
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
ibin
=
0
for
bin
in
entry
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
]:
bin
[
'
bins
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
][
ibin
][
'
bins
'
]
ibin
=
ibin
+
1
continue
continue
if
'
approach
'
in
entry
:
if
'
sensitive
'
not
in
entry
:
for
conf
in
config
[
'
Surfaces
'
][
str
(
entry
[
'
volume
'
])]:
if
'
approach
'
in
conf
and
conf
[
'
approach
'
]
==
entry
[
'
approach
'
]
and
conf
[
'
value
'
][
'
bounds
'
][
'
type
'
]
==
entry
[
'
value
'
][
'
bounds
'
][
'
type
'
]:
entry
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
entry
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
ibin
=
0
for
bin
in
entry
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
]:
bin
[
'
bins
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
][
ibin
][
'
bins
'
]
ibin
=
ibin
+
1
continue
continue
if
'
sensitive
'
in
entry
:
if
'
approach
'
not
in
entry
:
for
conf
in
config
[
'
Surfaces
'
][
str
(
entry
[
'
volume
'
])]:
if
'
sensitive
'
in
conf
and
conf
[
'
sensitive
'
]
==
'
X
'
and
conf
[
'
layer
'
]
==
entry
[
'
layer
'
]
and
conf
[
'
value
'
][
'
bounds
'
][
'
type
'
]
==
entry
[
'
value
'
][
'
bounds
'
][
'
type
'
]:
entry
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mapMaterial
'
]
entry
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
mappingType
'
]
ibin
=
0
for
bin
in
entry
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
]:
bin
[
'
bins
'
]
=
conf
[
'
value
'
][
'
material
'
][
'
binUtility
'
][
'
binningdata
'
][
ibin
][
'
bins
'
]
ibin
=
ibin
+
1
continue
continue
data
[
'
Volumes
'
]
=
config
[
'
Volumes
'
]
json_file
.
seek
(
0
)
json
.
dump
(
data
,
json_file
,
indent
=
4
)
json_file
.
truncate
()
Loading