Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
athena
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Fernando Torales Acosta
athena
Commits
86f05009
Commit
86f05009
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Feature: Convert to GDML script and pipeline integration
parent
c9434e57
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+9
-0
9 additions, 0 deletions
.gitlab-ci.yml
scripts/convert_to_gdml.py
+47
-0
47 additions, 0 deletions
scripts/convert_to_gdml.py
with
56 additions
and
0 deletions
.gitlab-ci.yml
+
9
−
0
View file @
86f05009
...
...
@@ -124,6 +124,7 @@ report:
-
view_15
-
dump_constants
-
dump_geometry
-
convert_to_gdml
script
:
-
pip3 install jinja2 && ls -lrth
-
./bin/make_images > doc/dawn_views.md
...
...
@@ -144,6 +145,14 @@ overlap_check:
-
echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
-
if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" &&
false
; fi
convert_to_gdml
:
stage
:
test
needs
:
-
[
"
common:detector"
]
script
:
-
mkdir -p geo
-
python scripts/convert_to_gdml.py --compact ${DETECTOR_PATH}/athena.xml --output geo/athena.gdml
tracking_geometry_debug
:
stage
:
test
allow_failure
:
true
...
...
This diff is collapsed.
Click to expand it.
scripts/convert_to_gdml.py
0 → 100755
+
47
−
0
View file @
86f05009
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
(
"
--compact
"
,
help
=
"
compact detector file
"
,
default
=
"
athena.xml
"
)
parser
.
add_argument
(
"
--output
"
,
help
=
"
gdml detector file
"
,
default
=
"
athena.gdml
"
)
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
)
#
# Setup the GDML writer action
writer
=
DDG4
.
Action
(
kernel
,
'
Geant4GDMLWriteAction/Writer
'
)
writer
.
enableUI
()
kernel
.
registerGlobalAction
(
writer
)
ui
.
Commands
=
[
'
/ddg4/Writer/Output {}
'
.
format
(
args
.
output
),
'
/ddg4/Writer/OverWrite 1
'
,
'
/ddg4/Writer/write
'
]
kernel
.
configure
()
kernel
.
initialize
()
kernel
.
run
()
kernel
.
terminate
()
if
__name__
==
"
__main__
"
:
run
()
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