Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchall committed Aug 10, 2016
1 parent 4c924d8 commit b1b41b0
Show file tree
Hide file tree
Showing 53 changed files with 391 additions and 280 deletions.
6 changes: 6 additions & 0 deletions examples-docs/Basic/FlatteningFilter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _example_basic_flatteningfilter:

FlatteningFilter.txt
--------------------

.. literalinclude:: /examples/Basic/FlatteningFilter.txt
1 change: 1 addition & 0 deletions examples-docs/Basic/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Basic
DividedComponents
Emittance_Gaussian
Emittance_Twiss
FlatteningFilter
Isotope
LayeredMassGeometry
OneBox
Expand Down
6 changes: 6 additions & 0 deletions examples-docs/PhaseSpace/WriteROOT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _example_phsp_root_write:

WriteROOT.txt
--------------

.. literalinclude:: /examples/PhaseSpace/WriteROOT.txt
19 changes: 10 additions & 9 deletions examples-docs/PhaseSpace/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ PhaseSpace
==========

.. toctree::
:maxdepth: 1
:maxdepth: 1

MultiRun_Write_ASCII
ReadASCII
ReadBinary
ReadLimited
WriteASCII
WriteBinary
WriteIonsASCII
WriteLimited
MultiRun_Write_ASCII
ReadASCII
ReadBinary
ReadLimited
WriteASCII
WriteBinary
WriteIonsASCII
WriteLimited
WriteROOT
6 changes: 3 additions & 3 deletions examples/Basic/DNAModelByRegions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# A simple geometry. The material must be G4_WATER.
s:Ge/Target/Parent = "World"
s:Ge/Target/Type = "G4Box"
s:Ge/Target/Type = "TsBox"
s:Ge/Target/Material = "G4_WATER"
d:Ge/Target/HLX = 0.5 um
d:Ge/Target/HLY = 0.5 um
Expand All @@ -24,7 +24,7 @@ s:Ge/World/Material = "G4_WATER"
s:Ge/World/Color = "blue"

# Start with a physics list
sv:Ph/Default/Modules = 7 "g4em-penelope" "g4h-phy_QGSP_BIC_HP" "g4decay" "g4ion-binarycascade" "g4h-elastic_HP" "g4stopping" "g4radioactivedecay"
sv:Ph/Default/Modules = 6 "g4em-penelope" "g4h-phy_QGSP_BIC_HP" "g4decay" "g4ion-binarycascade" "g4h-elastic_HP" "g4stopping"
# Set the regions where g4em-penelope is switch to g4-dna (opt1)
sv:Ph/Default/ActiveG4DNAInRegionsNamed = 1 "target"
s:Ph/Default/DNAModelName = "opt1" # Default is "opt0"
Expand All @@ -35,7 +35,7 @@ s:So/Example/Component = "BeamPosition"
s:So/Example/BeamParticle = "proton"
d:So/Example/BeamEnergy = 5 MeV
u:So/Example/BeamEnergySpread = 0.757504
s:So/Example/BeamPositionDistribution = "Point"
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution = "Gaussian"
d:So/Example/BeamAngularCutoffX = 90. deg
d:So/Example/BeamAngularCutoffY = 90. deg
Expand Down
2 changes: 1 addition & 1 deletion examples/Basic/Emittance_Gaussian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ d:Ge/MyBeamSizeInX = 20.0 cm
d:Ge/MyBeamSizeInY = 20.0 cm

#--- Beam Box
s:Ge/PlaneAtBeamPosition/Type = "G4Box"
s:Ge/PlaneAtBeamPosition/Type = "TsBox"
s:Ge/PlaneAtBeamPosition/Material = "Vacuum"
s:Ge/PlaneAtBeamPosition/Parent = "World"
d:Ge/PlaneAtBeamPosition/HLX = 0.5 cm + Ge/MyBeamSizeInX
Expand Down
35 changes: 35 additions & 0 deletions examples/Basic/FlatteningFilter.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is not any particular actual flattening filter.
# It just demonstrates the general principle of how to
# combine two different kinds of polycones to create
# a shape that no single polycone can represent.

b:Ge/World/Invisible = "True"

s:Gr/MyViewA/Type = "OpenGL"
d:Gr/MyViewA/Phi = 45. deg
d:Gr/MyViewA/Theta = 45. deg

b:Ts/PauseBeforeQuit = "True"

s:Ge/FlatteningFilter/Type = "Group"
s:Ge/FlatteningFilter/Parent = "World"
#d:Ge/FlatteningFilter/RotX = 90. deg

# Inner section is implemented as a Solid Polycone
s:Ge/InnerCone/Type = "G4SPolycone"
s:Ge/InnerCone/Parent = "FlatteningFilter"
s:Ge/InnerCone/Material = "G4_Ti"
s:Ge/InnerCone/Color = "grey"
s:Ge/InnerCone/DrawingStyle = "Solid"
dv:Ge/InnerCone/R = 7 0 9 9 6 5 2 0 mm
dv:Ge/InnerCone/Z = 7 0 0 1 2 6 8 10 mm

# Outer section is implemented as a Hollow Polycone
s:Ge/OuterCone/Type = "G4HPolycone"
s:Ge/OuterCone/Parent = "FlatteningFilter"
s:Ge/OuterCone/Material = "G4_Ti"
s:Ge/OuterCone/Color = "brown"
s:Ge/OuterCone/DrawingStyle = "Solid"
dv:Ge/OuterCone/ROuter = 4 15 15 15 15 mm
dv:Ge/OuterCone/RInner = 4 9 9 10 13 mm
dv:Ge/OuterCone/Z = 4 0 1 2 3 mm
2 changes: 1 addition & 1 deletion examples/Basic/Isotope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ i:Is/U238/Z = 92
i:Is/U238/N = 238
d:Is/U238/A = 238.03 g/mole

s:Ge/MyBox/Type = "G4Box"
s:Ge/MyBox/Type = "TsBox"
s:Ge/MyBox/Material = "MyUranium"
s:Ge/MyBox/Parent = "World"
d:Ge/MyBox/HLX = 2.5 m
Expand Down
2 changes: 1 addition & 1 deletion examples/Basic/LayeredMassGeometry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape = "Ellipse"
d:So/Example/BeamPositionCutoffX = 5 cm
d:So/Example/BeamPositionCutoffY = 20 cm
s:So/Example/BeamAngularDistribution = "Point"
s:So/Example/BeamAngularDistribution = "None"
i:So/Example/NumberOfHistoriesInRun = 10

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
Expand Down
2 changes: 1 addition & 1 deletion examples/Basic/OneBox.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Simplest TOPAS example.
# A box in a beam with EM physics.

s:Ge/MyBox/Type = "G4Box"
s:Ge/MyBox/Type = "TsBox"
s:Ge/MyBox/Material = "Air"
s:Ge/MyBox/Parent = "World"
d:Ge/MyBox/HLX = 2.5 m
Expand Down
66 changes: 33 additions & 33 deletions examples/Basic/ShapeTestWithAllParameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
# http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch04.html#sect.Geom.Solids

# Box
s:Ge/DemoG4Box/Type = "G4Box"
s:Ge/DemoG4Box/Parent = "World"
s:Ge/DemoG4Box/Material = "Air"
d:Ge/DemoG4Box/TransX = 0 cm
d:Ge/DemoG4Box/TransY = 0 cm
d:Ge/DemoG4Box/TransZ = 0 cm
d:Ge/DemoG4Box/RotX = 0 deg
d:Ge/DemoG4Box/RotY = 0 deg
d:Ge/DemoG4Box/RotZ = 0 deg
d:Ge/DemoG4Box/HLX = 30. mm
d:Ge/DemoG4Box/HLY = 40. mm
d:Ge/DemoG4Box/HLZ = 60. mm
s:Ge/DemoG4Box/Color = "white"
s:Ge/DemoBox/Type = "TsBox"
s:Ge/DemoBox/Parent = "World"
s:Ge/DemoBox/Material = "Air"
d:Ge/DemoBox/TransX = 0 cm
d:Ge/DemoBox/TransY = 0 cm
d:Ge/DemoBox/TransZ = 0 cm
d:Ge/DemoBox/RotX = 0 deg
d:Ge/DemoBox/RotY = 0 deg
d:Ge/DemoBox/RotZ = 0 deg
d:Ge/DemoBox/HLX = 30. mm
d:Ge/DemoBox/HLY = 40. mm
d:Ge/DemoBox/HLZ = 60. mm
s:Ge/DemoBox/Color = "white"

# Tubs
s:Ge/DemoTubs/Type = "G4Tubs"
s:Ge/DemoTubs/Parent = "World"
s:Ge/DemoTubs/Material = "Air"
d:Ge/DemoTubs/TransX = 0 cm
d:Ge/DemoTubs/TransY = 0 cm
d:Ge/DemoTubs/TransZ = 12 cm
d:Ge/DemoTubs/RotX = 0 deg
d:Ge/DemoTubs/RotY = 0 deg
d:Ge/DemoTubs/RotZ = 0 deg
d:Ge/DemoTubs/RMin = 10 mm
d:Ge/DemoTubs/RMax = 15 mm
d:Ge/DemoTubs/HL = 20 mm
d:Ge/DemoTubs/SPhi = 1. rad
d:Ge/DemoTubs/DPhi = 1.5 rad
s:Ge/DemoTubs/Color = "lightblue"
s:Ge/DemoTubs/DrawingStyle = "FullWireFrame"
# Cylinder
s:Ge/DemoCylinder/Type = "TsCylinder"
s:Ge/DemoCylinder/Parent = "World"
s:Ge/DemoCylinder/Material = "Air"
d:Ge/DemoCylinder/TransX = 0 cm
d:Ge/DemoCylinder/TransY = 0 cm
d:Ge/DemoCylinder/TransZ = 12 cm
d:Ge/DemoCylinder/RotX = 0 deg
d:Ge/DemoCylinder/RotY = 0 deg
d:Ge/DemoCylinder/RotZ = 0 deg
d:Ge/DemoCylinder/RMin = 10 mm
d:Ge/DemoCylinder/RMax = 15 mm
d:Ge/DemoCylinder/HL = 20 mm
d:Ge/DemoCylinder/SPhi = 1. rad
d:Ge/DemoCylinder/DPhi = 1.5 rad
s:Ge/DemoCylinder/Color = "lightblue"
s:Ge/DemoCylinder/DrawingStyle = "FullWireFrame"

# CutTubs
s:Ge/DemoCutTubs/Type = "G4CutTubs"
Expand Down Expand Up @@ -153,7 +153,7 @@ d:Ge/DemoGTrap/Alp2 = 10 deg
s:Ge/DemoGTrap/Color = "indigo"

# Sphere
s:Ge/DemoSphere/Type = "G4Sphere"
s:Ge/DemoSphere/Type = "TsSphere"
s:Ge/DemoSphere/Parent = "World"
s:Ge/DemoSphere/Material = "Air"
d:Ge/DemoSphere/TransX = 0 cm
Expand Down Expand Up @@ -233,8 +233,8 @@ d:Ge/DemoSPolycone/RotY = 0 deg
d:Ge/DemoSPolycone/RotZ = 0 deg
d:Ge/DemoSPolycone/PhiStart = 0.25 rad
d:Ge/DemoSPolycone/PhiTotal = 1.5 rad
dv:Ge/DemoSPolycone/R = 9 0 10 10 5 5 10 10 2 2 mm
dv:Ge/DemoSPolycone/Z = 9 5 7 9 11 25 27 29 31 35 mm
dv:Ge/DemoSPolycone/R = 10 0 10 10 5 5 10 10 2 2 0 mm
dv:Ge/DemoSPolycone/Z = 10 5 7 9 11 25 27 29 31 35 35 mm
s:Ge/DemoSPolycone/Color = "grey"
s:Ge/DemoSPolycone/DrawingStyle = "FullWireFrame"

Expand Down
36 changes: 18 additions & 18 deletions examples/Basic/ShapeTestWithOnlyRequiredParameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
# http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch04.html#sect.Geom.Solids

# Box
s:Ge/DemoG4Box/Type = "G4Box"
s:Ge/DemoG4Box/Parent = "World"
s:Ge/DemoG4Box/Material = "Air"
d:Ge/DemoG4Box/HLX = 30. mm
d:Ge/DemoG4Box/HLY = 40. mm
d:Ge/DemoG4Box/HLZ = 60. mm
s:Ge/DemoG4Box/Color = "white"
s:Ge/DemoBox/Type = "TsBox"
s:Ge/DemoBox/Parent = "World"
s:Ge/DemoBox/Material = "Air"
d:Ge/DemoBox/HLX = 30. mm
d:Ge/DemoBox/HLY = 40. mm
d:Ge/DemoBox/HLZ = 60. mm
s:Ge/DemoBox/Color = "white"

# Tubs
s:Ge/DemoTubs/Type = "G4Tubs"
s:Ge/DemoTubs/Parent = "World"
s:Ge/DemoTubs/Material = "Air"
d:Ge/DemoTubs/TransZ = 12 cm
d:Ge/DemoTubs/RMax = 15 mm
d:Ge/DemoTubs/HL = 20 mm
s:Ge/DemoTubs/Color = "lightblue"
s:Ge/DemoTubs/DrawingStyle = "FullWireFrame"
s:Ge/DemoCylinder/Type = "TsCylinder"
s:Ge/DemoCylinder/Parent = "World"
s:Ge/DemoCylinder/Material = "Air"
d:Ge/DemoCylinder/TransZ = 12 cm
d:Ge/DemoCylinder/RMax = 15 mm
d:Ge/DemoCylinder/HL = 20 mm
s:Ge/DemoCylinder/Color = "lightblue"
s:Ge/DemoCylinder/DrawingStyle = "FullWireFrame"

# CutTubs
s:Ge/DemoCutTubs/Type = "G4CutTubs"
Expand Down Expand Up @@ -122,7 +122,7 @@ d:Ge/DemoGTrap/Alp2 = 10 deg
s:Ge/DemoGTrap/Color = "indigo"

# Sphere
s:Ge/DemoSphere/Type = "G4Sphere"
s:Ge/DemoSphere/Type = "TsSphere"
s:Ge/DemoSphere/Parent = "World"
s:Ge/DemoSphere/Material = "Air"
d:Ge/DemoSphere/TransZ = 124 cm
Expand Down Expand Up @@ -171,8 +171,8 @@ s:Ge/DemoSPolycone/Type = "G4SPolycone"
s:Ge/DemoSPolycone/Parent = "World"
s:Ge/DemoSPolycone/Material = "Air"
d:Ge/DemoSPolycone/TransZ = 186 cm
dv:Ge/DemoSPolycone/R = 9 0 10 10 5 5 10 10 2 2 mm
dv:Ge/DemoSPolycone/Z = 9 5 7 9 11 25 27 29 31 35 mm
dv:Ge/DemoSPolycone/R = 10 0 10 10 5 5 10 10 2 2 0 mm
dv:Ge/DemoSPolycone/Z = 10 5 7 9 11 25 27 29 31 35 35 mm
s:Ge/DemoSPolycone/Color = "grey"
s:Ge/DemoSPolycone/DrawingStyle = "FullWireFrame"

Expand Down
2 changes: 1 addition & 1 deletion examples/Basic/TwoBeams.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ s:So/Imaging/BeamPositionCutoffShape = "Ellipse"
s:So/Imaging/BeamPositionDistribution = "Flat"
d:So/Imaging/BeamPositionCutoffX = 7. cm
d:So/Imaging/BeamPositionCutoffY = 21. cm
s:So/Imaging/BeamAngularDistribution = "Point"
s:So/Imaging/BeamAngularDistribution = "None"
i:So/Imaging/NumberOfHistoriesInRun = 5

s:So/Therapy/Type = "Beam"
Expand Down
2 changes: 1 addition & 1 deletion examples/DICOM/DoseTo4DCT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape = "Ellipse"
d:So/Example/BeamPositionCutoffX = 0.5 cm
d:So/Example/BeamPositionCutoffY = 0.5 cm
s:So/Example/BeamAngularDistribution = "Point"
s:So/Example/BeamAngularDistribution = "None"
i:So/Example/NumberOfHistoriesInRun = 100

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
Expand Down
6 changes: 3 additions & 3 deletions examples/DICOM/DoseToCT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape = "Ellipse"
d:So/Example/BeamPositionCutoffX = 5. cm
d:So/Example/BeamPositionCutoffY = 20. cm
s:So/Example/BeamAngularDistribution = "Point"
i:So/Example/NumberOfHistoriesInRun = 10000
s:So/Example/BeamAngularDistribution = "None"
i:So/Example/NumberOfHistoriesInRun = 500

# Uncomment to activate graphics
s:Gr/ViewA/Type = "OpenGL"
Expand All @@ -83,6 +83,6 @@ d:Gr/ViewA/Phi = 10 deg
# Extra graphics options to handle complex voxel geometries
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 210000000

i:Ts/ShowHistoryCountAtInterval = 5000
i:Ts/ShowHistoryCountAtInterval = 100

b:Ts/PauseBeforeQuit = "True"
2 changes: 1 addition & 1 deletion examples/DICOM/Implant.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape = "Ellipse"
d:So/Example/BeamPositionCutoffX = 5 cm
d:So/Example/BeamPositionCutoffY = 20 cm
s:So/Example/BeamAngularDistribution = "Point"
s:So/Example/BeamAngularDistribution = "None"
i:So/Example/NumberOfHistoriesInRun = Tf/Num/Value

# Graphics
Expand Down
2 changes: 1 addition & 1 deletion examples/Graphics/TestGraphics.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Demonstrates a variety of Graphics options

s:Ge/Box/Type = "G4Box"
s:Ge/Box/Type = "TsBox"
s:Ge/Box/Parent = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX = 1. m
Expand Down
2 changes: 1 addition & 1 deletion examples/Graphics/TwoProjections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ d:Gr/MyOGLb/PerspectiveAngle = 10. deg
d:Gr/MyOGLb/Theta = 45. deg
d:Gr/MyOGLb/Phi = 45. deg

s:Ge/Box/Type = "G4Box"
s:Ge/Box/Type = "TsBox"
s:Ge/Box/Parent = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX = 1. m
Expand Down
5 changes: 2 additions & 3 deletions examples/Nozzle/ConstantsForNozzles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ s:Ma/CompensatorLucite/DefaultColor = "grey"

########################################
# Dummy beam
# Point type beam
########################################
s:So/Example/Type = "Beam"
s:So/Example/Component = "BeamPosition"
s:So/Example/BeamParticle = "proton"
d:So/Example/BeamEnergy = 160.0 MeV
u:So/Example/BeamEnergySpread = 0.0
s:So/Example/BeamPositionDistribution = "Point"
s:So/Example/BeamAngularDistribution = "Point"
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution = "None"
i:So/Example/NumberOfHistoriesInRun = 10


Expand Down
4 changes: 2 additions & 2 deletions examples/Nozzle/RasterScanningPattern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ s:Tf/BField1st/Function = "Step"
dv:Tf/BField1st/Times = 4 0.25 0.5 0.75 1.0 s
dv:Tf/BField1st/Values = 4 -0.105 -0.035 0.035 0.105 tesla

d:Ge/Dipole1/Strength = Tf/BField1st/Value tesla
d:Ge/Dipole2/Strength = Tf/BField2nd/Value tesla
d:Ge/Dipole1/MagneticFieldStrength = Tf/BField1st/Value tesla
d:Ge/Dipole2/MagneticFieldStrength = Tf/BField2nd/Value tesla

0 comments on commit b1b41b0

Please sign in to comment.