From 71eb8521610abc1f17ebfd419305b1868ab8c386 Mon Sep 17 00:00:00 2001 From: Whitney Armstrong <warmstrong@anl.gov> Date: Sun, 19 Jul 2020 14:31:03 -0500 Subject: [PATCH] modified: links.md modified: part3/simulating_detectors.md --- src/docs/links.md | 5 +++- src/docs/part3/simulating_detectors.md | 34 ++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/docs/links.md b/src/docs/links.md index 7dde024..7630655 100644 --- a/src/docs/links.md +++ b/src/docs/links.md @@ -43,5 +43,8 @@ https://indico.cern.ch/event/258092/contributions/1588579/attachments/454221/629 ## Others ### gaudi -https://gaudi-framework.readthedocs.io/en/latest/index.html + +- [Gaudi Read-the-docs](https://gaudi-framework.readthedocs.io/en/latest/index.html) +- [Gaudi HPX Discussion](https://indico.cern.ch/event/532371/) +- [Gaudo 2016 workshop](https://indico.cern.ch/event/556551/) diff --git a/src/docs/part3/simulating_detectors.md b/src/docs/part3/simulating_detectors.md index 6844073..aa7b43a 100644 --- a/src/docs/part3/simulating_detectors.md +++ b/src/docs/part3/simulating_detectors.md @@ -36,7 +36,6 @@ or XML should be straightforward. To be completed. ```python -#!/usr/bin/env python from __future__ import absolute_import, unicode_literals import os import time @@ -159,7 +158,38 @@ if __name__ == "__main__": ### Setup using XML -To be completed. +A lot of the setup can be off loaded to XML files. + +For example, the above setup can be run as followed: + +```python +from __future__ import absolute_import, unicode_literals +import os +import time +import logging +import DDG4 +from DDG4 import OutputLevel as Output +from g4units import keV, GeV, mm, ns, MeV + +def run(): + #os.environ['G4UI_USE_TCSH'] = "1" + kernel = DDG4.Kernel() + description = kernel.detectorDescription() + + kernel.loadGeometry(str("file:" + "solid_sidis.xml")) + kernel.loadXML(str("file:solid/sim/field.xml")) + kernel.loadXML(str("file:solid/sim/sequences.xml")) + kernel.loadXML(str("file:solid/sim/physics.xml")) + + kernel.configure() + kernel.initialize() + + kernel.run() + kernel.terminate() + +if __name__ == "__main__": + run() +``` -- GitLab