Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
athena
Manage
Activity
Members
Labels
Plan
Issues
38
Issue boards
Milestones
Wiki
Code
Merge requests
34
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
detectors
athena
Commits
9044fdc7
Commit
9044fdc7
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Feature: check overlaps with geant4
parent
25edacd4
No related branches found
No related tags found
1 merge request
!25
Feature: check overlaps with geant4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+16
-7
16 additions, 7 deletions
.gitlab-ci.yml
scripts/checkOverlaps.py
+45
-0
45 additions, 0 deletions
scripts/checkOverlaps.py
scripts/convert_to_gdml.py
+2
-2
2 additions, 2 deletions
scripts/convert_to_gdml.py
with
63 additions
and
9 deletions
.gitlab-ci.yml
+
16
−
7
View file @
9044fdc7
...
@@ -136,14 +136,23 @@ dump_constants:
...
@@ -136,14 +136,23 @@ dump_constants:
script
:
script
:
-
npdet_info dump ${DETECTOR_PATH}/athena.xml | tee doc/constants.out
-
npdet_info dump ${DETECTOR_PATH}/athena.xml | tee doc/constants.out
overlap_check
:
overlap_check
_tgeo
:
stage
:
test
stage
:
test
needs
:
needs
:
-
[
"
common:detector"
]
-
[
"
common:detector"
]
script
:
script
:
-
checkOverlaps -c ${DETECTOR_PATH}/athena.xml | tee doc/overlap_check.out
-
checkOverlaps -c ${DETECTOR_PATH}/athena.xml | tee doc/overlap_check_tgeo.out
-
echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
-
echo "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l) overlaps..."
-
if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" &&
false
; fi
-
if [[ "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" &&
false
; fi
overlap_check_geant4
:
stage
:
test
needs
:
-
[
"
common:detector"
]
script
:
-
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/athena.xml | tee doc/overlap_check_geant4.out
-
echo "$(cat doc/overlap_check_geant4.out | grep GeomVol1002 | wc -l) overlaps..."
-
if [[ "$(cat doc/overlap_check_geant4.out | grep GeomVol1002 | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" &&
false
; fi
convert_to_gdml
:
convert_to_gdml
:
stage
:
test
stage
:
test
...
@@ -177,7 +186,7 @@ benchmarks:detector:
...
@@ -177,7 +186,7 @@ benchmarks:detector:
trigger
:
trigger
:
project
:
EIC/benchmarks/detector_benchmarks
project
:
EIC/benchmarks/detector_benchmarks
strategy
:
depend
strategy
:
depend
needs
:
[
"
overlap_check"
,
"
report"
]
needs
:
[
"
overlap_check
_tgeo"
,
"
overlap_check_geant4
"
,
"
report"
]
allow_failure
:
true
allow_failure
:
true
...
@@ -189,7 +198,7 @@ benchmarks:detector:
...
@@ -189,7 +198,7 @@ benchmarks:detector:
# trigger:
# trigger:
# project: EIC/benchmarks/reconstruction_benchmarks
# project: EIC/benchmarks/reconstruction_benchmarks
# strategy: depend
# strategy: depend
# needs: ["env","overlap_check","report"]
# needs: ["env","overlap_check
_tgeo","overlap_check_geant4
","report"]
#
#
#
#
#benchmarks:physics:
#benchmarks:physics:
...
@@ -200,5 +209,5 @@ benchmarks:detector:
...
@@ -200,5 +209,5 @@ benchmarks:detector:
# trigger:
# trigger:
# project: EIC/benchmarks/physics_benchmarks
# project: EIC/benchmarks/physics_benchmarks
# strategy: depend
# strategy: depend
# needs: ["env","overlap_check","report"]
# needs: ["env","overlap_check
_tgeo","overlap_check_geant4
","report"]
This diff is collapsed.
Click to expand it.
scripts/checkOverlaps.py
0 → 100755
+
45
−
0
View file @
9044fdc7
from
__future__
import
absolute_import
,
unicode_literals
import
os
import
time
import
logging
import
argparse
parser
=
argparse
.
ArgumentParser
(
prog
=
'
convert_to_gdml.py
'
,
description
=
'''
Convert DD4Hep description to GDML
'''
,
epilog
=
'''
This program converts the compact detector file to a single GDML file.
'''
)
parser
.
add_argument
(
"
-c
"
,
"
--compact
"
,
help
=
"
compact detector file
"
,
default
=
"
athena.xml
"
)
parser
.
add_argument
(
"
-r
"
,
"
--resolution
"
,
help
=
"
number of points on surface
"
,
default
=
"
10000
"
)
parser
.
add_argument
(
"
-t
"
,
"
--tolerance
"
,
help
=
"
minimum distance (in mm) to report overlaps
"
,
default
=
"
0.1
"
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
help
=
"
print output
"
,
action
=
'
store_true
'
)
args
=
parser
.
parse_args
()
import
DDG4
from
g4units
import
keV
,
GeV
,
mm
,
ns
,
MeV
def
run
():
kernel
=
DDG4
.
Kernel
()
description
=
kernel
.
detectorDescription
()
kernel
.
loadGeometry
(
str
(
"
file:
"
+
args
.
compact
))
DDG4
.
importConstants
(
description
)
geant4
=
DDG4
.
Geant4
(
kernel
)
ui
=
geant4
.
setupCshUI
(
ui
=
None
)
ui
.
Commands
=
[
'
/geometry/test/resolution {}
'
.
format
(
args
.
resolution
),
'
/geometry/test/tolerance {}
'
.
format
(
args
.
tolerance
),
'
/geometry/test/verbosity {}
'
.
format
(
1
if
args
.
verbose
else
0
),
'
/geometry/test/run
'
]
kernel
.
configure
()
kernel
.
initialize
()
kernel
.
run
()
kernel
.
terminate
()
if
__name__
==
"
__main__
"
:
run
()
This diff is collapsed.
Click to expand it.
scripts/convert_to_gdml.py
+
2
−
2
View file @
9044fdc7
...
@@ -10,8 +10,8 @@ parser = argparse.ArgumentParser(
...
@@ -10,8 +10,8 @@ parser = argparse.ArgumentParser(
epilog
=
'''
epilog
=
'''
This program converts the compact detector file to a single GDML file.
This program converts the compact detector file to a single GDML file.
'''
)
'''
)
parser
.
add_argument
(
"
--compact
"
,
help
=
"
compact detector file
"
,
default
=
"
athena.xml
"
)
parser
.
add_argument
(
"
-c
"
,
"
--compact
"
,
help
=
"
compact detector file
"
,
default
=
"
athena.xml
"
)
parser
.
add_argument
(
"
--output
"
,
help
=
"
gdml detector file
"
,
default
=
"
athena.gdml
"
)
parser
.
add_argument
(
"
-o
"
,
"
--output
"
,
help
=
"
gdml detector file
"
,
default
=
"
athena.gdml
"
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
...
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