Welcome to the TOPAS documentation!

Note

A PDF version of the documentation is found by clicking the “Read the Docs” panel in the bottom-left corner of the website.

Introduction to TOPAS

TOPAS wraps and extends the Geant4 Simulation Toolkit to provide an easier-to-use application for the medical physicist. TOPAS’s unique parameter control system lets you assemble and control a rich library of simulation objects (geometry components, particle sources, scorers, etc.) with no need to write C++ code.

Advanced users remain free to implement their own simulation objects in C++ code, and add them to TOPAS via an extension mechanism. While user-written objects benefit from underlying functionality of TOPAS base classes and the TOPAS parameter system, they can exploit the full flexibility of Geant4.

To discover the Geant4 version used by a specific version of TOPAS, please consult the History.

Note

Users should carefully read the Introduction to Parameter System, as well as the introductory parts of the sections Geometry Components, Particle Sources, Physics and Scoring. The rest of the documentation provides a detailed reference that you may just want to skim initially.

Installation instructions for the latest TOPAS version are provided at the top of the Code Repository page of the TOPAS web site. This page is accessible only to licensed TOPAS users.

Authors

TOPAS Software

  • Joseph Perl
  • Jungwook Shin
  • Jan Schuemann
  • Bruce Faddegon
  • Harald Paganetti
  • Jose Ramos
  • Aimee McNamara
  • David Hall

TOPAS Documentation

Website Creator David Hall
Lead Author Joseph Perl
Additional Authors
  • Jungwook Shin
  • Jan Schuemann
  • Jose Ramos
  • David Hall
Editors
  • Joseph Perl
  • David Hall
User Contributions
  • Aleksandra Biegun
  • Fada Guan

Citation

If you use TOPAS, please be sure to cite the following paper (PubMed):

Perl J, Shin J, Schumann J, Faddegon B, Paganetti H. TOPAS: an innovative proton Monte Carlo platform for research and clinical applications. Med Phys. 2012; 39(11):6818-37.

and the follow-up paper emphasizing the latest developments:

Faddegon B, Ramos-Mendez J, Schuemann J, McNamara A, Shin J, Perl J, Paganetti H, The TOPAS Tool for Particle Simulation, a Monte Carlo Simulation Tool for Physics, Biology and Clinical Research, Physica Medica, doi:10.1016/j.ejmp.2020.03.019.Here is a BibTeX entry to aid use within LaTeX:

To discover the Geant4 version used by a specific version of TOPAS, please consult the History.

 @article{TOPAS,
     author = {Perl, J. and Shin, J. and Schumann, J. and Faddegon, B. and Paganetti, H.},
     title = {{TOPAS: An innovative proton Monte Carlo platform for research and clinical applications}},
     journal = {Medical Physics},
     pages = {6818},
     volume = {39},
     year = {2012},
     pmid = {23127075},
     doi = {10.1118/1.4758060}
 }

@article{TOPAS,
     author = {Faddegon, B. and Ramos-Mendez, J. and Schuemann, J. and McNamara, A. and Shin, J. and Perl, J. and Paganetti H.},
     title = {{The TOPAS Tool for Particle Simulation, a Monte Carlo Simulation Tool for Physics, Biology and Clinical Research}},
     journal = {Physica Medica},
     year = {2020},
     doi = {10.1016}
 }

User Support and Contributions

User Support

Help can be requested from TOPAS developers and other users at the User Forum. Note that you must login as a registered user before you can access the forums.

User Contributions

  • Feedback and feature requests are best communicated via the User Forum described above.

  • If you would like to share your TOPAS extensions or parameter files with other users, please get in touch

  • Contributions to this documentation website are also most welcome, but does require a GitHub account:

    • Click “Edit on GitHub” in the top-right corner of the page you wish to edit
    • This takes you to the page source at GitHub.com
    • Click the pencil icon to fork the repository and edit the page source
    • The source format is reStructuredText
    • After making your changes, open a pull request

History

TOPAS wraps and extends the Geant4 Simulation Toolkit. Geant4 is built directly into TOPAS (the user does not need to themselves install Geant4). The following table lists which Geant4 version is built into each TOPAS version.

TOPAS version Geant4 version
3.7.0 10.06.p03
3.6.0 10.06.p03
3.5.0 10.06.p01
3.4.0 10.05.p02
3.3.0 10.05.p01
3.2.0 10.05.p01
3.1.0 10.03.p01
3.0.0 10.02.p01
2.0.0 10.01.p02
1.0.0 9.06.4

A detailed list of changes introduced by each TOPAS version can be found below:

3.7 Series

This release adds many new features and fixes some rare bugs. It is recommended that all users update to this new release.

3.7.0 (2021-08-12)

TOPAS Version 3.7 is Released (12 August 2021)

This release adds many new features and fixes some rare bugs. It is recommended that all users update to this new release.

Among the New Features are:

  • Comprehensive Brachytherapy package.
  • Comprehensive MV Linac package.
  • New Particle Source Types: “Environment” and “Distributed”.
  • New Scorers: “OriginCount” and “TrackLengthEstimator”.
  • Ability to continue run until a given dose accuracy is achieved.
  • Simplified process to find and reuse a specific history’s random seed.

These and many other new features and fixes are detailed below.

Since there has been no change to the underlying Geant4 version, there is no need to update the Geant4 data files.

As this is a minor TOPAS release, any setup that worked previously should continue to work with no changes needed to your parameter control files. However, as the underlying Geant4 version has changed, results may not be an exact match (due to statistical variation).

Installation Notes:

Users of some Linux versions previously had to download Geant4Headers.zip separately. We now include this file directly in all builds, so the separate download is no longer necessary.

Users of some Linux versions, in particular some users on Windows WSL, previously had to issue “cmake” and “make” commands to use TOPAS even if they did not actually need any extensions. We have adjusted the RPATH settings of our build, such that this should no longer be necessary.

Two of our previously supported Linux versions, CentOS6 and Debian8, have reached end of life. We are no longer building TOPAS for these versions. Supported systems are now:

  • topas_3_7_osx10_14.zip works for MacOS 10.12 through 10.14.
  • topas_3_7_osx10_15.zip works for MacOS 10.15 and newer (both Intel and M1 chip sets).
  • topas_3_7_debian9.tar.gz works for Debian 9, Debian 10, Ubuntu 18, Ubuntu 19 and Ubuntu 20.
  • topas_3_7_centos7.tar.gz works for CentOS 7 and RHEL 7.
  • topas_3_7_centos8.tar.gz works for CentOS 8 and RHEL 8.

A comprehensive guide to help users of Windows systems install and run TOPAS using Windows Subsystem for Linux (WSL) can now be found at:

Comprehensive new Brachytherapy package:

A major effort led by colleagues at Université Laval has given TOPAS a ready-to-use and well validated set of LDR and HDR brachytherapy source models.

The team also provided a new scorer, TrackLengthEstimator, which uses the Track Length Estimator method to efficiently calculate dose in these simulations.

New examples:

  • examples/Brachytherapy

Details in the User Guide:

Comprehensive new MV Linac package:

Package includes new Geometry Components and a detailed example.

“TsJaws” is a new Geometry Component to construct a set of Jaws.

Details in the User Guide:

“TsDivergingMLC” is a new Geometry Component to construct a Doubly Diverging Multi Leaf Collimator.

Details in the User Guide:

New example:

  • examples/MVLinac/MainTxHead.txt

Details in the User Guide:

New Particle Source Types:

Source Type: Environment

The Environment source creates an isotropic, uniform radiation field enclosing a specified component. It provides a radiation field that might be experienced, for example, by a spacecraft in a radiation belt, or by a robot (or, indeed a human) in a damaged nuclear reactor.

New example:

  • examples/Basic/EnvironmentSource.txt

Details in the User Guide:

Source Type: Distributed

The Distributed source represents radioactive material randomly distributed within other material. The user specifies how many random source points to sample within the component. The particle generator will then start equal numbers of histories from each of these source points.

The Distributed Source is in many ways similar to the Volumetric Source. But whereas the Volumetric Source samples a new point every time it generates a particle (to simulate random activity within a volume of radioactive material), the Distributed Source does this sampling only a the construction phase (to simulate a random distribution of radioactive particles within some other material).

Parameters for the Distributed Source are:

s:So/Example/Type = "Distributed"
s:So/Example/Component = "DemoSphere"
i:So/Example/NumberOfHistoriesInRun = 5
i:So/Example/NumberOfSourcePoints = 4
b:So/Example/RedistributePointsOnNewHistory = "False"
s:So/Example/PointDistribution = "Gaussian" # default to "Flat"
d:So/Example/PointDistributionSigma = 20. mm

And then the usual other parameters to control particle type, energy, etc., such as:

s:So/Example/BeamParticle = "gamma"
d:So/Example/BeamEnergy = 10. keV
u:So/Example/BeamEnergySpread = 0.

New examples:

  • examples/Basic/DistributedSourcePointsInShell.txt
  • examples/Basic/DistributedSourcePointsInSphere.txt
  • examples/Basic/DistributedSourcePointsInSphereGaussian.txt
  • examples/Basic/DistributedSourcePointsInTwistedTubs.txt

Details in the User Guide:

New Scoring Features:

Scorer: OriginCount

Scores how many particles originate in a given component.

By combining this scorer with the OnlyIncludeParticlesNamed filter, one can create a scorer that tells how many particles of a given type were created in the component. That is, one can count reaction products.

So, for example, the following will count how many neutrons were created:

s:Sc/MyScorer/Quantity = "OriginCount"
s:Sc/MyScorer/Component = "MyComponent"
sv:Sc/MyScorer/OnlyIncludeParticlesNamed = 1 "neutron"

New example:

  • examples/Scoring/OriginCount.txt

Scorer: TrackLengthEstimator

Provides a more efficient dose calculation method of particular use in Brachytherapy.

New example:

  • examples/Brachytherapy/DoseTLE.txt

Details in the User Guide:

Scoring in Group Components

We have added the ability to score in a Group Component. You can attach any Volume Scorer to a Group if that Group has b:Ge/MyComponent/PropagateToChildren = “True” The scorer will accumulate hits in all children (recursively) of the given Group Component

Protection against excessive number of bins

Scorers are now protected against the user specifying so many bins that the bin index exceeds its allowed bounds, the MAX_INT (2,147,483,647).

Remember that this number of bins may be larger than just the number of voxel divisions, as it may also be multiplied by the number of bins allocated for Energy or Time divisions.

Added new Scoring Filters to evaluate the Incident Particle

Recall that what TOPAS refers to as the “Incident Particle” is the particle that is first incident on the scoring component. For example, if a proton hits s TsBox of water, this proton is the Incident Particle, while the final scored particles may be this proton or any secondary of this proton (such as a delta ray produced by this proton).

These new filters allow you to filter the scorer based on qualities of the Incident Particle.

Examples of the new filters are:

sv:Sc/MyScorer/OnlyIncludeIfIncidentParticlesNamed = 1 "proton"
sv:Sc/MyScorer/OnlyIncludeIfIncidentParticlesNotNamed = 1 "proton"
sv:Sc/MyScorer/OnlyIncludeIfIncidentParticlesFromProcess = 1 "hIoni"
sv:Sc/MyScorer/OnlyIncludeIfIncidentParticlesNotFromProcess = 1 "hIoni"
s:Sc/MyScorer/OnlyIncludeIfIncidentParticlesOfGeneration = "Primary"

Details in the User Guide:

Added new Scoring Filters to evaluate how many times a particle has interacted

Users asked for a way to separate dose from first scatter versus dose from multiple scatter. Already existing filters could tell us whether a particle has interacted, but could not differentiate first scatter from subsequent scatter.

We now keep count of how many times a particle has interacted, and offer several filters based on this count:

i:Sc/MyScorer/OnlyIncludeParticlesWithInteractionCountBelow
i:Sc/MyScorer/OnlyIncludeParticlesWithInteractionCountNotBelow
i:Sc/MyScorer/OnlyIncludeParticlesWithInteractionCount
i:Sc/MyScorer/OnlyIncludeParticlesWithInteractionCountNot
i:Sc/MyScorer/OnlyIncludeParticlesWithInteractionCountAbove
i:Sc/MyScorer/OnlyIncludeParticlesWithInteractionCountNotAbove

New example:

  • examples/Scoring/FilterByInteractionCount.txt

Details in the User Guide:

Ability to continue run until a given dose accuracy is achieved.

Users have requested a way to have TOPAS continue running until dose accuracy reaches a user-determined limit (rather than just running a pre-determined number of histories). This feature is now available, and we have done it in a general purpose way, such that run duration tests can depend upon any scored quantity (dose or otherwise).

Because TOPAS supports time features, any accuracy test is only meaningful once the entire run sequence has occurred. Accordingly, the new system works by evaluating various tests only after the entire run sequence is complete (all Histories of all Runs). TOPAS then evaluates the tests, and repeats the entire run sequence until all tests have been satisfied.

The tests are tied to the scoring system. Any scorer can have up to three tests.

New parameters are:

d:Sc/MyScorer/RepeatSequenceUntilSumGreaterThan = 1. MeV # type can be d, u or i depending on scoring quantity
d:Sc/MyScorer/RepeatSequenceUntilStandardDeviationLessThan = .004 MeV # type can be d, u or i
i:Sc/MyScorer/RepeatSequenceUntilCountGreaterThan = 1200

The second two tests above are necessary because the StandardDeviation is subject to statistical noise until a reasonable amount of data has been collected. By requiring a minimum Sum or minimum number of Counts, one can insure that there is enough data to use the StandardDeviation.

Tests can be applied to as many scorers as you wish. The entire simulation will repeat until All tests on All scorers are satisfied.

If the scorer has been binned in X, Y, Z, E or T, you must also specify which specific bin should be evaluated, using the parameters:

i:Sc/MyScorer/RepeatSequenceTestXBin = 2
i:Sc/MyScorer/RepeatSequenceTestYBin = 2
i:Sc/MyScorer/RepeatSequenceTestZBin = 2
i:Sc/MyScorer/RepeatSequenceTestEBin = 5
i:Sc/MyScorer/RepeatSequenceTestTimeBin = 0

Remember that the tests will be evaluated only after the entire simulation sequence is complete. You should therefore set:

So/MySource/NumberOfHistoriesInRun

to a value small enough that this end of test will be reached in a reasonable time. The final total number of histories will be that NumberOfHistoriesInRun times the number of times the testing process causes TOPAS to re-run the entire sequence.

Details in the User Guide:

Simplified process to find and reuse a specific history’s random seed.

When a rare issue is to be debugged, it is easier if one can make the simulation start immediately from the problematic history. To do this, one needs to know the seed number of that particular history. But if this issue causes a crash, it is then too late then to ask TOPAS to write out the seed.

A new technique can help with this situation. For a given history number, TOPAS can quickly find you the appropriate seed, which you can then use in a subsequent job to start out right from the relevant history.

Set the parameter:

i:Ts/FindSeedForHistory = 9998 # defaults to -1, meaning do not activate this feature

And if you have multiple Runs:

i:Ts/FindSeedForRun = 0 # defaults to 0

When you then run TOPAS, it will “fast forward” through a simulation to get just that history’s seed. It skips most of the time-consuming parts of the simulation. Its only job is to find and write out the random seed. The seed information will be written to the console, and will also be written to a “seed file” such as: TopasSeedForRun_0_History_9998.txt

This simulation will not be useful for anything else, but it will be very fast. TOPAS will:

  • Disable graphics
  • Disable GUI
  • Set physics to transportation_only
  • Disable setting of cuts
  • Disable variance reduction
  • Disable generators
  • Disable most UpdateForNewRun functions

You can then set up a fresh, normal TOPAS session that will starts right from the desired history. To do so, remove that FindSeedForHistory parameter, and tell TOPAS to use the saved seed file:

s:Ts/SeedFile = "TopasSeedForRun_0_History_9998.txt" # Seed file saved in fast-forward job above

If the seed file is not in the current directory, you can also specify a seed file directory:

s:Ts/SeedDirectory = "/Applications/tswork/testarea/SkipUntil" # defaults to read from current directory

Details in the User Guide:

Additional Geometry Improvements:

Geometry Component Type: TsPixelatedBox

The TsPixelatedBox constructs a pixelated geometry such as a pixel detector.

New example:

  • examples/Optical/PixelatedDetector.txt

Details in the User Guide:

Geometry Component Type: G4GenericPolycone

G4GenericPolycone is a relatively new way to represent a Polycone.

From the Geant4.10.0 release notes: “The G4Polycone solid no longer supports the case in which either the outer or the inner surface has more than one cone or tube section over a finite interval of Z values. These shapes must use the new class G4GenericPolycone instead. The general constructor of G4Polycone, which uses a series of vertices, includes a check whether the vertices are monotonic along Z for its inner and outer surfaces, and issues an error if not.”

New section in the ShapeTest examples:

  • examples/Basic/ShapeTest*

TsVPatient now has Trans and Rot parameters as Optional

The parameters TransX, TransY, TransZ, RotX, RotY and RotZ are supposed to be optional for all Geometry Components (they all default to zero). We found that they were still being required in TsVPatient. They are now optional.

TsImageCube now allows the non-vector form of NumberOfVoxelsZ and VoxelSizeZ

To support multiple slice thickness patients and phantoms, users have been allowed to specify the parameters NumberOfVoxelsZ and VoxelSizeZ either as dimensioned (d:) or dimensioned vector (dv:) parameters. This flexibility has now also been added to TsImageCube.

So, for example, for the case of a single slice thickness section of 10 Z slices, where one used to have to specify:

iv:Ge/MyComponent/NumberOfVoxelsZ = 1 10
dv:Ge/MyComponent/VoxelSizeZ = 1 1. mm

One can now just specify:

i:Ge/MyComponent/NumberOfVoxelsZ = 10
d:Ge/MyComponent/VoxelSizeZ = 1. mm

TsApertureArray no longer limits number of Beamlets

TsApertureArray was refusing to run if it had 300 or more Beamlets unless the GeometryMethod was not AddBeamlets. This was a protection against creating setups that were too slow to construct. This prohibition has now been changed to just a warning.

Verbosity Control for Geometry Construction:

Verbosity of geometry construction was previously controlled using the same parameter as the overall sequence verbosity:

i:Ts/SequenceVerbosity

Geometry verbosity now has its own parameter:

i:Ts/GeometryVerbosity
Additional Particle Source Improvements:

Emittance Source now supports Cutoff shape parameters:

The Emittance Source now supports the same Cutoff shape parameters as the Beam source:

s:So/MySource/BeamPositionCutoffShape = "Rectangle" # "Rectangle", "Ellipse" or "None". Defaults to "None"
d:So/MySource/BeamPositionCutoffX = 1. cm
d:So/MySource/BeamPositionCutoffY = 1. cm

Fix issues with PhaseSpace source reading TOPAS ASCII format

We had some bugs in the update of the PhaseSpace source in release 3.6.1. Users have been working around this by replacing:

So/MySource/Type = "PhaseSpace"

with:

So/MySource/Type = "PhaseSpaceOld"

Users are still welcome to stay with “PhaseSpaceOld” if the want, but we believe the new reader is now working correctly. The new reader also adds some functionality not present in the older reader, such as improved handling of empty histories, ability to skip the PreCheck, and better information from PreCheck.

Improve handling of Malformed IAEA phase space files:

Some of the files in the IAEA phase space repository seem to me to be malformed. Varian_TrueBeam6MV_01, for example, has no New History flags set at all. It also seems to have a proton as its first particle, even though the header says there are only photons, electrons and positrons.

We confirmed that some other IAEA files work fine, such as ELEKTA_PRECISE_10mv_part1.

We then added several new features to our reader to be able to read malformed files:

b:So/MySource/LimitedAssumeFirstParticleIsNewHistory = "true"
b:So/MySource/LimitedAssumeEveryParticleIsNewHistory = "true"
b:So/MySource/LimitedAssumePhotonIsNewHistory = "true"

We confirmed that we can read particles from Varian_TrueBeam6MV_01 if we either set the one parameter:

b:So/MySource/LimitedAssumeEveryParticleIsNewHistory = "true"

or set the two parameters together:

b:So/MySource/LimitedAssumeFirstParticleIsNewHistory = "true"
b:So/MySource/LimitedAssumePhotonIsNewHistory = "true"

We found that if we set only:

b:So/MySource/LimitedAssumeFirstParticleIsNewHistory = "true"

the job hangs (it tries to accumulate all of the millions of particles into a single history).

New examples:

  • examples/PhaseSpace/ReadElekta.txt
  • examples/PhaseSpace/ReadVarian.txt

Improved PhaseSpace PreCheck Procedure:

The PhaseSpace PreCheck procedure reads the entire phsp file once before any histories are generated. This allows us to confirm that the contents of the phsp file properly matches the header file.

While we continue to recommend that users leave this process in place, we accept that the process can be frustratingly slow, as phsp files can be very large.

Therefore, we have made two changes:

  • It is now always permitted to turn off the PreCheck (limited used to always require PreCheck).
  • PreCheck will print out a progress update after a given number of particles are read.

Default is to print out progress every 1M particles, but this interval can be adjusted with:

i:So/MySource/PreCheckShowParticleCountAtInterval = 100000

PhaseSpace PreCheck now tests for Excited Ions. TOPAS does not allow excited ions in phase space unless the user has set:

Ts/TreatExcitedIonsAsGroundState = "True"

This was causing some simulations to quite part way through simulation since this condition was only noted when the given particle was about to be simulated. We now test and warn about this during PreCheck.

Additional Scoring Improvements:

Prevent value of NAN from appearing in DoseToMaterial or DoseToWater

We found cases where some scoring bins contained the special value NAN (meaning “not a number”). This was because the scored particle had an energy too low for the given Geant4 stopping power table, resulting in a divide by zero in our stopping power conversion.

We now test for this condition, avoid scoring in this case, and give a warning message. At the end of the session, we report the number of unscored particles and the total unscored energy.

Removed Invalid Tags that made our RTDose DICOM output files unreadable by some applications

When outputting scored values to RTDose DICOM files, we previously passed along some tags from the input DICOM that were invalid for RTDose DICOM files:

  • (0028, 1052) Rescale intercept
  • (0028, 1053) Rescale slope

Some applications were then failing to read in our files. We no longer include these tags.

Added G4Track pointer to Extension Scorer’s UserHookForEndOfTrack

The UserHookforendOfTrack method of a user-written scorer can now be more functional, as TOPAS now passes along the pointer to the G4Track.

The new method signature is:

  • void UserHookForEndOfTrack(const G4Track *)
Other Improvements:

Materials no longer need to have Ma/MyMaterial/Fractions sum to 1

TOPAS had previously required that the sum of all Ma/MyMaterial/Fractions be exactly 1.

A new option allows any values and then normalizes the fractions to unity for you:

b:Ma/MyMaterial/NormalizeFractions = "True" # Defaults to "False"

Physics Setup Verbosity now has its own control

The verbosity of the physics setup can now be controlled by:

i:Ph/Verbosity

Time Feature RepetitionInterval is no longer always required

In the past, Time Feature functions Linear, Sine, Cosine and Sqrt always required the parameter Tf/MyFunction/RepetitionInterval

To make a time feature not repeat, it was necessary to set this value to a value longer than Tf/TimelineEnd.

Tf/MyFunction/RepetitionInterval is now optional, with the default being that there will be no repetition.

Bug Fix for Variance Reduction DirectionalRussianRoulette

We found that the variance reduction feature DirectionalRussianRoulette was not taking into account the position of the reference component in the calculation of particle direction towards the ROI. This has been fixed.

Region-specific production cuts

We have made some refinements to how production cuts are set, in particular when there are multiple Regions.

Previous behavior: Region-specific production cuts were set to 0.05 mm unless specifically set for each particle, regardless of production cuts set for the general simulation.

New behavior: Region-specific cuts are now set to the value for all particles (“CutForAllParticles”) and for specific particles based on the production cuts set for the general simulation. Particle-specific cuts (CutForElectron, CutForGamma, etc.) take precedence over CutForAllParticles. If setting CutForAllParticles for a region this sets the cuts for all particles in that region; particle-specific cuts for a region take precedence over all otherwise specified values in that region.

3.6 Series

This release adds a variety of new features, improves speed in certain setups and fixes some rare but annoying bugs. It is recommended that all users update to this new release.

3.6.1 (2021-02-01)

This is a narrow patch release to fix some issues that affected just a few users.

An unintialized variable situation caused TOPAS to crash in some cases. We are only aware of it affecting a few users, and if your previous jobs did not crash, there is no need to re-do those simulations. But we do recommend all users upgrade to the new release so they are protected against this bug.

We also fixed an issue affecting ASCII format phase space files. We had previously found that ASCII format phase space files that had been writen with the IncludeCreatorProcess option could not be read back in. New files written with that option will be readable.

3.6.0 (2020-12-18)

Speed Improvements:

Dramatically increased navigation speed for Spheres on Linux:

User Christian Velten figured out that simulations were orders of magnitude slower on Linux than on Mac for some geometries involving Spheres. The effect could be very dramatic in cases where one had many spheres or a TsSphere was divided into many radial bins. The problem was traced to the Linux C++ optimizer not finding a shortcut that the Mac compiler was finding. A change Christian submitted to Geant4.10.7 fixed this, and we have patched our built-in Geant4.6.p3 to also include this fix.

Volumetric sources now initialize faster:

Our Geant4 collaborator John Allison resolved an issue that was causing each volumetric source to take tens of seconds to initialize when there was complex geometry present (such as in the presence of a patients or phantoms that had a large numbers of voxels). If a simulation had several volumetric sources, or had time features moving the source, the resulting speed penalty could be very significant. This initialization time is now negligible.

Phase Space Scorer Improvements:

Phase Space Scorer and Phase Space Source improved Handling of Empty Histories:

Fixed a bug that was causing incorrect results when reading Phase Space with the option PhaseSpaceIncludeEmptyHistories = True and Multiple Threads.

In this case, primary particles were sometimes being distributed to wrong threads and either missed or used more than once. This bug is now fixed.

In the process of fixing the above bug, we conducted a major redesign of the phase space scorer and phase space source. There is no change to the default behavior of the phase space scorer, but a new parameter allows you to change how empty histories are represented in the phase space file itself (as opposed to the phase space header):

s:Sc/MyScorer/IncludeEmptyHistories = "None" # "None", "InSequence", "AtEndOfRun" or "AtEndOfFile"

The options are:

  • The default option, “None”, means that there are no lines in the phase space file itself to represent empty histories (but, as before, the phase space header gives you information about the total number of histories and the number of histories that reached the phase space file, so you can decide the number of empty histories from this).
  • “InSequence” means that new lines will be added to the phase space file itself to tell you that a given history was empty. The line will have zeros for most values but will have a negative number in the Weight column. A negative 1 here means that there was 1 empty history. A negative N here means that there were N consecutive empty histories.
  • “AtEndOfRun” means that empty histories will not be represented in the exact sequence, but instead they will be represented by a single empty history record at the end of each run.
  • “AtEndOfSequence” means that empty histories will not be represented in the exact sequence, but instead they will be represented by a single empty history record at the end of the entire simulation sequence (that is, once all runs are complete).

Because empty histories can now be assigned to their appropriate runs, it is now also allowed to read phase space that includes empty histories even when time features are present. In this case, it is the user’s responsibility to ensure that they have the same set of time features in the phase space reading job as they had in the phase space writing job.

Phase Space Source is now robust against extra blanks or newlines at the end of the file:

The new reader correctly ignores such junk at the end of the phase space file.

Phase Space Source can now include Optical Photons:

Optical Photons (PDG code zero) were not previously supported in phase space reading. The new design allows them to be included in the phase space source. Note that polarization will be set to uniformly random polarization vector (perpendicular to the initial momentum).

Other New Features:

All Particle Sources have new options to set polarization of Optical Photons:

In the past, optical photons always had their parameterization set to uniformly random polarization vector (perpendicular to the initial momentum). While this remains the default, new parameters allow you to explicitly set the polarization:

u:So/MySource/BeamPolarizationX
u:So/MySource/BeamPolarizationY
u:So/MySource/BeamPolarizationZ

The DICOM reader now gives the option to print out slice separation information:

If the separation between slices in a DICOM file is not uniform, the DICOM file can not be used in TOPAS, as we can not tell how thick to make the voxels in the Z coordinate. We do allow DICOMs that are made of just a few different slice thicknesses (to accommodate common setups such as where slices are thicker towards the first and last slices and thinner in the central slices). But if the slice thicknesses do not follow some simple pattern, we can not figure out how to turn the slice information into voxels. While we have not changed this behavior, we have added an optional new parameter to print out the slice thicknesses to the console so that you can see the slice thickness pattern that TOPAS is dealing with.

The optional new parameter is:

b:Ge/MyComponent/ShowSliceSeparations

Variance Reduction now includes option to apply Russian roulette to fat particles (particles with unitary statistical weight):

The following Boolean parameter can be used:

b:Vr/.../OnlySplitParticlesOfUnitaryWeight = "True" # defaults to "False"

This capability may be of help when combining GeometricalParticleSplit with another splitting technique like secondaryBiasing. For example, fat particles surviving Russian roulette from SecondaryBiasing can be split with a split plane from GeometricalParticleSplit

New Filter has been added, FilterByParticleWeight:

This filter is useful to avoid fat particles produced by particle split variance reduction technique. When reading back a phase space created with particle splitting, surviving fat particles stored in it may introduce bias in the form of hot spots to e.g. dose distributions. Users can filter these low-frequent particles with this filter. The TOPAS standard paradigm for filter names applies e.g.:

  • OnlyIncludeParticlesWithWeight
  • OnlyIncludeParticlesWithWeightBelow
  • OnlyIncludeParticlesWithWeightNotBelow
  • OnlyIncludeParticlesWithWeightAbove
  • OnlyInlcudeParticlesWithtWeightNotAbove
  • And InvertFilter

An additional G4Data environment variable is now set:

We now automatically set the variable G4PROTONHPDATA to help with some non-default physics lists.

A new Scoring Unit is available, /s:

While the unit is equivalent to Hz, this unit has been added to support Topas-nBio scavenging capacity scorers.

Solvated Electron Thermalization Models now offer Five Options:

Five models are now available: “Ritchie”, “Terrisol”, “Meesungnoen”, “MeesungnoenSolid” and “Kreipl”.

A specific model can be selected with:

s:Ph/Default/SolvatedElectronThermalizationModel = "Kreipl" # Default is "Meesungnoen"
Removed Restrictions:

Restriction on use of Parallel Worlds with Divided Spheres or Cylinders has been removed:

We are no longer seeing issues when parallel worlds are used in the presence of divided spheres or cylinders, so this restriction has been removed.

Restrictions on which Materials can accept parameters for State, Temperature and or Pressure have been removed:

These parameters were previously supported only for materials defined with certain ways. They are now available for all materials.

New Capabilities for User-Written Extensions:

Geometry Components now have a method to return their geometric Extent:

The new method returns a bounding box into which all volumes of the component are guaranteed to fit. The design works even if the given component is a Group component.

TsVGeometryComponent::GetExtent() returns a const G4VisExtent& from which one can then obtain:

  • GetXmin();
  • GetXmax();
  • GetYmin();
  • GetYmax();
  • GetZmin();
  • GetZmax();
  • GetExtentRadius();
  • GetExtentCentre();

User-written Geometry Components now have the option to set just a subset of volumes to be sensitive:

While some Geometry Components are made of only a single Geant4 volume, others may be made of many volumes. By default, scoring occurs in all volumes of the scorer’s Component. A new method allows a user-written component to only set a specific subset of volumes to be sensitive.

To do so, call the following method once for each logical volume that you want to be sensitive:

  • void TsVGeometryComponent::SetLogicalVolumeToBeSensitive(G4LogicalVolume* lvol)

If no calls are made to this new method, then, as before, all of the component’s volumes will be sensitive.

User-written Geometry Components now have additional method signatures to create physical volumes:

New methods are:

  • G4VPhysicalVolume* CreatePhysicalVolume(const char* subComponentName, G4int copy, G4bool reuseLogical,
    G4LogicalVolume* lVol, G4RotationMatrix* rot, G4ThreeVector* trans, G4LogicalVolume* parent);
  • G4VPhysicalVolume* CreatePhysicalVolume(G4String& subComponentName, G4int copy, G4bool reuseLogical,
    G4LogicalVolume* lVol, G4RotationMatrix* rot, G4ThreeVector* trans, G4LogicalVolume* parent);
  • G4VPhysicalVolume* CreatePhysicalVolume(G4String& subComponentName, G4LogicalVolume* lVol,
    G4VPhysicalVolume* parent, const EAxis pAxis, const G4int nReplicas, G4VPVParameterisation* pParam);

User-written Particle Generators no longer require BeamEnergy:

The previous design of our TsVParticleGenerator was such that the parameter BeamEnergy had to be set even if your generator didn’t use it. This has now been fixed.

User written Particle Sources can now access a pointer to their Geometry Component:

The particle source base class, TsSource, now provides the pointer:

  • TsVGeometryComponent* fComponent

User-written Particle Sources can now contain a method to be called at End of Run:

At end of each run, TOPAS will call the method:

  • void UpdateForEndOfRun()

User-written Scorers can now provide an UpdateForEndOfRun method:

Your scorer can now have a method which will be called at the end of each run:

  • void UpdateForEndOfRun()

Added User hook for begin of Chemical Track:

A chemical track can be obtained at exactly their time of creation with the method:

  • void PreUserTrackingAction(const G4Track*)

Added User hooks for pre/post timeStepAction (at time of creation/loss of chemical species):

Chemical track information can be accessed at the beginning (before evaluating for reactions) and at the end of individual time steps in the chemical stage. Methods are:

  • void UserPreTimeStepAction()
  • void UserPostTimeStepAction()
Bug Fixes:

Fixed issue of losing warning messages when TOPAS crashes during Qt GUI use:

Because the Qt GUI takes control of console output, and Qt cleans up the console upon finishing, we had a situation in which warning and error messages were lost during a crash. This is now solved by echoing all warning and error messages to the terminal console even during Qt GUI usage. The result is that they can still be seen after any crash.

Fixed a bug that was creating wrong divisions in some parallel scoring components:

There were some cases in which the parallel geometry components automatically created to support certain scoring divisions were done incorrectly. This could result in crashes or dramatically incorrect results.

It affected cases where a TsBox, TsCylinder or TsSphere was created with divisions (Ge/MyComponent/XBins not equal to 1, Ge/MyComponent/RBins not equal to 1, etc.) AND a scorer using this component also had divisions (Sc/MyScorer/XBins, Sc/MyScorer/RBins, etc.) AND the binning was set differently between the Geometry and the Scorer. The issue is now fixed for all cases.

Fixed a bug that was causing occasional navigation issues in TsCylinders that have Rho or Phi divisions:

We have changed our design for how TsCylinders are created when including Rho and Phi divisions. The old design cause occasional cases where Geant4 navigation seemed to be lost. This could result in extraneous very low energy hits appearing in the wrong bins or could cause nan values appearing in some bins of dose scorers. Because these extraneous hits were always with very low energy, if your previous simulation ran to completion, any occurrences of these very low energy hits are very unlikely to have had a significant effect. However, they did sometimes cause simulations to entirely fail. The bug is now fixed.

Fixed a bug where changing a material name in the Qt GUI did not actually change the material:

While changing a material from the Qt GUI worked fine for undivided TsBox, TsCylinder and TsSphere, the change had no actual effect if the Box, Cylinder or Sphere had divisions. The bug is now fixed.

Fixed a bug in Trajectory Colors:

Trajectories were not being assigned the correct colors when using user-defined colors (colors created by Gr/Color parameters). The bug is now fixed.

Parameter names have been fixed to define chemistry time step high edges and resolution:

Vector parameters previously named:

dv:Ch/.../AddTimeStepHighEdge
dv:Ch/.../AddTimeStepResolution
are now changed to match the parameter names in the Topas-nBio user’s guide:
dv:Ch/…/ChemicalStageTimeStepsHighEdges dv:Ch/…/ChemicalStageTimeStepsResolutions

Remove case-sensitivity from Region name “DefaultRegionForTheWorld”:

Simulation previously crashed if case was not an exact match in the parameter:

s:Ge/MyComponent/AssignToRegionNamed = "DefaultRegionForTheWorld"

The region name can now be specified with any case.

3.5 Series

This release is almost exactly the same TOPAS code as TOPAS Version 3.4, but with a new underlying Geant4 version. TOPAS 3.5 uses Geant4.10.06.p1, whereas TOPAS 3.4 used Geant4.10.05.p2. Our tests show no major difference in patient dose calculations, however, as this is a new Geant4 version, you should be on the lookout for changes that may affect your simulations. Our intention is that by comparing your TOPAS 3.5 simulation against a TOPAS 3.4 simulation, you can see how your results are affected by the underlying Geant4 version. There is one new feature:

3.5.0 (2020-06-21)

Added: Users of Topas 3.5 can take advantage of a new Drawing Style

This new drawing style represents a solid as a random cloud of points within the solid:

S:Ge/MyComponent/DrawingStyle = "Cloud" # Previous options were "WireFrame", "FullWireFrame" and "Solid"

It can be particularly useful in visualization of Boolean solids, as such solids are not always handled correctly by the polygon-generator underlying the other drawing styles. By default, the point cloud will be made of ten thousand points. You can adjust this by setting the new optional parameter:

i:Ge/MyComponent/NumberOfCloudPoints

3.4 Series

The main features introduced by the 3.4 series were:

  • significant reduction of the memory footprint of TOPAS
  • redefined variable density materials
  • graphics options

3.4.0 (2020-6-21)

Improved: Significant reduction to the memory footprint
The memory savings are substantial, in particular for the most challenging full patient simulations, when there are many different materials, many voxels and potentially many worker threads.
Fixed: Significant memory leak in defining patient materials
We identified some C++ objects involved in materials creation that did not need to be retained. For a typical patient simulation involving thousands of materials, the savings from this fix are on the order of a full GB.
Improved: Scorers now require much less memory
We found that our scoring code had been allocating all the maps needed for all of the different reporting options (Sum, Mean, Minimum, Maximum, etc.) even if the user only wanted to report a single one of these quantities. The result is an up to fivefold reduction in memory use by scorers. And as these memory costs are repeated once per worker thread, they can be even more substantial if your simulation has a high Ts/NumberOfThreads. Savings may be on the order of several GB.
Improved: Memory-intensive Mott Scattering correction tables are now optional

We found, for our default physics settings, most of the memory devoted to physics lookup tables was to support one specific process detail, the Mott Scattering correction. This correction is on by default in our default physics settings, as those settings include the EM module g4em-standard_opt4. Users may save significant memory by either changing their physics settings to use a different EM option, or by staying with Opt4 but turning off this correction factor:

b:Ph/Default/MottCorrection = "False" # Defaults to "True"
Added: Options for Variable Density Materials

We hoped to save additional memory by changing how we define materials. Our most commonly used imaging to material converter, the Schneider method, defines thousands of different materials (to correspond to the thousands of different Hounsfield numbers in the CT). Within this large set of materials, there are many cases where hundreds of materials share the same elemental composition, with only a variation of density. Up to now, we have used the original Geant4 method of material definition, defining each one of these thousands of materials as an entirely separate G4Material. However, Geant4 eventually added an option to just define a single material of a given composition, and then define many other materials as different density variants of this “Base Material”. In the hopes that this new method would give us comparable physics results while using less memory (as it would have to create fewer full material tables), we added a new option:

b:Ge/Patient/SchneiderUseVariableDensityMaterials = "True"

While this did result in memory savings, it also gave some alarming differences in a few of our detailed patient dose tests. For some test cases, there was a good match, but for other cases we saw significant dose differences in some areas with a high density gradient (such as the interface of patient head to the surrounding air). Our hypothesis is that the variable density material technique is not fully implemented for all Geant4 physics processes. We will continue to study this issue, but didn’t want to hold off on this release any longer. Users may want to try this option at their discretion, and depending on their choices of physics options, but we are leaving it off by default.

Added: Other features for Variable Density Materials

You can now define a TOPAS material as a variant of some other TOPAS material:

s:Ma/MyMaterial/BaseMaterial = "SomeOtherMaterialName"
d:Ma/MyMaterial/Density = 1.5 g/cm3

And if you are a C++ expert writing your own ImagingToMaterial converter, you can create a material based on a Base Material by calling the new method:

TsVImagingToMaterial: G4int DefineNewMaterial (G4String materialName, G4double density, G4String baseMaterialName, G4String colorName)
Improved: ImagingToMaterial converter options now include ByIntegerID

Some of our users have TsImageCube components where each voxel is represented not as a CT number but as an integer “tag number,” a 16-bit integer (C++ short) that corresponds to a particular material name. A new ImagingToMaterialConverter will interpret these tag numbers based on a lookup table created by two additional TOPAS vector parameters, MaterialTagNumbers and MaterialNames. For example:

s:Ge/Patient/Type = "TsImageCube"
s:Ge/Patient/ImagingToMaterialConverter = "ByIntegerID"
iv:Ge/Patient/MaterialTagNumbers = 6 0 3 42 43 100 110
sv:Ge/Patient/MaterialNames = 6 "Air" "G4_BLOOD_ICRP" "G4_BONE_CORTICAL_ICRP" "G4_BONE_COMPACT_ICRU" "G4_BRAIN_ICRP" "G4_MUSCLE_SKELETAL_ICRP"
  • Where the voxel is tagged with the number 0, the converter will interpret this as “Air”
  • Where the voxel is tagged with the number 3, the converter will interpret this as ” G4_BLOOD_ICRP “
  • Where the voxel is tagged with the number 42, the converter will interpret this as ” G4_BONE_CORTICAL_ICRP “

etc.

Improved: Ancestor Track and Vertex information has been extended in TsTrackInformation

This feature allows extension fillers and scorers to access more information about a track’s history. For each of the track’s ancestors, it now provides the track pointer (rather than just the track ID), the vertex momentum direction and the vertex kinetic energy (rather than just the vertex ID). Specifically, the new method signatures in TsTrackInformation.hh are:

std::vector<const G4Track*> TsTrackInformation::GetParentTracks()
std::vector<G4ThreeVector> TsTrackInformation::GetParentTrackVertexMomentumDirections()
std::vector<G4double> TsTrackInformation::GetParentTrackVertexKineticEnergies()
Improved: Ions of any charge can now work as Particle Sources
TOPAS previously only supported generation of fully stripped ions. All ion charges are now supported. Specify the charge by giving the appropriate Charge value in the particle name GenericIon(Z, A, Charge).
Improved: 4D CT Materials loading logic

The materials definition process has always been a little complicated for 4D CT cases, since Geant4 requires that we define all materials before the first particle history is created. If 4D behavior causes a new CT image to be loaded later in the simulation, and this image contains a material that was not present in the initial CT image, this could cause TOPAS to have to quit. Our previous method of handling this was to have you add the parameter:

b:Ge/Patient/PreLoadAllMaterials = "True"

This worked by defining every material in your HU conversion table, whether that material is ever actually used or not. This had the unwanted side effect of wasting initialization time and memory on some materials that were never used. We suggest you no longer use the PreLoadAllMaterials feature, and instead use the feature:

sv:Ge/Patient/PreLoadMaterialsFrom = 3 "CT_Image_1" "CT_Image_2" "CT_Image_3"

where you specify the names of all the different CT images that will eventually be loaded. TOPAS will then define all the materials in all of these images, but not waste time and memory on materials that are not used in any of the images.

Added: Multiple DICOM components can now be included in the same simulation
While this is an unusual situation, we had a user who wanted to represent two separate DICOM components in a single simulation. We found a small change we could make so that this is now supported, and we added a new example to demonstrate this capability examples/Patient/TwoDicoms.txt. The new example puts both the Abdomen DICOM and the DICOM_Box into two different locations in the same simulation. Note: each DICOM component in this example needs its own separate copy of the HU conversion parameters, so you will see that the example has includeFile statements for both HUtoMaterialSchneider.txt and HUtoMaterialSchneider2.txt. A more elegant solution would allow one to use the same conversion parameters in both DICOMs, but this would require syntax changes that would break previous use cases, so such a change will have to wait for a future new major release.
Improved: Particle Killing Variance Reduction options

This feature did not previously accept particle names that were of the form GenericIon. It now works for all particle types. We also added an inverted version of this option. So, the available options are now:

sv:Vr/KillOtherParticles/OnlyTrackParticlesNamed
sv:Vr/KillOtherParticles/OnlyTrackParticlesNotNamed
Added: Graphics Options

Graphics Options have been added to control Background Color, Line Width and Step Point Size:

s:Gr/MyOGL/BackgroundColor = "white" # Set background color
i:Gr/MyOGL/Linewidth = 8 # Set line width for both geometry and trajectories
i:Gr/MyOGL/StepPointSize = 16 # Set size of step points
Added: New Graphics Examples
New examples have been added to demonstrate various settings of the trajectory ColorBy options. Look in examples/Graphics to see the many new examples.
Fixed: Bug previously reported as “Incorrect results from dose scorer in certain unusual setups”
This bug affected dose scoring in a component that has a subcomponent, such as scoring on a box that has another box inside it. The issue is now fixed. Any users who have written their own extension scorers that rely on the volume of the scoring component are advised to copy our fix by replacing any calls to fSolid->GetCubicVolume() with the new method now accessible directly from the scorer’s base class GetCubicVolume(aStep).
Fixed: Bug that was preventing one of the physics parameters from working

This should now work correctly:

d:Ph/Default/SetProductionCutHighEdge
Fixed: Bug that was making Step Points drawing not work in some cases.

This was only working for some of the Trajectory ColorBy options. It now works for all cases:

b:Gr/MyView/IncludeStepPoints

3.3 Series

The main features introduced in the 3.3 series were:

  • Graphical User Interface (GUI)
  • option to declare neutrons stable
  • surface name AnySurface

3.3.1 (2020-03-31)

Fixed: Jobs crashing

Jobs were crashing if they had ALL THREE of the following characteristics in the same job:

  1. Geometry changing over time in a way that was more than just changing position
  2. Multiple threads
  3. Scoring

This has been fixed. If your job was not crashing, this issue did not affect your job and there is no need to re-do those simulations.

3.3.0 (2020-03-25)

Added: Graphical User Interface (GUI)
The key features of the GUI are as follows:
  • You can rotate and zoom the graphics window, and you can click on geometry and trajectories to get details about them
  • You can adjust parameters and see the effects immediately in the graphics window.
  • You can see and correct geometry issues such as overlaps for rapid prototyping (you will find that the “Run” button will not work until all overlaps are resolved).
  • You can add geometry components, scorers, particle sources, etc., from the GUI
  • Once you have a set of parameters that you like, click the “Save” button to save the changes to a new parameter file (for subsequent runs either with or without the GUI).
  • To activate the GUI, your parameter file needs: Ts/UseQt = "True"
  • To make a parameter appear in the GUI’s parameter control window, just add “c” (for changeable) right after the parameter type, for example, where your parameter file previously had d:Ge/MyBox/HLX change it to dc:Ge/MyBox/HLX
  • A simple Qt example has been added topas/examples/Graphics/QtTest.txt
  • MacOS 10.15 Catalina users will find that the GUI turns on automatically if they request OpenGL graphics even if they have not set Ts/UseQt. This is because the Qt GUI is the only way that we can activate OpenGL on that operating system.
  • The GUI is supported on all platforms except for CentOS6 and RHEL 6.
Improved: Color code trajectories
Options to color code trajectories have been extensively revised.
Improved: Coloring and filtering options for particle trajectory visualization
In response to an error reported by a user, we carried out a complete review of all the coloring and filtering options for particle trajectory visualization. We found and fixed many issues (this part of the TOPAS code has not been reviewed in a long time). We believe that all of the Gr/MyView/ColorBy... parameters and Gr/MyView/OnlyInclude... parameters are now working correctly. This includes making sure they understand all of the defined colors (previously only worked for a subset of the Topas colors that happened to also have the same name in the underlying Geant4 color defaults), and making sure they work for GenericIon as well as other particle types. We also added many new ColorBy and FilterBy examples in examples/Graphics.
Improved: Scoring with OutputAfterRun

When scoring with OutputAfterRun, there is now a way to avoid clearing the scorers between runs. Thus each run’s output will contain the new time interval’s scores plus all scores accumulated during previous runs. To activate this feature, set the parameter:

b/Sc/MyScorer/OutputAfterRunShouldAccumulate = "True"
Fixed: Scoring option OutputAfterRun
A user found that scorers gave incorrect output if they set OutputAfterRun and the scorer had been set to report more than just the sum. Scoring option OutputAfterRun now works correctly in all cases.
Fixed: Scoring in Geometry Components
Scoring now works correctly in geometry components that are changing size under time features. A user noted that if the scoring component changed size, it would no longer receive any hits. This has now been fixed.
Fixed: Variance Reduction
Variance Reduction now works correctly in components that are changing size under time features.
Fixed: Magnetic and Electric fields
Magnetic and Electric fields now work correctly in components that are changing size under time features.
Improved: Vr/KillOtherParticles/OnlyTrackParticlesNamed now supports GenericIons
It previously only worked for other particle names.
Added: Declare neutrons stable

You can now declare that neutrons should be considered stable. This can be used to work around error conditions such as “Can not determine decay channel …”. Set parameter:

b:Ph/SetNeutronToStable = "True"
Added: New surface name AnySurface
A new surface name AnySurface lets you make a surface scorer be sensitive on any surface. You could use this, for example, to capture phase space of particles passing through all surfaces of a cylinder (instead of the current ZPlusSurface, OuterCurvedSurface, etc.)
Improved: Surface names are no longer case sensitive
So where we previously required exactly ZPlusSurface, we now accept zplussurface, etc.
Improved: Mapped Magnetic Field handling
A user provided some corrections to the mapped field handling.
Fixed: DICOM RT Structure filter
The DICOM RT Structure filter now survives hits with invalid indices. A rare Geant4 bug used to cause this filter to crash. The filter now survives this condition, and the relevant hits are appropriately trapped and reported.
Improved: Protection against use of cylinders or spheres parameterized in r, phi or theta in the presence of parallel worlds

We have found that Geant4’s parallel world navigation system has problems in these conditions and can cause hits to be associated with wrong bins (often piling up in bin zero). We had some protection against this previously, but have learned that more cases are affected, so we now completely forbid use of these parameterizations when there are parallel worlds anywhere in the setup. You can override this limitation if you wish by setting the following parameter, but if you do so, we suggest you check that your results seem sensible:

b:Ge/AllowDividedCylinderOrSphereWithParallelWorld = "True"
Fixed: Scoring option PropagateToChildren
This option was not working correctly in cases where other scorers were also attached to those child components.
Improved: Forbid attaching a scorer to the World component
We have seen some examples where users set the World as the scoring component. This was something we had not anticipated in the TOPAS design, and it gives incorrect results in some cases (such as if you add binning options in the scorers). It is now simply forbidden.
Improved: Uniformity check on DICOM DoseGridOffset
The uniformity check on DICOM DoseGridOffset now allows for up to 2% difference.

3.2 Series

The main features introduced by the 3.2 series were:

  • Option to Score Recursively in Subcomponents
  • Volumetric Particle Source
  • Auger Cascade
  • New Physics Constructors and lists
  • Material can now be 4D
  • Centering Graphics on a Given Component
  • Scaling Graphics by Different Amounts in X, Y an Z
  • “power-based” history count

We also updated the underlying Geant4 version to Geant4.10.5.p01.

3.2.2 (2019-08-15)

Fixed: Reading of XCAT Phantoms and other simple ImageCube implementations
We have fixed these readings, and examples/Patient/XCAT.txt now works correctly.

3.2.1 (2019-07-07)

Fixed: Incorrect placement of the RT Dose Grid
A bug was introduced in release 3.2 that caused the RT Dose Grid to be improperly positioned. This is the grid that is automatically created when one uses the parameter CloneRTDoseGridFrom. Placement should now be correct.
Fixed: Crash if volumetric source is close to the size of the World
In some cases, Topas could crash if a volumetric source was close to the edge of the World. Such placement will no longer cause a problem.

3.2.0 (2019-05-02)

Improved: Simplified Setting of Environment Variables

Where you previously had to set a separate environment variable for each of Geant4’s many data files, you now just tell TOPAS the location of the overall G4Data directory. You can do this by either one of the following two ways:

Set one of these two environment variables:

export TOPAS_G4_DATA_DIR = "/PathToDataDir/G4Data"
setenv TOPAS_G4_DATA_DIR "/PathToDataDir/G4Data"

Or set a TOPAS parameter:

Ts/G4DataDirectory = "/PathToDataDir/G4Data"

As always, your syntax will depend on where you actually chose to put your data files, and on whether you are using a system that expects “export” versus “setenv” to set environment variables.

Improved: DICOM Slice Thickness Attribute is Now Mostly Ignored
We had previously refused to load a DICOM series if the DICOM slice thickness attribute did not match the actual separation between the individual slice positions. However, we have seen that in many DICOM data sets, this attribute does not correspond to the actual spacing of the slices. We now just ignore this slice thickness attribute, and the only case in which we use the slice thickness attribute is if you only load a single slice (so that there is no possibility for us to compute the actual separation between slices).
Improved: Control the Caching of Material Maps for 4D CT

For 4D CT, the previous TOPAS version always cached all the material maps (a separate map for each CT phase). We did this because we assumed 4D CT users would always want to return to each breathing phase multiple times. However, a user had a case where he had a very large number of maps and only wanted to use each map once. The caching caused him to run out of memory, so a new parameter lets you decide whether such maps should be cached (as before) or not:

b:Ge/CacheMaterialMapForEachTimeSlice defaults to True
Fixed: ShowSpecificSlicesVoxel Numbering

The following parameters limit which patient voxels are shown in graphics views. Where slice numbering previously started from 0, it now starts from 1:

Ge/ShowSpecificSlicesVoxelsX
Ge/ShowSpecificSlicesVoxelsY
Ge/ShowSpecificSlicesVoxelsZ
Improved: Option to Load a Truncated DICOM, XiO or ImageCube

The previous parameters, ShowSpecificSlicesVoxels, affected only the graphical output of the voxels. The voxels were still all loaded, and all affected the physics results, but only specific voxels were shown in graphics. These new parameters, RestrictVoxels, have a much more significant effect: they cause TOPAS to not even load some parts of the patient. This can save a lot of time and allow you to test things on DICOM or other image formats quickly, as you only have to load whatever part of the DICOM you actually want to use. But beware: if you use this option, you will change your results. It does not only affect graphics, it actually avoids creating the given voxels at all. Though our main motivation for this work was to get a way to do more rapid development (testing on real patients without the slowdown of loading everything), there may be a value also for our brachytherapy users. They may only need to load the part of the image that is near the brachy source. New parameters allow you to restrict which voxels of a patient image are loaded:

i:Ge/MyComponent/RestrictVoxelsXMin
i:Ge/MyComponent/RestrictVoxelsYMin
i:Ge/MyComponent/RestrictVoxelsZMin
i:Ge/MyComponent/RestrictVoxelsXMax
i:Ge/MyComponent/RestrictVoxelsYMax
i:Ge/MyComponent/RestrictVoxelsZMax
Improved: ViewAbdoment.txt Example has been Sped Up
We have modified our simplest example of viewing a DICOM, examples/Patient/ViewAbdomen.txt by applying the new RestrictVoxels parameters described above.
Fixed: XCAT Phantom Reading
We fixed an issue with attenuation parameters not being read properly.
Improved: Energy Binning

We have understood that some users want to use our energy binning (EBins) for a different thing than we designed. From our proton therapy dose calculation roots, the energy binning that we currently do is based not on the energy of the final particle at hit deposition time but instead on the incident particle energy. This is the energy of the final scored particle, or its ancestor, when that particle or ancestor was first incident on the scoring volume. However, users who have been trying to use this feature to get a spectrum instead need the particle’s energy at the current step. So we have now added a parameter to control what kind of energy we use for this binning:

s:Sc/MyScorer/EBinEnergy = "IncidentTrack" # "IncidentTrack", "PreStep" or "DepositedInStep"
  • “IncidentTrack” is the behavior we have had in the past, the energy that the particle or its ancestor had when it first was incident on the scoring component. This remains the default.
  • “PreStep” is the track’s energy at the start of the current step.
  • “DepositedInStep” is the amount of energy deposited in the current step.
  • A new example shows the effect of the three different choices examples/Scoring/EnergyDepositBinnedByEnergy.txt
Added: Option to Score Recursively in Subcomponents

When your scoring component is the parent of other components, you now have the option to set scoring to record particles note only in the parent component, but also in its children. This action is recursive to all levels of subcomponents:

Sc/MyScorer/PropagateToChildren = "True"
Improved: Allow nTuple Scorers to Get Binning Information
A helper method, GetBin, tells scorers which bin was hit within a divided component. This method was previously only available to scorers that implement TsVBinnedScorer. At request of a user, this method has now also been made accessible to scorers that implement TsVNTupleScorer.
Fixed: Binning in Variable Density Materials
A user pointed out that when we generate Variable Density Materials, our binning was slightly off such that the top bin was not quite getting the maximum intended density value. This has been corrected.
Improved: Scoring Sensitivity in Some Rare Cases of Complex Geometry Components
In the past, when components other than TsBox, TsCylinder and TsSphere were made up of more than one volume, scoring was only sensitive in the mother volume. Scoring is now sensitive in all volumes, however this change is unlikely to affect most users. The scoring was already correct in TsBox, TsCylinder and TsSphere.
Improved: Redesigned Filtering
We modified the design of our filters to avoid an issue that was bothering the newer compiler included in Debian 9. The only impact on users is that if you have written your own extension filter, you should modify your filter’s constructor to replace TsVFiltered* filter with TsVGenerator* generator, TsVScorer* scorer.
Added: Volumetric Particle Source

A new Particle Source type, Volumetric, has been designed for Brachytherapy applications (though there may be other applications as well). It randomly samples particle starting positions from within the radioactive volume of a given component. When you have a Source of Type “Volumetric”, Topas will expect a second parameter:

s:Sc/MyScorer/ActiveMaterial

to specify which material within the given component should be considered radioactive. So, for example, if you have:

s:So/Example/Type = "Volumetric"
s:So/Example/Component = "ActiveSource"
sc:So/Example/ActiveMaterial = "G4_Ir"

particles will start from randomly sampled positions within the Iridium parts of the component named ActiveSource. See the new example examples/Basic/VolumetricSource.txt

Added: New Geometry Component TsBrachyApplicator
This component represents a gynecological applicator. Parameters control overall dimensions and the number of holes into which one can guide a source wire. See examples/Patient/Applicator.txt which simulates a Varian VS2000 source wire moving through various dwell positions within a brachytherapy applicator (that is in turn placed within a phantom).
Improved: EM Physics Models per Region:

You can now select different Electromagnetic Physics models in different regions:

s:Ph/Default/ForRegion/MyRegion2/ActiveG4EmModelFromModule = "g4em-livermore"

New example for EmPhysics models per region examples/Basic/EmModelByRegions.txt

Added: Auger Cascade
Auger Cascade is now supported.
Added: New Physics Constructors
New Physics Constructors for G4DNA available in Geant4.10.05 have been added to our modular physics list:
  • g4em-dna_opt6
  • g4em-dna_opt7
  • g4em-dna_opt8
Added: New Physics Lists
New Physics Lists that artificially maintain constant the incident particle kinetic energy (frozen-velocity approximation), ensuring the correct calculation of stopping power:
  • g4em-dna-stationary
  • g4em-dna-stationary_opt2
  • g4em-dna-stationary_opt4
  • g4em-dna-stationary_opt6
Improved: Variance Reduction
We added several new features to Variance Reduction:
  • The capability to change VR parameters (e.g. split number) using time features.
  • The capability of have more than one VR per simulation (e.g. uniform splitting + imp sampling)
  • Forced interaction VR
Added: New manager for generic biasing process
A new virtual class TsVBiasingProcess facilitates the integration of new VRs. Current parameters for VR are still functional, but now they can be renamed different than Vr/ParticleSplit/XYZ
Improved: Examples for secondary biasing
We added several new examples for secondary biasing
  • New example for forced interaction examples/VarianceReduction/ForcedInteraction.txt
  • New example showing cross-section enhancement for bremsstrahlung examples/VarianceReduction/CrossSectionEnhancement.txt
  • New example showing importance sampling and bremsstrahlung splitting examples/VarianceReduction/ImportanceSamplingSecondaryBiasing.txt
  • Also shows the capabilities of having more than one VR in the same simulation.
Fixed: Obscure Problem with Component Placement
Components were incorrectly placed when the first component in a parallel world was a Group Component. Interestingly, we never had any reports of this problem from users. It was only found during some of our own special tests.
Added: Forbid Use of Parallel Worlds with Chemistry
Since Geant4 DNA’s chemistry processes do not support parallel worlds, we have added a check to forbid use of parallel worlds if chemistry is turned on in your physics list.
Fixed: Diagnostic Printout of TsPropeller Component
The TsPropeller component has a diagnostic that prints out its angle. Where this was meant to print out the full angle, it was actually printing the half-angle. This has been corrected.
Added: Material can now be 4D
You can now change a component’s material over time. You can also change the material that is specified in the DoseToMaterial scorer (though we don’t know why you might want to do this).
Added: Centering Graphics on a Given Component

A new graphics parameter allows you to center the view on a given component:

s:Gr/MyView/CenterOn = "MyComponent"

Topas will then ignore any parameters of the form: Gr/MyView/TransX or Gr/MyView/TransY

Added: Scaling Graphics by Different Amounts in X, Y an Z

New parameters allow you to scale by different amounts in each dimension:

uv:Gr/MyView/Scale = 3 1. 2. 3.

would scale by 1 in X, by 2 in Y and by 3 in Z.

Improved: Zooming to the Nanometer Scale
With very large Gr/MyView/Zoom values, as one might use to zoom into the nano scale, floating point errors in the graphics card lead to discontinuous jumps in the image position. This makes it difficult to center or size the view as one wishes, but an easy workaround has been understood. If one simply makes the world invisible, then because the initial graphics extent only includes the nanometer scale components, one doesn’t need much zoom. This effect and its solution are demonstrated in the new example examples/Graphics/NanoMeterScaleTest.txt
Improvemed: Controlling Console Output

You can add time stamps to the history count:

b:Ts/IncludeTimeInHistoryCount = "True"
Added: You can have a “power-based” history count b:Ts/ShowHistoryCountLessFrequentlyAsSimulationProgresses

After first ten histories, output will change to once for every 10, then to once for every 100, etc. An additional optional parameter, i:Ts/MaxShowHistoryCountInterval, puts an upper limit on how high the ShowHistoryCountInterval can be. For example:

b:Ts/ShowHistoryCountLessFrequentlyAsSimulationProgresses
i:Ts/MaxShowHistoryCountInterval = 100

Gives: 1, ,2, 3…9, 10, 20, 30…100 but from there always keep counting by 100 (rather than going on to counting by 1000, 10,000, etc.)

Improved: Handling of Mapped Magnetic Fields
Thanks to several users, we have identified and improved some aspects of the MappedMagnet field reader. The system now works for a wider variety of field maps and allows for 4D changes in the map.
Improved: Increased the Default Ts/MaxStepNumber
TOPAS watches the number of steps on tracks to try to detect tracks that are stuck endlessly looping. The limit is set by the parameter Ts/MaxStepNumber. We have found cases where legitimate tracks take more than 100K steps, so we have increased the default limit from 100K to 1M.
Improved: Made Parameter File Reading be More Robust
We now catch and replace smart quotes (single and double) with simple double quotes. We also now catch and replace various Unicode hyphen characters with minus sign.

3.1 Series

The main features introduced by the 3.1 series were:

  • improved support for DICOM input and output
  • added XCAT phantom geometry component
  • outcome modeling (e.g. TCP and NTCP)

We also updated the underlying Geant4 version to Geant4.10.3.p01.

3.1.2 (2017-10-07)

Fixed: time varying magnetic or electric field when using more than one thread
If you ran with more than one thread, that is Ts/NumberOfThreads not set to its default value of 1, only the first thread was correctly updating fields over time. In other threads, the field never changed from its initial setting. This bug did not affect any other time features, only magnetic and electric fields.
Fixed: DICOM RT structure sets
Structure contours were incorrectly read from at least some structure set files. This affected both scoring (filtering by structure) and graphics (coloring by structure). Also, graphics was erratic if any structures that were being filtered on were not also being colored by.
Added: Protection against inconsistent DICOM FrameOfReferenceUID

In a properly constructed DICOM data set, all files from a given study (slices, structures and dose files) will have a consistent FrameOfReferenceUID. We now test on these UIDs and give an informative error message if they do not match. You can override this test if you need to by specifying:

b:Ge/Patient/IgnoreInconsistentFrameOfReferenceUID = "True"
Improved: ReferencedDicomPatient now infered from component ancestry
If a scorer does not have the ReferencedDicomPatient parameter set, it will automatically be infered from the ancestry of the scorer’s Component.
Added: Protection against attempts to run with more than one thread in random time mode
Attempting to make a simulation with Tf/RandomizeTimeDistribution = "True" faster by using multiple threads actually makes the simulation slower. Geant4 multithreading only saves time if a run has many histories to share among the threads. Our random mode has only one history per run, randomizing the time for the next run. With only one history per run, the overhead from extra, never used threads just slows things down. We now give an informative error message if you try to run in this inefficient way.
Added: Protection against accidentally using Sc/MyScorer/Type when you should use Sc/MyScorer/Quantity
We have seen cases where users thought the parameter to select a scorer was Sc/MyScorer/Type (it is actually Sc/MyScorer/Quantity). We should have made it Sc/MyScorer/Type since that would be consistent with other parameter names such as Ge/MyComponent/Type and Gr/MyGraphics/Type, but we can’t change it now without breaking existing parameter files (something we only allow ourselves to do for a Major release). We now give an informative error message if we see any cases of Ge/MyComponent/Type.
Improved: Protection against two chains of parameter files affecting the same component, scorer, etc
TOPAS includes tests to make sure that no two parameter chains try to affect the same component, scorer, etc. This is to insure that you can safely take parameter chains from some other work group and incorporate them into your own simulation without unexpected effects. This protects against, for example, two groups each defining different components that happen to have the same name. The test was overly tight, making the following situation needlessly forbidden One chain has: Ge/MainCylider/... Other chain has: Ge/MainCylider/ThingInsideIt/... The code considered these both to be the same component, "MainCylinder". But really they are two different components, "MainCylinder" and "MainCylinder/ThingInsideIt".

3.1.1 (2017-06-02)

Improved: Reduce sensitivity of test for stuck tracks

In Topas 3.1, we introduced a test to catch a rare problem in which Geant4 stops propagating any tracks but still runs to completion, resulting in misleading results. The test looks for cases where a history has only a single track, and that track has only two steps and that track does not exit the world. In the case where Geant4 got stuck, we saw that once the job was in trouble all histories had this signature. A user has since shown us a case where this test was triggered when the simulation was not actually stuck (thanks Eelco Lens for sharing your example with us - it involved a particle with nearly zero energy emitted by a phase space source).

With this patch, we make the test less sensitive and make it controllable by two new parameters. Only quits now if 10 such histories are found in a row. The number of such histories allowed in a row can be adjusted by:

i:Ts/NumberOfAnomalousHistoriesToAllowInARow = 10

And the test can be disabled completely by setting:

b:Ts/QuitIfManyHistoriesSeemAnomalous = "False"

3.1.0 (2017-05-09)

Improved: Updated Geant4 to latest version 10.03.p01
Includes new physics modules such as g4em-standard_SS and new EM options: EMBins and EMBinsPerDecade.
Improved: Extensions Interface
You can now add your own physics modules for use in modular physics lists. You can have more than one extension directory: semicolon-separated paths in cmake argument TOPAS_EXTENSIONS_DIR. TOPAS now knows to ignore any hidden directories within your extensions directories (for example .DS_Store directories). Added support for gcc compiler versions later than 5.0.
Improved: DICOM tags of output files set appropriately

Some metadata tags (Study Instance UID, Frame of Reference UID) are copied from input DICOM (TsDicomPatient) to output DICOM (the scorer), which is important for data provenance:

  • The metadata source can be specified by the new parameter: ReferencedDicomPatient. This is helpful when scoring on a TsBox.
  • Otherwise, the metadata is copied from the scorer’s Component (if it is a TsDicomPatient)
  • Otherwise, the metadata is generated by TOPAS

Other metadata tags (SOP Instance UID, Series Instance UID, Series Description, Manufacturer, Manufacturer’s Model Name, Dates and Times) are now set appropriately. It is also possible to set a custom Series Description using the new SeriesDescription parameter.

Added: Automatically create a Scoring Grid that exactly matches a provided RTDOSE file in your DICOM dataset

This makes it easier to compare TOPAS results to Treatment Planning System results. Tell TOPAS which RTDOSE file to use by providing a "CloneRTDoseGridFrom" parameter, such as:

s:Ge/Patient/CloneRTDoseGridFrom = Ge/Patient/DicomDirectory + "/RTDOSE.dcm"

TOPAS will then automatically create a scoring volume in a parallel world to overlay your grid, and will name this component with the same name as your patient, plus "/RTDoseGrid". You can then score on this component just like on any other component:

s:Sc/Dose/Component = "Patient/RTDoseGrid"
Added: Automatically set DicomOrigin parameters to help with patient positioning

If you define a set of DicomOrigin parameters for your patient:

dc:Ge/Patient/DicomOriginX = 0.0 mm
dc:Ge/Patient/DicomOriginY = 0.0 mm
dc:Ge/Patient/DicomOriginZ = 0.0 mm

then when you read in a TsDicomPatient, TOPAS will update these parameters on the fly to provide the origin of the DICOM coordinate system specified in the TOPAS coordinate system. You can combine this information with other information you may have about your isocenter to get your patient properly positioned.

For example, if you just wanted to center your patient in its parent component, such as PatientGroup, you would do:

s:Ge/Patient/Type     = "TsDicomPatient"
s:Ge/Patient/Parent   = "PatientGroup"
d:Ge/Patient/TransX   = 0.0 mm
d:Ge/Patient/TransY   = 0.0 mm
d:Ge/Patient/TransZ   = 0.0 mm

If you also had isocenter information from at RT-Ion plan in DICOM coordinates:

d:Rt/plan/IsoCenterX = 0.0      mm
d:Rt/plan/IsoCenterY = -99.9904 mm
d:Rt/plan/IsoCenterZ = -14.0    mm

you could adjust the patient to isocenter by doing:

d:Ge/Patient/TransX = Ge/Patient/DicomOriginX - Rt/plan/IsoCenterX mm
d:Ge/Patient/TransY = Ge/Patient/DicomOriginY - Rt/plan/IsoCenterY mm
d:Ge/Patient/TransZ = Ge/Patient/DicomOriginZ - Rt/plan/IsoCenterZ mm

A new example shows how to use the new features: ViewAbdomen_rtdose.txt.

Added: Read XCAT Phantoms and any other user-defined simple cube of imaging values
This new component type, TsImageCube, replaces and extends our previous TsXiOPatient. Data can be either short, int or float values. Conversion of imaging values to materials can use XCAT_Attenuation or XCAT_Activity values from an XCAT log file, or some other conversion class you provide yourself through our extensions mechanism, or can take values that you set directly in TOPAS Parameters. See documentation and example in XCAT.txt.
Fixed: Adjusted the names of some of the materials automatically created during HU conversion

Where the HU number was negative, automatically generated material names were such as:

Ma/PatientTissueFromHU-295

But we’ve said that the minus sign is a reserved character, not allowed in parameter names. So we now create material names such as:

Ma/PatientTissueFromHUNegative295

Should have no impact on users as these material names are both created and used automatically.

Improved: Other DICOM improvements
  • Updated DICOM toolkit gdcm to latest version 2.6.8
  • DICOM scoring output is now stored in RTDOSE files (previously stored in CT files)
  • Corrected the voxel size in DICOM output
  • Automated scaling so that DICOMOutputScaleFactor parameter is no longer needed
  • Added support for negative values in DICOM output (e.g. charge scoring)
  • Gave DICOM output a TOPAS-specific root UID: 1.2.826.0.1.3680043.9.5871.
  • Fixed coordinate systems of DICOM input and output, which also affected RTStruct filtering
  • Added check that where DICOM output is specified, the scoring component is appropriate (e.g. TsBox or TsPatient)
  • Renamed examples/DICOM to examples/Patient. The change was made since we support not just DICOM but also XiO, XCAT and arbitrary image cubes.
  • TsDicomPatient no longer requires overall material parameter
Added: Outcome modeling

TOPAS can now directly perform Outcome Modeling such as calculating Tumor Control Probabilities and Normal Tissue Complication Probabilities. Expanding on TOPAS previous capability to directly produce a Dose Volume Histogram, TOPAS can now directly apply outcome models to the DVH. We provide a variety of standard outcome models from the literature, for each of which you can adjust various parameters. See documentation and examples.

We also allow you to read back in a previously created DVH to have TOPAS apply new outcome models without having to re-do the Monte Carlo simulation phase of the job.

You can also supply your own outcome model via the TOPAS extensions interface.

Added: New options when reading phasespace files

Phase space source can now scale the particle start positions:

u:So/MyPhaseSpaceSource/PhaseSpaceScaleXPosBy = 0.1
u:So/MyPhaseSpaceSource/PhaseSpaceScaleYPosBy = 0.1
u:So/MyPhaseSpaceSource/PhaseSpaceScaleZPosBy = 0.1

To ignore a position, scale to zero, as in:

u:So/MyPhaseSpaceSource/PhaseSpaceScaleXPosBy = 0.

The previous way to ignore a position was:

b:So/MyPhaseSpaceSource/PhaseSpaceIgnoreXPos = "True"

is still supported, but is deprecated and will be removed at the next major release.

Added: Reading Limited Phase Space can now handle files that lack NewHistory flags

We found that some files from other vendors that are supposed to have NewHistory flags do not have them, so that TOPAS could not tell which particles were new histories. These files seemed to have the assumption that all photons are new histories. To support this, we added a parameter:

b:So/MyPhaseSpaceSource/LimitedAssumePhotonIsNewHistory = "True"
Added: Phasespace scorer can output creator process

Phase space output can now include Creator Process Name:

b:So/MyPhaseSpaceSource/IncludeCreatorProcessName = "True"
Improved: Made PhaseSpace source accept time-varying NumberOfHistoriesInRun
This option is only allowed if you have MultipleUse = 0, meaning you intend to explicitly say how many histories to use, rather than running through the entire phase space file 1 or more times.
Added: Protection against unreasonable setups of phase space input

Do not allow PhaseSpaceMultipleUse is negative.

Do not allow PhaseSpaceMultipleUse to be controlled by a time feature.

Do not allow phase space source with empty histories when there are time features since we can’t tell where in the time sequence these empty histories are supposed to occur (we will address this with an addition to the TOPAS phase space formats in the next release).

Improved: Extension scorers C++ interface
When developing extension scorers, the C++ class interface has changed when using sub-scorers. This does not affect the parameter interface. Sub-scorers are now assigned names, which are used for identification in the CombineSubScorers() method. This also allows sub-scorers to be shared between scorers, which reduces the memory used by a simulation (e.g. multiple RBE scorers can reuse Dose and LET scorers). The new C++ interface is demonstrated in ExtensionExamplesMore/MyScoreProtonLET. See the Custom Scorers for details.
Improved: Improved handling of empty runs in scoring
When scoring has OutputAfterRun, but a particular run has zero histories (as may happen during beam current modulation), TOPAS was not producing any output file for the run. This was occurring because Geant4 itself does not actually increment its RunID for such empty runs. However this is not what users want when they have OutputAfterRun. TOPAS now maintains its own RunID that includes empty runs. Empty runs will now have output files just as non-empty runs will.
Improved: Other scoring improvements
  • Added example of OpticalPhotonCount scorer: OpticalPhotonCount.txt
  • Added a more complex example of a user-written Ntuple Scorer
  • Fixed bug in SplitByTimeFeature with step function of a double parameter. Reported by Weiguang Yao in user forum.
  • Added Number of Entries to Ntuple headers
  • Protected against attempts to score on a Group Component
  • Added track vertex 4-momentum to information in TsTrackInfo. Users can access this information when writing custom scorers or filters.
Improved: Default color definitions to match HTML 4.01 standard
Some of the color values we had were strange leftovers from some very very old code. We now use the standard values from the HTML 4.01 standard as described here. As with any parameters, you are free to redefine these in your own parameter files.
Added: Support for transparency

Where color parameters used to take just three integer values (0 to 255) for the three color components, they now allow an optional fourth integer value (0 to 255) for the alpha value. So, for example:

iv:Gr/Color/TransparentYellow = 4 255 255 0 50

If the alpha value is omitted, the color is fully opaque.

Improved: Increased default value of Gr/SwitchOGLtoOGLIifVoxelCountExceeds
This parameter controls when TOPAS switches from using the “Stored” mode of OpenGL to using the “Immediate” mode. Stored allows for faster re-rendering when the view changes. Immediate mode does not re-render as quickly, but uses less RAM. Value was increased from 3 million to 70 million voxels.
Improved: Other graphics improvements
  • Made division lines in divided components match color of the overall component. These were previously showing as white no matter what color the component was.
  • Fixed various issues with having multiple graphics views at same time.
Improved: Faster overlap checking

Overlap checking previously spent some unnecessary time checking whether the divisions within a divided component (such as the voxels in a TsBox) overlapped each other. Since these voxels are generated automatically by TOPAS, you can trust that they do not overlap. If you really want to turn this overlap checking back on, set:

b:Ge/CheckInsideEnvelopesForOverlaps = "True"
Added: More control over precision of overlap check

Geant4’s overlap checking works by randomly placing points on the surface of a solid, and then checking whether any of these points are inside another solid that is not a mother. You can now control the number of such points:

i:Ge/CheckForOverlapsResolution = 1000

And you can check the tolerance for overlap:

d:Ge/CheckForOverlapsTolerance = 0. mm

You can also set these in a more granular fashion, per Component (overrides the above parameters for this particular component):

i:Ge/MyComponent/CheckForOverlapsResolution = 1000
d:Ge/MyComponent/CheckForOverlapsTolerance = 0. mm
Improved: Other geometry improvements
  • Added ability for World to be a Sphere or a Cylinder. World was previously always a Box.
  • Removed limitation on number of parallel worlds. Previously had limit of 8 parallel worlds. There is no longer any limit (but you should avoid using more than necessary as they may slow performance).
Improved: Trap anomaly in which Geant4 appears to run through entire job, but no particles propagate
This is a rare anomaly. We do not yet understand what causes it, but we have seen it start happening in otherwise reasonable setups after some random large number of histories. Once the anomaly sets in, the job would appear to run successfully to completion, but no particles actually propagate, and thus nothing is scored. We have found that a signature of this condition is that the entire history has only one step and the endpoint of that step is not on the world volume. We now watch all histories for this signature, and exit the job if this this signature is detected. The workaround we have for now is to then try the same job with a different random seed.
Improved: Other miscellaneous improvements
  • Added checks that integer parameters are within bounds. Covers input values up to 9223372036854775807.

  • Added protection against missing parameter type letter before first colon. Catches mistake such as:

    :Ge/MyBox/Type = "TsBox"
    
  • Improved various error messages about inappropriate parameter formatting

  • When dumping parameters to file per run, file names now have underscore after “Run”. This makes parameter dump file naming consistent with scoring file names.

  • Fixed bug that made some particle sources give too many histories when there were multiple sources in multithreaded mode

  • Improved error trapping for case of invalid particle name set for variance reduction

  • Corrected units in information printout from propeller

  • All MaxStepSize in components that have parallel scoring copies. TOPAS was previously trying to apply the MaxStepSize to the parallel copy. This is not appropriate and was causing Geant4 to fail.

  • NumberOfHistoriesInRandomJob is now a required parameter when running in random mode. This fixes a bug where users of RandomizeTimeDistribution saw the Demo source produce histories even if it was not wanted.

3.0 Series

The main features introduced by the 3.0 series were:

  • n-tuple output from custom scorers
  • new extensions mechanism
  • redesigned beam source parameter interface
  • generalized imaging to material conversion
  • electric fields
  • faster graphics performance

We also updated the underlying Geant4 version to Geant4.10.2.p01.

We took the opportunity of a major release to revise some parameter names with the benefit or hindsight and looking towards future releases. Consequently, we provided a topas2to3 script to help in upgrading parameter files.

3.0.1 (2016-06-02)

Fixed: drawing to multiple OpenGL graphics views not working correctly
We have been struggling with some issues in OpenGL graphics since we moved to Geant4.10.02. In particular, there were issues if you drew more than one view at a time. We now believe this is fixed, with the exception of the Debian8 build. Behavior is highly dependent on the specific operating system, and we (and Geant4) are still working to get this just right.
Fixed: compiler issues when adding extensions
Building with extensions should now work on all operating systems. It is no longer necessary to run cmake twice in a row, and our cmake does a better job now of setting the required C++11 flags. You will still need to update your compiler if your default compiler does not support C++11. This is now discussed in the last section of the README.
Fixed: bug in filter extensions
Can now add multiple filter extensions simultaneously.
Improved: geometry component types now case-insensitive
It no longer matters what case you use in Ge/MyComponent/Type values. So, for example, you could use "tsBox", "TsBox" or "tsbox". This also applies to user-supplied extension components.

3.0.0 (2016-06-01)

Added: n-tuple output from custom scorers

If you’re not familiar with n-tuples, you may be interested to know that you’ve already been using a version of one if you were outputting particle information to phase space.

Our new design gives you very fine control over what information your scorer will write.

In your scorer’s constructor you define each column and its data type. For floating point columns you also specify the unit string, similar to how the SetUnit() method is used in other scorers. In the ProcessHits() method, you then compute the variables you want to output and then call fNtuple->Fill(). Buffered file writing is automatically handled. Output can be to ASCII, binary and ROOT data formats.

Added: phase space scorers can be output to ROOT format
This is a binary data format associated with the ROOT data analysis framework.
Improved: overhaul of extension mechanism

No more editing the CMakeLists file or adding a clause into the TsExtensionManager.cc.

Just create a folder anywhere on your computer, put your extensions into it (you can even organize them by subfolders within this folder), add one special comment line to the top of each cc file, and run CMake, telling it where your folder is with the –DTOPAS_EXTENSIONS_DIR option. Our CMake scripts will then automatically interweave your code in with ours, and all will work. Please note that, with the introduction of n-tuple scorers, existing scorers will require some additional modifications to distinguish them as “binned scorers”.

Improved: revised parameter interface for beam and isotropic sources

You can now provide a cutoff (like a collimation) to the angular spread distribution. This improvement was sparked by a request from Christian Sommer.

The overall parameter set has been revised to be, we think, easier to understand and remember.

  • Type = {Beam, Phasespace, Emittance, Isotropic}
  • BeamPositionDistribution = {None, Flat, Gaussian} (if Beam)
    • BeamPositionCutoffShape = {Rectangle, Ellipse} (if Flat/Gaussian)
    • BeamPositionCutoffX/Y (if Flat/Gaussian)
    • BeamPositionSpreadX/Y (if Gaussian)
  • BeamAngularDistribution = {None, Flat, Gaussian} (if Beam)
    • BeamAngularCutoffX/Y (if Flat/Gaussian)
    • BeamAngularSpreadX/Y (if Gaussian)

The previous option BeamShape = “Point” is now chosen via BeamPositionDistribution = “None”, and the previous option BeamShape = “Isotropic” is now chosen via Type = “Isotropic”.

Here is the list of parameters that already existed, but now have new names:

  • BeamXYDistribution –> BeamPositionDistribution
  • BeamShape –> BeamPositionCutoffShape
  • BeamHWX –> BeamPositionCutoffX
  • BeamHWY –> BeamPositionCutoffY
  • BeamStandardDeviationX –> BeamPositionSpreadX
  • BeamStandardDeviationY –> BeamPositionSpreadY
Improved: default source removed

The default particle source parameters, So/Default/*, have been removed. While revising particle sources, we changed our mind about whether we should provide any default particle source parameters. We see so many differences in what different users need, that we now believe it is important that every user carefully consider all of their particle source parameters. Accordingly, we removed the default parameters So/Default/*. All examples now include a full specification of their particle source parameters.

We still bundle a built-in source, but we have renamed it So/Demo to emphasize that it should be used only for demonstration and teaching purposes. Users who write their own parameter files should fully specify their Particle Source.

Improved: changed the default water material

We removed our custom Water (mean excitation energy 75 eV) in favor of G4_WATER (78 eV).

For some time, we had been using a custom material, Water, with a mean excitation energy of 75 eV, instead of Geant4’s pre-defined G4_WATER, which has a mean excitation energy of 78 eV. With newer Geant4 physics, we find we get better agreement at MGH when we use 78 eV. Accordingly, we have removed our material Water and switched all of our examples to G4_WATER.

We created a new material named Water_75eV in case you have calibrated with this material and really want to stick with that.

Added: support for additional imaging to material conversion

Support Dual Energy CT, Multi-Energy CT and other complex ways of assigning material. We have generalized our imaging to material conversion. You can now provide your own extension class to control how TOPAS assigns materials in the patient. Input can come from one or more image files and the imaging modality is not limited to CT. TOPAS pulls the information out of the images for you, and gives your class the one or more values per voxel. Your class then determines what material to then assign for this voxel.

New parameters are:

i:Ge/Patient/NumberOfEnergies = 1 # defaults to 1
sv:Ge/Patient/DicomModalityTags = 1 "CT" # defaults to just CT
s:Ge/Patient/ImagingtoMaterialConverter = "Schneider"

You will note that we renamed the parameter HUtoMaterialConversionMethod to ImagingToMaterialConverter to emphasize that input need not necessarily be Hounsfield Units.

Added: field handling extended to include electric fields

Where before we had:

Ge/MyComponent/MagneticField = "Dipole" # or "Quadrupole", "Map"

We now have:

Ge/MyComponent/Field = "DipoleMagnet" # or "QuadrupoleMagnet", "MappedMagnet", "UniformElectroMagnetic"

The latter can have both magnetic and electric components. To specify a pure electric field, use “UniformElectroMagnetic” while specifying a zero MagneticFieldStrength. You can also write your own extension field class that provides any other Electric, Magnetic or ElectroMagnetic field.

To make way for ElectricField parameters, we renamed some parameters:

  • DirectionX –> MagneticFieldDirectionX
  • DirectionY –> MagneticFieldDirectionY
  • DirectionZ –> MagneticFieldDirectionZ
  • Strength –> MagneticFieldStrength
  • GradientX –> MagneticFieldGradientX
  • GradientY –> MagneticFieldGradientY
  • 3DTable –> MagneticField3DTable
  • Stepper –> FieldStepper
  • StepMinimum –> FieldStepMinimum
  • DeltaChord –> FieldDeltaChord
Improved: magnetic field setup from 3D field maps
The new code does a much better job of handling various field maps. Thanks to Eric Able of Varian Medical Systems for his extensive prototype work.
Added: support for variable density materials

Driven by needs from imaging to material conversion, we have added a way that you can easily define a set of materials that differ only in density:

i:Ma/MyMaterial/VariableDensityBins = 100
u:Ma/MyMaterial/VariableDensityMin = .1
u:Ma/MyMaterial/VariableDensityMax = 10.

will generate 100 versions of MyMaterial, with densities varying from .1 x normal to 10. x normal.

The material names will then be like:

MyMaterial_VariableDensityBin_0
MyMaterial_VariableDensityBin_1
...
MyMaterial_VariableDensityBin_99

Note that numbering starts at zero.

Improved: support for multiple slice thicknesses in TsDicomPatient
This capability was previously restricted to the TsXioPatient.
Improved: OpenGL graphics are dramatically faster
Especially true for patient geometry. If you were avoiding displaying patient geometry, it’s time to try it again.
Added: new export options for OpenGL Graphics

Where before we had:

Gr/MyView/CopyOpenGLToEPS

we now have that plus three new options:

Gr/MyView/CopyOpenGLToPDF
Gr/MyView/CopyOpenGLToSVG
Gr/MyView/CopyOpenGLToPS

.

Added: new syntax for specifying vectors

New parameter expressions let you set vector parameters from other vector parameters:

dv = name_of_double_vector_parameter unit
dv = number * name_of_double_vector_parameter unit
dv = name_of_unitless_or_integer_parameter * name_of_double_vector_parameter unit
uv = name_of_unitless_vector_parameter
uv = number * name_of_unitless_vector_parameter
uv = name_of_unitless_or_integer_parameter * name_of_unitless_vector_parameter
iv = name_of_integer_vector_parameter
iv = integer * name_of_integer_vector_parameter
iv = name_of_integer_parameter * name_of_integer_vector_parameter
bv = name_of_boolean_vector_parameter
sv = name_of_string_vector_parameter

This makes it easier to adjust existing vector parameters in file hierarchies.

Improved: G4Box, G4Tubs and G4Sphere components removed
You should instead use TsBox, TsCylinder and TsSphere. These provide all the same functionality, but also support divisions. We have done this both to simplify the underlying TOPAS code (simpler means less likelihood for bugs), and because we have seen many cases where someone tried to apply divisions to G4Box, G4Tubs or G4Sphere, and had a hard time figuring out why this wasn’t working (this has even happened to us during live demos).
Added: specify material per voxel for any divided component

This means you can create complex phantoms directly from the parameter system:

sv:Ge/Phantom/VoxelMaterials = 100 "G4_WATER" "G4_WATER" "Air" "Air" "G4_WATER" ...

Works for all three kinds of divided components: TsBox, TsCylinder and TsSphere.

Improved: TsBox and TsCylinder allow parameterizations in parallel worlds
The underlying limitation that was preventing this has been resolved in the new Geant4 version. The restriction against using parameterization within a parallel world now only applies to TsSphere (as the underlying issue for this case is still present in Geant4).
Improved: support larger numbers of histories

Various Counters have been changed from int to long to accommodate larger numbers of histories. With the move to multi-threading, we now have users running so many histories in a single session that various counters exceeded the size of our internal counters. There remain some limits within Geant4 itself, so we enforce a maximum of 10^9 histories per run.

We also found a way to allow you to have more than 10^9 histories in a single TOPAS session. The solution is to break these histories into multiple Geant4 runs. Originally, the parameters Tf/TimeLineStart, Tf/TimeLineEnd and Tf/NumberOfSequentialTimes were intended to let you have different runs at different times (TOPAS Time Features). But if you leave TimeLineEnd the same as TimeLineStart (and by default they are both 0), and just set Tf/NumberOfSequentialTimes to some value greater than 1, you will have multiple runs, and each can have up to 10^9 histories, but the total can be much larger.

Improved: ProtonLET scorer extended to very low density materials

Our current LET scorer gives values that are too high in air, where the mean path length between discrete processes can be larger than the voxel size. This can be avoided by neglecting secondary electrons, so we introduce the NeglectSecondariesBelowDensity parameter, whose default value is 0.1 g/cm3.

Even when you do this, rare events that produce very low energy protons (e.g. a recoiling hydrogen nucleus) will produce spikes in LET. This is also seen in the PreStepLookup version of the scorer. They are not seen in the fluence-averaged version of the scorer, since they are rare events. For this reason we introduce a UseFluenceWeightedBelowDensity parameter, whose default value is zero. We disable this by default because it is strange to mix both types of LET in a single distribution, and could be significantly wrong at the end of range. We expect users to want to enable this when making a pretty plot of LET to overlay on a CT scan, without spikes in cavities and outside the patient.

Improved: convenience method GetIndex for custom scorers
Scorers can now easily obtain the voxel indices from hits in divided or parameterized components. The base class TsVScorer now provides a convenience method, G4int GetIndex(G4Step*). This is convenient for some expert users and also hides the GetIndex method that we don’t want people trying to use from the G4VPrimitiveScorer (since the latter doesn’t perform as the user would expect).
Improved: DoseToWater and DoseToWaterBinned scorers are unified

DoseToWaterBinned was a way of scoring dose to water that improved speed at some cost to accuracy by pre-calculating stopping power ratios. We now offer only one scorer, DoseToWater. To get the previous behavior of DoseToWaterBinned, add the optional parameter:

b:Sc/MyScorer/PreCalculateStoppingPowerRatios = "True" # defaults to "False"

The same parameter is also available for the DoseToMaterial scorer.

Improved: removed our custom EM Physics Module from our Default Physics List
In TOPAS 2.0 we provided a custom EM physics module, tsem-standard_opt3_WVI, that attempted to use the new WentzelVI model of multiple Coulomb scattering (MCS). Now that this MCS model has been fully incorporated into the Geant4 built-in physics module, g4em-standard_opt4, we switch to using this in our default physics list and remove the custom module.
Improved: removed the G4RadioactiveDecay module from our Default Physics List

We have found that the G4RadioactiveDecay process sometimes causes errors such as:

G4Exception : de0001 issued by : G4AtomicTransitionManager::Shell()
No de-excitation for Z= 3  shellIndex= 2>=  numberOfShells= 2 AtomicShell not found

Since this module is not needed for most simulations, we have removed it from the default. If you really want this process, you can add it back to Ph/Default/Modules.

Fixed: renamed surfaces of TsCylinder and TsSphere

We have revised the names of Surfaces to have a more consistent overall design. Phi/Theta now have Plus/Minus afterwards, like X/Y/Z.

  • PlusPhiSurface –> PhiPlusSurface
  • MinusPhiSurface –> PhiMinusSurface
  • PlusThetaSurface –> ThetaPlusSurface
  • MinusThetaSurface –> ThetaMinusSurface
Fixed: corrected some surface area calculations
  • TsCylinder: calculation was wrong for area of Z surfaces and curved surfaces.
  • TsSphere: calculation was wrong for area of curved surfaces when there was a phi cut.
  • TsSphere: calculation was wrong for area of phi and theta cut surfaces.

We are sorry to have allowed these errors to slip through our testing process. Thanks to Christian Sommer for alerting us to the first of these (which led to a full review).

Added: other minor features
  • We added a way to have TOPAS list all processes in the currently selected physics list:

    b:Ph/ListProcesses = "True"
    
  • Topas can now tell you it’s version information: just type: topas --version

Fixed: other minor bugs
  • Removed need for BeamEnergy and BeamEnergySpread when source is spectrum.
  • Removed the particle source type Twiss as source type Emittance does the same and more.
  • The angular generation for Beam sources has been corrected so that it is valid beyond the small-angle approximation.
  • The base class for scorers, TsVScorer.hh, now includes G4SystemOfUnits.hh. Scoring often uses units, and this should make everyone’s life easier.
  • We removed the requirement that some water be present in the simulation when using the DoseToWater and DoseToMaterial scorers.
  • In time feature random time mode, Ts/ShowHistoryCountAtInterval now counts runs rather than events.
  • The material name Flourine has been corrected to Fluorine.
  • The parameter Ph/MyPhysicsList/LamdaBins has been corrected to Ph/MyPhysicsList/LambdaBins.
  • PhaseSpaceBufferSize is now called OutputBufferSize. We renamed this parameter as it now applies not just to phase space but also to n-tuples.
  • Sources now move correctly when the source component’s parent component is moving. This situation used to work only when the source component’s parent was a group component. It now works correctly for all cases. Thanks to Christian Sommer for showing us this bug.
  • Phase space source now correctly handles all ions. Some ions were previously being forbidden in the phase space source. Thanks to Vadim Moskvin for reporting this bug.
  • Solved bug that was causing part of phase space file to be used by two separate threads. When a multi-threaded session was using a phase space source, histories were being incorrectly assigned to the worker threads, causing some histories at the end of the file to be used more than once. Thanks to Hugo Moreira for showing us this bug.

2.0 Series

The main feature introduced by the 2.0 series was multithreading. In doing so we changed the underlying Geant4 to version Geant4.10.1.p02. This upgrade required extensive recoding within TOPAS, but was done in a way that required almost no changes to Parameter Files.

2.0.3 (2016-01-12)

Fixed: bug affecting scoring in divided TsBoxes, TsCylinders and TsSpheres
This caused some of the dose due to secondary particles to be assigned to wrong divisions. This bug was introduced when we switched to the Geant4.10 series, so began at Topas 2.0.
Fixed: bug in DICOM output
Dose value per voxel index was correct, but the entire structure was being drawn too small.
Fixed: bug using “Map” magnetic field type
In multi-threaded mode, field only took effect after the first run.
Fixed: bug in Phase Space output
Was crashing for cases of Ts/NumberOfThreads = 0 (meaning use all threads).
Fixed: a type in the header of DoseToWaterBinned scorer
Header had some extraneous text left over from an earlier design.
Improved: restored two convenience methods to TsVScorer
GetRunID and GetEventID are once again available for use by user-written scorers.

2.0.2 (2015-11-18)

Fixed: segfaults from secondary biasing
Filtering on whether a particle interacted in a given component was failing to notice the interactions. Thanks to Gray Lu and Christian Sommer for reporting these bugs.
Fixed: first few histories could ignore filters when using multiple threads
In testing our fix for the particle interaction filter, we also found a more subtle bug that could cause the first few histories to ignore any filter when running on more than one thread.

2.0.1 (2015-11-13)

Fixed: scorers report incorrect “Sum” in a specific case
Bug triggered when you have more than one bin (that is, where XBin, YBin, ZBin, RBin, PhiBin or ThetaBin is more than one) and the scorer’s Report options are set to exactly “Sum” and “Mean”.

2.0.0 (2015-11-04)

Added: multithreading support
Set i:Ts/NumberOfThreads to the number of CPU threads you want to use. If set to a positive integer, TOPAS will use that number of threads. If set to 0, TOPAS will use all of your computer’s threads (may be number of hardware cores or number of virtual cores (which includes hyper-threading cores) depending on your hardware architecture. If set to a negative number, TOPAS will use all BUT this number of threads, leaving you some threads reserved for other tasks (email, web browsing, etc.).
Improved: updated physics lists for Geant4.10.1.p02
We have upgraded the default physics list to what we believe is the best option for proton therapy dose calculation in this Geant4 release. Remember that the default physics settings in TOPAS may not be the best settings for your own work. The only assurance we can give you is that the default settings are what we have currently chosen for proton therapy dose calculation research at our home institutions of MGH and UCSF. Geant4 physics changes in each release, and it is always the user’s responsibility to perform any validations and adjustments that may be required.
Improved: magnetic field is now just a parameter on any component

You no longer specify special components for magnetic fields. Instead, the field is just an extra parameter that you can set for any of the standard components. So where you used to have:

Ge/MyComponent/Type = "TsDipoleMagnet" # or "TsQuadrupoleMagnet", "TsTabulated3DField"

you now use:

Ge/MyComponent/Type = "TsBox" # or "TsCylinder", etc
Ge/MyComponent/MagneticField = "Dipole" # or "Quadrupole", "Map"

which gives more flexibility.

Added: quadrupole magnetic more flexible
Can now have separate GradientX and GradientY
Added: visualization of magnetic fields

Field intensity and direction are represented as a set of arrows. The arrow density is controlled by:

i:Gr/ViewA/MagneticFieldArrowDensity = 10

Use with caution. When combined with rotation it sometimes causes crashes in polycone drawing (involved in drawing the arrowheads).

Added: magnetic fields to extensions mechanism
See here for how to add custom magnetic fields.
Improved: overlap checking is more strict

Geometry Overlaps previously caused only a warning. This meant that users might not even notice that their simulation had this dangerous geometry problem. TOPAS now is set to quit if any overlap is detected. If you really want TOPAS to continue, you can set:

Ge/QuitIfOverlapDetected = "False"

You will then still get a warning when the overlap is detected, an another warning at the end of the session. As before, you can turn off overlap checking entirely with:

Ge/CheckForOverlaps = "False"

This saves a small amount of time at startup, but is only recommended in cases where you are running a setup that you have already extensively tested.

Added: “Twiss” source type replaced by “Emittance”
The new source type provides more flexibility than the previous Twiss (see here).
Improved: user extensions require updating
  • If you have written your own Scorer in C++, you will need to add one additional argument to the constructor and pass this argument on to the TsVScorer.
  • If you have written your own Particle Source in C++, you will need to redesign this to have separate TsSource and TsGenerator.
Fixed: rare bug affecting some apertures

We have found rare cases in which an Aperture leaked dose (particles passed through one part of the aperture as material as if there was no material present). This was traced to an underlying bug in Geant4’s TessellatedSolid. While the bug is not yet fixed in Geant4, we now trap it and interrupt the relevant history. If this bug affects your session you will see warning message each time it occurs, plus a summary about this bug at the end of the console. An additional parameter aborts the session if this bug is found more than a specified number of times:

i:/Ts/MaxInterruptedHistories = 10 # defaults to 10

We do not recommend setting this to be a significant fraction of the total number of simulated histories.

Added: new examples
Random versus Sequential Time Feature modes are demonstrated in two new examples (RunRandom_Mode.txt and RunSequential_Mode.txt). Bremsstrahlung splitting is demonstrated in a new example (SecondaryBiasing.txt).

1.X Series

1.3.0 (2015-10-21)

Improved: scoring report option “Min_Max” is split into “Min” and “Max”
If you have previously used the option “Min_Max”, you will need to replace it with “Min” “Max”.
Added: new ways to dump parameters to text files
Ts/DumpParametersToSimpleFile takes a list of parameter names and dumps their types, names and values to a simple, human-readable file. Ts/DumpParametersToSemicolonSeparatedFile takes a list of parameter names and dumps their types, names and values to a semicolon separated file, suitable for easy import into other applications.
Added: method of defining elements
Elements can now be defined from specific combinations of isotopes (rather than from natural abundance).
Improved: zero padding of RunID in output file names
For example, MyScorerOutput_Run_0001.csv rather than MyScorerOutput_Run_1.csv, so that they will sort naturally in various file viewers. The number of padding places can be modified by the parameter i:Ts/RunIDPadding.
Improved: scoring filters can now specify ion charges

Source ions must be fully stripped (as before), but this restriction is no longer applied to scoring filters. For example:

sv:Sc/IonsWithCharge3to5/OnlyIncludeParticlesNamed = 1 "GenericIon(6,12,5)"

will only score those carbon ions that have charge of 5.

Improved: console output of phase space scorers
Additional information reported to the console.
Improved: filtering example
Now includes InitialParticle filters (see examples/Scoring/Filters.txt).
Improved: replaced the LET scorer
The new version has a new name, ProtonLET, to clarify that this calculation technique is only appropriate for protons. It uses a new “subscorer” mechanism by which the energy deposit and step length are internally scored by two separate scorers which are created for you on the fly and then divided to produce the final value.
Fixed: phi divisions in TsCylinder and TsSphere
The phi order of the divisions was previously backwards. For cases where the Cylinder or Sphere covered the full two Pi, this was only a numbering issue. But for cases where the Cylinder or Sphere was cut to less than the full two Pi, this caused the phi divisions to extend outside of the mother volume.
Fixed: excessive generation of parallel worlds
Some jobs were unnecessarily hitting the maximum number of parallel worlds (8). TOPAS was generating parallel worlds where they were not needed for one very specific situation: when a component’s name was a subset of a surface scorer’s target component’s name. So for example, when there was a component named MyComponent while a scorer was using MyComponent/SubComponentName. (Yes, never mind the details, it’s fixed.)
Fixed: other minor bugs
  • The phase space might not read all particles in the phase space file.
  • Setting AssignToRegionNamed for a component that is unused creates a segfault.
  • Using verbose scoring output from unsegmented components creates a segfault.
  • Histogram IDs in xml and root files had incorrect run numbers.
  • Quadrupole magnetic field incorrectly respected rotation of the component.

1.2.2 (2015-06-12)

Improved: TOPAS now prevents Geant4 from hanging due to stuck particles
We check the particle’s GetCurrentStepNumber at every step, killing the particle in the very rare case that the step numbers exceeds 100,000 (reasonable particles generally take no more than a few thousand steps). The limit can be adjusted by the parameter Ts/MaxStepNumber, but there is unlikely to be any reason that you should do so (stuck particles are rare, and even taking 100,000 steps doesn’t take very long). In principle, stuck particles should never occur, as Geant4 has a mechanism in place to gently nudge stuck particles, but this mechanism appears to have occasional failings (on the order a few per ten million histories). Because this mechanism now requires us to include a stepping action for every step in every region, we have checked carefully to evaluate its cost in CPU time. The cost appears to be only about 1%, well worth paying to avoid the workflow disruption that comes from stuck jobs. A message is printed at the bottom of the console if any particles have been killed by this new check. It tells the total number of particles affected and the total kinetic energy involved. More detailed information on each killed particle is provided earlier in the console log.
Improved: testing of complex parameter file graphs
These are complex arrangements with multiple includeFile. This fixes an issue in which our checks to prevent ambiguous parameter file graphs had been rejecting some valid graphs.
Fixed: correctly handle non-zero timeline starting value
This fixes an issue in which geometry setup failed or reported overlaps at time zero, when time zero was not actually going to be used for any of the runs.
Fixed: placement within parallel worlds
Components that are children of a parallel world group component are now placed correctly.
Improved: error messages from sources
Particle sources now have improved checks and more helpful error messages when required parameters are missing.
Fixed: bug in DVH output
DVH header files now give the correct name for their DVH data file. This fixes a minor issue in which the wrong file extension was shown in the header.
Improved: specifying ions
Ion handling has been updated to reflect that Geant4 only handles fully stripped ions. The third parameter in GenericIon(Z, A, Charge) is now optional. If present, it must equal Z since Geant4 only handles fully stripped ions. Since this argument is redundant, you can also just specify GenericIon(Z, A).
Added: IncludeCharge option for phase space output
This may be informative for ions that can lose charge as they move through material. Not available for Limited output format.

1.2.1 (2015-05-15)

Fixed: bug in range modulator wheel component
The bug caused a mis-alignment in the position of the modulator wheel blocks. The magnitude of the effect depends on ones exact simulation (and hence was missed in our own SOBP tests). A review of changes shows that we introduced this bug just before we upgraded from our Beta releases to our Release 1.0. Thanks to Benjamin Lutz for identifying this bug.
Fixed: incorrect RunID output by parameter dump
Triggered by diagnostic parameter dumps from Ts/DumpParametersToCsvFile, etc.
Fixed: remove extraneous debugging messages
Removed diagnostic output that was left over from recent development of the beam source spectrum feature.

1.2.0 (2015-04-20)

Added: energy spectrum parameters to beam source
Beam particle source can sample energy from a user-defined spectrum (see here).
Added: particle sources to extension mechanism
See here for how to add custom particle sources.
Added: new user hooks to extension mechanism
See here for how to add new methods: BeginSession, BeginRun, BeginHistory, EndHistory, EndRun, EndSession .
Improved: column ordering in scorer output can be customized
Whereas previously, the Report parameter just indicated which quantities to report (Sum, Mean, etc.), the parameter is now also used to tell the order of these output columns. Thus: sv:Sc/MyScorer/Report = 2 "Sum" "Mean" now gives a different column order than sv:Sc/MyScorer/Report = 2 "Mean" "Sum".
Improved: removed trailing comma in csv output format
The trailing comma on each line caused problems for some Matlab users.
Added: ability to read back and manipulate scorer output

Scoring Output can be read back in, so that one can then write out with different Report options:

Ts/RestoreResultsFromFile = "True" # defaults to "False"

will then expect each scorer to have:

s:Sc/MyScorer1/InputFile = "MySavedFileName"
s:Sc/MyScorer1/InputType = "csv" # "csv" or "binary"

Reads header of input file to check that input is appropriate for the given scorer. Can be used to output with different Report options than the original file, such as different columns, different column order or creating a DVH. Can also be used to translate from csv to binary or back again.

Added: option to dump parameter values to csv file

Dumps the requested parameters to a txt file: TopasParameterDump_Run0.txt. Triggered by:

sv:Ts/DumpParametersToCsv = 2 "SomeParameter" "SomeOtherParameter"

When multiple runs are involved, makes a new file for each run.

Fixed: by default, phase spaces do not output empty histories
PhaseSpaceIncludeEmptyHistories default value changed to False to match what was already in the User Guide.
Improved: meaning of EBins = 1 and TimeBins = 1 has changed
Previously, setting these values to 1 meant “do not use binning”. But since even when there is only one bin the data in the underflow and overflow bins can be useful, we now have EBins = 1 mean create one bin, plus underflow and overflow bins. To have no binning at all, set EBins = 0 (or don’t set EBins at all). A similar change was made for TimeBins = 1.
Fixed: conflict between energy binning and some filters
Energy Binning was not working in presense of FilterByAtomicMass, FilterByAtomicNumber and the example user-supplied filter, TsMyFilter1.
Fixed: memory bug in energy binning
Previously caused segfault on some systems when EBins was used.
Improved: check vector parameter length is non-negative
Previously protected against this number being zero but not against this being negative.
Added: example of rotation directions
See examples/TimeFeature/Rotation.txt.
Fixed: size of parallel scoring component for DICOM and XiO patient
This is the parallel world TsBox that is created if you attempt to score a DICOM or XiO Patient in a different grid than the original input file.
Fixed: visualization of parallel scoring component for DICOM and XiO patient
These parallel scoring components were often invisible. They now show correctly.

1.1.0 (2015-02-23)

Fixed: bug in particle type filters
It corrects behavior of the following four types of filters: OnlyIncludeParticlesNamed, OnlyIncludeParticlesNotNamed, OnlyIncludeIfParticleOrAncestorNamed, OnlyIncludeIfParticleOrAncestorNotNamed,

1.0.0 (2015-02-11)

First version of TOPAS was released! (Uses Geant4.9.6.p04)

Prior to the release of version 1.0, TOPAS had a long public beta phase.

Introduction to Parameter System

Design Philosophy

TOPAS follows a consistent set of design paradigms. Understanding these paradigms will make TOPAS more intuitive to you.

All control is through the TOPAS Parameters System. Use of Geant4 macros or interactive commands is not supported as it does not give you the reliability and repeatability that comes from the parameters system.

  • TOPAS Parameter files are not Geant4 macro files. TOPAS is specifically designed to avoid the kind of order-dependence risks that Geant4 macro files create.
  • TOPAS Parameter files are not XML files. Those too involve the kind of order dependence that we explicitly avoid.

To keep OpenGL graphics from vanishing from the screen, you have the option to have TOPAS pause at the Geant4 command line by including the option:

b:Ts/PauseBeforeQuit = "True" # defaults to "False"

To exit the Geant4 command line, and continue with the TOPAS session, type exit. For simulations that do not involve OpenGL graphics, just leave this option at "False".

All positions are set relative to Geometry Components. If you want to place a particle source or a scorer, you place it relative to a particular Component. You may choose to do your placement relative to the center of the World component, in which case you have essentially used the global coordinate system, but you will likely choose a more directly relevant Component. For example, a source that represents a particle beam might be placed at the beamline exit window. Doing so means that the source position will move appropriately with any nozzle movement.

All time dependent behaviors are controlled through the Time Features system.

TOPAS fully supports the Multi-Threaded simulation capability of Geant4. By default, TOPAS will occupy just one CPU thread, but you can spread the simulation over multiple threads, distributing the load over your entire computer, by adjusting the parameter i:Ts/NumberOfThreads. See details in the section Multithreading.

Syntax

The TOPAS Parameter System is a control structure for applications in which a large number of complex inter-related parameters are controllable by designers and end-users, in a manner that is absolutely flexible but simultaneously easy to use. The system is designed with safety and repeatability as top priorities. A key error-checking strategy is strict type checking, in which every parameter must have a specific declared type (string, boolean, integer, etc.) and the provided values are checked to ensure they are appropriate to the given type.

The system takes a set of “Parameters Files,” simple text files made up of lines of key/value pairs:

Parameter_Type : Parameter_Name = Parameter_Value # Optional comment

When you edit parameter files, be careful to use a Plain Text editor. TOPAS will not understand the various hidden characters created by complex word processors (such as Word or Keynote). Whatever your editor, turn off advanced features such as “Smart quotes”, “Smart dashes” and “Smart links”.

Ten example parameter settings are given below:

d:Ge/Phantom/HLX                           = 10. cm     # Dimensioned Double
u:Ge/Magnet/Dipole/MagneticFieldDirectionX = 1.0        # Unitless Double
i:Sc/DoseScorer/ZBins                      = 100        # Integer
b:Sc/DoseScorer/Active                     = "True"     # Boolean
s:Ge/Phantom/Material                      = "G4_WATER" # String
dv:Ge/RMW_Track1/Angles         = 4 69.1 92.2 111.0 126.0 deg      # Dimensioned Double Vector
uv:Ma/Phantom_Plastic/Fractions = 3 0.05549 0.75575 0.18875        # Unitless Double Vector
iv:Gr/Color/yellow              = 3 225 255 0                      # Integer Vector
bv:Tf/ScoringOnOff/Values       = 4 "true" "false" "true" "false"  # Boolean Vector
sv:Ma/MyPlastic/Components      = 3 "Hydrogen" "Carbon" "Oxygen"   # String Vector

Note

The order of lines within a parameter file does not matter.

A Parameter_Name can be almost any string, but we have prefix conventions to keep things clear:

  • Ma/ for Materials
  • El/ for Elements
  • Is/ for Isotopes
  • Ge/ for Geometry Components
  • So/ for Particle Sources
  • Ph/ for Physics
  • Vr/ for Variance Reduction
  • Sc/ for Scoring
  • Gr/ for Graphics
  • Tf/ for Time Features
  • Ts/ for TOPAS overall control

The Parameter_Type tells TOPAS what type of data will be in this parameter:

  • d for Dimensioned Double
  • u for Unitless Double
  • i for Integer
  • b for Boolean
  • s for String
  • dv for Dimensioned Double Vector
  • similarly for uv, iv, bv and sv

Warning

The only forbidden characters in a parameter name are: = + - * " ` TAB NEWLINE and RETURN The only forbidden characters in a parameter value are: = `

TOPAS uses this Parameter_Type to perform “strict type checking,” checking that the Parameter_Value is appropriate and complete for the given Parameter_Type.

A String parameter must be in quotes and may take any value.

A Boolean parameter must be in quotes and may be either:

  • "True", "t" or "1" (in any case) to mean true
  • "False", "f" or "0" (in any case) to mean false

An Integer parameter must be something that can be interpreted as an integer.

  • The value may not contain any decimal part, as this can lead to ambiguity as to the employed rounding strategy.
  • These are 32 bit integers, thus the values can range from 0 to 2147483647.

A Dimensioned Double parameter requires both a value and a unit.

  • We require the unit to avoid misunderstandings.
  • The value must be something that can be interpreted as a floating point number.

A Vector of Dimensioned Doubles parameter requires an integer (larger than zero) to indicate how many values are expected, then the values themselves, then a unit.

  • Vector of Dimensioned Doubles is useful when the definition of a single shape, motion, etc. requires multiple dimensioned double values.
  • Our usage of the term “vector” may be unfamiliar to some readers but is the standard term for such structures in modern programming languages.

Vectors of Unitless, Integer, Boolean and String again require an integer to indicate how many values are expected, then the values themselves. The individual strings in a Vector of Strings can not contain spaces (this requirement will be relaxed in a subsequent TOPAS release).

The comment character is #. Anything to the right of the comment character is taken as a comment. Comments can span as many lines as desired, until a new line is found that contains the equals sign.

Warning

A given parameter name may not be defined more than once in a single file.

Blank lines are ignored.

Parameter names may use mixed case, but their interpretation is not case sensitive. That is, "myParameter" is considered the same as "myparameter" or "myPaRaMeter", etc.

Complete Set of Allowed Syntax for any one Parameter Line

Warning

Note that in all of the expressions below, there must be a space before and after any +, - or *.

Dimensioned Double parameters:

d:parameterName = number unit
d:parameterName = number unit + name_of_dimensioned_double_parameter
d:parameterName = number unit - name_of_dimensioned_double_parameter
d:parameterName = number unit * name_of_unitless_or_integer_parameter
d:parameterName = number * name_of_dimensioned_double_parameter unit
d:parameterName = name_of_dimensioned_double_parameter unit
d:parameterName = name_of_dimensioned_double_parameter unit * number
d:parameterName = name_of_dimensioned_double_parameter unit * name_of_unitless_or_integer_parameter
d:parameterName = name_of_unitless_or_integer_parameter * number unit
d:parameterName = name_of_dimensioned_double_parameter + number unit
d:parameterName = name_of_dimensioned_double_parameter - number unit
d:parameterName = name_of_dimensioned_double_parameter + name_of_dimensioned_double_parameter unit
d:parameterName = name_of_dimensioned_double_parameter - name_of_dimensioned_double_parameter unit

Unitless parameters:

u:parameterName = number
u:parameterName = number + name_of_unitless_or_integer_parameter
u:parameterName = number - name_of_unitless_or_integer_parameter
u:parameterName = number * name_of_unitless_or_integer_parameter
u:parameterName = name_of_unitless_or_integer_parameter
u:parameterName = name_of_unitless_or_integer_parameter + number
u:parameterName = name_of_unitless_or_integer_parameter - number
u:parameterName = name_of_unitless_or_integer_parameter * number
u:parameterName = name_of_unitless_or_integer_parameter + name_of_unitless_or_integer_parameter
u:parameterName = name_of_unitless_or_integer_parameter - name_of_unitless_or_integer_parameter
u:parameterName = name_of_unitless_or_integer_parameter * name_of_unitless_or_integer_parameter

Integer parameters:

i:parameterName = integer
i:parameterName = integer + name_of_integer_parameter
i:parameterName = integer - name_of_integer_parameter
i:parameterName = integer * name_of_integer_parameter
i:parameterName = name_of_integer_parameter
i:parameterName = name_of_integer_parameter + integer
i:parameterName = name_of_integer_parameter - integer
i:parameterName = name_of_integer_parameter * integer
i:parameterName = name_of_integer_parameter + name_of_integer_parameter
i:parameterName = name_of_integer_parameter - name_of_integer_parameter
i:parameterName = name_of_integer_parameter * name_of_integer_parameter

Boolean parameters:

b:parameterName = value
b:parameterName = name_of_boolean_parameter
b:parameterName = name_of_boolean_parameter * name_of_boolean_parameter

String parameters:

s:parameterName = string
s:parameterName = string + name_of_integer_or_string_parameter
s:parameterName = name_of_integer_or_string_parameter
s:parameterName = name_of_integer_or_string_parameter + string
s:parameterName = name_of_integer_or_string_parameter + name_of_integer_or_string_parameter

Dimensioned Double Vector parameters:

dv:parameterName = number_of_values value1 value2 ... valueN unit
dv:parameterName = number_of_values value1 value2 ... valueN unit + name_of_dimensioned_double_or_double_vector_parameter
dv:parameterName = number_of_values value1 value2 ... valueN unit - name_of_dimensioned_double_or_double_vector_parameter
dv:parameterName = number_of_values value1 value2 ... valueN unit * name_of_unitless_or_integer_or_unitless_vector_or_integer_vector
dv:parameterName = number_of_values value1 value2 ... valueN * name_of_dimensioned_double_or_double_vector_parameter unit
dv:parameterName = name_of_dimensioned_double_vector_parameter unit
dv:parameterName = number * name_of_dimensioned_double_vector_parameter unit
dv:parameterName = name_of_unitless_or_integer_parameter * name_of_dimensioned_double_vector_parameter unit
# value1, value2, etc. can be a numeric value or the name of a dimensioned double parameter.

Unitless Vector parameters:

uv:parameterName = number_of_values value1 value2 ... valueN
uv:parameterName = number_of_values value1 value2 ... valueN + name_of_unitless_or_integer_or_unitless_vector_or_integer_vector
uv:parameterName = number_of_values value1 value2 ... valueN - name_of_unitless_or_integer_or_unitless_vector_or_integer_vector
uv:parameterName = number_of_values value1 value2 ... valueN * name_of_unitless_or_integer_or_unitless_vector_or_integer_vector
uv:parameterName = name_of_unitless_vector_parameter
uv:parameterName = number * name_of_unitless_vector_parameter
uv:parameterName = name_of_unitless_or_integer_parameter * name_of_unitless_vector_parameter
# value1, value2, etc. can be a numeric value or the name of a unitless parameter

Integer Vector parameters:

iv:parameterName = number_of_values value1 value2 ... valueN
iv:parameterName = number_of_values value1 value2 ... valueN + name_of_integer_or_integer_vector_parameter
iv:parameterName = number_of_values value1 value2 ... valueN - name_of_integer_or_integer_vector_parameter
iv:parameterName = number_of_values value1 value2 ... valueN * name_of_integer_or_integer_vector_parameter
iv:parameterName = name_of_integer_vector_parameter
iv:parameterName = integer * name_of_integer_vector_parameter
iv:parameterName = name_of_integer_parameter * name_of_integer_vector_parameter
# value1, value2, etc. can be a numeric value or the name of an integer parameter

Boolean Vector parameters:

bv:parameterName = number_of_values value1 value2 ... valueN
bv:parameterName = name_of_boolean_vector_parameter
# value1, value2, etc. can be a numeric value or the name of a boolean parameter

String Vector parameters:

sv:parameterName = number_of_values value1 value2 ... valueN
sv:parameterName = number_of_values value1 value2 ... valueN + name_of_integer_or_string_or_integer_vector_or_string_vector
sv:parameterName = name_of_string_vector_parameter
# value1, value2, etc. can be a numeric value or the name of a string parameter

Other operations are intentionally not supported since their behavior might be unclear. Such things can be done in user C++ code, generating new parameters on the fly (see Transient Parameters). d * d is forbidden because can create new units that we don’t recognize. Division is forbidden because of divide by zero issues, etc.

Relative Parameters

TOPAS supports “relative parameters”, wherein one parameter may be set relative to another, as in:

s:Ge/Phantom/Material = SomeOtherParameterName

Note

The many uses of this relative parameter syntax become more clear once one understands the entirety of the TOPAS design, including hierarchical control files and time features.

With relative dimensioned double parameters, we must protect against a user setting a parameter relative to some other parameter that does not have appropriate units. The solution is to insist that a unit be included on the right side of the expression. In the example below, the unit of cm indicates that SomeOtherParameter must itself have units of length. If that other parameter’s unit is of the entirely wrong unit category (mass, angle, etc.), TOPAS will refuse to run. If the unit is of the right category but a different exact unit (m, mm, etc.), TOPAS will perform appropriate unit conversion:

d:Ge/Phantom/HLX = SomeOtherParameterName cm

TOPAS has a grammar for operations such as adding or multiplying parameters:

Ge/Compensator/TransZ = Ge/Aperture/DistalEdge + Ge/Compensator/HLZ mm

Warning

Note that there must be a space before and after the plus sign.

Relative parameters allow only a limited number of functions, intentionally not a full math library, since other math functions may be ambiguous, requiring too much prior understanding of the mathematical syntax. The complete set of allowed syntax for any one parameter line is shown here.

Hierarchical Control

_images/hierarchy.png

Parameter files may pull in other parameters through includeFile statements, such as:

includeFile = someOtherParameterFile

On most operating systems, the case of the file name matters - MyIncludeFile.txt is not considered the same file as MYIncludeFile.txt - so take care to match the exact case.

includeFile lines may appear anywhere in the parameter file.

includeFile can use either absolute or relative file positions, such as:

includeFile = /Applications/topas/someDirectory/MyIncludeFile.txt
# or
includeFile = ../someDirectory/MyIncludeFile.txt

A file inherits all settings from its includeFile statements, and can override any of those included settings by setting the same parameter name to a new value.

Type and kind of units has to match type and kind of units for the same parameter name in any includeFile.

Type can be omitted if the same parameter name has already been defined with a type in an includeFile.

Parameter File Chains

When a parameter file includes another parameter file, and this in turn includes another parameter file, we refer to this as a “parameter file chain”.

Parameter file chains fit nicely into research workflow. You can define most of your standard settings in one file, while a file higher on the chain overrides just those values that you want to change today.

To define a parameter in terms of the value of the same parameter in an includeFile, set the value to the same parameter name (always interpreted to mean this parameter value from an includeFile) or use the shortcut value, inheritedValue. The following example would set a foil to be twenty percent thicker than in its included file:

Ge/IonChamber/Layer2/Foil/HLZ = Ge/IonChamber/Layer2/Foil/HLZ mm * 1.2
# or
Ge/IonChamber/Layer2/Foil/HLZ = inheritedValue mm * 1.2

Warning

Note that there must be a space before and after the multiplication sign.

A basic set of TOPAS default parameters are built into the system (see Default Parameters). You may override these defaults in your own parameter files if you wish.

Parameter File Graphs

TOPAS is designed to facilitate multiple independent workgroups focused on separate aspects such as treatment head design, patient handling and imaging devices. To this end, a parameter file may inherit settings from more than one other parameter file, forming a structure that is more complex than just a single chain. We refer to such a structure as a “parameter file graph.” An example is shown below:

_images/file_graphs.png

To implement such designs, a parameter file allows any number of includeFile statements, the statements may be located anywhere in the file, and you may specify one or more include files in a single includeFile statement, as in:

includeFile = someFile someOtherFile someOtherOtherFile
includeFile = stillAnotherFile

There is no significance to the left to right arrangement. That is:

includeFile = fileA fileB fileC

will behave the same as:

includeFile = fileC fileB fileA

or even the same as if this was broken up into multiple includeFile statements:

includeFile = fileB
includeFile = fileC fileA

To keep this order from mattering, TOPAS does not allow you to set up a simulation object (a Geometry Component, a Scorer, etc.) in one chain but modify it in a different chain. All parameters on a given Geometry Component need to be handled in the same chain. All parameters on a given Scorer need to be handled in the same chain.

TOPAS also checks to make sure that no two parameter file chains modify the same parameter in a way that is ambiguous. If, for example, the material MySpecialTungstenAlloy has been defined in the imaging chain, it cannot also be defined differently in the treatment head chain (unless the top level file, the user file, itself defines this parameter in an absolute way, that is, not relative to any other parameter).

The basic paradigm controlling use of multiple parameter chains is that nothing you do in one chain should magically change the behavior of anything in another chain. Think of the simulation world as an actual physical room. We don’t want the behavior of one thing in the room to magically change just because something else entered the room. So when you have multiple chains, TOPAS will check that neither chain modifies anything from the other chain.

This also means that no chain can redefine any of the Default Parameters, since all of the Default Parameters effectively belong at the base of every chain. The only place you can redefine the Default Parameters is in the top parameter file. This can feel like a heavy requirement, but it is essential. We want TOPAS to be a great tool for use in collaborative research environments where several people or teams may be contributing their own parts of the simulation setup.

It can take some experience to design complex parameter file chains. If you get stuck, feel free to ask for help on the TOPAS User Forum.

Controlling Multiple Batch Jobs

The hierarchical nature of parameter files makes it easy to control multiple batch jobs.

Make up a parameter file (or hierarchy of files) that has most of your settings:

  • MostOfMySettings.txt

Then make small additional parameter files for each job you want to submit:

  • Job1.txt
  • Job2.txt
  • Job3.txt

where each of these files has:

includeFile = MostOfMySettings.txt
Ts/Seed = 1 # Set this differently for each of Job1, Job2, Job3, ...
Sc/MyScorer/OutputFile = "Job1Output" # Set this differently for each of Job1, Job2, Job3,

Each job will thus have a unique starting random number seed (and hence produce a statistically distinct sample) and a unique output file specification, but all other aspects of the simulation will be identical from one job to the next.

Default Parameters

The following parameters are built-in by default. They are actually compiled into the code rather than set from a parameter file, so that all users will always have the same starting set of defaults. You can override any of these parameters in your own files.

Overall program control

i:Ts/Seed = 1 # starting random seed
i:Ts/MaxStepNumber = 1000000 # limit on number of steps before a track is killed
i:Ts/MaxInterruptedHistories = 10 # limit on how many histories can throw rare Geant4 errors
b:Ts/DumpParameters = "False" # Set true to dump full set of parameters to html file TopasParameterDump_Run0.html
b:Ts/DumpNonDefaultParameters = "False" # Like above but omits defaults
b:Ts/ListUnusedParameters = "False" # Set true to list unused parameters on the console
i:Ts/ShowHistoryCountAtInterval = 1 # How often to print history count to the console
b:Ts/ShowHistoryCountLessFrequentlyAsSimulationProgresses = "False" # Counts by 1, then by 10, then by 100, etc.
i:Ts/MaxShowHistoryCountInterval = "2147483647" # Stops increasing count interval after this limit
b:Ts/ShowHistoryCountOnSingleLine = "False" # Set true to make history count reuse same line of console
b:Ts/IncludeTimeInHistoryCount = "False" # Adds time stamp to history count
i:Ts/RunIDPadding = 4 # pad Run ID numbers to this many places in file names
b:Ts/PauseBeforeInit = "False" # Pause for Geant4 commands before initialization
b:Ts/PauseBeforeSequence = "False" # Pause for Geant4 commands before run sequence
b:Ts/PauseBeforeQuit = "False" # Pause for Geant4 commands before quitting
i:Ts/RunVerbosity = 0 # Set to larger integer to see details of run. Maximum is 2
i:Ts/EventVerbosity = 0 # Set to larger integer to see details of event. Maximum is 5
i:Ts/TrackingVerbosity = 0 # Set to larger integer to see details of tracking
i:Ts/SequenceVerbosity = 0 # Set to larger integer to see details of TOPAS run sequence
b:Ts/QuitIfManyHistoriesSeemAnomalous = "True" # Quits if Geant4 warnings issued on too many histories
i:Ts/NumberOfAnomalousHistoriesToAllowInARow = 10000 # Limit for above
b:Ts/RestoreResultsFromFile = "False" # Re-reads previous results to allow new output format or outcome modeling
i:Ts/NumberOfThreads = 1 # Number of CPU threads to which work will be distributed
b:Ts/BufferThreadOutput = "False" # Causes console output to be show one thread at a time
b:Ts/TreatExcitedIonsAsGroundState = "False" # Allows you to read back in excited ions in a phase space file
s:Ts/G4DataDirectory = "" # Specify path to Geant4 Data files (instead of having to set environment variable)

Overall timeline control

b:Tf/RandomizeTimeDistribution = "False" # Causes each history to be at a different time sampled from timeline
d:Tf/TimelineStart = 0. s
d:Tf/TimelineEnd = Tf/TimelineStart s
i:Tf/NumberOfSequentialTimes = 1
i:Tf/Verbosity = 0 # set to 1 to generate time log, set to 2 to get detailed update messages

Optional checks on correctness of geometry

b:Ge/CheckForOverlaps = "True"
b:Ge/CheckInsideEnvelopesForOverlaps = "False" # Speeds up checking by assuming inner parts of components are OK
i:Ge/CheckForOverlapsResolution = 1000
d:Ge/CheckForOverlapsTolerance = 0. mm
b:Ge/QuitIfOverlapDetected = "True"
i:Ge/NumberOfPointsPerOverlapCheck = 100
b:Ge/CheckForUnusedComponents = "True"

Top level geometry component, the World Volume

s:Ge/World/Type = "TsBox"
s:Ge/World/Material = "Air"
d:Ge/World/HLX = 5. m # Half Length
d:Ge/World/HLY = 5. m
d:Ge/World/HLZ = 5. m
d:Ge/World/TransX = 0. m
d:Ge/World/TransY = 0. m
d:Ge/World/TransZ = 0. m
d:Ge/World/RotX = 0. deg
d:Ge/World/RotY = 0. deg
d:Ge/World/RotZ = 0. deg

Demo Beam position

s:Ge/BeamPosition/Parent = "World"
s:Ge/BeamPosition/Type = "Group"
d:Ge/BeamPosition/TransX = 0. m
d:Ge/BeamPosition/TransY = 0. m
d:Ge/BeamPosition/TransZ =  Ge/World/HLZ m
d:Ge/BeamPosition/RotX = 180. deg
d:Ge/BeamPosition/RotY = 0. deg
d:Ge/BeamPosition/RotZ = 0. deg

Demo Particle Source

s:So/Demo/Type = "Beam" # Beam, Isotropic, Emittance or PhaseSpace
s:So/Demo/Component = "BeamPosition"
s:So/Demo/BeamParticle = "proton"
d:So/Demo/BeamEnergy = 169.23 MeV
u:So/Demo/BeamEnergySpread = 0.757504
s:So/Demo/BeamPositionDistribution = "Gaussian" # Flat or Gaussian
s:So/Demo/BeamPositionCutoffShape = "Ellipse" # Point, Ellipse, Rectangle or Isotropic
d:So/Demo/BeamPositionCutoffX = 10. cm
d:So/Demo/BeamPositionCutoffY = 10. cm
d:So/Demo/BeamPositionSpreadX = 0.65 cm
d:So/Demo/BeamPositionSpreadY = 0.65 cm
s:So/Demo/BeamAngularDistribution = "Gaussian" # Flat or Gaussian
d:So/Demo/BeamAngularCutoffX = 90. deg
d:So/Demo/BeamAngularCutoffY = 90. deg
d:So/Demo/BeamAngularSpreadX = 0.0032 rad
d:So/Demo/BeamAngularSpreadY = 0.0032 rad
i:So/Demo/NumberOfHistoriesInRun = 0
i:So/Demo/NumberOfHistoriesInRandomJob = 0

Physics

s:Ph/ListName = "Default"
b:Ph/ListProcesses = "False" # Set true to dump list of active physics processes to console
s:Ph/Default/Type = "Geant4_Modular"
sv:Ph/Default/Modules = 6 "g4em-standard_opt4" "g4h-phy_QGSP_BIC_HP" "g4decay" "g4ion-binarycascade" "g4h-elastic_HP" "g4stopping"
d:Ph/Default/EMRangeMin = 100. eV
d:Ph/Default/EMRangeMax = 500. MeV

Scoring

b:Sc/AddUnitEvenIfItIsOne = "False" # If unit is 1, rather than, say, Gy, default is to leave out unit in header.
s:Sc/RootFileName = "topas" # name for root output files
s:Sc/XmlFileName = "topas" # name for xml output files

Graphics

b:Gr/Enable = "True" # Set False to avoid instantiating any part of Geant4 visualization system (useful for running on batch machines that lack the OpenGL graphics library)
i:Gr/Verbosity = 0 # Set to higher integer to increase verbosity of Geant4 visualization system
s:Gr/RefreshEvery = "Run" # "History", "Run" or "Session"
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 8000 # Above this limit, only show outer box
i:Gr/SwitchOGLtoOGLIifVoxelCountExceeds = 70000000 # Above this limit, switch OpenGL Graphics to Immediate mode

Elements

s:El/Hydrogen/Symbol = "H"
s:El/Helium/Symbol = "He"
s:El/Lithium/Symbol = "Li"
s:El/Beryllium/Symbol = "Be"
s:El/Boron/Symbol = "B"
s:El/Carbon/Symbol = "C"
s:El/Nitrogen/Symbol = "N"
s:El/Oxygen/Symbol = "O"
s:El/Fluorine/Symbol = "F"
s:El/Neon/Symbol = "Ne"
s:El/Sodium/Symbol = "Na"
s:El/Magnesium/Symbol = "Mg"
s:El/Aluminum/Symbol = "Al"
s:El/Silicon/Symbol = "Si"
s:El/Phosphorus/Symbol = "P"
s:El/Sulfur/Symbol = "S"
s:El/Chlorine/Symbol = "Cl"
s:El/Argon/Symbol = "Ar"
s:El/Potassium/Symbol = "K"
s:El/Calcium/Symbol = "Ca"
s:El/Scandium/Symbol = "Sc"
s:El/Titanium/Symbol = "Ti"
s:El/Vanadium/Symbol = "V"
s:El/Chromium/Symbol = "Cr"
s:El/Manganese/Symbol = "Mn"
s:El/Iron/Symbol = "Fe"
s:El/Cobalt/Symbol = "Co"
s:El/Nickel/Symbol = "Ni"
s:El/Copper/Symbol = "Cu"
s:El/Zinc/Symbol = "Zn"
s:El/Gallium/Symbol = "Ga"
s:El/Germanium/Symbol = "Ge"
s:El/Arsenic/Symbol = "As"
s:El/Selenium/Symbol = "Se"
s:El/Bromine/Symbol = "Br"
s:El/Krypton/Symbol = "Kr"
s:El/Rubidium/Symbol = "Rb"
s:El/Strontium/Symbol = "Sr"
s:El/Yttrium/Symbol = "Y"
s:El/Zirconium/Symbol = "Zr"
s:El/Niobium/Symbol = "Nb"
s:El/Molybdenum/Symbol = "Mo"
s:El/Technetium/Symbol = "Tc"
s:El/Ruthenium/Symbol = "Ru"
s:El/Rhodium/Symbol = "Rh"
s:El/Palladium/Symbol = "Pd"
s:El/Silver/Symbol = "Ag"
s:El/Cadmium/Symbol = "Cd"
s:El/Indium/Symbol = "In"
s:El/Tin/Symbol = "Sn"
s:El/Antimony/Symbol = "Sb"
s:El/Tellurium/Symbol = "Te"
s:El/Iodine/Symbol = "I"
s:El/Xenon/Symbol = "Xe"
s:El/Caesium/Symbol = "Cs"
s:El/Barium/Symbol = "Ba"
s:El/Lanthanum/Symbol = "La"
s:El/Cerium/Symbol = "Ce"
s:El/Praseodymium/Symbol = "Pr"
s:El/Neodymium/Symbol = "Nd"
s:El/Promethium/Symbol = "Pm"
s:El/Samarium/Symbol = "Sm"
s:El/Europium/Symbol = "Eu"
s:El/Gadolinium/Symbol = "Gd"
s:El/Terbium/Symbol = "Tb"
s:El/Dysprosium/Symbol = "Dy"
s:El/Holmium/Symbol = "Ho"
s:El/Erbium/Symbol = "Er"
s:El/Thulium/Symbol = "Tm"
s:El/Ytterbium/Symbol = "Yb"
s:El/Lutetium/Symbol = "Lu"
s:El/Hafnium/Symbol = "Hf"
s:El/Tantalum/Symbol = "Ta"
s:El/Tungsten/Symbol = "W"
s:El/Rhenium/Symbol = "Re"
s:El/Osmium/Symbol = "Os"
s:El/Iridium/Symbol = "Ir"
s:El/Platinum/Symbol = "Pt"
s:El/Gold/Symbol = "Au"
s:El/Mercury/Symbol = "Hg"
s:El/Thallium/Symbol = "Tl"
s:El/Lead/Symbol = "Pb"
s:El/Bismuth/Symbol = "Bi"
s:El/Polonium/Symbol = "Po"
s:El/Astatine/Symbol = "At"
s:El/Radon/Symbol = "Rn"
s:El/Francium/Symbol = "Fr"
s:El/Radium/Symbol = "Ra"

Materials

s:Ma/DefaultColor = "white"
i:Ma/Verbosity = 0 # Set to 1 to report each time a material is defined

sv:Ma/Vacuum/Components = 4 "Carbon" "Nitrogen" "Oxygen" "Argon"
uv:Ma/Vacuum/Fractions = 4 0.000124 0.755268 0.231781 0.012827
d:Ma/Vacuum/Density = 1.0E-25 g/cm3
s:Ma/Vacuum/State = "Gas"
d:Ma/Vacuum/Temperature = 2.73 kelvin
d:Ma/Vacuum/Pressure = 3.0E-18 pascal
s:Ma/Vacuum/DefaultColor = "skyblue"

sv:Ma/Carbon/Components = 1 "Carbon"
uv:Ma/Carbon/Fractions = 1 1.0
d:Ma/Carbon/Density = 1.867 g/cm3
d:Ma/Carbon/MeanExcitationEnergy = 78 eV
s:Ma/Carbon/DefaultColor = "green"

sv:Ma/Aluminum/Components = 1 "Aluminum"
uv:Ma/Aluminum/Fractions = 1 1.0
d:Ma/Aluminum/Density = 2.6989 g/cm3
s:Ma/Aluminum/DefaultColor = "skyblue"
i:Ma/Aluminum/AtomicNumber =  13
d:Ma/Aluminum/AtomicMass = 26.98154 g/mole

sv:Ma/Nickel/Components = 1 "Nickel"
uv:Ma/Nickel/Fractions = 1 1.0
d:Ma/Nickel/Density = 8.902 g/cm3
s:Ma/Nickel/DefaultColor = "indigo"

sv:Ma/Copper/Components = 1 "Copper"
uv:Ma/Copper/Fractions = 1 1.0
d:Ma/Copper/Density = 8.96 g/cm3
s:Ma/Copper/DefaultColor = "orange"

sv:Ma/Iron/Components = 1 "Iron"
uv:Ma/Iron/Fractions = 1 1.0
d:Ma/Iron/Density = 7.87 g/cm3
s:Ma/Iron/DefaultColor = "skyblue"

sv:Ma/Tantalum/Components = 1 "Tantalum"
uv:Ma/Tantalum/Fractions = 1 1.0
d:Ma/Tantalum/Density = 16.654 g/cm3
s:Ma/Tantalum/DefaultColor = "indigo"

sv:Ma/Lead/Components = 1 "Lead"
uv:Ma/Lead/Fractions = 1 1.0
d:Ma/Lead/Density = 11.35 g/cm3
i:Ma/Lead/AtomicNumber =  82
d:Ma/Lead/AtomicMass = 207.19 g/mole
d:Ma/Lead/MeanExcitationEnergy = 823 eV
s:Ma/Lead/DefaultColor = "brown"

sv:Ma/Air/Components = 4 "Carbon" "Nitrogen" "Oxygen" "Argon"
uv:Ma/Air/Fractions = 4 0.000124 0.755268 0.231781 0.012827
d:Ma/Air/Density = 1.20484 mg/cm3
d:Ma/Air/MeanExcitationEnergy = 85.7 eV
s:Ma/Air/DefaultColor = "lightblue"

sv:Ma/Brass/Components = 2 "Copper" "Zinc"
uv:Ma/Brass/Fractions = 2 0.7 0.3
d:Ma/Brass/Density = 8.550 g/cm3
d:Ma/Brass/MeanExcitationEnergy = 324.4 eV
s:Ma/Brass/DefaultColor = "grass"

sv:Ma/Lexan/Components = 3 "Hydrogen" "Carbon" "Oxygen"
uv:Ma/Lexan/Fractions = 3 0.055491 0.755751 0.188758
d:Ma/Lexan/Density = 1.2 g/cm3
d:Ma/Lexan/MeanExcitationEnergy = 73.1 eV
s:Ma/Lexan/DefaultColor = "grey"

sv:Ma/Lucite/Components = 3 "Hydrogen" "Carbon" "Oxygen"
uv:Ma/Lucite/Fractions = 3 0.080538 0.599848 0.319614
d:Ma/Lucite/Density = 1.190 g/cm3
d:Ma/Lucite/MeanExcitationEnergy = 74.0 eV
s:Ma/Lucite/DefaultColor = "grey"

sv:Ma/Mylar/Components = 3 "Hydrogen" "Carbon" "Oxygen"
uv:Ma/Mylar/Fractions = 3 0.041959 0.625017 0.333025
d:Ma/Mylar/Density = 1.40 g/cm3
s:Ma/Mylar/DefaultColor = "red"

sv:Ma/Mylon/Components = 4 "Hydrogen" "Carbon" "Nitrogen" "Oxygen"
uv:Ma/Mylon/Fractions = 4 0.097976 0.636856 0.123779 0.141389
d:Ma/Mylon/Density = 1.140 g/cm3
s:Ma/Mylon/DefaultColor = "purple"

sv:Ma/Kapton/Components = 4 "Hydrogen" "Carbon" "Nitrogen" "Oxygen"
uv:Ma/Kapton/Fractions = 4 0.026362 0.691133 0.073270 0.209235
d:Ma/Kapton/Density = 1.420 g/cm3
s:Ma/Kapton/DefaultColor = "purple"

sv:Ma/Water_75eV/Components = 2 "Hydrogen" "Oxygen"
uv:Ma/Water_75eV/Fractions = 2 0.111894 0.888106
d:Ma/Water_75eV/Density = 1.0 g/cm3
d:Ma/Water_75eV/MeanExcitationEnergy = 75.0 eV
s:Ma/Water_75eV/DefaultColor = "blue"

sv:Ma/Titanium/Components = 1 "Titanium"
uv:Ma/Titanium/Fractions = 1 1.0
d:Ma/Titanium/Density = 4.54 g/cm3
s:Ma/Titanium/DefaultColor = "blue"

sv:Ma/Steel/Components = 8 "Carbon" "Silicon" "Phosphorus" "Sulfur" "Chromium" "Manganese" "Iron" "Nickel"
uv:Ma/Steel/Fractions = 8 0.0015 0.01 0.00045 0.0003 0.19 0.02 0.67775 0.1
d:Ma/Steel/Density = 8.027 g/cm3
s:Ma/Steel/DefaultColor = "lightblue"

Colors

iv:Gr/Color/White =     3 255 255 255
iv:Gr/Color/Silver =    3 191 191 191
iv:Gr/Color/Gray =      3 127 127 127
iv:Gr/Color/Grey =      3 127 127 127
iv:Gr/Color/Black =     3   0   0   0
iv:Gr/Color/Red =       3 255   0   0
iv:Gr/Color/Maroon =    3 127   0   0
iv:Gr/Color/Yellow =    3 255 255   0
iv:Gr/Color/Olive =     3 127 127   0
iv:Gr/Color/Lime =      3   0 255   0
iv:Gr/Color/Green =     3   0 127   0
iv:Gr/Color/Aqua =      3   0 255 255
iv:Gr/Color/Teal =      3   0 127 127
iv:Gr/Color/Blue =      3   0   0 255
iv:Gr/Color/Navy =      3   0   0 127
iv:Gr/Color/Fuchsia =   3 255   0 255
iv:Gr/Color/Purple =    3 127   0 127

iv:Gr/Color/Lightblue = 3 175 255 255
iv:Gr/Color/Skyblue =   3 175 124 255
iv:Gr/Color/Magenta =   3 255   0 255
iv:Gr/Color/Violet =    3 224   0 255
iv:Gr/Color/Pink =      3 255   0 222
iv:Gr/Color/Indigo =    3   0   0 190
iv:Gr/Color/Grass =     3   0 239   0
iv:Gr/Color/Orange =    3 241 224   0
iv:Gr/Color/Brown =     3 225 126  66

iv:Gr/Color/grey020 =   3  20  20  20
iv:Gr/Color/grey040 =   3  40  40  40
iv:Gr/Color/grey060 =   3  60  60  60
iv:Gr/Color/grey080 =   3  80  80  80
iv:Gr/Color/grey100 =   3 100 100 100
iv:Gr/Color/grey120 =   3 120 120 120
iv:Gr/Color/grey140 =   3 140 140 140
iv:Gr/Color/grey160 =   3 160 160 160
iv:Gr/Color/grey180 =   3 180 180 180
iv:Gr/Color/grey200 =   3 200 200 200
iv:Gr/Color/grey220 =   3 220 220 220
iv:Gr/Color/grey240 =   3 240 240 240

Overall Control

Time mode

If you do nothing special, TOPAS will do a single run with no time variation. We call this “Fixed Time Mode”. Other available modes are “Sequential” and “Random”.

Fixed Time Mode

To run in Fixed Time Mode, just set your source’s NumberOfHistoriesInRun, as in:

i:So/MySource/NumberOfHistoriesInRun = 100

If your parameter files include Time Features, they will all be evaluated with time equals zero. To instead have them evaluated at a different fixed time, specify TimelineStart, as in:

d:Tf/TimelineStart = 10. s # defaults to zero

If you have more than one source, the run will continue until all sources have run all of their histories. For each Geant4 “beamOn”, each source will get called, but only those that have more histories left to produce will actually produce any.

Sequential Time Mode

To have TOPAS do several runs at fixed time intervals, specify the start time, end time and number of sequential times, as in:

d:Tf/TimelineStart = 0. s # defaults to zero
d:Tf/TimelineEnd = 10. s # must be larger than TimelineStart
i:Tf/NumberOfSequentialTimes = 100 # defaults to 1

TOPAS will divide the overall time, TimelineEnd - TimelineStart, by NumberOfSequentialTimes and perform runs at each of these intervals.

  • The first run will be at time = TimelineStart.
  • The last run will be at time = TimelineEnd minus one interval. That is, TOPAS will stop before it reaches TimelineEnd.

So, in the example above:

  • Run 0 will have Time = 0. s
  • Run 1 will have Time = 0.1 s
  • Run 99 will have Time = 9.9 s

At each of these intervals, your source will generate your indicated NumberOfHistoriesInRun:

i:So/MySource/NumberOfHistoriesInRun = 10

So, for example, if you have 100 intervals, and NumberOfHistoriesInRun = 10, you will generate a total of 100 x 10 = 1000 histories.

To have TOPAS print time feature information to a log file and to the console:

i:Tf/Verbosity = 2 # defaults to zero.
# set to 1 to get time log (NbParticlesInTime.txt)
# set to 2 to get detailed update messages

To implement beam current modulation, have your source’s NumberOfHistoriesInRun get its value from a time feature, as in:

i:So/MySource/NumberOfHistoriesInRun = Tf/MyBCMTimeFeature/Value

By default, scorers will output just once, after the entire session. But if you wish to have separate output from specific runs:

b:Sc/MyScorer/OutputAfterRun = "True" # set True to trigger output of scorer after this run
  • If this is False, or not defined, we just output at the end of the simulation.
  • If this is True, we output after every run.

Random Time Mode

Random Time Mode generates one history per run, with a randomly sampled time at each run. This has several uses.

  • It allows one to sample time in a continuous fashion, so may show features that are obscured by Sequential Mode
  • It provides a way to do a lower statistics run of what would have been a very long Sequential Mode job, yet still see aspects of the entire time interval, rather than just the first subset of the sequential times

To run in Random Time Mode, specify the TimelineStart and TimelineEnd, turn on RandomizeTimeDistribution, and set your source’s NumberOfHistoriesInRandomJob, as in:

b:Tf/RandomizeTimeDistribution = "True" # defaults to "False"
d:Tf/TimelineStart = 0. s # defaults to zero
d:Tf/TimelineEnd = 10. s # must be larger than TimelineStart
i:So/MySource/NumberOfHistoriesInRandomJob = 1000 # defaults to 100

For each history, a random time will be sampled between TimelineStart an TimelineEnd.

We keep the parameters that control random mode (NumberOfHistoriesInRandomJob) separate from those that control sequential mode (NumberOfHistoriesInRun and NumberOfSequentialTimes) so that you can easily switch between the two modes (by just switching RandomizeTimeDistribution).

To implement beam current modulation, give your source a time-dependent ProbabilityOfUsingAGivenRandomTime, as in:

d:So/MySource/ProbabilityOfUsingAGivenRandomTime = Tf/MyBCMTimeFeature/Value

Fixed Time but with Very Large Number of Histories

The maximum number of histories possible per run is limited by the size of some of Geant4’s internal counters. If you need more than 10^9 histories at a fixed time, you can work around this limitation by breaking your session into multiple runs:

  • Set Tf/NumberOfSequentialTimes to some value greater than 1
  • No need to actually set TimelineStart or TimelineEnd (they both default to 0)

Your total number of histories will then be NumberOfSequentialTimes * NumberOfHistoriesInRun.

Multithreading

TOPAS fully supports the Multi-Threaded simulation capability of Geant4.

By default, TOPAS will occupy just one CPU thread. To use more, adjust:

i:Ts/NumberOfThreads = 4 # defaults to 1
  • If set to a positive integer, TOPAS will use that number of threads
  • If set to 0, TOPAS will use all of your computer’s threads. This may be number of hardware cores or number of virtual cores (which includes hyper-threading cores) depending on your hardware architecture.
  • If set to a negative number, TOPAS will use all BUT this number of threads, leaving you some threads reserved for other tasks (email, web browsing, etc.).

By default, console output from various threads will be interleaved. Output from each worker thread will have a distinctive prefix, such as:

G4WT0 >
G4WT1 >

To instead make Geant4 buffer the output, showing first everything from one thread and then everything from another thread, set:

b:Ts/BufferThreadOutput = "True" # Causes console output to be show one thread at a time

Random Number Seed

To set the random seed:

i:Ts/Seed = 1 # default is 1

To generate several statistically independent runs, give each run a different Ts/Seed. A typical solution to produce 10 independent runs would be to give starting seeds of 1 to 10. The allowed range is 0 to 2147483647 (the maximum 32 bit integer).

For more details see the discussion in the Geant4 Application Developer’s Guide.

We use the random engine called RanecuEngine and the seed given to TOPAS is passed to the engine through CLHEP::HepRandom::setTheSeed.

How to save and reuse random seed of a problematic history:

When a rare issue is to be debugged, it is easier if one can make the simulation start immediately from the problematic history. To do this, one needs to know the seed number of that particular history. But if this issue causes a crash, it is then too late then to ask TOPAS to write out the seed.

For a given history number, TOPAS can quickly find you the appropriate seed, which you can then use in a subsequent job to start out right from the relevant history.

Set the parameter:

i:Ts/FindSeedForHistory = 9998 # defaults to -1, meaning do not activate this feature

And if you have multiple Runs:

i:Ts/FindSeedForRun = 0 # defaults to 0

When you then run TOPAS, it will “fast forward” through a simulation to get just that history’s seed. It skips most of the time-consuming parts of the simulation. Its only job is to find and write out the random seed. The seed information will be written to the console, and will also be written to a “seed file” such as:

  • TopasSeedForRun_0_History_9998.txt

This simulation will not be useful for anything else, but it will be very fast. TOPAS will:

  • Disable graphics
  • Disable GUI
  • Set physics to transportation_only
  • Disable setting of cuts
  • Disable variance reduction
  • Disable generators
  • Disable most UpdateForNewRun functions

You can then set up a fresh, normal TOPAS session that will starts right from the desired history. To do so, remove that FindSeedForHistory parameter, and tell TOPAS to use the saved seed file:

s:Ts/SeedFile = "TopasSeedForRun_0_History_9998.txt" # Seed file saved in fast-forward job above

If the seed file is not in the current directory, you can also specify a seed file directory:

s:Ts/SeedDirectory = "/Applications/tswork/testarea/SkipUntil" # defaults to read from current directory

Set run duration based on statistical goals

Users have requested a way to have TOPAS continue running until dose accuracy reaches a user-determined limit (rather than just running a pre-determined number of histories). This feature is now available, and we have done it in a general purpose way, such that run duration tests can depend upon any scored quantity (dose or otherwise).

Because TOPAS supports time features, any accuracy test is only meaningful once the entire run sequence has occurred. Accordingly, the new system works by evaluating various tests only after the entire run sequence is complete (all Histories of all Runs). TOPAS then evaluates the tests, and repeats the entire run sequence until all tests have been satisfied.

The tests are tied to the scoring system. Any scorer can have up to three tests. New parameters are:

d:Sc/MyScorer/RepeatSequenceUntilSumGreaterThan = 1. MeV # type can be d, u or i depending on scoring quantity
d:Sc/MyScorer/RepeatSequenceUntilStandardDeviationLessThan = .004 MeV # type can be d, u or i
i:Sc/MyScorer/RepeatSequenceUntilCountGreaterThan = 1200

The second two tests above are necessary because the StandardDeviation is subject to statistical noise until a reasonable amount of data has been collected. By requiring a minimum Sum or minimum number of Counts, one can insure that there is enough data to use the StandardDeviation.

Tests can be applied to as many scorers as you wish. The entire simulation will repeat until All tests on All scorers are satisfied.

If the scorer has been binned in X, Y, Z, E or T, you must also specify which specific bin should be evaluated, using the parameters:

i:Sc/MyScorer/RepeatSequenceTestXBin = 2
i:Sc/MyScorer/RepeatSequenceTestYBin = 2
i:Sc/MyScorer/RepeatSequenceTestZBin = 2
i:Sc/MyScorer/RepeatSequenceTestEBin = 5
i:Sc/MyScorer/RepeatSequenceTestTimeBin = 0

Remember that the tests will be evaluated only after the entire simulation sequence is complete. You should therefore set So/MySource/NumberOfHistoriesInRun to a value small enough that this end of test will be reached in a reasonable time. The final total number of histories will be that NumberOfHistoriesInRun times the number of times the testing process causes TOPAS to re-run the entire sequence.

Miscellaneous

Interactive Geant4 Sessions

To have TOPAS pause and wait for interactive Geant4 commands:

b:Ts/PauseBeforeInit = "True"
b:Ts/PauseBeforeSequence = "True"
b:Ts/PauseBeforeQuit = "True"

After each pause, type the Geant4 command exit to return control to TOPAS.

  • Most users will only use PauseBeforeQuit, typically to make a graphics window stay open at the end of the session (graphics windows close when Geant4 quits).
  • The other two options, PauseBeforeInit and PauseBeforeSequence, provide the ability to enter Geant4 commands by hand, which may be useful in certain tests, but invalidates the basic TOPAS concept that the behavior of your simulation should be perfectly defined by TOPAS parameters.

Dump Parameter Values

Additional overall control parameters are:

b:Ts/DumpParameters = "True" # dump full list of params to file TopasParameterDump_Run0.html
b:Ts/DumpNonDefaultParameters = "False" # Like above but omits defaults
sv:Ts/DumpParametersToSimpleFile = 2 "SomeParameter" "SomeOtherParameter" # Dumps the requested parameter types, names and values to a simple, human-readable file, TopasParameterDump_Run0.txt
sv:Ts/DumpParametersToSemicolonSeparatedFile = 2 "SomeParameter" "SomeOtherParameter" # Dumps the requested parameter types, names and values to a semicolon separated file, TopasParameterDumpSSF_Run0.txt. This file is suitable for easy import into other applications

Verbosity

Additional overall control parameters are:

i:Ts/ShowHistoryCountAtInterval = 1 # how often to print history count to the console
# If set to 0, history count will never be printed
b:Ts/ShowHistoryCountOnSingleLine = "False" # Make count reuse a single line of console
i:Ts/TrackingVerbosity = 0 # Set to larger integer to see details of tracking

You can add time stamps to the history count:

b:Ts/IncludeTimeInHistoryCount = “True”

You can have a “power-based” history count:

b:Ts/ShowHistoryCountLessFrequentlyAsSimulationProgresses

After first ten histories, output will change to once for every 10, then to once for every 100, etc.

An additional optional parameter:

i:Ts/MaxShowHistoryCountInterval

puts an upper limit on how high the ShowHistoryCountInterval can be.

For example:

b:Ts/ShowHistoryCountLessFrequentlyAsSimulationProgresses i:Ts/MaxShowHistoryCountInterval = 100

Gives:

1 2 3 … 9 10 20 30 … 100

but from there always keep counting by 100 (rather than going on to counting by 1000, 10,000, etc.)

Other

Additional overall control parameters are:

b:Ts/ShowCPUTime = "True" # Show CPU time used in various phases of the simulation
i:Ts/RunIDPadding = 4 # Run numbers are padded in output files, such as MyScoringOutput_Run_0001.csv, so that they will sort naturally in various file viewers. This parameter sets how many places of padding are used.

Quick Ways to Deactivate Parts of the Parameters Files

For most parameter categories, there is one key kind of parameter that triggers creation:

Parameter object type Triggering pattern
Element El/.../Symbol =
Material Ma/.../Components =
Component Ge/.../Parent =
Particle Source So/.../Type =
Physics setup Ph/.../Type =
Scorer Sc/.../Quantity =
Graphic View Gr/.../Type =
Variance Reduction setup Vr/.../Type =
Time Feature Tf/.../Function =

Thus you could effectively comment out the entire Component, Element, Material, Particle Source, etc. by just commenting out that line. But this way of turning something off can get you into trouble since you may then inherit behavior from a parent parameter file.

A better way to handle this is by setting a specific parameter designed for this purpose:

Ge/MyComponent/Include = "False"
So/MySource/NumberOfHistoriesInRun = 0
Sc/MyScorer/Active = "False"
Gr/MyGraphics/Active = "False"

Such a parameter can then even be controlled by a time feature.

Materials

We have pre-defined a few materials. You are free to define additional materials, as in:

sv:Ma/Air/Components=4 "Carbon" "Nitrogen" "Oxygen" "Argon" # names of elements
uv:Ma/Air/Fractions=4 0.000124 0.755268 0.231781 0.012827 # fractions of elements
d:Ma/Air/Density=1.2048 mg/cm3
d:Ma/Air/MeanExcitationEnergy=85.7 eV
s:Ma/Air/DefaultColor="lightblue"

All Elements have been pre-defined with natural isotope abundance from the NIST database. You will only need to create your own Elements if you need something other than natural isotope abundance. For that, see Elements and Isotopes below.

Fractions are by weight.

If you set the parameter:

b:Ma/*/NormalizeFractions = "True" # Defaults to "False"

TOPAS will normalize your Fractions to 1. Otherwise, TOPAS will require that the sum of all Fractions is already 1.

MeanExcitationEnergy is the I parameter in the Bethe equation, which not only includes ionization, but also inner-atomic excitations, etc.

In the Default Parameters section, we show the complete list or pre-defined materials. This basically covers those materials that are used in our included examples.

You can also create a new material from a combination of other materials. The key is that you provide a additional parameter called BuildFromMaterials and set this to True. Then instead of Components being element names, it will expect material names.

Here’s an example of making a material that is a combination of water and air:

b:Ma/MyMixture/BuildFromMaterials = "True"
sv:Ma/MyMixture/Components = 2 "G4_WATER" "Air"
uv:Ma/MyMixture/Fractions = 2 .5 .5
d:Ma/MyMixture/Density = .5 g/cm3

You may also use any of the Materials and Compounds that are defined by default in Geant4. The names start with the prefix, G4_, such as: G4_Al, G4_Ti, G4_MUSCLE_SKELETAL_ICRP, etc. The complete list of these materials and compounds can be found here.

  • NIST material names must be specified with exact case.
  • As of this writing, the mean excitation energy listed in the above reference for G4_WATER is incorrect. It lists G4_WATER mean excitation energy as 75.0 eV but it is actually set to 78.0 eV.

Note

The Geant4-DNA physics processes have special behavior for G4_WATER. They take into account the material’s molecular properties rather than just the atomic properties. Accordingly, you should use G4_WATER rather than defining your own Water, unless you have some other reason to make a specific change (such as changing the mean excitation energy to something other than 78.0 eV).

It is up to you to define any additional materials that you want in your own parameter files. If you make your own material, make sure to pick a new material name (the string after the Ma/) and make sure that any other parameter file that uses this material includes the file where you defined this material (either directly or through Parameter File Chains). The usual rules of Parameter File Graphs govern parameter conflicts.

Warning

Do not use the prefix G4_ for the materials that you add. This prefix is reserved for materials and compounds from the pre-defined NIST database.

Where a pre-defined material definition exists, it is generally better to use that definition rather than making your own material. The pre-defined material may provide extra benefit by triggering specific corrections to ionization models.

If you have a set of materials that differ only in density, you can define them all at once (this is commonly needed for imaging to material conversion):

i:Ma/MyMaterial/VariableDensityBins = 100
u:Ma/MyMaterial/VariableDensityMin = .1
u:Ma/MyMaterial/VariableDensityMax = 10.

will generate 100 versions of MyMaterial, with densities varying from .1 x normal to 10. x normal. The material names will then be like:

MyMaterial_VariableDensityBin_0
MyMaterial_VariableDensityBin_1
...
MyMaterial_VariableDensityBin_99

Elements and Isotopes

All Elements have been pre-defined with natural isotope abundance from the NIST database. You will only need to create your own Elements if you need something other than natural Isotope abundance. You can define additional elements as follows:

Define each isotope that you will use, specifying Z, N and A:

i:Is/U235/Z = 92
i:Is/U235/N = 235
d:Is/U235/A = 235.01 g/mole
i:Is/U238/Z = 92
i:Is/U238/N = 238
d:Is/U238/A = 238.03 g/mole

Define your element with your desired proportion of these isotopes:

s:El/MyEIU/Symbol = "MyElU"
sv:El/MyElU/IsotopeNames = 2 "U235" "U238"
uv:El/MyElU/IsotopeAbundances = 2 90. 10.

See Isotope.txt example.

Geometry Components

Introduction

All Geometry Components must have at least the following parameters:

s:Ge/MyComponent/Parent = "World"
s:Ge/MyComponent/Type = "TsBox"
d:Ge/MyComponent/TransX=0.0 cm # defaults to 0
d:Ge/MyComponent/TransY=0.0 cm # defaults to 0
d:Ge/MyComponent/TransZ=0.0 cm # defaults to 0
d:Ge/MyComponent/RotX=0.0 deg # defaults to 0
d:Ge/MyComponent/RotY=0.0 deg # defaults to 0
d:Ge/MyComponent/RotZ=0.0 deg # defaults to 0

The Parent, Trans and Rot parameters place a component within its “mother” as described in Placement of Components.

Each Type has its own set of additional required parameters, discussed elsewhere for each specific component type.

The World can be either a TsBox, TsSphere or TsCylinder.

The component name can include the forward slash character /, and this is used in many examples to give some hints about component hierarchy , such as:

s:Ge/VBox2/Dipole/Parent = "Nozzle"

This bit of hierarchy in the component name, such as VBox2/Dipole, does NOT actually control how the components are assembled. The actual control is from the Parent parameter (discussed here). The forward slash is just another character here. You could just as well use VBox2_Dipole or VBox2Dipole, as long as you use the same exact string whenever you refer to this component.

Components that are in the real world (as opposed to Parallel Worlds) must also have a material:

s:Ge/MyComponent/Material = "Air"

To deactivate a Component (and all its children), you can either comment out the parameter that sets its Parent, or set its Include parameter to false, as in:

b:Ge/MyComponent/Include = "False" # defaults to "True"

While it is not forbidden to have unused components (components that are never assigned a Parent), this can often be a sign that you have not correctly assigned the parents in your geometry. Accordingly, we check for unused components on startup and given a warning message if any are found. You can disable this warning message by setting:

Ge/CheckForUnusedComponents = "False"

In some cases you may want to keep unused components around. This can be like keeping extra pieces of unused laboratory equipment handy on a shelf. They will have no effect on your simulation, but remain available to quickly plug in when needed by assigning a parent and setting placement parameters.

Physics control for a specific component is done as part of the Ge/ parameters for that component rather than in the Ph/ parameters, such as:

d:Ge/MyComponent/MaxStepSize = 1. mm # sets maximum step size used in this component

Placement of Components

A component’s Parent parameter tells which other component the current one is a child of. In this way, one can build a hierarchy of components:

s:Ge/MyComponent/Parent = SomeOtherComponent

The one component that is always provided automatically for you, into which you plug the rest of your hierarchy, is called World.

Each component has three translation and three rotation parameters. These give the position of the component in the coordinate system of its parent component.

The following defines a box of air with half width of 5 m on each side placed at the center of the world:

s:Ge/MyBox/Type="TsBox"
s:Ge/MyBox/Parent = "World"
s:Ge/MyBox/Material="Air"
d:Ge/MyBox/HLX=5. m # Half Length
d:Ge/MyBox/HLY=5. m
d:Ge/MyBox/HLZ=5. m
d:Ge/MyBox/TransX=0. m
d:Ge/MyBox/TransY=0. m
d:Ge/MyBox/TransZ=0. m
d:Ge/MyBox/RotX=0. deg
d:Ge/MyBox/RotY=0. deg
d:Ge/MyBox/RotZ=0. deg

If you set more than one rotation, note that rotation happens first around X, then the Y rotation is applied around the now-rotated axes, and then the Z rotation is applied around those rotated axes. In general, a way to keep rotations more clear is to use intermediate Group components as follows:

  • Place your component inside a Group component.
  • Rotate your component around one axis.
  • Rotate the group component around the other axis.

While the direction of rotation can be confusing, the correctness of rotations in TOPAS has been double, triple and quadruple checked and found consistent with the definitions in Geant4. The Rotation.txt example shows an object being rotated first in the positive X direction, then in the positive Y direction, then in the positive Z direction.

For Geant4 experts, be advised that the rotation angles you provide to TOPAS are passed into G4RotationMatrix()->rotateX/Y/Z. Further discussion of Geant4 rotations can be found here.

The following overrides the size definition of the World box that was inherited from the built-in default parameters and then inserts a box into this world and another box into the first box:

# Overrides the world size that was set in built-in defaults:
Ge/World/HLX=10. m
Ge/World/HLY=10. m
Ge/World/HLZ=10. m

# Box inserted into the World
s:Ge/TestBox/Material="Air"
s:Ge/TestBox/Parent="World"
s:Ge/TestBox/Type="TsBox"
d:Ge/TestBox/HLX=400. cm
d:Ge/TestBox/HLY=300. cm
d:Ge/TestBox/HLZ=200. cm
d:Ge/TestBox/TransX=0. m
d:Ge/TestBox/TransY=0. cm
d:Ge/TestBox/TransZ=0. m
d:Ge/TestBox/RotX=0. deg
d:Ge/TestBox/RotY=0. deg
d:Ge/TestBox/RotZ=0. deg

# Another box inserted into the first box
s:Ge/TestBox2/Material="Carbon"
s:Ge/TestBox2/Parent="TestBox"
s:Ge/TestBox2/Type="TsBox"
d:Ge/TestBox2/HLX=180. cm
d:Ge/TestBox2/HLY=120. cm
d:Ge/TestBox2/HLZ=80. cm
d:Ge/TestBox2/TransX=0. m
d:Ge/TestBox2/TransY=0. cm
d:Ge/TestBox2/TransZ=150. cm
d:Ge/TestBox2/RotX=0. deg
d:Ge/TestBox2/RotY=30. deg
d:Ge/TestBox2/RotZ=0. deg

Overlap Checking

Because accidental overlaps of geometry volumes are a serious issue for all Monte Carlo simulations, Geant4 provides tools to automatically check for such overlaps. Overlap checking is not perfect, it works by testing a random set of points on each boundary, to see if they are inside any other boundary. Thus it will not necessarily find all overlaps. By default TOPAS checks 100 points on each volume. Overlap checking has a speed cost at initialization time, so once you are confident that your geometry has no overlaps, you may choose to turn this feature off (though most users never find this necessary):

Ge/CheckForOverlaps = "False"

TOPAS will save time by avoiding overlap checking for individual parts within a divided component (such as the voxels within a patient) since these subdivisions are generated automatically by our own code. But if you ever want to turn these back on:

b:Ge/CheckInsideEnvelopesForOverlaps = "True"

You can control the number of points used in the overlap check:

i:Ge/CheckForOverlapsResolution = 1000

And you can check the tolerance for overlap:

d:Ge/CheckForOverlapsTolerance = 0. mm

You can also set these in a more granular fashion, per Component (overrides the above parameters for this particular component):

i:Ge/MyComponent/CheckForOverlapsResolution = 1000
d:Ge/MyComponent/CheckForOverlapsTolerance = 0. mm

Pre-Defining Values

It may be useful to pre-define a range of named-values, such that you can easily access the values later. For example, we pre-define the angles at which certain scatterers are stored on a scatterer selection wheel:

d:Ge/Gantry1/Scatterer2/RotZForSS0 = 0. deg
d:Ge/Gantry1/Scatterer2/RotZForSS8 = 270. deg
d:Ge/Gantry1/Scatterer2/RotZForSS2 = 180. deg
d:Ge/Gantry1/Scatterer2/RotZForSS3 = 90. deg

And then in our user file, the user doesn’t have to know these actual angles, but can just rotate to one of the named scatterers:

Ge/Scatterer2/Holder/RotZ = Ge/Gantry1/Scatterer2/RotZForSS3 deg

Parallel Worlds

Components can be assigned to “parallel worlds” rather than the standard, mass world. Such components have no effect on physics (other than usually very minor step limitation effects) but can still be used for scoring. Such components can arbitrarily overlay the mass world. Their volumes can overlap any other volumes in other mass or parallel worlds. To assign a component to a parallel world, include the line:

b:Ge/MyComponent/IsParallel = "True"

Due to limitations in the Geant4-DNA chemistry design, parallel worlds may not be used if Geant4-DNA chemistry is included in your physics list. TOPAS will issue an error message in this situation.

  • Parallel world components may be children of other parallel world components.
  • Parallel world components may be children of mass world components.
  • Mass world components may not be children of parallel world components.

A new parallel world will be created each time you specify IsParallel, with an automatically generated parallel world name based on the component name. If you want to explicitly assign multiple components to the same parallel world, provide the additional parameter:

s:Ge/MyComponent/ParallelWorldName = "SomeParallelWorldName"

There is no limit on the total number of parallel worlds, but each additional world can cause some performance penalty.

Warning

In certain cases, TOPAS must represent a geometry by using a Geant4 technique called “parameterized volumes.” However we have found that Geant4 behaves unreliably if parameterized sphere is placed in a parallel world. Accordingly, TOPAS applies a safety restriction:

  • TsSphere can not be in a parallel world if it has any divisions.

Layered Mass Geometry

Components that are in a parallel world can have material or not. If they have material, and they are listed in the LayeredMassGeometryWorlds parameter, this material will take precedence over any real world material found in that location.

In Geant4 this is called Layered Mass Geometry. It is further described in (PubMed):

Enger S et al, “Layered mass geometry: a novel technique to overlay seeds and applicators onto patient geometry in Geant4 brachytherapy simulations,” Phys Med Biol. 2012 Oct 7;57(19):6269-77.

Any time a component in a parallel world has material, that world must be listed in the LayeredMassGeometryWorlds parameter. The parameter is a string vector because any number of parallel worlds can have material. The order of the worlds in this parameter is significant. Material from worlds listed later in this list take precedence over material in worlds listed earlier. Thus, in the following example, material in the world Seed will take precedence over material in the world Tumor which will take precedence over material in the regular world:

sv:Ph/Default/LayeredMassGeometryWorlds = 2 "Tumor" "Seed"

A simple example is provided in LayeredMassGeometry.txt.

Electromagnetic Fields

You can assign an electric, magnetic or combined electromagnetic field to any geometry component (with exception of Group components, which have no intrinsic extent). The field will extend into any child components unless they themselves have their own field.

To assign a field, add the parameter Field, as in:

s:Ge/MyComponent/Field = "DipoleMagnet" # "DipoleMagnet", "QuadrupoleMagnet", "MappedMagnet", "UniformElectroMagnetic" or your own definition

For "DipoleMagnet", specify dipole field and strength, as in (see DipoleMagnet.txt):

u:Ge/MyComponent/MagneticFieldDirectionX = 0.0
u:Ge/MyComponent/MagneticFieldDirectionY = 1.0
u:Ge/MyComponent/MagneticFieldDirectionZ = 0.0
d:Ge/MyComponent/MagneticFieldStrength = 3.0 tesla

For "QuadrupoleMagnet", specify the two components of the gradient, as in (see QuadrupoleMagnet.txt):

d:Ge/MyComponent/MagneticFieldGradientX = 1.0 tesla
d:Ge/MyComponent/MagneticFieldGradientY = 1.0 tesla

For "MappedMagnet", specify a field map in the Opera 3D format, as in (see PurgingMagnet_move.txt):

s:Ge/MyComponent/MagneticField3DTable = "PurgMag3D.TABLE"

For "UniformElectroMagnetic", specify electric field and dipole magnetic field, as in (see UniformElectroMagneticField.txt):

u:Ge/MyComponent/ElectricFieldDirectionX = 1.0
u:Ge/MyComponent/ElectricFieldDirectionY = 1.0
u:Ge/MyComponent/ElectricFieldDirectionZ = 0.0
d:Ge/MyComponent/ElectricFieldStrength   = 5000 kV/cm
u:Ge/MyComponent/MagneticFieldDirectionX = 0.0
u:Ge/MyComponent/MagneticFieldDirectionY = 1.0
u:Ge/MyComponent/MagneticFieldDirectionZ = 0.0
d:Ge/MyComponent/MagneticFieldStrength   = 5.0 tesla

If you have any other value in Field, TOPAS will look in your extensions to find your own class that defines this field. See Custom Fields for details on writing extension fields.

Field orientation is set by rotating the component.

You can visualize magnetic fields, with field intensity and direction depicted through a set of arrows:

i:Gr/ViewA/MagneticFieldArrowDensity = 10

Use with caution. When combined with rotation seems to sometimes cause crashes in polycone drawing (involved in drawing the arrowheads).

As with almost any TOPAS parameter, the Electric Field Strength, Dipole Magnet Strength, Quadrupole Magnet Gradient or Mapped Magnetic Field file can be set to change over time by using Time Features such as (see QuadAndDipoleMagnets.txt):

d:Ge/MyComponent/MagneticFieldStrength = Tf/BField1st/Value tesla

Fine control of the stepping algorithm can be done by changing the following parameters from their default values:

s:Ge/MyComponent/FieldStepper = "ClassicalRK4"
d:Ge/MyComponent/FieldStepMinimum = 1.0 mm
d:Ge/MyComponent/FieldDeltaChord = 1.0e-1 mm

See the Geant4 Application Developers Guide on the Geant4 Documention Page for detailed discussion of these options.

Stepper choices for purely magnetic fields are:

  • “ExplicitEuler”
  • “ImplicitEuler”
  • “SimpleRunge”
  • “SimpleHeum”
  • “HelixExplicitEuler”
  • “HelixImplicitEuler”
  • “HelixSimpleRunge”
  • “CashKarpRKF45”
  • “RKG3”
  • “ClassicalRK4”

Stepper choices for electromagnetic fields are:

  • “ExplicitEuler”
  • “ImplicitEuler”
  • “SimpleRunge”
  • “SimpleHeum”
  • “ClassicalRK4”

Visualization Attributes

By default, Components are colored according to their materials, based on the default color that was assigned to the material, such as:

s:Ma/Air/DefaultColor="lightblue"

Parameters of the Component let you override this color and set other visualization attributes:

s:Ge/MyComponent/Color = "red"
s:Ge/MyComponent/DrawingStyle = "Solid" # "Solid", "Wireframe" or "FullWireFrame"
i:Ge/MyComponent/VisSegsPerCircle = 100 # Number of line segments to use to approximate a circle, defaults to 24
b:Ge/MyComponent/Invisible = "True" # defaults to False meaning visible

FullWireFrame includes drawing of additional edge lines that Geant4 calls “soft edges” - on many graphics devices WireFrame and FullWireFrame give the same result.

Increase VisSegsPerCircle if you want a smoother curve.

Dividable Components

Type Parameters Type Default value
TsBox
XBins
YBins
ZBins
i
i
i
1
1
1
TsCylinder
RBins
PhiBins
ZBins
i
i
i
1
1
1
TsSphere
RBins
PhiBins
ThetaBins
i
i
i
1
1
1
_images/dividable.png

Scorers associated with the dividable components may use the same or different divisions (thus one can do things like represent the patient with CT resolution but score with other resolutions). See here for details.

You cannot place child components inside a divided component, but if the only reason for dividing this component is to have fine-grained scoring, you can easily work around this limitation. Use an undivided parent component. Place the children into this undivided parent component. Then when you specify that you want to score on this parent component, specify divided scoring (see here). TOPAS will automatically create a parallel world version of your component to handle the divided scoring.

You can optionally specify different materials for each voxel, overriding the value set in the regular Ge/.../Material parameter:

sv:Ge/Phantom/VoxelMaterials = 100 "G4_WATER" "G4_WATER" "Air" "Air" "G4_WATER" ...

This means you can create complex phantoms directly from the parameter system. VoxelMaterials works for all three kinds of divided components: TsBox, TsCylinder and TsSphere. See the DoseInVoxelMaterials.txt example.

Generic Components

You can create a Geometry Component for any of the standard solids defined in the geometry section of the Geant4 Application Developers Guide.

The ShapeTestWithAllParameters.txt example demonstrates how to build each of the solids.

_images/generic.png

Below we list the parameters for each Geant4 solid. Further details about the parameters, along with helpful diagrams, can be found in the Geant4 Application Developers Guide. For most solids, sizes are specified in Half Lengths, denoted with an HL, such as HLX. For a few solids, sizes are specified in full Lengths, denoted with just L, such as LX.

Note

The TsBox, TsCylinder and TsSphere should be used instead of G4Box, G4Tubs and G4Sphere respectively. See Dividable Components.

Some examples of components that can be built just from Generic Components:

  • Scatterer
  • Collimator
  • Mirror
  • Water Tank
  • Rando Phantom (as constructive solid geometry rather than DICOM import)
  • Pin Diode Chamber
  • Flat Panel Imaging Device
  • Standard Ion Chamber
  • Segmented Ion Chamber
  • Faraday Cup

We have built some complex things just from combinations of the Generic Components (such as the STAR radiosurgery beamline at MGH).

Group Component

Creates no actual solid, but still has a placement (Trans and Rot). Other components placed within this Group component are affected by this placement just as if the group were an enclosing box component.

The following defines a group component called MyGroup:

s:Ge/MyGroup/Type="Group"
s:Ge/MyGroup/Parent = "World"
d:Ge/MyGroup/TransX=2. m
d:Ge/MyGroup/TransY=2. m
d:Ge/MyGroup/TransZ=0. m
d:Ge/MyGroup/RotX=0. deg
d:Ge/MyGroup/RotY=0. deg
d:Ge/MyGroup/RotZ=30. deg

The following example shows how a Group Component, Jaws, placed in a nozzle, allows one to position two individual movable collimator blocks, Jaw_Upper and Jaw_Lower, without the creation of an extraneous mother volume:

s:Ge/Jaws/Type = "Group"
s:Ge/Jaws/Parent = "Nozzle"
d:Ge/Jaws/TransZ = 0. m
...
s:Ge/Jaw_Upper/Type = "TsBox"
s:Ge/Jaw_Upper/Parent = "Jaws"
s:Ge/Jaw_Upper/Material = "Tungsten"
d:Ge/Aperture/TransY = 2. cm
...
s:Ge/Jaw_Lower/Type = "TsBox"
s:Ge/Jaw_Lower/Parent = "Jaws"
s:Ge/Jaw_Lower/Material = "Tungsten"
d:Ge/Aperture/TransY = -2. cm
...

Specialized Components

Geometry Component Type
Range Modulator Wheel TsRangeModulator
Propeller TsPropeller
Ridge Filter TsRidgeFilter
Multi Wire Chamber TsMultiWireChamber
Jaws TsJaws
Multi Leaf Collimator TsMultiLeafCollimator
Doubly Diverging Multi Leaf Collimator TsDivergingMLC
CAD (Computer Aided Design) TsCAD
Aperture TsAperture
Compensator TsCompensator
BrachyApplicator TsBrachyApplicator
Pixelated box TsPixelatedBox

Each of the specialized components has its own set of special parameters. Usage is best learned by studying the relevant examples parameter files included in TOPAS.

You may write your own additional components (see Custom Geometry Components).

The following figure from Samsung Medical Center shows how their very specific quadrupole magnet system was coded as a TOPAS geometry.

_images/SMC.png

Range Modulator Wheel

TOPAS Range modulator is designed to accommodate various specifications from a vendor. We suggest modeling your Range Modulator Wheel (RMW) by the following procedure:

  • Define the dimension of RMW drum, such as thickness and material of shell and hub (see figure below). Tracks will be placed in between the hub and the shell.
  • This space (in between hub and shell) is vertically divided into three sections named, “Upper”, “Middle”, and “Bottom” so that each section can have its own tracks. You can adjust heights of these sections. The sum of these heights is the total height of your RMW.
  • In order to reserve spaces for tracks, divide radially each section into as many as tracks you want by using the parameter, RadialDivision
  • Using vector parameters, configure the tracks individually such as each block’s height, span angle, and material. Then assign vector parameter to the parameter, called Pattern
_images/RMW_1.png

Illustration for TOPAS RMW dimensions. Tracks are placed in between Rout of Hub and Rin of Shell and this area is to be radially divided in case of placing multiple tracks. There are three vertical rooms, so it is possible to make double sided RMWs with an interface disk.

_images/RMW_2.png

An example of RMW; (a) Perspective view. Upper section is divided into two but only inner radial division has a track pattern. In middle section, two track patterns are used to make a hole. (b) X-Y view from +z of RMW and (c) X-Y view from -z of RMW. Tracks are drawn in wireframe style, so more lines on the tracks are shown than the number of blocks.

Here is the complete set of the parameters for the above RMW (see RangeModulator.txt example):

# Common parameters: type of geometry, position, and rotation
s:Ge/RangeModulatorA/Type = "TsRangeModulator"
s:Ge/RangeModulatorA/Material = "Parent"
s:Ge/RangeModulatorA/Parent = "World"
d:Ge/RangeModulatorA/TransX = 10.0 cm
d:Ge/RangeModulatorA/TransY = 0.0 cm
d:Ge/RangeModulatorA/TransZ = 0.0 cm
d:Ge/RangeModulatorA/RotX = 0.0 deg
d:Ge/RangeModulatorA/RotY = 0.0 deg
d:Ge/RangeModulatorA/RotZ = 0.0 deg
b:Ge/RangeModulatorA/Invisible = "TRUE"

# Set height of each sections and total height = 160.0 mm
d:Ge/RangeModulatorA/HeightOfUpper = 150 mm
d:Ge/RangeModulatorA/HeightOfMiddle = 1.0 mm
d:Ge/RangeModulatorA/HeightOfLower = 9.0 mm

# Shell dimensions, material, color, etc.
d:Ge/RangeModulatorA/Shell/Rin = 15.0 cm
d:Ge/RangeModulatorA/Shell/Rout = 15.5 cm
s:Ge/RangeModulatorA/Shell/Material = "Aluminum"
s:Ge/RangeModulatorA/Shell/Color = "grey"
s:Ge/RangeModulatorA/Shell/DrawingStyle = "Solid"
i:Ge/RangeModulatorA/Shell/VisSegsPerCircle = 360

# Hub dimensions, material, color, etc.
d:Ge/RangeModulatorA/Hub/Rin = 6.0 cm
d:Ge/RangeModulatorA/Hub/Rout = 7.0 cm
s:Ge/RangeModulatorA/Hub/Material = "Aluminum"
s:Ge/RangeModulatorA/Hub/Color = "grey"
s:Ge/RangeModulatorA/Hub/DrawingStyle = "Solid"
i:Ge/RangeModulatorA/Hub/VisSegsPerCircle = 360

# Setting tracks on Upper area
# Two tracks Track1 (7.0 cm ~ 11.0 cm) and Track2 ( 11.0 cm ~ 15.0 cm)
dv:Ge/RangeModulatorA/Upper/RadialDivisions=1 11.0 cm

# Assignment of track pattern of Upper area
# Track1 refers the pattern named "LexanBlockT1" whose vector parameters are defined elsewhere (see below).
s:Ge/RangeModulatorA/Upper/Track1/Pattern = "LexanBlockT1"
s:Ge/RangeModulatorA/Upper/Track2/Pattern = "NULL" #NULL means empty track.

# Track1 pattern: 14 blocks of Lexan.
# Numbers of Angles, Heights, and Materials should be same.
d:Ge/LexanBlockT1/Offset=0.0 deg #means shift of zero-angle
# Angle divisions. The first block’s spans from 5.0 deg to 115.0 deg.
# The last block starting at 324.0 deg spans to the first block’s boundary.
# This case last block spans from 324.0 deg to 360.0 + 5.0 deg
dv:Ge/LexanBlockT1/Angles=14
5.00 115.00 146.50 173.2 195.07
216.15 230.14 243.00 255.5 270.60
282.20 294.60 306.20 324.00 deg
# Height of each block.
# Note that zero height means that no block in that angle range.
dv:Ge/LexanBlockT1/Heights=14
77.0 82.0 87.0 92.15 95.0
100.4 106.0 110.2 115.3 119.5
124.0 128.8 132.00 60.0 mm

# Material of each block.
sv:Ge/LexanBlockT1/Materials=14
"Lexan" "Lexan" "Lexan" "Lexan" "Lexan"
"Lexan" "Lexan" "Lexan" "Lexan" "Lexan"
"Lexan" "Lexan" "Lexan" "Brass"

In the same way, you can configure other tracks. Then the track1 on upper area looks like following figure.

_images/RMW_3.png

A track pattern from the parameter above; (left) a complete set of the track view. (right) blocks are constructed in counterclockwise.

b:Ge/RangeModulatorA/PrintInformation = "True" #Print out specification, see below

When TOPAS builds the geometry, you will see the numbers are input properly from console output as:

---UpperTrack1 , # of Blocks: 14
0th Block
  Angle : 5, 115 deg
  Height : 7.7 cm
  Material: Ts_Lexan
1st Block
  Angle : 115, 146.5 deg
  Height : 8.2 cm
  Material: Ts_Lexan
2nd Block
  Angle : 146.5, 173.2 deg
  Height : 8.7 cm
  Material: Ts_Lexan
3rd Block
  Angle : 173.2, 195.07 deg
  Height : 9.215 cm
  Material: Ts_Lexan
4th Block
  Angle : 195.07, 216.15 deg
  Height : 9.5 cm
  Material: Ts_Lexan
...

TOPAS RMW is a specialized geometry and so allows only the rotation around z-axis as well as the propeller rotation. Two examples demonstrate how to rotate RMW and modulate beam current using Time Features (RangeModulator_ConstantBeam.txt and RangeModulator_CurrentModulatedBeam.txt).

Propeller

A propeller is a component widely used to modulate the range of Bragg peaks. TOPAS currently supports a symmetrical propeller, i.e., each blade has the same shape but in different placements. Users can specify the number of blades with a spanning angle, thickness and materials of each layer. Here is an example of a single-layer propeller having 4 blades.

_images/Propeller_1.png

Each blade is constructed in the counterclockwise order. The figure shows its shape with coordination system.

Here is the complete set of the parameters for the above Propeller:

# Common parameters: type of geometry, position, and rotation
s:Ge/PropellerA/Type = "TsPropeller" #TsPropeller as type of geometry
s:Ge/PropellerA/Parent = "World"
s:Ge/PropellerA/Material = "Parent" #This is required to be set as "Parent"
d:Ge/PropellerA/TransX = 0.0 cm
d:Ge/PropellerA/TransY = 0.0 cm
d:Ge/PropellerA/TransZ = 0.0 cm
d:Ge/PropellerA/RotX = 0.0 deg
d:Ge/PropellerA/RotY = 0.0 deg
d:Ge/PropellerA/RotZ = 0.0 deg
b:Ge/PropellerA/Invisible = "true" #To avoid visualize propeller’s mother volume.

i:Ge/PropellerA/NbOfBlades = 4 #Number of blades
d:Ge/PropellerA/Rin = 10.0 mm #Inner radius, Rin in the figure
d:Ge/PropellerA/Rout = 127.5 mm #Outer radius, Rout in the figure

dv:Ge/PropellerA/Thickness =1 0.356 mm #thickness.
dv:Ge/PropellerA/Angles =1 63.15 deg #span angle of each blade.
sv:Ge/PropellerA/Materials =1 "G4_POLYVINYL_ACETATE" #material.

# Visualization attributes setting
s:Ge/PropellerA/Blade/Material = Ge/PropellerA/Material
s:Ge/PropellerA/Blade/Color = "skyblue"
s:Ge/PropellerA/Blade/DrawingStyle = "Solid"
i:Ge/PropellerA/Blade/VisSegsPerCircle = 360
# you can apply a propeller specific step size
d:Ge/PropellerA/Blade/MaxStepSize = 10 mm
b:Ge/PropellerA/PrintInformation = "True" #Print out specification, see below

While TOPAS starts to build geometries, you can confirm whether the numbers you put are input properly from console output as:

Layer: "0" , Thickness: 0.0356 (cm), Angle: 63.15 (deg), Material: G4_POLYVINYL_ACETATE
  Blade "0", Angle (-31.575 deg, 31.575deg)
  Blade "1", Angle (88.425 deg, 151.575deg)
  Blade "2", Angle (208.425 deg, 271.575deg)

With different numbers of blades, the angle of each blade will look like:

_images/Propeller_2.png

(Left) Ge/PropellerA/NbOfBlades = 2, (Right) Ge/PropellerA/NbOfBlades = 3.

You can model a multiple layered propeller just by extending the vector parameters, such as Thickness, Angles, and Materials (for more detail, see Propeller.txt):

dv:Ge/PropellerA/Thickness=10
0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 mm
dv:Ge/PropellerA/Angles=10
63.15 54.15 46.450 40.65 35.85 31.8 28.1 24.725 21.8 19.1 deg
sv:Ge/PropellerA/Materials=10
"Lexan" "G4_WATER" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE"
"G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE"
"G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE"

Layers are created in the order of the parameter vector, i.e., Lexan is the bottom layer in this case, Water layer is the next, and so on. It is possible to make each layer with different thickness, angles, and materials. Note that these three vector parameters have same number of elements.

TOPAS propeller allows only the rotation around z-axis, which means that you can only assign rotation Time Feature to RotZ, such as Ge/PropellerA/RotZ = Tf/ContinuousRotation/Value. Two examples demonstrate how to handle propeller rotations (Propeller_ContinuousRotation.txt and Propeller_StepRotation.txt).

Ridge Filter

A ridge filter is an energy modulation component used in proton therapy. TOPAS offers a generic way to model an arbitrary shape of a ridge and place the replica. The shape of a ridge is defined in the x-z plane and then it becomes a volume by extending in the y direction.

_images/RidgeFilter_1.png

(left) A ridge shape in X-Z plane, represented by points-connection. Because the connection starts at the origin and ends at the last point, (width, 0), so users need to define the width of a ridge first. Depending on the topology of points, the arbitrary shape can be constructed. (right) A complete ridge by extending the shape along with y axis.

Here is a complete set of the parameters for the above ridge filter (see RidgeFilter.txt example):

# Common parameters: type of geometry, position, and rotation
s:Ge/RidgeFilterA/Type = "TsRidgeFilter"
s:Ge/RidgeFilterA/Parent = "RidgeGroup"
s:Ge/RidgeFilterA/Material = "Aluminum"
d:Ge/RidgeFilterA/TransX = 0.0 cm
d:Ge/RidgeFilterA/TransY = 0.0 cm
d:Ge/RidgeFilterA/TransZ = 0.0 cm
d:Ge/RidgeFilterA/RotX = 0.0 deg
d:Ge/RidgeFilterA/RotY = 0.0 deg
d:Ge/RidgeFilterA/RotZ = 0.0 deg
s:Ge/RidgeFilterA/DrawingStyle = "Solid"

#Ridge Filter-specific parameters;
#Width definition
#Note that points are sequentially connected.
#Number of XPoints and YPoints should be same.
dv:Ge/RidgeFilterA/XPoints = 8
0.0 0.8 1.3 1.8 2.2 2.7 3.2 4.0 mm
dv:Ge/RidgeFilterA/ZPoints = 8
2.4 4.0 9.1 14.0 14.0 9.1 4.0 2.4 mm
d:Ge/RidgeFilterA/Width = 4.0 mm
d:Ge/RidgeFilterA/Length = 1.0 cm

To check that the numbers are input properly:

b:Ge/RidgeFilterA/PrintInformation = "True"

will generate console output as:

Ridge points (x,z) --- :8
  P initial : (0, 0) cm
  P 0th     : (0, 0.24) cm
  P 1st     : (0.08, 0.4) cm
  P 2nd     : (0.13, 0.91) cm
  P 3rd     : (0.18, 1.4) cm
  P 4th     : (0.22, 1.4) cm
  P 5th     : (0.27, 0.91) cm
  P 6th     : (0.32, 0.4) cm
  P 7th     : (0.4, 0.24) cm
  P final   : (0.4, 0) cm

You can make replicas of the ridge and their positions along the x-axis. A total of 3 replicas of the ridge and placed at -5.0, 0.0, 5.0. Each point represents the x-coordinate of the center of ridge width:

dv:Ge/RidgeFilterA/Displacement = 3 -5.0 0.0 5.0 mm
_images/RidgeFilter_2.png

An example of replica set.

Multi Wire Chamber

A multi wire chamber may be built from many of geometry primitives such as TsBox and TsCylinder. However, It is quite cumbersome to place many wires individually and adjust their dimension on any request. So TOPAS multi wire chamber (TsMultiWireChamber) allows to instantiate many wires and to place them efficiently. TsMultiWireChamber is a box consisting of multiple sets of wires. Each set can have its own configuration, such as the dimension and material of the wires, spaces between wires, alignment axis, Z-positions, and drawing-style.

Here is an example of TsMultiWireChamber (see MultiWire_Chamber.txt example).

_images/MWC_1.png

TOPAS multi wire chamber consists of two wire sets aligned along the X and Y axes. Three red wires are aligned to X axis while four gray wires are aligned to Y axis. These two sets of wires are placed within their mother box (gas filed).

The following parameters show how to model the above multi wire chamber:

s:Ge/WireChamberA/Parent = "World"
s:Ge/WireChamberA/Type = "TsMultiWireChamber" #Type of geometry
d:Ge/WireChamberA/HLX=30.0 cm #Chamber dimension
d:Ge/WireChamberA/HLY=30.0 cm
d:Ge/WireChamberA/HLZ=10.0 cm
s:Ge/WireChamberA/Material="Air" #Chamber is filled with this material.
d:Ge/WireChamberA/TransX=0.0 cm
d:Ge/WireChamberA/TransY=0.0 cm
d:Ge/WireChamberA/TransZ=0.0 cm
d:Ge/WireChamberA/RotX=0.0 deg
d:Ge/WireChamberA/RotY=0.0 deg
d:Ge/WireChamberA/RotZ=0.0 deg
i:Ge/WireChamberA/NbOfLayers=2 #Number of wire sets.

# Parameters for specifying each wire set add ‘Layer#’ to geometry name.
# So Layer1 to Layer’NumberofLayers’.
d:Ge/WireChamberA/Layer1/RMin=0.0 cm #Wire’s inner radius
d:Ge/WireChamberA/Layer1/RMax=1.0 cm #Wire’s outer radius
s:Ge/WireChamberA/Layer1/Material="Brass" #Wire material
d:Ge/WireChamberA/Layer1/HL=20.0 cm #Wire’s half length
s:Ge/WireChamberA/Layer1/Align= "X" #Align axis
dv:Ge/WireChamberA/Layer1/Displacement=3 -10 0 10 cm #number of wires and its position in Y, because wires are aligned to X axis)
d:Ge/WireChamberA/Layer1/PosZ=5.0 cm #Z-position w.r.t its mother box.
s:Ge/WireChamberA/Layer1/DrawingStyle="FullWireFrame"
s:Ge/WireChamberA/Layer1/Color="red"

d:Ge/WireChamberA/Layer2/RMin=0.5 cm
d:Ge/WireChamberA/Layer2/RMax=1.0 cm
s:Ge/WireChamberA/Layer2/Material="Lexan"
d:Ge/WireChamberA/Layer2/HL=20.0 cm
s:Ge/WireChamberA/Layer2/Align= "Y"
dv:Ge/WireChamberA/Layer2/Displacement=5 -20 -10 0 10 20 cm
d:Ge/WireChamberA/Layer2/PosZ=-5.0 cm
s:Ge/WireChamberA/Layer2/DrawingStyle="Solid"
b:Ge/WireChamberA/PrintInformation = "True" #Print out specification, see below

When TOPAS starts to build geometries, you will see the numbers are input properly from console output as:

Layer: "0" , # of Wires: 3, Alignment: X, Wire (Rmin= 0 cm, Rmax= 1 cm, HL= 20 cm) , Z Position in the Chamber: 5 (cm)
  Wire "0", Position (0 cm, -10 cm)
  Wire "1", Position (0 cm, 0 cm)
  Wire "2", Position (0 cm, 10 cm)
Layer: "1" , # of Wires: 5, Alignment: Y, Wire (Rmin= 0.5 cm, Rmax= 1 cm, HL= 20 cm) , Z Position in the Chamber: -5 (cm)
  Wire "0", Position (-20 cm, 0 cm)
  Wire "1", Position (-10 cm, 0 cm)
  Wire "2", Position (0 cm, 0 cm)
  Wire "3", Position (10 cm, 0 cm)
  Wire "4", Position (20 cm, 0 cm)

Jaws

TOPAS provides a component to specify a pair of asymmetric, diverging jaws (type = TsJaws), e.g., as part of a linear accelerator treatment head. The component is built from Geant4 trapezoids.

_images/Jaws.png

TsJaws component with select parameters set in the parameter control file shown in orange. In this case there is an asymmetric pair of jaws upstream of a MLC bank. TransZ is at the middle of the jaw (half thickness) and is provided as a changeable parameter in the TOPAS GUI even though it is not present in a parameter control file.

The following parameters are shown in the diagram above:

1. The SAD parameter is the source-axis distance; that is, the distance from the nominal source
   position (x-ray target) to the gantry rotation axis (the machine isocenter).
2. The distance from the origin of the coordinate system to the jaw is calculated from the
   parameters SAD and SourceToUpstreamSurfaceDistance. This is for consistency in jaw positioning
   with the other components in the linear accelerator simulation example.
3. The NegativeFieldSetting and PositiveFieldSetting parameters specify the setting of each jaw
   as the distance from the coordinate system Z axis to each jaw surface, projected to the plane
   perpendicular to the Z at the origin of the coordinate system (isocenter). This is the field
   setting used in treatment planning systems and at the machine. NegativeFieldSetting is less
   than or equal to PositiveFieldSetting.

The following parameter set specifies a symmetric 40 cm wide field at isocenter collimated by a Siemens Oncor jaw:

s:Ge/Jaw/JawTravelAxis  = "X" # Jaw travel axis, "X" or "Y"
d:Ge/Jaw/PositiveFieldSetting  = 20 cm
d:Ge/Jaw/NegativeFieldSetting  = -20 cm
s:Ge/Jaw/Parent  = "World"
s:Ge/Jaw/Type  = "TsJaws"
s:Ge/Jaw/Material = "G4_W"
d:Ge/Jaw/LX  = 20. cm  # Actual jaw width along JawTravelAxis
d:Ge/Jaw/LY  = 20. cm  # Actual jaw length perpendicular to JawTravelAxis
d:Ge/Jaw/LZ  = 7.80 cm # Jaw thickness along Z axis
dc:Ge/Jaw/SourceToUpstreamSurfaceDistance = 19.73 cm #Distance from source to jaw
d:Ge/Jaw/SAD = 100. cm #Distance for source to isocenter
s:Ge/Jaw/DrawingStyle = "Solid"

Multi Leaf Collimator

TOPAS provides a simple Multi Leaf Collimator (MLC) and a doubly diverging MLC. The simple MLC (type = TsMultiLeafCollimator) is comprised of rectangular parallelopipeds (six rectangular surfaces, at right angles with each other).

The simple TOPAS MLC has a minimal set of parameters to define the width and opening (travel) of each leaf.

_images/MLC_1.png

Illustrations for TOPAS MLC dimensions. The user can define an arbitrary number of leaves with different width of each leaf. TOPAS detects leaf collision when it is built and leaves are repositioned by Time Features operations.

Here is a complete set of the parameters for the above TOPAS MLC (see MultiLeafCollimator.txt example):

# Common parameters: type of geometry, position, and rotation
s:Ge/MultiLeafCollimatorA/Type = "TsMultiLeafCollimator"
s:Ge/MultiLeafCollimatorA/Parent = "World"
s:Ge/MultiLeafCollimatorA/Material = "Aluminum"
d:Ge/MultiLeafCollimatorA/TransX = 0.0 cm
d:Ge/MultiLeafCollimatorA/TransY = 0.0 cm
d:Ge/MultiLeafCollimatorA/TransZ = 0.0 cm
d:Ge/MultiLeafCollimatorA/RotX = 0.0 deg
d:Ge/MultiLeafCollimatorA/RotY = 0.0 deg
d:Ge/MultiLeafCollimatorA/RotZ = 0.0 deg
s:Ge/MultiLeafCollimatorA/DrawingStyle = "Solid"
b:Ge/MultiLeafCollimatorA/PrintInformation = "True"

# MLC-specific parameters:
# Limits Leaf opening. Any of absolute values from X+- Leaf can’t exceed this value.
d:Ge/MultiLeafCollimatorA/MaximumLeafOpen = 5.0 cm
d:Ge/MultiLeafCollimatorA/Thickness = 5.0 cm #Leaf thickness (z)
d:Ge/MultiLeafCollimatorA/Length = 6.0 cm #Leaf length (y)
dv:Ge/MultiLeafCollimatorA/Widths = 5 1.5 0.5 0.5 0.5 1.5 cm #Leaves width

# Each leaf’s opening distance from Y axis.
# XMinusLeavesOpen means the x position of X- leaf’s right edge.
# XPlusLeavesOpen means the x position of X+ leaf’s left edge.
dv:Ge/MultiLeafCollimatorA/XMinusLeavesOpen = 5 0.0 -0.3 -0.2 -0.5 0.0 cm
dv:Ge/MultiLeafCollimatorA/XPlusLeavesOpen = 5 0.0 0.3 0.2 0.5 0.0 cm

TOPAS MLC is a specialized geometry and so allows only the reposition of each leaf as a function of time, using Time Features (see MultiLeafCollimator_sequence.txt example).

Doubly Diverging Multi Leaf Collimator

The doubly diverging MLC (type = TsDivergingMLC) is comprised of trapezoids.

_images/MLC_2.png

TsDivergingMLC component with select parameters set in the parameter control file shown in orange. In this case there is an MLC bank downstream of an asymmetric pair of jaws. TransZ is at the middle of the MLC (half thickness) and is provided as a changeable parameter in the TOPAS GUI even though it is not present in a parameter control file.

The following parameter set fully specifies a pair of MLC banks with doubly diverging leaves, in this case, a symmetric 20 cm x 10 cm field at isocenter collimated by a Siemens Oncor MLC. If the leaf travel axis is X, the leaf numbering is from negative to positive along Y. If the leaf travel axis is Y, the leaf numbering is from positive to negative along X.:

s:Ge/MLC/Parent           = "World"
s:Ge/MLC/Type              = "TsDivergingMLC"
s:Ge/MLC/Material         = "G4_W"
d:Ge/MLC/SAD               = 100. cm
d:Ge/MLC/SourceToUpstreamSurfaceDistance = 28.26  cm # Distance from source to MLC bank
s:Ge/MLC/LeafTravelAxis   = "X" # Leaf travel axis, "X" or "Y"
d:Ge/MLC/MaximumLeafOpen  = 20.0 cm # Actual limit of leaf travel
d:Ge/MLC/Thickness        = 7.56 cm # Actual thickness of MLC leaves along IEC Zb
d:Ge/MLC/Length           = 20.0 cm # Length of MLC leaves in direction of travel
# MLC leaf widths and positions, projected to isocenter for 10 cm x 20 cm field
dv:Ge/MLC/LeafWidths           = 42 5. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
                                    1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
                                    1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
                                    1. 1. 1. 1. 1. 5. cm
dv:Ge/MLC/NegativeFieldSetting = 42  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0. -5.
                                    -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5.
                                    -5. -5. -5. -5. -5. -5. -5.  0.  0.  0.  0.  0.
                                     0.  0.  0.  0.  0.  0. cm
dv:Ge/MLC/PositiveFieldSetting = 42 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 5. 5.
                                    5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5.
                                    5. 5. 5. 5. 5. 0. 0. 0. 0. 0. 0. 0. 0.
                                    0. 0. 0. Cm
s:Ge/MLC/DrawingStyle = "Solid"

CAD (Computer Aided Design)

The TsCAD component allows you to turn any geometry that has been designed in a CAD system into a TOPAS Component. This allows you to incorporate arbitrarily complex geometries.

_images/CAD_1.png

The supported CAD formats are:

  • STL - Stereolithography binary format
  • PLY - Polygon ASCII format

STL and PLY files describe a geometry as a tessellation, providing a set of vertices and faces of triangular or quadrangular surfaces to approximate the volume. While some STL and PLY files also contain additional information such as material and color, TOPAS does not currently accept such information. The STL and PLY files you provide to TOPAS must contain only the tessellation information. Internally, TOPAS represents this component as a G4TessellatedSolid.

Most CAD systems allows direct export of parts to the above formats. If your CAD system does not support one of those formats, you may be able to convert from some other CAD format by using a free conversion tool such as MeshLab.

# Common parameters: type of geometry, position, and rotation
s:Ge/MyPartFromCAD/Type = "TsCAD"
s:Ge/MyPartFromCAD/Parent = "World"
s:Ge/MyPartFromCAD/Material = "G4_WATER"
d:Ge/MyPartFromCAD/TransX = 0.0 cm
d:Ge/MyPartFromCAD/TransY = 0.0 cm
d:Ge/MyPartFromCAD/TransZ = 0.0 cm
d:Ge/MyPartFromCAD/RotX = 0.0 deg
d:Ge/MyPartFromCAD/RotY = 0.0 deg
d:Ge/MyPartFromCAD/RotZ = 0.0 deg
s:Ge/MyPartFromCAD/DrawingStyle = "Wireframe"

# CAD-specific parameters:
s:Ge/MyPartFromCAD/InputFile = "Foot" # file name, without extensions. Match exact case
s:Ge/MyPartFromCAD/FileFormat = "ply" # file extension
d:Ge/MyPartFromCAD/Units = 1.0 cm # how to interpret dimension numbers in the file. Changing this value will re-scale the component

TOPAS does not automatically know where the center of your CAD component will be. This is affected by how your CAD system manages coordinates. For example, some CAD software exports the STL by relocating the volume to the first positive octant of its coordinate system. You may have to adjust the TransX/Y/Z parameters of your component to center it as desired.

_images/CAD_2.png

Above, A plastic scintillator with customized groove. Left: CAD, Right: TOPAS

Aperture

An aperture is a component used to shape the lateral penumbra of a (generally) double-scattered proton beam. It is basically a block of brass with a hole cut out from the middle, in the shape of the treatment volume. The purpose is to block the beam outside the desired irradiation path. TOPAS models the aperture by connecting the aperture file points to create a polygon and then extruding this polygon in Z to cut out the aperture hole.

_images/Aperture_1.png

A typical implementation of an apertures in TOPAS is given below followed by a more detailed description of each option (see ScatteringNozzle.txt example):

s:Ge/Aperture/Type = "TsAperture"
s:Ge/Aperture/Parent = "Snout"
s:Ge/Aperture/Material= "Brass"
d:Ge/Aperture/RMax =4.5 cm
d:Ge/Aperture/HL= 2.5 cm
d:Ge/Aperture/TransX = 0.0 cm
d:Ge/Aperture/TransY = 0.0 cm
d:Ge/Aperture/TransZ = -13.0 cm
d:Ge/Aperture/RotX = 0.0 deg
d:Ge/Aperture/RotY = 0.0 deg
d:Ge/Aperture/RotZ = 0.0 deg
s:Ge/Aperture/InputFile = "ApertureFileIn.ap" # Match exact case
s:Ge/Aperture/FileFormat = "XYCoordinates" # XYCoordinates or MGH
b:Ge/Aperture/PrintPoints = "True" # Print points to console

FileFormat has two options:

  • "XYCoordinates" takes is a simple list of points. The first line defines how many points there are in the file, each following line in the file is a comma separated x,y pair, such as:

    • numberOfPoints
    • x1,y1
    • x2,y2
    • xN,yN

    N = numberOfPoints is the number of data points (xi, yi). This is a required condition. The units of the coordinates are millimeter.

  • "MGH" takes the milling data produced by the MGH machine shop. It consists of the same information as the "XYCoordinates" option, but with more overhead, such as:

    • patientName
    • Warning message about not fabricating this file
    • someDoubleValue
    • someIntValue
    • M (this is a number of dummy points, this amount of points will be skipped)
    • x1 y1 x2 y2 … xM yM
    • N
    • x1 y1 x2 y2 … xN yN

    Data pairs are listed in a simple space-separated list. The units are in centimeter.

Compensator

A compensator is a component that is used to shape the distal edge of a proton beam by placing a varying amount of material in the beam path, usually behind the aperture. An example compensator is shown below in top and side views. The compensator consists of a material that is to be placed in the beam to attenuate the beam (usually lexan) and a number of drill holes that were drilled into the compensator.

_images/Compensator_1.png

A typical compensator has the following parameters (see ScatteringNozzle.txt example):

s:Ge/Compensator/Type = "TsCompensator"
s:Ge/Compensator/Parent = "Snout"
s:Ge/Compensator/Material = "CompensatorLucite"
d:Ge/Compensator/RMax = 5.5. cm
d:Ge/Compensator/TransX = 0. cm
d:Ge/Compensator/TransY = 0. cm
dc:Ge/Compensator/Thickness = 0. cm # will be reset to actual thickness when compensator is read in. This allows other parameter files to access this variable thickness.
d:Ge/Compensator/InvHL = -0.5 * Ge/Compensator/Thickness cm
d:Ge/Compensator/TransZ = -15.5 cm + Ge/Compensator/InvHL # Allows centering regardless of thickness
d:Ge/Compensator/RotX = 0. deg
d:Ge/Compensator/RotY = 0. deg
d:Ge/Compensator/RotZ = 0. deg
s:Ge/Compensator/InputFile = "CompensatorFileInRowsDepths.rc" # match exact case
s:Ge/Compensator/FileFormat = "RowsAndDepths" # RowsAndDepths or MGH
s:Ge/Compensator/Method = "ExtrudedSolid" # Polyhedra, ExtrudedSolid, SubtractionCylinders or UnionCylinders
b:Ge/Compensator/PrintPoints = "True"

Thickness has the special parameter type, dc, where the c means this dimensioned double is changeable, that is, it can change on the fly based on what exact compensator is read in. Other parameters can then take this thickness into account when the perform placements.

FileFormat has two options:

  • "RowsAndDepths": all sizes are in millimeters:

    • numberOfRows
    • MainCylinderThickness
    • DrillHoleDiameter
    • n1 deltaX1 X1 Y1
    • D1 D2 … Dn1
    • n2 deltaX2 X2 Y2
    • D1 D2 … Dn2
    • nN deltaXn Xn Yn
    • D1 D2 … DnN

    NumberOfRows = N defines how many rows of drill holes there are (in Y), the MainCylinderThickness. The DrillHoleDiameter is the diameter of the drill hole, we approximate this by a hexagon. The values ni are the number of drill holes in X for each row of drill holes in Y, deltaXi defines the step size (and direction) and Xi and Yi are the starting position of the drilling for this row.

  • "MGH": all sizes are in inches:

    • Some line
    • numberOfRows
    • dummyDouble dummyDouble dummyDouble dummyDouble
    • MainCylinderThickness
    • dummyDouble dummyDouble dummyDouble dummyDouble dummyDouble dummyDouble dummyDouble
    • DrillHoleDiameter
    • n1 deltaX1 X1 Y1
    • D1 D2 … Dn1
    • n2 deltaX2 X2 Y2
    • D1 D2 … Dn2
    • nN deltaXn Xn Yn
    • D1 D2 … DnN

Method has four options:

  • "ExtrudedSolid" builds the compensator from a set of extruded solids. This is the most reliable and efficient technique.

  • "Polyhedra" carves hexagon shapes out of the compensator. This method has an extra check to adjust the position of each starting drill hole of each row to compensate for rounding inaccuracies produced by the drilling machine:

    d:Ge/Compensator/XTolerance = 1. mm
    d:Ge/Compensator/YTolerance = 1. mm
    
  • "SubtractionCylinders" builds the compensator by subtracting drill hole cylinders from the overall compensator cylinder. This technique gives the most perfect representation of the drilling process, however the added precision is insignificant, while particle navigation time is increased. Note that if you want to visualize this form of compensator, you should use RayTracer, as this is the only Geant4 visualization drivers that can correctly render boolean operations.

  • "UnionCylinders" builds the compensator by first creating a union solid of all the holes, and then subtracting this union solid from the overall compensator cylinder. This technique is similar to "SubtractionCylinders" but slightly more efficient. Note that if you want to visualize this form of compensator, you should use RayTracer, as this is the only Geant4 visualization drivers that can correctly render boolean operations.

BrachyApplicator

A BrachyApplicator is a component that is used to precisely place source wires for brachytherapy applications. It is the first of what we intend to become a large library of new compoents for brachytherapy applications.

The overall shape of the BrachyApplicator is a cylinder with a hemispherical cap on one end. There is one hole in the center into which a source wire can be driven, plus a configurable number of other holes located radially around this center. The component generates additional parameters at run-time to represent the x and y translations of these holes relative to the applicator center line. These parameters can be used to easily postion the source wire into these holes.

_images/Applicator.png

The following example parameters are taken from the new example: examples/Patient/Applicator.txt This example places the applicator inside of a patient, and then uses time features to drive a source wire to various dwell positions within this applicator.

The parameters you set are as follows.:

s:Ge/Applicator/Type = "TsBrachyApplicator"
s:Ge/Applicator/Parent = "Patient"
b:Ge/Applicator/IsParallel = "True"
s:Ge/Applicator/Material = "G4_WATER"
d:Ge/Applicator/CylinderLength = 40. mm
d:Ge/Applicator/Radius = 12.5 mm
i:Ge/Applicator/NumberOfRadialHoles = 6
d:Ge/Applicator/HoleOffset = 6 mm # Distance of radial holes from center
d:Ge/Applicator/HoleRadius = 1.2 mm
s:Ge/Applicator/DrawingStyle = "Solid"
s:Ge/Applicator/Color = "transparentgrey"
iv:Gr/Color/transparentgrey = 4 255 255 255 90

The following parameters are updated automatically by the applicator component to show true hole centers. They need to be defined here, but these initial values are not important. They must run from Hole0 (for the central hole) to HoleN, for the Nth radial hole.:

d:Ge/Applicator/Hole0/TransX = 0. mm
d:Ge/Applicator/Hole0/TransY = 0. mm
d:Ge/Applicator/Hole1/TransX = 0. mm
d:Ge/Applicator/Hole1/TransY = 0. mm
d:Ge/Applicator/Hole2/TransX = 0. mm
d:Ge/Applicator/Hole2/TransY = 0. mm
d:Ge/Applicator/Hole3/TransX = 0. mm
d:Ge/Applicator/Hole3/TransY = 0. mm
d:Ge/Applicator/Hole4/TransX = 0. mm
d:Ge/Applicator/Hole4/TransY = 0. mm
d:Ge/Applicator/Hole5/TransX = 0. mm
d:Ge/Applicator/Hole5/TransY = 0. mm
d:Ge/Applicator/Hole6/TransX = 0. mm
d:Ge/Applicator/Hole6/TransY = 0. mm

Pixelated box

A TsPixelatedBox is a helpful component to simulate pixelated detectors. It consists of a 2D array of rectangular boxes with a constant gap in between. Thus, the pixel size and pitch must be provided, with the sole condition that the pitch values must be greater than the pixel sizes for the corresponding axes. For this component, the whole dimensions (not half lengths) of each pixel must be providen. The associated figure shows the general scheme of a detector array of 4 x 4 pixels.

_images/PixelatedDetector.png

The parameters are as follows:

d:Ge/MyComponent/Type = "TsPixelatedBox"
d:Ge/MyComponent/Material = "G4_AIR"
s:Ge/MyComponent/Pixel/Material = "G4_WATER"
s:Ge/MyComponent/Pixel/Color    = "yellow"
d:Ge/MyComponent/PixelSizeZ     = 15 mm # Pixel thickness
d:Ge/MyComponent/PixelSizeX     = 2 mm
d:Ge/MyComponent/PixelSizeY     = 2 mm
d:Ge/MyComponent/PitchX         = 2.1 mm
d:Ge/MyComponent/PitchY         = 2.1 mm
i:Ge/MyComponent/NumberOfPixelsX= 4
i:Ge/MyComponent/NumberOfPixelsY= 4

As depicted, two materials must be assigned, one for an envelope volume automatically created to hold the pixels, the other for the pixels. It is also shown the index order with integer numbers for each pixel. Thus, the first pixel is placed on the bottom left. Currently, there is not a dedicated scorer for the TsPixelatedBox component. However, advanced users willing to create their scoring extensions could use the following line of code to access the pixel indices (which start from 1):

G4int pixelIndex = aStep->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber();

A sample of use of the TsPixelatedBox can be found in examples/Optical/PixelatedDetector.txt. The scoring in such an example is performed using a phase space placed behind the pixelated detector.

Patient Components

TOPAS currently supports the following Patient Component types:

Geometry Component Type
Patient in DICOM Format TsDicomPatient
Patient in ImageCube Format (handles XCAT, XiO, MaterialTagNumber and more) TsImageCube (handles XCAT, XiO and more)

It is also necessary to define how to convert the imaging data to material data, following a Imaging to Material Conversion scheme.

Common Parameters

Many of the parameters for Patient Components are common to both TsDicomPatient and TsImageCube. These are described here.

To perform Monte Carlo simulation, TOPAS needs to map each voxel of the patient image to a material, density and, for useful graphics, a color. You specify how to do this by telling TOPAS which Imaging to Material Conversion to use.

To dump your file’s raw imaging values to the console:

b:Ge/Patient/DumpImagingValues = "True"

Set any parent you like, but it is often convenient to place patient into a group component which can then be rotated to represent couch setup:

s:Ge/Patient/Parent = "PatientGroup"

Even though a large number of materials are defined in your HU conversion file, TOPAS will only create those materials that are actually used in your CT image. In the 4DCT case, if any image introduces new materials that were not in the first image, Geant4 will be unable to proceed (it cannot load new materials after physics has initialized). TOPAS will exit with a warning message advising you to set the parameter:

b:Ge/Patient/PreLoadAllMaterials = "True"

Startup will then be slower, since TOPAS will preload the full set of materials defined in your HU conversion file, but your 4DCT will then work.

For single slice thickness images, scoring will use the same voxel divisions as your CT image. For multiple slice thicknesses, scoring will not know what divisions to use unless you explicitly specify these in your scoring parameters, such as:

i:Sc/MyScorer/XBins = 512
i:Sc/MyScorer/YBins = 512
i:Sc/MyScorer/ZBins = 256

The built-in Geant4 visualization tools do not perform well when a complex voxel structure is loaded. To make visualization more successful, several additional parameters are provided.

There is generally little value in showing all pixels of the image at once. Each slice just covers up the last slice. To instead show only a specific set of slices in any dimension:

iv:Gr/Patient/ShowSpecificSlicesZ = 4 1 3 9 12 # will only show slices 1, 3, 9 and 12.

Number of slices begins at number 1.

Similar slicing is allowed in X and Y. Three special values are also allowed:

iv:Gr/Patient/ShowSpecificSlicesZ = 1 0 # means show all slices
iv:Gr/Patient/ShowSpecificSlicesZ = 1 -1 # means only show center slice
iv:Gr/Patient/ShowSpecificSlicesZ = 1 -2 # means only first, center and last slice

The following will result in a display that shows 27 pixels comprising the boundaries and center of the image. This allows you to see the overall placement of the image and see the individual voxel size:

iv:Gr/Patient/ShowSpecificSlicesX = 1 -2 # means only show center slice
iv:Gr/Patient/ShowSpecificSlicesY = 1 -2 # means only show center slice
iv:Gr/Patient/ShowSpecificSlicesZ = 1 -2 # means only show center slice

You have the Option to Load a Truncated DICOM, XiO or ImageCube. Parameters to restrict which voxels of a patient image are loaded are:

i:Ge/MyComponent/RestrictVoxelsXMin i:Ge/MyComponent/RestrictVoxelsYMin i:Ge/MyComponent/RestrictVoxelsZMin i:Ge/MyComponent/RestrictVoxelsXMax i:Ge/MyComponent/RestrictVoxelsYMax i:Ge/MyComponent/RestrictVoxelsZMax

The previously mentioned parameters, ShowSpecificSlicesVoxels, affect only the graphical output of the voxels. The voxels were still all loaded, and all affected the physics results, but only specific voxels were shown in graphics.

The RestrictVoxels… parameters have a much more significant effect: they cause TOPAS to not even load some parts of the patient. This can save a lot of time and allow you to test things on DICOM or other image formats quickly, as you only have to load whatever part of the DICOM you actually want to use. Beware though: if you use this option, you will change your results. It is not just a graphics thing. It actually avoids creating the given voxels at all.

Though our main motivation for this work was to get a way to do more rapid development (testing on real patients without the slowdown of loading everything), there may be a value also for our brachytherapy users. They may only need to load the part of the image that is near the brachy source.

Another option allows you to specify the maximum number of voxels to show. If the total number of voxels is greater than this limit, TOPAS will just draw the overall DICOM outline:

i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 8000

Patient in DICOM Format

DICOM import is handled through the GDCM package, which is pre-built into TOPAS.

See the DoseToCT.txt and DoseTo4DCT.txt examples of how to use TsDicomPatient. Note that before running this example, you must unzip the included DICOM files.

You specify the name of a directory containing one or more dcm files (one for each slice):

s:Ge/Patient/DicomDirectory = "DICOM_Box"

To specify 4DCT, you can have DicomDirectory change under control of a Time Feature.

Files of other types in this directory will be ignored. Exact titles of the dcm files are not important as TOPAS will re-order them based on the slice ordering information inside the DICOM headers.

By default, Topas will only consider dcm files that are from CT. This can be adjusted by:

sv:Ge/Patient/DicomModalityTags = 1 "CT" # defaults to just CT

Other modality tags are, for example, "MR" for Magnetic Resonance and "US" for Ultrasound. A complete list can be found here.

Patient positioning information from the DICOM file is not currently used. You must position as you would for any TOPAS component:

d:Ge/Patient/TransX=0. m
d:Ge/Patient/TransY=0. m
d:Ge/Patient/TransZ=0. m
d:Ge/Patient/RotX=0. deg
d:Ge/Patient/RotY=0. deg
d:Ge/Patient/RotZ=0. deg

You can ask TOPAS to print out the slice separation that it finds in in the DICOM series:

b:Ge/MyComponent/ShowSliceSeparations = "True"

TOPAS can read DICOM RT Structure Sets. A structure set is an extra file in the DICOM directory that provides information on structures such as organs, tumors, PTVs, etc. that have been outlined (contoured) in the planning process. The data is stored as a set of polygons, up to one per slice for each contoured structure. TOPAS can color code DICOM components according to this structure information and can filter scoring based on these structures (see the filter: OnlyIncludeIfInRTStructure).

To make TOPAS color the voxels by structure:

sv:Ge/Patient/ColorByRTStructNames = 2 "R_LUNG" "L_LUNG"
sv:Ge/Patient/ColorByRTStructColors = 2 "yellow" "red"
  • If the structure name includes a space, substitute an underscore in the parameter. So, for example, if the structure name is “R LUNG”, you should supply the parameter as “R_LUNG”.

  • If you don’t actually know what structures are included in your DICOM, just try providing in ColorByRTStructNames. TOPAS will give you an error message that includes a list of the known structure names.

  • To allow easy testing of this feature in simple DICOM examples that don’t really have any structures, the following parameter will “fake” an RT structure set, assigning the given structure to all voxels in the lower XY quadrant:

    b:Ge/Patient/FakeStructures = "True"
    

TOPAS can automatically set DicomOrigin parameters to help with patient positioning.

If you define a set of DicomOrigin parameters for your patient:

dc:Ge/Patient/DicomOriginX = 0.0 mm
dc:Ge/Patient/DicomOriginY = 0.0 mm
dc:Ge/Patient/DicomOriginZ = 0.0 mm

then when you read in a TsDicomPatient, TOPAS will update these parameters on the fly to provide the origin of the DICOM coordinate system specified in the TOPAS coordinate system.

You can combine this information with other information you may have about your isocenter to get your patient properly positioned. For example, if you just wanted to center your patient in its parent component, such as PatientGroup, you would do:

s:Ge/Patient/Type     = "TsDicomPatient"
s:Ge/Patient/Parent   = "PatientGroup"
d:Ge/Patient/TransX   = 0.0 mm
d:Ge/Patient/TransY   = 0.0 mm
d:Ge/Patient/TransZ   = 0.0 mm

If you also had isocenter information from at RT-Ion plan in DICOM coordinates:

d:Rt/plan/IsoCenterX = 0.0      mm
d:Rt/plan/IsoCenterY = -99.9904 mm
d:Rt/plan/IsoCenterZ = -14.0    mm

you could adjust the patient to isocenter by doing:

d:Ge/Patient/TransX = Ge/Patient/DicomOriginX - Rt/plan/IsoCenterX mm
d:Ge/Patient/TransY = Ge/Patient/DicomOriginY - Rt/plan/IsoCenterY mm
d:Ge/Patient/TransZ = Ge/Patient/DicomOriginZ - Rt/plan/IsoCenterZ mm

See ViewAbdomen_rtdose.txt for an example of how to use these patient-positioning features.

TOPAS can automatically create a Scoring Grid that exactly matches a provided RTDOSE file in your DICOM dataset. This makes it easier to compare TOPAS results to Treatment Planning System results.

Tell TOPAS which RTDOSE file to use by providing “CloneRTDoseGridFrom” parameter, such as:

s:Ge/Patient/CloneRTDoseGridFrom = Ge/Patient/DicomDirectory + "/RTDOSE.dcm"
_images/rtdose_grid_option1.png

You can adjust pixel sizes while keeping the position, such as:

s:Ge/Patient/CloneRTDoseGridFrom = Ge/Patient/DicomDirectory + "/rtdose.dcm"
dv:Ge/Patient/CloneRTDoseGridSize = 3 5 5 8 mm
_images/rtdose_grid_option2.png

In addition, you can define a dose grid without a RTDOSE file by specifying its grid size such as:

dv:Ge/Patient/CloneRTDoseGridSize = 3 5 5 5 mm

A dose grid that fits the volume of a TsDicomPatient will be created.

_images/rtdose_grid_option3.png

TOPAS will then automatically create a scoring volume in a parallel world to overlay your grid, and will name this component with the same name as your patient, plus “/RTDoseGrid”. You can then score on this component just like on any other component:

s:Sc/Dose/Component = "Patient/RTDoseGrid"

TOPAS Scoring can use information from your DICOM dataset so that scored results can be more easily compared to those from treatment planning systems, by using a consistent coordinate system. See DICOM Output for more information.

Patient in ImageCube Format (handles XCAT, XiO, MaterialTagNumber and more)

We refer to a patient input file as an “Image Cube” if it is a simple binary file that contains one value for each voxel. These values may be Housefield units or any other sort of imaging information that you have. Elsewhere you will tell TOPAS how to convert a given value from this file into a specfic material for that voxel.

  • For the case of an XCAT phantom, the binary file will contain, for each voxel, an activation or attenuation value as a float
  • For the case of an XiO patient, the binary file will contain, for each voxel, a Hounsfield value as a short
  • For the case of a MaterialTagNumber file, the binary file will contain, for each voxel, a material index as a short
  • For other cases, you can provide a binary file that contains, for each voxel, any float, int or short
(and for XCAT phantoms, there may be an additional file, an XCAT log, that provides metadata)

An ImagingToMaterialConverter, described in the next section, handles the details of how each voxel’s information is converted to a material specification.

See the XCAT.txt example of how to read an XCAT file. See the DoseToCT.txt example of how to read an XiO file.

Specify file directory and file name:

s:Ge/Patient/InputDirectory = "./"
s:Ge/Patient/InputFile = "ctvolume.dat" # match exact case

To specify 4DCT, you can have InputDirectory or InputFile change under control of a Time Feature.

For 4D CT, a parameter lets you decide whether the material maps for the various CT phases will be cached (saving time if they are reused again) or not (saving memory):

b:Ge/CacheMaterialMapForEachTimeSlice defaults to True

You must position as you would for any TOPAS component:

d:Ge/Patient/RotX = 0. deg
d:Ge/Patient/RotY = 90. deg
d:Ge/Patient/RotZ = 0. deg
d:Ge/Patient/TransX = 1.5 mm
d:Ge/Patient/TransY = 3.3 mm
d:Ge/Patient/TransZ = 4.2 mm

TOPAS then needs some metadata: specifically it needs to know:

  • how many voxels there are in each dimension
  • how large the voxels are in each dimension
  • what data type is involved (float, int or short)
  • how to convert the given value to a material

For XCAT phantoms, all of this metadata can come from an XCAT log file:

s:Ge/Patient/MetaDataFile = "XCAT_FullMouse_86x86x161_atn_1.log"

If you had some other form of Image Cube (not XCAT), or you don’t want to read this information from an XCAT log file, you can provide this meta data as TOPAS parameters:

s:Ge/Patient/DataType  = “FLOAT” # “SHORT”, “INT” or “FLOAT"
i:Ge/Patient/NumberOfVoxelsX  = 86
i:Ge/Patient/NumberOfVoxelsY  = 86
i:Ge/Patient/NumberOfVoxelsZ = 161
d:Ge/Patient/VoxelSizeX       = .5 mm
d:Ge/Patient/VoxelSizeY       = .5 mm
d:Ge/Patient/VoxelSizeZ       = .5 mm

If there are multiple slice thicknesses in your image, use vectors to specify number and thickness of voxels in each section. For example, a 30 slice image that has 10 slices of 2.5 mm and then 20 slices of 1.25 mm:

iv:Ge/Patient/NumberOfVoxelsZ = 2 10 20
dv:Ge/Patient/VoxelSizeZ = 2 2.5 1.25 mm

If you are using XCAT without providing metadata from an XCAT log file, you should also provide parameters to tell TOPAS what material to use for a given value found in the XCAT binary file, such as:

u:Ge/Patient/AttenuationForMaterial_XCAT_Air    =   0.
u:Ge/Patient/AttenuationForMaterial_XCAT_Muscle = 195.2515
u:Ge/Patient/AttenuationForMaterial_XCAT_Lung   =  57.5347

Imaging to Material Conversion

You are free to write your own converter, including approaches that use alternative imaging modalities (e.g. MRI, pCT, ultrasound), or that use more than one image (e.g. Dual Energy CT, Multi-Energy CT). To write your own converter, see Custom Imaging to Material Conversion.

XCAT

TOPAS provides two built-in converters for XCAT and other Image Cube data:

s:Ge/Patient/ImagingToMaterialConverter = "XCAT_Attenuation" # "XCAT_Activity"

These converters assume the value found in the binary file for a given voxel is either an Attenuation or an Activity. They then convert the given value to a material name from either the metadata file (the XCAT log file) or from explicit parameters you have specified such as:

u:Ge/Patient/AttenuationForMaterial_XCAT_Air    =   0.
u:Ge/Patient/AttenuationForMaterial_XCAT_Muscle = 195.2515
u:Ge/Patient/AttenuationForMaterial_XCAT_Lung   =  57.5347

The actual material name that TOPAS will expect you to define somewhere is the part after "AttenuationForMaterial_", such as XCAT_Air and XCAT_Muscle. You need to make sure that these material names have been defined somewhere in your TOPAS parameters. In our XCAT example we defined these in the file XCAT_Materials.txt. Two notes on this example XCAT_Materials file:

  • We faked the definitions, defining all the materials as different colors of what is really just water. You could edit this file to provide the real elemental compositions of the various materials.
  • We only defined the materials used in the attenuation part of the XCAT log file. If you instead want to use the materials used in the activity part of the XCAT log file, you’ll need to define some additional materials (the activity part of that XCAT log file had more materials than the attenuation part).

MaterialTagNumber

Some of our users have TsImageCube components where each voxel is represented not as a CT number but as an integer “tag number,” a 16-bit integer (C++ short) that corresponds to a particular material name. The ImagingToMaterialConverter called MaterialTagNumber will interpret these tag numbers based on a lookup table created by two additional TOPAS vector parameters, MaterialTagNumbers and MaterialNames. For example:

s:Ge/Patient/Type = "TsImageCube"
s:Ge/Patient/ImagingToMaterialConverter = "MaterialTagNumber"
iv:Ge/Patient/MaterialTagNumbers = 6 0 3 42 43 100 110
sv:Ge/Patient/MaterialNames = 6 "Air" "G4_BLOOD_ICRP" "G4_BONE_CORTICAL_ICRP" "G4_BONE_COMPACT_ICRU" "G4_BRAIN_ICRP" "G4_MUSCLE_SKELETAL_ICRP"

Thus:

  • Where the voxel is tagged with the number 0, the converter will interpret this as “Air”
  • Where the voxel is tagged with the number 3, the converter will interpret this as ” G4_BLOOD_ICRP “
  • Where the voxel is tagged with the number 42, the converter will interpret this as ” G4_BONE_CORTICAL_ICRP “
  • etc.

Schneider

TOPAS provides a built-in converter that follows the most common method used in proton therapy for DICOM or XiO patient data (PubMed):

  • Schneider W, Bortfeld T and Schlegel W. Correlation between CT numbers and tissue parameters needed for Monte Carlo simulations of clinical dose distributions. Phys. Med. Biol. 2000; 45(2):459-78.

This converter follows the technique developed by Schneider to assign materials based on a single CT image file containing Hounsfield Unit (HU) values. It is selected using:

s:Ge/Patient/ImagingtoMaterialConverter = "Schneider"

The HU conversion parameters are typically stored in a separate parameter file:

includeFile = HUtoMaterialSchneider.txt

An example of such a HU conversion parameter file is examples/DICOM/HUtoMaterialSchneider.txt.

The first set of parameters in the HU file are used to calculate density:

dv:Ge/Patient/DensityCorrection = 3996 9.35212 5.55269 4.14652 ...1.06255 1.00275 g/cm3
iv:Ge/Patient/SchneiderHounsfieldUnitSections = 8 -1000 -98 15 23 101 2001 2995 2996
uv:Ge/Patient/SchneiderDensityOffset = 7 0.00121 1.018 1.03 1.003 1.017 2.201 4.54
uv:Ge/Patient/SchneiderDensityFactor = 7 0.00103 0.00089 0.0 0.00117 0.00059 0.0005 0.0
uv:Ge/Patient/SchneiderDensityFactorOffset = 7 1000. 0. 1000. 0. 0. -2000. 0.

DensityCorrection:

  • One value for every possible HU value.
  • Values start from Ge/Patient/MinImagingValue which defaults to -1000

SchneiderHounsfieldUnitSections:

  • Specifies how to break up the entire set of HU units into several density calculation sections. The HU conversion formula then uses different correction factors for each of these sections.

  • The total range (last value minus first value) must equal the number of values in DensityCorrection.

  • In the above example, the 8 values define 7 sections:

    • Section 1: -1000 to -99
    • Section 2: -98 to 14
    • Section 7: 2995 to 2996

SchneiderDensityOffset, SchneiderDensityFactor and SchneiderDensityFactorOffset:

  • Must have one value for each of the density calculation sections, so length must be one less than the length of SchneiderHounsfieldUnitSections

Thus, for any specific HU number, we can extract the appropriate:

  • DensityCorrection
  • SchneiderDensityOffset
  • SchneiderDensityFactor
  • SchneiderDensityFactorOffset

And use these in the Schneider formula:

  • Density = ( Offset + ( Factor * ( FactorOffset + HU[-1000,2995] ) ) ) * DensityCorrection

The second set of parameters in the HU file are used to calculate material name and graphics color:

iv:Ge/Patient/SchneiderHUToMaterialSections = 26 -1000 -950 -120 -83 ... 1500 2995 2996
sv:Ge/Patient/SchneiderElements = 13 "Hydrogen" "Carbon" "Nitrogen" "Oxygen" ...
uv:Ge/Patient/SchneiderMaterialsWeight1 = 13 0.0   0.0   0.755 0.232 ...
uv:Ge/Patient/SchneiderMaterialsWeight2 = 13 0.103 0.105 0.031 0.749 ...
...
iv:Gr/Color/PatientTissue1 = 3  63 63 63
iv:Gr/Color/PatientTissue2 = 3 100  0  0
...

iv:SchneiderHUToMaterialSections:

  • Specifies how to break up the entire set of HU units into several material name assignment sections.

  • The total range (last value minus first value) must equal the number of values in DensityCorrection.

  • In the above example, the 26 values define 25 material name assignment sections:

    • Section 1: -1000 to -949
    • Section 2: -50 to -119
    • Section 25: 2995 to 2996

sv:SchneiderElements:

  • Specifies all of the elements that will be used in the patient.
  • All patient materials must be composed from combinations of this set of elements.

uv:SchneiderMaterialsWeight1 through SchneiderMaterialsWeight25:

  • There should be one of these parameters for each of the material name assignment sections. The length of SchneiderMaterialsWeight must equal the length of SchneiderElements.

  • Each value in SchneiderMaterialsWeight tells what proportion of the given element in SchneiderElements to use in this material.

  • In our SchneiderMaterialsWeight2 parameter, the values: 0.103 0.105 0.031 0.749 mean:

    • 10.3 percent of the first element, Hydrogen
    • 10.5 percent of the second element, Carbon
    • 3.1 percent of the second element, Nitrogen
    • 74.9 percent of the second element, Oxygen
  • You may optionally provide this parameter to override the default mean excitation energies of some or all of the materials.

  • There should be one value for each material name assignment section.

  • To use the default mean excitation energy for a particular material, enter that value as 0.

  • For example, the following just overrides defaults for two out of 25 assignment sections:

    dv:Ge/Patient/SchneiderMaterialMeanExcitationEnergy = 25 88.8 0. 77.7 0. 0. 0. 0. 0.
    0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. eV
    

iv:Gr/Color/PatientTissue1:

  • Specifies what colors should be assigned to each of the materials.
  • There should be one of these parameters for each of the SchneiderHUToMaterialSections.
  • The three values specify the Red, Green and Blue components of the color.

Putting it all together, we have now specified density, material name, color and, optionally, mean excitation energy, for each of the Hounsfield numbers in the patient.

You can review the materials definitions that TOPAS created based on your patient file and the HU conversion settings. The following parameter tells TOPAS to dump parameters to a file:

Ts/DumpNonDefaultParameters = "True"

For each HU number that was used in the patient file, you will see a set of parameters starting with Ma/PatientTissueFromHU followed by an HU number. For example, for HU number -295, you may see:

Ma/PatientTissueFromHU-295/Component = 9 Hydrogen Carbon Nitrogen Oxygen Phosphorus Sulfur Chlorine Sodium Potassium
Ma/PatientTissueFromHU-295/Fractions = 9 0.103 0.105 0.031 0.749 0.002 0.003 0.003 0.002 0.002
Ma/PatientTissueFromHU-295/Density = 0.707487 g/cm3
Ma/PatientTissueFromHU-295/DefaultColor = PatientTissue2

where you then follow the DefaultColor parameter named PatientTissue2 to see that Gr/Color/PatientTissue2 is 3 100 0 0 which means a mixture of 100 percent Red, 0 percent green, 0 percent blue.

Particle Sources

Introduction

We allow any number of particle sources (zero, one or many) with no limitation on how they can be mixed.

We provide four different types of particle sources, each with many options:

And you may also write your own entirely new particle source (see Custom Particle Sources).

The position of the source is always centered on an associated Geometry Component. This is in keeping with the general TOPAS paradigm that all geometrical information resides in Geometry Components. We know that this may feel odd to experienced Geant4 users who are used to setting beam directions irrespective of any geometry volumes, but the TOPAS paradigm enables sources, components, scorers and even fields to all move together in an internally consistent manner.

The Geometry Component associated with a Particle Source is often a Group Component. Such components have a center position and orientation but no actual shape or extent. The Particle Source is placed at this center position and orientation. If the Component is some other Type, such as a TsBox or TsCylinder, the Particle Source still only takes center position and orientation from this Component. None of the other aspects of the Component, such as the Component’s shape or size, have any impact on the Particle Source. So, for example, the shape and size of a Beam source is set by various BeamPosition parameters, not by the Component’s shape or size.

Some examples place the source at a vacuum window at the entrance to a nozzle. The source then moves as the nozzle moves.

Particle Names

Throughout TOPAS, particle names can take the following forms (case does not matter):

  • A simple string such as

    • “proton”
  • A string describing an ion with arguments Z, A, and optionally Charge, such as:

    • “GenericIon(6,12,6)”
    • “GenericIon(6,12)” - Charge defaults to Z, that is, the ion is fully stripped
    • When used to filter sources, ions must be fully stripped (this is the only kind of ion that Geant4’s primary particle generation supports).
    • When used to filter scoring, ions can have any Charge, and any of the arguments can have wildcard value * so, for example, “GenericIon(6,*,*)” will score any Carbon ion (any A and any Charge).
  • An integer PDG ID code, though still contained in a string parameter, such as

  • When PDG code has 10 digits and starts with 100, this is passed to Geant4 either as the appropriate Geant4 light ion name (“alpha”, “deuteron”, “He3” or “triton”) or as GenericIon(Z,A) where:

    • Characters 4-6 give Z
    • Characters 7-9 give A
    • Character 10 gives Isomer level (not used)

The full set of known particles depends on the physics you have defined. Here are some common values, with associated PDG codes:

Particle PDG code
“proton” “2212”
“neutron” “2112”
“e-” “11”
“e+” “-11”
“gamma” “22”
“He3” “100002003”
“alpha” “100002004”
“deuteron” “100001002”
“triton” “100001003”
“opticalphoton” “0” (PDG group has no code for this particle)
“geantino” “0” (sees transportation processes but no physics, no PDG code)
“chargedgeantino” “0” (same as above but with charge, no PDG code)

Beam Sources

By default there is a single source named Demo centered on a Component named BeamPosition that is placed at one end of the World. The beam shape is an Ellipse. Each of these parameters is described in detail below:

s:So/Demo/Type = "Beam" # Beam, Isotropic, Emittance or PhaseSpace
s:So/Demo/Component = "BeamPosition"
s:So/Demo/BeamParticle = "proton"
d:So/Demo/BeamEnergy = 169.23 MeV
u:So/Demo/BeamEnergySpread = 0.757504
s:So/Demo/BeamPositionDistribution = "Gaussian" # None, Flat or Gaussian
s:So/Demo/BeamPositionCutoffShape = "Ellipse" # Rectangle or Ellipse (if Flat or Gaussian)
d:So/Demo/BeamPositionCutoffX = 10. cm # X extent of position (if Flat or Gaussian)
d:So/Demo/BeamPositionCutoffY = 10. cm # Y extent of position (if Flat or Gaussian)
d:So/Demo/BeamPositionSpreadX = 0.65 cm # distribution (if Gaussian)
d:So/Demo/BeamPositionSpreadY = 0.65 cm # distribution (if Gaussian)
s:So/Demo/BeamAngularDistribution = "Gaussian" # None, Flat or Gaussian
d:So/Demo/BeamAngularCutoffX = 90. deg # X cutoff of angular distrib (if Flat or Gaussian)
d:So/Demo/BeamAngularCutoffY = 90. deg # Y cutoff of angular distrib (if Flat or Gaussian)
d:So/Demo/BeamAngularSpreadX = 0.0032 rad # X angular distribution (if Gaussian)
d:So/Demo/BeamAngularSpreadY = 0.0032 rad # Y angular distribution (if Gaussian)
i:So/Demo/NumberOfHistoriesInRun = 0

Where the default definition of BeamPosition is:

s:Ge/BeamPosition/Parent="World"
s:Ge/BeamPosition/Type="Group"
d:Ge/BeamPosition/TransX=0. m
d:Ge/BeamPosition/TransY=0. m
d:Ge/BeamPosition/TransZ= Ge/World/HLZ m
d:Ge/BeamPosition/RotX=180. deg
d:Ge/BeamPosition/RotY=0. deg
d:Ge/BeamPosition/RotZ=0. deg

Details on BeamEnergySpread:

  • The number is unitless because we find it more convenient generally to speak of the spread in terms of percentage of the mean energy, rather than as an absolute number. We could have chosen either representation, but this one seemed most consistent with what we see from other beam modeling applications.
  • This is a standard deviation. So the code we have is:
fEnergySpread = BeamEnergySpread * fEnergy / 100.;
p.kEnergy = CLHEP::RandGauss::shoot(fEnergy, fEnergySpread);
  • So, for example, if you want a spread of 0.2 MeV, and your energy is 153 MeV, set BeamEnergySpread to:
0.2 MeV / 153 MeV * 100 = 0.13

To run generate histories using this demo source, set its number of histories to some value:

So/Demo/NumberOfHistoriesInRun = 10

We recommend that you not use So/Demo for any serious work. This demonstration source is just there for simple demonstrations. For any serious work, please define your own source so that you do not just accidentally inherit any of the characteristics of our Demo source. Source characteristics vary greatly from one application to another. There is no meaningful “default” value that we can set for you.

So when you set out on your own work, define a new source name, such as:

s:So/MySource/BeamParticle = "proton"
d:So/MySource/BeamEnergy = 200. MeV
i:So/MySource/NumberOfHistoriesInRun = 100
...

You can provide an energy spectrum instead of a fixed energy by setting the following to "Discrete" or "Continuous":

s:So/MySource/BeamEnergySpectrumType = "Continuous" # Either "None", "Discrete" or "Continuous"

and providing energies and weights as:

dv:So/MySource/BeamEnergySpectrumValues = 3 50. 100. 150. MeV
uv:So/MySource/BeamEnergySpectrumWeights = 3 .20 .60 .20

An example is in Spectrum.txt.

Any source that has NumberOfHIstoriesInRun greater than zero will contribute primary particles.

The beam is emitted along the Z axis of the beam’s Component and may have some spread along the X and Y axes.

For Type = "Beam", the beam shape can be further described by a set of parameters that control the position distribution of the start of the beam:

s:So/MySource/BeamPositionDistribution = "Gaussian" # None, Flat or Gaussian
s:So/MySource/BeamPositionCutoffShape = "Ellipse" # Rectangle or Ellipse (if Flat or Gaussian)
d:So/MySource/BeamPositionCutoffX = 10. cm # X extent of position (if Flat or Gaussian)
d:So/MySource/BeamPositionCutoffY = 10. cm # Y extent of position (if Flat or Gaussian)
d:So/MySource/BeamPositionSpreadX = 0.65 cm # X standard deviation (used only if Gaussian)
d:So/MySource/BeamPositionSpreadY = 0.65 cm # Y standard deviation (used only if Gaussian)

and a set of parameters that control how the beam spreads out from that start position:

s:So/MySource/BeamAngularDistribution = "Gaussian" # None, Flat or Gaussian
d:So/MySource/BeamAngularCutoffX = 90. deg # X cutoff of angular distrib (if Flat or Gaussian)
d:So/MySource/BeamAngularCutoffY = 90. deg # Y cutoff of angular distrib (if Flat or Gaussian)
d:So/MySource/BeamAngularSpreadX = 0.0032 rad # X standard deviation of angular distribution (used only if Gaussian)
d:So/MySource/BeamAngularSpreadY = 0.0032 rad # Y standard deviation of angular distribution (used only if Gaussian)

The Cutoff parameter is applied symmetrically.

You will note that for Gaussian beams, the position and angular distribution are controlled both by Spread and by Cutoff parameters. The Spread control the standard deviation of the Gaussian with zero mean (keep in mind that the position and orientation of the source is controlled by the parameter So//Component), while the Cutoff cut off the tails (which would otherwise be infinite). Inside TOPAS, when the Gaussian formula generates a starting point outside of this cutoff, that starting point is rejected and instead the random function is thrown again until a value is found that is within the specified cutoff.

If your particle type is Optical Photon, additional parameters let you set the polarization:

u:So/MySource/BeamPolarizationX
u:So/MySource/BeamPolarizationY
u:So/MySource/BeamPolarizationZ

If polarization is not set, the Beam will have a uniformly random polarization vector (perpendicular to the initial momentum).

Distributed Source

The Distributed source represents radioactive material randomly distributed within other material. The user specifies how many random source points to sample within the component. The particle generator will then start equal numbers of histories from each of these source points.

The Distributed Source is in many ways similar to the Volumetric Source. But whereas the Volumetric Source samples a new point every time it generates a particle (to simulate random activity within a volume of radioactive material), the Distributed Source does this sampling only a the construction phase (to simulate a random distribution of radioactive particles within some other material).

Specify source type as:

s:So/Example/Type = "Volumetric"

Additional required Parameters for the Distributed Source are:

s:So/Example/Component = "DemoSphere"
i:So/Example/NumberOfHistoriesInRun = 5
i:So/Example/NumberOfSourcePoints = 4
b:So/Example/RedistributePointsOnNewHistory = "False"
s:So/Example/PointDistribution = "Gaussian" # default to "Flat"
d:So/Example/PointDistributionSigma = 20. mm

And then the usual other parameters to control particle type, energy, etc., such as:

s:So/Example/BeamParticle = “gamma” d:So/Example/BeamEnergy = 10. keV u:So/Example/BeamEnergySpread = 0.

Examples that use this source can be found in:

  • examples/Basic/DistributedSourcePointsInShell.txt
  • examples/Basic/DistributedSourcePointsInSphere.txt
  • examples/Basic/DistributedSourcePointsInSphereGaussian.txt
  • examples/Basic/DistributedSourcePointsInTwistedTubs.txt

Emittance Sources

Emittance sources provide 4 ways of sampling particles’ position (X and Y) and momentum direction (X’ and Y’) on a plane. Specify source type as:

s:So/MySource/Type = "emittance"

To sample particle position and momentum direction from “Gaussian” (bivariate 2D gaussian) per axis (see the Emittance_Gaussian.txt example):

s:So/MySource/Distribution = "BiGaussian" # distribution name
d:So/MySource/SigmaX = 0.2 mm # std of x positions
u:So/MySource/SigmaXprime = 0.032 # std of x’, note that it’s unitless. 1 equals to 1.0 rad.
u:So/MySource/CorrelationX = -0.9411 # correlation of x and x’
d:So/MySource/SigmaY = 0.2 mm # std of y positions
u:So/MySource/SigmaYPrime = 0.032 # std of y’
u:So/MySource/CorrelationY = 0.9411 # correlation of y and y’

Alternative distributions are TWISS Gaussian, TWISS Kapchinskij-Vladimirskij (KV), and TWISS Waterbag (based on the Courant-Snyder invariant ellipse in the following figure for X axis only):

_images/emittance_1.png

Additional parameters specify the TWISS alpha, beta and gamma as shown in the following from Emittance_Twiss.txt:

s:So/MySource/Distribution = "twiss_gaussian" # "twiss_gaussian", "twiss_kv" or "twiss_waterbag"
u:So/MySource/AlphaX = 0.2
d:So/MySource/BetaX  = 600.0 mm
d:So/MySource/EmittanceX = 0.01 mm # we don’t multiply pi intrinsically.
u:So/MySource/AlphaY = 2.5
d:So/MySource/BetaY = 1400.0 mm
d:So/MySource/EmittanceY = 0.02 mm
# below for twiss gaussian option only
#0.9 means that 90 % particles will be included in ellipse circle
u:So/MySource/ParticleFractionX = 0.90
u:So/MySource/ParticleFractionY = 0.90

The energies and species of the emitted particles and the Cutoff Shape Parameters can be specified using the same parameters available to the Beam Sources.

The following images based on the Emittance_Twiss.txt example show how particle position and momentum directions are sampled and the shape of the beam spots (purple). The blue solid lines in X (red dots) and Y (green dots) represent the Courant-Snyder invariant ellipse. For example, 90% of particles are sampled from the given emittance ellipse in (a).

_images/emittance_2.png

Environment Source

The Environment source creates an isotropic, uniform radiation field enclosing a specified component. It provides a radiation field that might be experienced, for example, by a spacecraft in a radiation belt, or by a robot (or, indeed a human) in a damaged nuclear reactor.

A notional radiation “cavity” is created enclosing all volumes in a component. The cavity is a sphere of radius R. Primary particles are generated on the surface of the sphere, directed inwards, following a cosine angular distribution (Lambert’s cosine law) relative to the inward direction. This produces an isotropic, homogeneous, “omnidirectional flux”.

Even if the radiation has some directional dependency it is often the case that the instrument (your detector) is rotating or moving about so the flux will average to isotropic over time.

The basic definition of flux, f, which in principle can vary with direction and position, is defined by dN/dt = f*da*dOmega, the rate of flow of particles out of an element of area da perpendicular to the direction into an element of solid angle dOmega. If the flux is homogenous and isotropic, we can define the “omnidirectional flux” F = 4*pi*f per unit area. It is quoted, for example, as number per cm2 per second.

Fluence is simply F*T, the flux F over a time period T, so quoted, for example, as number per cm2.

One can derive equivalent definitions of fluence:

  • the number of particles that enter a sphere of unit cross-sectional area;
  • the track length per unit volume.

For N particles (histories), the fluence will be N/(pi*R^2). This is printed at the end of run. It is up to you to decide if this is enough for your application. Thus:

  • to simulate flux F for time T you need pi*R^2*F*T histories;
  • or, given N histories, you will have simulated a time period T = N/(F*pi*R^2).

A test sphere of radius r will attract N*r^2/R^2 particles.

A thin test disc of radius r will attract (N/2)*r^2/R^2 particles.

Specify source type as:

s:So/MySource/Type = "Environment"

See the example: examples/Basic/EnvironmentSource.txt.

Note: the world must be bigger than the radiation cavity, which may be bigger than a box enclosing your geometry. TOPAS will tell you if you need to increase the world size.

The energies and species of the emitted particles can be specified using the same parameters available to the Beam Sources.

Isotropic Sources

Isotropic sources emit particles uniformly from the center of the specified Component.

Specify source type as:

s:So/MySource/Type = "Isotropic"

The energies and species of the emitted particles can be specified using the same parameters available to the Beam Sources.

Volumetric Source

The Volumetric source emit particles from randomly sampled starting positions from within the radioactive volume of a given component.

This source type has been designed for Brachytherapy applications (though there may be other applications as well).

Specify source type as:

s:So/MySource/Type = "Volumetric"

And then add an additional required parameter:

s:So/MySource/ActiveMaterial

to specify which material within the given component should be considered radioactive.

So, for example, if you have:

s:So/MySource/Type = “Volumetric” s:So/MySource/Component = “ActiveSource” sc:So/MySource/ActiveMaterial = “G4_Ir”

particles will start from randomly sampled positions within the Iridium parts of the component named ActiveSource.

Examples that use this source can be found in:

  • examples/Brachytherapy
  • examples/Basic/VolumetricSource.txt

The energies and species of the emitted particles can be specified using the same parameters available to the Beam Sources.

Phase Space Sources

Phase Space refers to the technique of saving or replaying a set of particles crossing a given surface.

  • When one saves a phase space, one defines a surface and then saves the position, particle type, energy and momentum of some or all particles crossing that surface.
  • When one replays a phase space, one starts a set of particles from the saved positions, with the saved particle types, energy and momentum.

Phase Space enables separating two parts of a simulation or analysis job, and can be used to transfer sets of particles among different codes.

Each phase space must come as two related files (with same file name but different file extensions):

  • A .header file tells the number of histories, the number of saved particles and the order of information in the .phsp file
  • A .phsp file contains all the details of all the saved particles

We support three formats for Phase Space (and TOPAS automatically figures out the format of your .phsp file by studying the related .header file):

  • ASCII provides particle information in a human-readable text file, which data encoded as a series of columns of text. The header file tells the contents and column order per particle.
  • Binary provides the same information as ASCII, but in a much more compact format, with data encoded in a stream of bytes. The header file tells the contents and byte order per particle. Use Binary in cases where the ASCII format produces excessively large files.
  • Limited is an alternate binary format compatible with some legacy codes. It has fewer options for what data can be expressed, but is compatible with codes such as that used by Varian for their TrueBeam phase space files. Use Limited format only when you need to exchange phase space with legacy codes.

Some users have found legacy phase space files that were unreadable in the Limited format because, though they were supposed to contain information about which particles represent a new history, there was in fact no new history information. In such cases, it seems that all photons were to be considered new histories. To read such files, use the Limited format with the additional TOPAS parameter:

b:So/MySource/LimitedAssumePhotonIsNewHistory = "true"

Note that while our Phase Space Scorer lets you also write phase space to ROOT files, we do not provide the capability read phase space back in from this format. For more details, see Phase Space Format.

Phase Space sources ignore the parameters starting with “Beam” and instead use:

s:So/MySource/Type = "PhaseSpace"
s:So/MySource/Component = "World" # coordinate system of phase space. Usually "World"
s:So/MySource/PhaseSpaceFileName = "ASCIIOutput" # match exact case

TOPAS will look for header and phsp files with the given PhaseSpaceFileName.

You can generate some sample data by running any of the examples: WriteASCII.txt, WriteBinary.txt or WriteLimited.txt.

When using phase space sources, it is important to decide how you want to handle a special case we call “Empty Histories.” Recall that when a phase space is first recorded, for a given Original History, the set of resulting particles that cross the phase space surface:

  • may include the primary particles, or
  • may include a mix of primary and secondary particles, or
  • may include only secondary particles, or
  • may include no particles at all. We refer to this last case as an “Empty History.”

The Phase Space Source documentation explains the options for whether and how empty histories are recorded in TOPAS Binary and ASCII phase space files.

When you subsequently use this file as a Phase Space Source, you need to decide how you want TOPAS to handle Empty Histories. If you’re just calculating sums, it doesn’t matter. The Empty Histories contribute nothing to the sum anyway. But if you’re calculating statistical quantities, such as Mean, then these Empty Histories matter. Imagine you want to know the mean dose per Original History. If half of the Original Histories never made it to the phase space file, the decision of whether or not to include these Empty Histories will give a factor of two difference in the calculated Mean Dose per History.

Depending on your use case you may or may not want to include these Empty Histories. It comes down to whether the statistics you want to calculate are:

  • per Original History, or
  • per Original Histories that Reached Phase Space

You control this with:

b:So/MySource/PhaseSpaceIncludeEmptyHistories = "False" # defaults to false

TOPAS ASCII and Binary phase space format headers show all of the relevant information:

  • Number of Original Histories
  • Number of Original Histories that Reached Phase Space
  • Number of Scored Particles

Limited phase space format header does not give:

  • Number of Original Histories that Reached Phase Space
  • so the only way to get that in Limited format is to first read through the entire phsp file and count how many histories contributed there.

TOPAS provides an option to check that the values in the header match what is in the file:

b:So/MySource/PhaseSpacePreCheck = "True" # defaults to true

For TOPAS ASCII and Binary formats, this is a thorough safety check. It will catch any cases where the files have somehow become corrupted (as could happen, for example, if you are doing a very long phase space writing job and the output disk becomes full during some part of the job). For Limited format, the check is still helpful but less thorough as the header file provides incomplete information.

While we recommend that users leave the PreCheck process in place, we accept that the process can be frustratingly slow, as phsp files can be very large. If you have already checked a given file once, you may want to turn off PreCheck for subsequent uses of the same phase space file.

PreCheck will print out a progress update after a given number of particles are read. Default is to print out progress every 1M particles, but this interval can be adjusted with:

i:So/MySource/PreCheckShowParticleCountAtInterval = 100000

If the phase space you are replaying came from a TOPAS job, the particle starting positions in that file will have been defined relative to the World Component. Set the Component parameter above to "World". If you want to offset these particles to some other center or orientation, choose a Component that has the new desired center and orientation (reuse some existing Component, or define a new Group Component just for this purpose). If the phase space you are replaying did not come from TOPAS, there is no automatic way to know what coordinate system was used. It will be up to you to choose a Component that has this appropriate coordinate system.

You can optionally tell the phase space source to scale its position information:

u:So/MySource/PhaseSpaceScaleXPosBy = 0.1 # adjust starting point on X axis by factor of 0.1
u:So/MySource/PhaseSpaceScaleYPosBy = 0.1 # adjust starting point on Y axis by factor of 0.1
u:So/MySource/PhaseSpaceScaleZPosBy = 0.1 # adjust starting point on Z axis by factor of 0.1

You can tell the phase space source to ignore parts of its position information by scaling by zero:

u:So/MySource/PhaseSpaceScaleXPosBy = 0.
u:So/MySource/PhaseSpaceScaleYPosBy = 0.
u:So/MySource/PhaseSpaceScaleZPosBy = 0.

That coordinate of the particle position then just exactly matches the Component center.

You can optionally invert any of the phase space axes by:

b:So/MySource/PhaseSpaceInvertXAxis = "True"
b:So/MySource/PhaseSpaceInvertYAxis = "True"
b:So/MySource/PhaseSpaceInvertZAxis = "True"

In most cases you will instead want to just rotate the source component. However if the handedness of your source phase space is incorrect, one of these invert options will be necessary.

By default, a PhaseSpace source will run all of the histories in the file. To run all of the histories multiple times:

i:So/MySource/PhaseSpaceMultipleUse = 2 # reuse this phase space multiple times

If you set PhaseSpaceMultipleUse to zero, the number of histories in the file will be ignored, and we will instead run the exact number from:

i:So/MySource/NumberOfHistoriesInRun

This may mean only partial use of the phase space file, or partial reuse to get the right number of histories.

  • If your data was generated with time dependence, partial reuse of phase space may not give valid results (you may be playing back only a part of the time sequence). Many more details on controlling number of histories are found in Time mode.
  • Partial reuse of phase space can not include Empty Histories. There is no statistically valid way to handle these empty histories when the phase space file is only partially used (since one does not know where in the phase space order these Empty Histories would have occurred).

Take care when mixing Phase Space Sources with Time Features. While TOPAS can save the current TOPAS time to a phase space file, this time is not automatically applied when reading particles back in from phase space. Thus, if you want to correctly replay source particles that were recorded with time features, it is your responsibility to apply the identical time features during the play back simulation. Some additional notes:

  • Do not attempt to change the name of the phase space file over time. Save and replay all particles from a single phase space file.
  • Do not use Random Time Mode. The randomly generated times during playback will not necessarily match the randomly generated times that were saved to the phase space. Only use Fixed Time Mode or Sequential Time Mode.

A future version of TOPAS will provide more tools to synchronize and check playback time features.

Handling of Malformed IAEA phase space files:

Some of the files in the IAEA phase space repository seem to me to be malformed. Varian_TrueBeam6MV_01, for example, has no New History flags set at all. It also seems to have a proton as its first particle, even though the header says there are only photons, electrons and positrons.

We confirmed that some other IAEA files work fine, such as ELEKTA_PRECISE_10mv_part1.

We then added several new features to our reader to be able to read malformed files:

b:So/MySource/LimitedAssumeFirstParticleIsNewHistory = "true"
b:So/MySource/LimitedAssumeEveryParticleIsNewHistory = "true"
b:So/MySource/LimitedAssumePhotonIsNewHistory = "true"

We confirmed that we can read particles from Varian_TrueBeam6MV_01 if we either set the one parameter:

b:So/MySource/LimitedAssumeEveryParticleIsNewHistory = "true"

or set the two parameters together:

b:So/MySource/LimitedAssumeFirstParticleIsNewHistory = "true"
b:So/MySource/LimitedAssumePhotonIsNewHistory = "true"

We found that if we set only:

b:So/MySource/LimitedAssumeFirstParticleIsNewHistory = "true"

the job hangs (it tries to accumulate all of the millions of particles into a single history).

Examples reading IAEA files can be found at:

  • examples/PhaseSpace/ReadElekta.txt
  • examples/PhaseSpace/ReadVarian.txt

Miscellaneous

Additional Control of Number of Histories

Because TOPAS supports both sequential and random time, there are additional parameters that can control the number of histories in random mode. Read Time mode before using these parameters:

i:So/MySource/NumberOfHistoriesInRandomJob = 100
d:So/MySource/ProbabilityOfUsingAGivenRandomTime = 1.

Filtering Sources

Optionally filter what comes from the source. This is mainly intended for use with saved PhaseSpace, but is applied uniformly to all sources. Syntax is identical to that used for filtering in Scorers.

You may write your own additional filters (see Custom Filters).

Filter by Charge. Accepts one or more of "Positive", "Negative" or "Neutral":

sv:So/MySource/OnlyIncludeParticlesCharged = 1 "Negative"
sv:So/MySource/OnlyIncludeParticlesNotCharged = 1 "Negative"

Filter by Atomic Mass or Number:

i:So/MySource/OnlyIncludeParticlesOfAtomicMass = 10 # allow all ions of atomic mass 10
i:So/MySource/OnlyIncludeParticlesNotOfAtomicMass = 10
i:So/MySource/OnlyIncludeParticlesOfAtomicNumber = 6 # allow all ions of Carbon
i:So/MySource/OnlyIncludeParticlesNotOfAtomicNumber = 6

Filter by Particle’s Initial Kinetic Energy:

d:So/MySource/OnlyIncludeParticlesWithInitialKEBelow = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialKENotBelow = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialKE = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialKENot = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialKEAbove = 10. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialKENotAbove = 10. MeV

Filter by Particle’s Initial Momentum:

d:So/MySource/OnlyIncludeParticlesWithInitialMomentumBelow = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialMomentumNotBelow = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialMomentum = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialMomentumNot = 1. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialMomentumAbove = 10. MeV
d:So/MySource/OnlyIncludeParticlesWithInitialMomentumNotAbove = 10. MeV

Filter by Particle Name:

sv:So/MySource/OnlyIncludeParticlesNamed = 2 "proton" "neutron"
sv:So/MySource/OnlyIncludeParticlesNotNamed = 2 "proton" "neutron"

Particle names are as described here.

You may specify more than one filter. For example, to emit protons with initial KE over 100 MeV:

sv:So/MySource/OnlyIncludeParticlesNamed = 1 "proton"
d:So/MySource/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV # minimum energy

You can invert the results of all previous filters. The following would score only particles that are 1. not protons AND 2. not neutrons AND 3. have initial KE smaller or equal to 100 MeV:

sv:So/MySource/OnlyIncludeParticlesNamed = 2 "proton" "neutron"
d:So/MySource/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV # minimum energy
b:So/MySource/InvertFilter = "True"

Any filter property can be set by Time Features if you wish, to produce time-dependent filtering.

Physics

Introduction

In Geant4, physics options are set in pieces of code called “Physics Lists”. A physics list specifies what particles and physics processes are defined, plus various cuts and options. By default, we set TOPAS physics to a list that has been shown to work well for proton therapy research at the Massachusetts General Hospital. This list includes models that handle not only protons but also all secondary particles (neutrons, helium ions, deuterons, tritons, photons, electrons, etc.). The default gives results that closely match a previous custom list that was described in:

    1. Zacharatou Jarlskog and H. Paganetti, “Physics settings for using the Geant4 toolkit in proton therapy,” IEEE Trans. Nucl. Sci. 55, 1018-1025 (2008)

but which can no longer be used since that list corresponded to a much earlier Geant4 release.

The choice of physics list generally depends on the accuracy required for the scored quantities and the speed of the calculation. The Geant4 Medical Simulation Benchmark Group (G4MSBG) has collected a comprehensive set of mainly measured benchmarks that are run at the time of each Geant4 release. Results may be viewed at https://geant-val.cern.ch/ (see Arce et al, “Report on G4-Med, a Geant4 benchmarking system for medical physics applications developed by the Geant4 Medical Physics Benchmarking Group,” In press, Med Phys, April 2020). Future benchmarks will include the trade-off with speed.

The default list we provide is a Modular physics list. It is specified by the parameters described here.

Advanced users can set their own parameters to override some of these default settings, or can specify entirely different physics lists.

You can choose from two general types of physics lists:

You can also provide your own physics list using Custom Physics Lists and Physics Modules (not recommended unless you have significant Geant4 expertise).

You can get a list of what processes are in your currently selected physics list by:

b:Ph/ListProcesses = "True"

Modular Physics Lists

The default list we provide is a Modular physics list. It is specified by the parameters described here.

The Geant4 EM physics group recommends against setting EMRangeMin too low:

  • Set to 100. eV or greater when using standard Geant4 EM physics
  • Set to 10. eV or greater when using Geant4-DNA physics

If you want to run with no physics, but only the transportation process (useful for some demos and tests), specify the modules in the following special way:

sv:Ph/Default/Modules = 1 "Transportation_Only"

If you want to simplify physics so that only basic electromagnetic physics is done (useful for making basic geometry tests run faster), specify just the one module:

sv:Ph/Default/Modules = 1 “g4em-standard_opt0”

Below is a List of Available Modules with the corresponding Geant4 class names. Users who are advanced experts in Geant4 physics can also write their own Geant4 physics modules.

The remaining options for the "Geant4_Modular" physics type are:

d:Ph/Default/CutForAllParticles = 0.05 mm # single range cut to use for all particles
d:Ph/Default/CutForGamma = 0.05 mm # overrides CutForAllParticles for Gamma
d:Ph/Default/CutForElectron = 0.05 mm # overrides CutForAllParticles for Electron
d:Ph/Default/CutForPositron = 0.05 mm # overrides CutForAllParticles for Positron
d:Ph/Default/CutForProton = 0.05 mm # overrides CutForAllParticles for Proton
d:Ph/Default/CutForAlpha = 0.05 mm # overrides CutForAllParticles for Alpha
d:Ph/Default/CutForDeuteron = 0.05 mm # overrides CutForAllParticles for Deuteron
d:Ph/Default/CutForTriton = 0.05 mm # overrides CutForAllParticles for Triton
d:Ph/Default/EMRangeMin = 100. eV # minimum for EM tables
d:Ph/Default/EMRangeMax = 500. MeV # maximum for EM tables
i:Ph/Default/EMBins = 77 # number of bins for EM tables
i:Ph/Default/EMBinsPerDecade = 7 # number of bins per decade for EM tables
b:Ph/Default/Fluorescence = "False" # Set to true to turn on Fluorescence
b:Ph/Default/Auger = "False" # Set to true to turn on Auger
b:Ph/Default/AugerCascade = "False" # Set to true to turn on AugerCascade
b:Ph/Default/DeexcitationIgnoreCut = "False" # Set to true to implement DeexcitationIgnoreCut
b:Ph/Default/PIXE = "False" # Set to true to turn on PIXE

Physics Regions

By default, cuts affect the entire world, but you can optionally divide the world into several regions and can specify different cuts in each region. First, specify which components belong to a given region:

s:Ge/MyComponent/AssignToRegionNamed = "MyRegion"
  • All children of this component will also be assigned to that region, unless the child has its own AssignToRegionNamed parameter.
  • There is no requirement that all of the components in a given region be contiguous.

Then assign cuts per region by including the region name in the parameter name as in:

d:Ph/Default/ForRegion/MyRegion/CutForGamma = 0.05 mm
d:Ph/Default/ForRegion/MyRegion/CutForElectron = 0.05 mm
d:Ph/Default/ForRegion/MyRegion/CutForPositron = 0.05 mm
d:Ph/Default/ForRegion/MyRegion/CutForProton = 0.05 mm

Note: CutForAllParticles does not have effect on physics regions. The cuts in physics regions should be specifically assigned to each particle. On the contrary, a cut of 0.05 mm will be assigned for the particles without specified cuts in the named region.

Cuts do not affect all processes, but only those listed below:

  • Energy thresholds for gamma are used in Bremsstrahlung

  • Energy thresholds for electrons are used in ionization and e+e- pair production processes Energy thresholds for positrons are used in e+e- pair production process

  • Energy thresholds for gamma and electrons are used optionally in all discrete processes

    • Photoelectriceffect
    • Compton
    • gamma conversion
  • Energy thresholds for protons are used in processes of elastic scattering for hadrons and ions defining the threshold for kinetic energy of nuclear recoil

List of Available Modules

Users who are advanced experts in Geant4 physics can also write their own Geant4 physics modules and plug these into TOPAS through the Extensions Interface.

TOPAS Module Name Geant4 Class Name
g4h-chargeexchange G4ChargeExchangePhysics
g4decay G4DecayPhysics
g4em-dna G4EmDNAPhysics
g4em-dna_opt1 G4EmDNAPhysics_option1
g4em-dna_opt2 G4EmDNAPhysics_option2
g4em-dna_opt3 G4EmDNAPhysics_option3
g4em-dna_opt4 G4EmDNAPhysics_option4
g4em-dna_opt5 G4EmDNAPhysics_option5
g4em-dna_opt6 G4EmDNAPhysics_option6
g4em-dna_opt7 G4EmDNAPhysics_option7
g4em-dna_opt8 G4EmDNAPhysics_option8
g4em-dna-stationary G4EmDNAPhysics_stationary
g4em-dna-stationary_opt2 G4EmDNAPhysics_stationary_option2
g4em-dna-stationary_opt4 G4EmDNAPhysics_stationary_option4
g4em-dna-stationary_opt6 G4EmDNAPhysics_stationary_option6
g4em-dna-chemistry G4EmDNAChemistry
g4em-standard_GS G4EmStandardPhysicsGS
g4em-standard_SS G4EmStandardPhysicsSS
g4em-standard_WVI G4EmStandardPhysicsWVI
g4h-phy_QGSP_BIC_AllHP G4HadronPhysicsQGSP_BIC_AllHP
g4em-extra G4EmExtraPhysics
g4em-livermore G4EmLivermorePhysics
g4em-polarized G4EmLivermorePolarizedPhysics
g4em-lowep G4EmLowEPPhysics
g4em-penelope G4EmPenelopePhysics
g4em-standard_opt0 G4EmStandardPhysics
g4em-standard_opt1 G4EMStandardPhysics_option1
g4em-standard_opt2 G4EMStandardPhysics_option2
g4em-standard_opt3 G4EMStandardPhysics_option3
g4em-standard_opt4 G4EMStandardPhysics_option4
g4h-elastic_D G4HadronDElasticPhysics
g4h-elastic G4HadronElasticPhysics
g4h-elastic_HP G4HadronElasticPhysicsHP
g4h-elastic_LEND G4HadronElasticPhysicsLEND
g4h-elastic_XS G4HadronElasticPhysicsXS
g4h-elastic_H G4HadronHElasticPhysics
g4h-inelastic_QBBC G4HadronInelasticQBBC
g4h-phy_FTFP_BERT HadronPhysicsFTFP_BERT
g4h-phy_FTFP_BERT_HP HadronPhysicsFTFP_BERT_HP
g4h-phy_FTFP_BERT_TRV HadronPhysicsFTFP_BERT_TRV
g4h-phy_FTF_BIC HadronPhysicsFTF_BIC
g4h-phy_QGSP_BERT HadronPhysicsQGSP_BERT
g4h-phy_QGSP_BERT_HP HadronPhysicsQGSP_BERT_HP
g4h-phy_QGSP_BIC HadronPhysicsQGSP_BIC
g4h-phy_QGSP_BIC_HP HadronPhysicsQGSP_BIC_HP
g4h-phy_QGSP_FTFP_BERT HadronPhysicsQGSP_FTFP_BERT
g4h-phy_QGS_BIC HadronPhysicsQGS_BIC
g4h-phy_Shielding HadronPhysicsShielding
g4ion-binarycascade G4IonBinaryCascadePhysics
g4ion-inclxx G4IonINCLXXPhysics
g4ion G4IonPhysics
g4ion-QMD G4IonQMDPhysics
g4n-trackingcut G4NeutronTrackingCut
g4optical G4OpticalPhysics
g4radioactivedecay G4RadioactiveDecayPhysics
g4stopping G4StoppingPhysics

Reference Physics Lists

Reference physics lists are pre-made, complete lists provided by Geant4.

One complication with reference lists is that they do not support use of Parallel Worlds. This means that you cannot place components into a parallel world, and, for the Dividable Components (TsBox, TsCylinder and TsSphere), you cannot score with a different set of divisions than you have set for the component itself (we handle such complex scoring by creating parallel worlds). TOPAS will give an error if you attempt to use a reference list in a situation where parallel worlds are needed. In such situations, use Modular Physics Lists.

The names of the reference physics lists, and their detailed descriptions, are here.

To use a reference physics list, specify the list name in the Type parameter, such as:

s:Ph/Default/Type = "QGSP_BERT_HP"

Reference physics lists allow only one additional option:

d:Ph/Default/CutForAllParticles = 0.05 mm # single range cut to use for all particles

Optical Physics

Optical Photons

A full description of the tracking of optical photons is available in the Geant4 Physics Reference Manual and the Geant4 Guide for Applications Developers.

TOPAS allows to include optical physics by means of the g4optical module in the physics list. The available optical processes included in the g4optical module are: scintillation, Cerenkov radiation, wavelength shifting, optical absorption, Rayleigh scattering and boundary processes. However, the optical properties of the material of the volumes must also be defined (at the least the refractive index must to be defined). There exist two types of variables to define the optical properties: a vector based and constant based. The vector-based parameter allows to define a property (refractive index for example) as a function of the photon’s energy. While the constant-based parameters allows to define an scalar (scintillation yield for example).

To activate the optical properties in a material one must to set:

b:Ma/MyMaterial/EnableOpticalProperties = "True"

To set a property based on a vector, one must to define the energy of reference. For example to include the refractive index one must to define two parameters:

dv:Ma/MyMaterial/RefractiveIndex/Energies = 3 2.0 2.5 3.0 eV
uv:Ma/MyMaterial/RefractiveIndex/Values = 3 1.58 1.58 1.58

To set a property based on a scalar only one parameter is needed, for example:

u:Ma/MyMaterial/ScintillationYield = 1120 # in ph/MeV
d:Ma/MyMaterial/FastTimeConstant = 2.1 ns

The full list of parameters available is listed in the next table.

Type Parameter name
uv RefractiveIndex
uv ImaginaryRefractiveIndex
uv RealRefractiveIndex
dv AbsLength
uv FastComponent
uv SlowComponent
uv Miehg
uv SpecularLobeConstant
uv SpecularSpikeConstant
uv BackScatterConstant
uv WLSAbsLength
uv WLSComponent
uv Reflectivity
uv Efficiency
uv Transmittance
u ScintillationYield ( in photons/MeV)
u ResolutionScale
d FastTimeConstant
d SlowTimeConstant
u YieldRatio
u MiehgForward
u MiehgBackward
u MiehgForwardRatio
u WLSTimeConstant
u BirksConstant (in mm/MeV)

Optical Surfaces

If a perfect smooth interface is between two dielectric materials, the user only needs to provide the refractive index. In all other cases, a surface or optical boundary needs to be defined. There exist two kinds of surfaces: the border surface that delimits the boundary between two components; and the skin surface which surrounds one single component. Border surface is ordered in the sense that the order of the components matters, two border surfaces can exists between a pair of components. Thus, the follow parameters define two surfaces for a pair of components:

s:Ge/MyComponent1/OpticalBehaviorTo/MyComponent2 = "MySurface1"
s:Ge/MyComponent2/OpticalBehaviorTo/MyComponent1 = "MySurface2"

For skin surface only one surface can be defined per component:

s:Ge/MyComponent1/OpticalBehavior = "MySurface1"

Surfaces can be defined as follows (see next table for description):

s:Su/MySurfaceName/Type = "dielectric_dielectric" # or dielectric_metal

Next, choose the model for optical surfaces:

s:Su/MySurfaceName/Model = "Glisur " # Or Unified

Finally the finish:

s:Su/MySurfaceName/Finish = "Polished"

In addition, more detailed properties can be added by parameters described in the table below. In such a case, the way to define would be for example (with prefix Su instead of Ma):

dv:Su/MySurfaceName/Energies = 2 1.0 4.0 eV
uv:Su/MySurfaceName/Reflectivity = 2 0.8 0.8
Type Parameter name Possible values
string Type
dielectric_dielectric
dielectric_metal
string Finish
polished: smooth perfectly polished surface
polishedfrontpainted: smooth top-layer (front) paint
polishedbackpainted: same as polished but with a back-paint
ground: rough surface
groundfrontpainted: rough top-layer (front) paint
groundbackpainted: same as ground but with a back-paint
string Model
Unified: reference
Glisur: original GEANT3.21 model
unitless SigmaAlpha Between 0 and 1. By default 0

Miscellaneous

User-Supplied Physics Lists

See Custom Physics Lists and Physics Modules for details on how to provide your own physics list. This option is not recommended unless you have significant Geant4 expertise.

Multiple Physics Lists

You can have more than one list defined at the same time, but only the one specified in Ph/ListName will actually be in effect:

s:Ph/ListName = "MyList1"
s:Ph/MyList1/Type= "QGSP_BERT_HP" # This list is in effect now
d:Ph/MyList1/CutForAllParticles = 0.05 mm
...
s:Ph/MyList2/Type= "Geant4_Modular" # This list goes into effect if Ph/ListName set to MyList2
sv:Ph/MyList2/Modules = 1 "g4em-standard_opt3"
d:Ph/MyList2/CutForGamma = 0.04 mm

Production Thresholds

Production Thresholds and range cuts are discussed in detail in the Geant4 Application Developers Guide. By default, appropriate limits are set by the physics list. You can override these defaults with:

d:Ph/MyPhysics/SetProductionCutLowerEdge = 200 eV
d:Ph/MyPhysics/SetProductionCutHighEdge = 30 MeV

Region-specific cuts are set to the value for all particles (“CutForAllParticles”) and for specific particles based on the production cuts set for the general simulation. Particle-specific cuts (CutForElectron, CutForGamma, etc.) take precedence over CutForAllParticles.

If setting CutForAllParticles for a region this sets the cuts for all particles in that region; particle-specific cuts for a region take precedence over all otherwise specified values in that region.

Step Size

The selection of step size is a complex issue in Monte Carlo tracking. Geant4 has its own complex logic for automatically selecting what it thinks will be an appropriate step size, based on local geometry and physics, and the user will not generally need to override this automatic behavior. However, your applications may be sensitive to this behavior, and you may therefore want to set a maximum step size in certain components. In general, larger step sizes give faster performance, but smaller step sizes may give better accuracy.

To limit Geant4’s maximum step size in a given component:

d:Ge/MyComponent/MaxStepSize = 1. mm # sets maximum step size used in this component

Step size settings do not affect other Components placed within this Component. You must explicitly set the step size for any subcomponents that you want to affect.

The choice of maximum step size is highly dependent on your exact simulation problem. If you think you need to set a maximum step size, try running with several values, and pick one for which a small variation up or down does not cause a significant change in results.

Scoring

Introduction

There are two basic classes of scorers:

Most scorers output overall quantities that are accumulated over many particles (counts and averages), but other scorers can output specific information per particle (in an n-tuple format).

You can have any number of scorers. A scorer is defined when you have a line that ends with Quantity, such as:

s:Sc/MyScorer/Quantity = "DoseToMedium"

When your scoring component is the Parent of other components, you have the option to set scoring to record particles not only in the parent component, but also in its children:

b:Sc/MyScorer/PropagateToChildren = "True"

This action is recursive to all levels of subcomponents.

You may write your own additional scorers (see Custom Scorers).

Volume Scorers

Here are the available volume scorers:

Quantity Description
DoseToMedium sum of energy deposits divided by mass
DoseToWater from energy-dependent stopping power conversion (see below)
DoseToMaterial from energy-dependent stopping power conversion (see below)
TrackLengthEstimator dose calculated using the track-length etimator technique
AmbientDoseEquivalent sum of fluence times fluence-to-effective dose conversion coefficients
EnergyDeposit sum of energy deposits
Fluence sum of step lengths divided by volume
EnergyFluence sum of step lengths times energy divided by volume
StepCount counting number of Geant4 steps in the volume
OpticalPhotonCount fills an ntuple with information about optical photons seen in volume
OriginCount counts how many particles originate in a given component
Charge counting method described below
EffectiveCharge counting method described below
ProtonLET various methods described below

Volume Scorers must indicate the relevant Component:

s:Sc/MyScorer/Component = "Phantom"

When your scoring component is the Parent of other components, you have the option to set scoring to record particles not only in the parent component, but also in its children:

b:Sc/MyScorer/PropagateToChildren = "True"

This action is recursive to all levels of subcomponents.

DoseToMaterial:

you must also specify the Material:

s:Sc/MyScorer/Material = "SomeMaterial"

Note that in this case, the material name must exactly match the case defined in Geant4. To check what materials have been defined, add the parameter:

i:Ma/Verbosity = 1

TrackLengthEstimator:

Dose is calculated using a linear Track Length Estimator (TLE). The TLE technique approximates the absorbed dose as electronic (collisional) kerma. The dose along the voxels a photon encounters in its path between successive collisions is accounted for, resulting in a drastic variance reduction.

Use of this scorer is demonstrated in examples/Brachytherapy/DoseTLE.txt

The TOPAS TrackLengthEstimator is further described at:

  • Francisco Berumen, Yunzhi Ma, José Ramos-Méndez, Joseph Perl, and Luc Beaulieu. “Validation of the TOPAS Monte Carlo toolkit for HDR brachytherapy simulations”, Brachytherapy (2021) https://doi.org/10.1016/j.brachy.2020.12.007

AmbientDoseEquivalent:

Scoring is performed per single particle:

s:Sc/MyScorer/Quantity = "AmbientDoseEquivalent"
s:Sc/MyScorer/Component = "MyDetectorComponent"
s:Sc/MyScorer/GetAmbientDoseEquivalentForParticleNamed = 1 “neutron”

The scorer uses a track-length estimator, a variance reduction technique that consists of retrieving the absorbed dose at the scoring regions (voxels) located along the particle path until the point of interaction. That improves the computational efficiency substantially for neutral particles. To that end, the ambient dose equivalent is obtained by folding the incident particle fluence, defined as the particle’s track-length divided by the scorer’s volume [1], with linearly-interpolated fluence-to-effective dose conversion coefficients. Then, the user needs to provide the corresponding fluence-to-effective dose conversion coefficients for a range of incident energy values using a couple of dimensioned double vectors:

dv:Sc/MyScorer/FluenceToDoseConversionEnergies = 30 ... MeV
dv:Sc/MyScorer/FluenceToDoseConversionValues = 30 ... Sv*mm2

The example AmbientDoseEquivalent.txt provides a complete example for neutron particles. It uses the fluence-to-effective dose conversion coefficients from reference [2], downloaded from reference [3].

[1] Attix FH, Introduction to radiological physics and radiation dosimetry, 1986 Wyley-VCH, Chapter 1, Section III.D.

[2] Pelliccioni, M. Overview of Fluence-to-Effective Dose and Fluence-to-Ambient Dose Equivalent Conversion Coefficients for High Energy Radiation Calculated Using the FLUKA Code, Radiat. Prot. Dosim. 88(4), 279-297 (2000).

[3] http://www.fluka.org/fluka.php?id=examples&sub=example4 Accessed on March 10, 2021.

DoseToWater and DoseToMaterial:

we use energy-dependent stopping power conversion as in:

dose_to_new_material = dose_to_medium * ( density_of_medium / density_of_new_material ) * ( dEdX_in_new_material / dEdX_in_medium )

The dEdX comes from the Geant4 EmCalculator utility.

The DoseToWater and DoseToMaterial scorers are somewhat slow since, for every hit, they need to compute stopping power ratios based on the current energy of the particle. You can obtain better speed by adding the option:

b:Sc/MyScorer/PreCalculateStoppingPowerRatios = "True" # defaults to "False"
  • False gives the best accuracy, calculating stopping power on-the-fly for the exact energy.
  • True gives the best speed, looking up stopping power from a pre-calculated table binned by energy. It is about 50% faster than the default option for typical patient simulations. The difference in accuracy is not significant for most studies.

For PreCalculateStoppingPowerRatios, the table of stopping power ratios can be tuned by:

Sc/MyScorer/ProtonEnergyBinSize # default is 1 MeV
Sc/MyScorer/MinProtonEnergyForStoppingPowerRatio # default is 1 MeV
Sc/MyScorer/MaxProtonEnergyForStoppingPowerRatio # default is 500 MeV
Sc/MyScorer/ElectronEnergyBinSize # default is 1 keV
Sc/MyScorer/MinElectronEnergyForStoppingPowerRatio # default is 1 keV
Sc/MyScorer/MaxElectronEnergyForStoppingPowerRatio # default is 1 MeV

OriginCount:

By combining this scorer with the OnlyIncludeParticlesNamed filter, one can create a scorer that tells how many particles of a given type were created in the component. That is, one can count reaction products.

So, for example, the following will count how many neutrons were created:

s:Sc/MyScorer/Quantity = "OriginCount"
s:Sc/MyScorer/Component = "MyComponent"
sv:Sc/MyScorer/OnlyIncludeParticlesNamed = 1 "neutron"

See example: examples/Scoring/OriginCount.txt

Charge and EffectiveCharge:

  • If a particle reaches zero kinetic energy in the scoring volume, its charge is accumulated
  • If a particle is generated in the scoring volume, its charge is subtracted
  • For Charge, the charge comes from the particle definition’s PDGCharge
  • For EffectCharge, the charge comes from the PreStepPoint’s Charge

ProtonLET Scorer

The ProtonLET scorer gives the LET of primary and secondary protons, including the energy deposited by associated secondary electrons. It uses techniques discussed in two recent articles on best practices to score LET in Geant4:

  • Phys. Med. Biol. 60 (2015) 2645–2669 by MA Cortes-Giraldo and A Carabe
  • Phys. Med. Biol. 60 (2015) N283–N291 by DA Granville and GO Sawakuchi

In particular, we adopt the methods developed by Granville and Sawakuchi. We compute dose-averaged LET, but you may instead request track-averaged:

s:Sc/MyScorer/WeightBy = "Track" # defaults to "Dose"

By default, the LET is computed by dividing the energy deposited by the step length. Such distributions can feature spurious spikes, caused by events where the step length is severely constrained by a voxel boundary crossing. Three solutions to this issue are provided:

  • By default, a step-by-step upper cut-off is set, such that steps contributing greater than this value are not be scored:

    d:Sc/MyScorer/MaxScoredLET = 100 MeV/mm/(g/cm3) # default 100 MeV/mm/(g/cm3)
    
  • Alternatively, you can set the LET computation to look up the electronic stopping power for the pre-step proton energy:

    b:Sc/MyScorer/UsePreStepLookup = "True" # defaults to “False”
    
  • Or you can increase the electron production threshold:

    d:Ph/Default/CutForElectron = 1 mm # defaults to 0.05 mm
    

The ProtonLET Scorer can give values that are too high in air, where the mean path length between discrete processes can be larger than the voxel size. This can be avoided by neglecting secondary electrons, with:

d:Sc/MyScorer/NeglectSecondariesBelowDensity = 0.1 g/cm3

Even when you do this, rare events that produce very low energy protons (e.g. a recoiling hydrogen nucleus) will produce spikes in LET. This is also seen in the PreStepLookup version of the scorer. They are not seen in the fluence-averaged version of the scorer, since they are rare events. For this reason we introduce the parameter:

d:Sc/MyScorer/UseFluenceWeightedBelowDensity = 0. g/cm3

We set this to zero by default because it is strange to mix both types of LET in a single distribution, and could be significantly wrong at the end of range. We expect users to want to enable this when making a pretty plot of LET to overlay on a CT scan, without spikes in cavities and outside the patient.

Surface Scorers

Surface Scorer Quantities are:

  • SurfaceCurrent
  • SurfaceTrackCount
  • PhaseSpace

Surface Scorers must indicated the relevant Component and Surface name:

s:Sc/MyScorer/Surface = "Phantom/ZMinusSurface"

where the surface name refers to the coordinate system of the Component.

When your scoring component is the Parent of other components, you have the option to set scoring to record particles not only in the parent component, but also in its children:

b:Sc/MyScorer/PropagateToChildren = "True"

The syntax to specify surface depends on which shape component is involved.

  • For TsBox:

    • XMinusSurface
    • XPlusSurface
    • YMinusSurface
    • YPlusSurface
    • ZMinusSurface
    • ZPlusSurface
    • AnySurface
  • For TsCylinder:

    • ZMinusSurface
    • ZPlusSurface
    • InnerCurvedSurface
    • OuterCurvedSurface
    • PhiMinusSurface (if cut or divided along Phi)
    • PhiPlusSurface (if cut or divided along Phi)
    • AnySurface
  • For TsSphere:

    • InnerCurvedSurface
    • OuterCurvedSurface
    • PhiMinusSurface (if cut or divided along Phi)
    • PhiPlusSurface (if cut or divided along Phi)
    • ThetaMinusSurface (if cut or divided along Theta)
    • ThetaMinusSurface (if cut or divided along Theta)
    • AnySurface
  • For any other Component Type, TOPAS does not have a syntax to tell one surface from another, so the only allowable option is:

    • AnySurface

If you are scoring on a divided component (TsBox, TsCylinder or TsSphere), all surfaces of the divided component then become sensitive for scoring. So, for example, ZMinusSurface will mean to accumulate hits on every ZMinusSurface of every voxel in the divided TsBox.

Creators of parameter files can pre-define more user-friendly synonyms through relative parameters, such as:

s:Ge/WaterTank/Water/UpstreamSurface = Ge/WaterTank/Water/ZMinusSurface

so that users can then score using the named Surface, as in:

s:Sc/MyScorer/Surface = Ge/WaterTank/Water/UpstreamSurface

Phase Space Scorer

Phase Space refers to the technique of saving or replaying a set of particles crossing a given surface. It is the only one of our built-in scorers that saves data to n-tuple format, rather than storing accumulated overall data (counts or averages). However you can write extension scorers to use this generalized n-tuple capability to store other information on a per-particle basis (see Custom Scorers).

  • When one saves a phase space, one defines a surface and then saves the position, particle type, energy and momentum of some or all particles crossing that surface.
  • When one replays a phase space, one starts a set of particles from the saved positions, with the saved particle types, energy and momentum.

Phase Space enables separating two parts of a simulation or analysis job, and can be used to transfer sets of particles among different codes.

If your Surface Scorer has Quantity = "PhaseSpace", the output will be a pair of Phase Space files:

  • A .header file tells the number of histories, the number of saved particles and the order of information in the .phsp file
  • A .phsp file contains all the details of all the saved particles

Note that if your scoring Component is a divided component, such as a voxelized patient, phase space will be scored on the specified surface of Every Voxel (this is the same scoring behavior you will see from any other Surface Scorer in TOPAS).

We support three formats for Phase Space:

  • ASCII provides particle information in an easy to read simple text file, which data encoded as a series of columns of text. The header file tells the contents and column order per particle.
  • Binary provides the same information as ASCII, but in a much more compact format, with data encoded in a stream of bytes. The header file tells the contents and byte order per particle. Use Binary in cases where the ASCII format produces excessively large files.
  • Limited is an alternate binary format compatible with some legacy codes. It has fewer options for what data can be expressed, but is compatible with codes such as that used by Varian for their TrueBeam phase space files. Use Limited format only when you need to exchange phase space with legacy codes.

You can additionally write phase space to ROOT files, however there is no corresponding ability to read phase space back in from these files.

You tell TOPAS what format to write out by setting:

s:Sc/MyScorer/OutputType = "ASCII" # "Binary", "ASCII," "Limited" or "ROOT"

All formats provide at least ten quantities for each scored particle:

  • X position
  • Y position
  • Z position
  • U (direction cosine of momentum with respect to X)
  • V (direction cosine of momentum with respect to Y)
  • Energy in MeV
  • Weight
  • Particle ID
  • Flag to tell if Third Direction Cosine is Negative (1 means true)
  • Flag to tell if this is the First Scored Particle from this History (1 means true) (Note that this may or may not be the primary, as the primary may or may not have made it all the way to the scoring plane).

The positions are relative to the center of the World.

For the ASCII and Binary formats, you can turn on additional columns of phase space output:

b:Sc/MyScorer/IncludeTOPASTime = "True" # Time used by TimeFeatures for this history
b:Sc/MyScorer/IncludeTimeOfFlight = "True" # Time of Flight of this particle from start of history to scoring plane
b:Sc/MyScorer/IncludeRunID = "True"
b:Sc/MyScorer/IncludeEventID = "True"
b:Sc/MyScorer/IncludeTrackID = "True"
b:Sc/MyScorer/IncludeParentID = "True" # Track ID of parent particle
b:Sc/MyScorer/IncludeCharge = "True"
b:Sc/MyScorer/IncludeCreatorProcess = "True"
b:Sc/MyScorer/IncludeVertexInfo = "True" # Initial KE, Position and Momentum
b:Sc/MyScorer/IncludeSeed = "True"

The last of these gives the four variable parts of a random seed. Replaying this random seed will get you the same event back later. The full random seed should be a file of the form:

Uvec
1878463799
3
1425618182
1466214412

To reuse a saved seed, create a file with the above five lines, replacing the four numeric parts with the four integers in the phase space file. Assuming you name that file event1.rndm, you can then make TOPAS start from this random seed by having TOPAS wake up at the Geant4 command line, by using:

Ts/PauseBeforeSequence = "True"

And then typing:

/random/resetEngineFrom event1.rndm
exit

The phase space scorer and any custom n-tuple scorers buffer output to avoid excessive disk access. You will not generally need to adjust this buffering value, but can adjust if if you wish:

i:Sc/MyScorer/OutputBufferSize = 1000 # Number of particles in phase space buffer

Phase Space Format

Phase Space refers to the technique of saving or replaying a set of particles crossing a given surface.

  • When one saves a phase space, one defines a surface and then saves the position, particle type, energy and momentum of some or all particles crossing that surface.
  • When one replays a phase space, one starts a set of particles from the saved positions, with the saved particle types, energy and momentum.

Phase Space enables separating two parts of a simulation or analysis job, and can be used to transfer sets of particles among different codes.

A Phase Space is stored as a pair of related files:

  • A .header file tells the number of histories, the number of saved particles and the order of information in the .phsp file
  • A .phsp file contains all the details of all the saved particles

We support three formats for Phase Space:

  • Binary is a compact format, with data encoded in a stream of bytes. The header file tells the contents and byte order per particle.
  • ASCII provides the same information as Binary, but presents it as a much less compact, but easier to read simple text file, which data encoded as a series of columns of text. The header file tells the contents and column order per particle.
  • Limited is an alternate binary format compatible with some legacy codes. It has fewer options for what data can be expressed, but is compatible with codes such as that used by Varian for their TrueBeam phase space files.

You can additionally write phase space to ROOT files, however there is no corresponding ability to read phase space back in from these files.

For the Binary and ASCII formats, Particle ID is encoded using the large set of integer codes specified by the Particle Data Group (PDG):

  • 22 = photon
  • 11 = electron
  • -11 = positron
  • 2112 = neutron
  • 2212 = proton
  • Additional codes go all the way up to ten digit ion codes of the form ±10LZZZAAAI.
  • See the PDG web site for a full explanation

For the Limited format, only a few particle codes are supported, while other particle types are not scored at all (and so this format is only recommended if you need to interface with legacy codes):

  • 1 = photon
  • 2 = electron
  • 3 = positron
  • 4 = neutron
  • 5 = proton

The Binary and ASCII formats are self-describing, with the complete column or byte order documented in the associated header file. The exact set of columns will depend on which options are used to create the phase space file. Run the WriteASCII.txt and WriteBinary.txt examples to see these headers.

If you are attempting to create TOPAS Binary or ASCII phase space from some application other than TOPAS, be advised that the formatting requirements are very specific. It is best to compare your phase space header and phsp files to those produced by the TOPAS examples listed above. Some things to watch out for:

  • First line of header has to be exactly as produced by TOPAS, with no extra spaces, tabs, etc.
  • Integer values in the ASCII phase space must not contain decimal points

The Limited format uses the following byte order (the format is not self-describing):

Size Quantity
1 byte
Particle ID
Absolute value gives the particle code
Sign of this value encodes the direction of the 3rd direction cosine
4 bytes
Energy
Absolute value gives the energy in MeV
Sign of this value is set to negative if this is the first scored particle from this history
4 bytes X position
4 bytes Y position
4 bytes Z position
4 bytes U (direction cosine of momentum with respect to X)
4 bytes V (direction cosine of momentum with respect to Y)
4 bytes Weight

Direction cosines are consistent between Binary, ASCII and Limited formats. Descriptions can be found on Wikipedia and on MathWorld. Direction cosines U, V and W correspond to direction cosines alpha, beta and gamma on those sites.

Handling of Empty Histories:

In order to discuss 4D simulations, with applications to MLC sequences, treatment head or gantry motion, gated scoring, patient motion, etc., it is helpful to define some terms.

“Run”: a set of histories for which there is no change in any of the simulation parameters (geometry, particle source characteristics, variance reduction, physics setting or scoring parameters). While it is true that VMAT or Tomo has a continuous beam delivery, for simulation purposes it can be useful to approximate even these continuous therapies by breaking the motion into a set of many static Runs.

“Sequence”: a complete simulation job consisting of one or more Run.

“Empty History”: an original history for which no particles make it into the phsp.

For many simulations, it is not important to know when the empty histories occured during the overall sequence, but only how many empty histories there were. This is Total Empty Histories. But for some 4D simulations, it can be necessary to know which run those empty histories belonged to. This can be important for simulations in which one wants to score statistical information per history, or for when one wants to reproduce a 4D simulation. This is Empty Histories per Run. For debugging purposes, it may also be helpful to have a way to mark not just how many empty histories there were per run, but exactly which histories during that run were the empty ones. This is Empty Histories in Exact Order.

A parameter allows you to change how empty histories are represented in the phase space file:

s:Sc/MyScorer/IncludeEmptyHistories = "None" # "None", "InSequence", "AtEndOfRun" or "AtEndOfFile"

The options have the following effects:

  • The default option, “None”, means that there are no lines in the phase space file itself to represent empty histories (but, as before, the phase space header gives you information about the total number of histories and the number of histories that reached the phase space file, so you can decide the number of empty histories from this).
  • “InSequence” means that new lines will be added to the phase space file itself to tell you that a given history was empty. The line will have zeros for most values but will have a negative number in the Weight column. A negative 1 here means that there was 1 empty history. A negative N here means that there were N consecutive empty histories.
  • “AtEndOfRun” means that empty histories will not be represented in the exact sequence, but instead they will be represented by a single empty history record at the end of each run.
  • “AtEndOfSequence” means that empty histories will not be represented in the exact sequence, but instead they will be represented by a single empty history record at the end of the entire simulation sequence (that is, once all runs are complete).

Filtering Scorers

You may add filters to limit what is scored.

You may assign more than one filter to the same scorer. When you have more than one filter, they work as an “AND”.

You may write your own additional filters (see Custom Filters).

Filter by Generation. Accepts either "Primary" or "Secondary":

s:Sc/MyScorer/OnlyIncludeParticlesOfGeneration = "Primary"

Filter by Charge. Accepts one or more of "Positive", "Negative" or "Neutral":

sv:Sc/MyScorer/OnlyIncludeParticlesCharged = 1 "Negative"
sv:Sc/MyScorer/OnlyIncludeParticlesNotCharged = 1 "Negative"

Filter by Atomic Mass or Number:

i:Sc/MyScorer/OnlyIncludeParticlesOfAtomicMass = 10    # allow all ions of atomic mass 10
i:Sc/MyScorer/OnlyIncludeParticlesNotOfAtomicMass = 10
i:Sc/MyScorer/OnlyIncludeParticlesOfAtomicNumber = 6   # allow all ions of Carbon
i:Sc/MyScorer/OnlyIncludeParticlesNotOfAtomicNumber = 6

Filter by Particle’s Initial Kinetic Energy:

d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKEBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKENotBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKE = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKENot = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKEAbove = 10. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKENotAbove = 10. MeV

When designing energy or momentum filters, keep in mind that since no vacuum is perfect in Geant4 (density can be low but cannot be exactly zero), even particles traveling through "Vacuum" will experience some energy loss.

Filter by Particle’s Initial Momentum:

d:Sc/MyScorer/OnlyIncludeParticlesWithInitialMomentumBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialMomentumNotBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialMomentum = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialMomentumNot = 1. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialMomentumAbove = 10. MeV
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialMomentumNotAbove = 10. MeV

Filter by Kinetic Energy of Particle or its Ancestor when it hit the Scoring Component (excludes any particles descended from primaries that originated in the component):

d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKEBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKENotBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKE = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKENot = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKEAbove = 10. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKENotAbove = 10. MeV

Filter by Momentum of Particle or its Ancestor when it hit the Scoring Component (excludes any particles descended from primaries that originated in the component):

d:Sc/MyScorer/OnlyIncludeIfIncidentParticleMomentumBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleMomentumNotBelow = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleMomentum = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleMomentumNot = 1. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleMomentumAbove = 10. MeV
d:Sc/MyScorer/OnlyIncludeIfIncidentParticleMomentumNotAbove = 10. MeV

Filter by Name of Particle or its Ancestor when it hit the Scoring Component (excludes any particles descended from primaries that originated in the component):

sv:Sc//OnlyIncludeIfIncidentParticlesNamed = 1 "proton"
sv:Sc//OnlyIncludeIfIncidentParticlesNotNamed = 1 "proton"

Filter by Origin Process of Particle or its Ancestor when it hit the Scoring Component (excludes any particles descended from primaries that originated in the component):

sv:Sc//OnlyIncludeIfIncidentParticlesFromProcess = 1 "hIoni"
sv:Sc//OnlyIncludeIfIncidentParticlesNotFromProcess = 1 "hIoni"

Filter by Generation of Particle or its Ancestor when it hit the Scoring Component (excludes any particles descended from primaries that originated in the component):

s:Sc/MyScorer/OnlyIncludeIfIncidentParticlesOfGeneration = "Primary"

Filter by Process that created the particle. Allows one or more process name:

sv:Sc/MyScorer/OnlyIncludeParticlesFromProcess = 2 "hIoni" "eBrem"
sv:Sc/MyScorer/OnlyIncludeParticlesNotFromProcess = 2 "hIoni" "eBrem"

Filter by Process that created the particle or any of its ancestors:

sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorFromProcess = 2 "hIoni" "eBrem"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotFromProcess = 2 "hIoni" "eBrem"

Filter by Particle Name:

sv:Sc/MyScorer/OnlyIncludeParticlesNamed = 2 "proton" "neutron"
sv:Sc/MyScorer/OnlyIncludeParticlesNotNamed = 2 "proton" "neutron"

Filter by Particle Name or the name of any of the particle’s ancestors. Use this to, for example, score all charge that results from neutrons, even if the final particle is not a neutron:

sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNamed = 1 "neutron"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotNamed = 1 "neutron"

Particle names are as described here.

Filter by Particle’s Origin Volume, Component, or Component and Subcomponents:

sv:Sc/MyScorer/OnlyIncludeParticlesFromVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeParticlesNotFromVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeParticlesFromComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeParticlesNotFromComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeParticlesFromComponentOrSubComponentsOf = 1 "Nozzle"
sv:Sc/MyScorer/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf = 1 "Nozzle"

If you specify multiple Volume or Component names, this is interpreted as an “OR”, not “AND”.

You will see that you can specify a single Volume or a Component.

sv:Sc/OnlyIncludeParticlesFromVolume/OnlyIncludeParticlesFromVolume = 2 “World” “Foil” sv:Sc/OnlyIncludeParticlesFromComponent/OnlyIncludeParticlesFromComponent = 2 “World” “Foil”

If the Component is a simple one, like a box or a sphere, then the component only has a single G4Volume, so the two are functionally identical. But if the Component is a more complicated one, like a Range Modulator Wheel, then there are multiple G4Volumes in the Component, and the latter would allow one to do things like tell just which particles interacted in the Wheel’s “stop block”.

Filter by Particle or its Ancestor’s Origin Volume, Component, or Component and Subcomponents:

sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorFromVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotFromVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorFromComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotFromComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf = 1 "Nozzle"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf = 1 "Nozzle"

Filter by whether Particle Interacted in Volume, Component, or Component and Subcomponents:

sv:Sc/MyScorer/OnlyIncludeIfParticleInteractedInVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleNotInteractedInVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleInteractedInComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleNotInteractedInComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf = 1 "Nozzle"
sv:Sc/MyScorer/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf = 1 "Nozzle"

Filter by Particle or its Ancestor Interacted in Volume, Component, or Component and Subcomponents:

sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorInteractedInVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorInteractedInComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf = 1 "Nozzle"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf = 1 "Nozzle"

Filter by how many times the particle has Interacted since it was created. This allows one to separate, for example, dose from primary, versus first scatter, versus multiple scatter:

i:Sc//OnlyIncludeParticlesWithInteractionCountBelow
i:Sc//OnlyIncludeParticlesWithInteractionCountNotBelow
i:Sc//OnlyIncludeParticlesWithInteractionCount
i:Sc//OnlyIncludeParticlesWithInteractionCountNot
i:Sc//OnlyIncludeParticlesWithInteractionCountAbove
i:Sc//OnlyIncludeParticlesWithInteractionCountNotAbove

Filter by whether Particle Traversed Volume, Component, or Component and Subcomponents:

sv:Sc/MyScorer/OnlyIncludeIfParticleTraversedVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleNotTraversedVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleTraversedComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleNotTraversedComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf = 1 "Nozzle"
sv:Sc/MyScorer/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf = 1 "Nozzle"

Filter by Particle or its Ancestor Traversed Volume, Component, or Component and Subcomponents:

sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorTraversedVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotTraversedVolume = 1 "Propeller20/Leaf"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorTraversedComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotTraversedComponent = 1 "Jaws"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf = 1 "Nozzle"
sv:Sc/MyScorer/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf = 1 "Nozzle"

Filter by material:

sv:Sc/MyScorer/OnlyIncludeIfInMaterial = 2 "G4_WATER" "Air"
sv:Sc/MyScorer/OnlyIncludeIfNotInMaterial = 2 "G4_WATER" "Air"

Note that in this case, the material name must exactly match the case defined in Geant4. To check what materials have been defined, add the parameter:

i:Ma/Verbosity = 1

Filter on DICOM RT Structure Sets: A structure set is an extra file in the DICOM directory that provides information on structures such as organs, tumors, PTVs, etc. that have been outlined (contoured) in the planing process. The data is stored as a set of polygons, up to one per slice for each contoured structure. TOPAS can color code DICOM components according to this structure information (see Patient in DICOM Format) and can filter scoring based on these structures:

sv:Sc/MyScorer/OnlyIncludeIfInRTStructure = 2 "R_LUNG" "L_LUNG"

If the structure name includes a space, substitute an underscore in the parameter. So, for example, if the structure name is “R LUNG”, you should supply the parameter as “R_LUNG”.

The scored value is set to -1 if the given voxel is not in one of the named structures.

For Surface Scorers, you can also filter by whether particle is going "In" or "Out" of scoring surface. Omit this filter to allow either option:

s:Sc/MyScorer/OnlyIncludeParticlesGoing = "In"

You may specify more than one filter. For example, to score protons with initial KE over 100 MeV:

sv:Sc/MyScorer/OnlyIncludeParticlesNamed = 1 "proton"
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV # minimum energy

You can invert the results of all previous filters by adding the InvertFilter:

b:Sc/MyScorer/InvertFilter = "True"

The InvertFilter inverts the final result of the full set of other filters. Thus, the following would score only particles that are NOT ( (proton OR neutron) AND have initial KE larger than 100. MeV ). Note the double parenthesis after the NOT. The NOT applies to the overall result from the set of other filters:

sv:Sc/MyScorer/OnlyIncludeParticlesNamed = 2 "proton" "neutron"
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV # minimum energy
b:Sc/MyScorer/InvertFilter = "True"

Just to be more clear here: the InvertFilter is applied After all the other filters have been evaluated. It inverts the Total result of the other filters (rather than inverting them one at a time).

So, if you have filters:

A
B

Then the result is to allow particles that pass A AND B.

If you have filters:

A
B
Invert

Then the result is to allow particles that DO NOT PASS (A AND B) which is logically equivalent to:

(NOT A) OR (NOT B)

(see how the And was replaced by an Or here)

And, as with any TOPAS parameter statement, it does not matter what order these lines are in the parameter file.

Any filter property can be set by Time Features if you wish, to produce time-dependent filtering.

Output Specification

Scored quantities can be output to simple files (csv or binary formats), data files for use in analysis systems (ROOT or XML format) or to a DICOM file. There are also options to directly produce Volume Histograms (such as DVH).

Common Parameters

To specify output file name:

s:Sc/MyScorer/OutputFile = "myOutputFileName" # if null, use scorer name, e.g. "MyScorer"

Note that this can be more than just a file name - it can include a relative or absolute file path, as in:

   s:Sc/MyScorer/OutputFile = "../myOutputFileName" # one directory above current directory
   s:Sc/MyScorer/OutputFile = "~/SomeSubdirectory/myOutputFileName"

d

If you are outputting to ROOT or XML, the above only affects the name of a particular histograph within your overall ROOT or XML file. But the name of the overall ROOT or XML file is set by a different parameter:

s:Sc/RootFileName = “topas” # name for ROOT output file s:Sc/XmlFileName = “topas” # name for XML output file

To specify output file type for all except the Phase Space Scorer:

s:Sc/MyScorer/OutputType = "csv" # "csv", "binary", "Root", "Xml" or "DICOM"

For binary output of 3D data, such as from scoring in a water phantom or a patient, the following table shows the correspondence between TOPAS divisions and common 3D data viewing applications:

TOPAS fNi (X/R/R) fNj (Y/Phi/Phi) fNk (Z/Z/Theta)
ImageJ Width Height Images
ParaView X Y Z
Amide X Y Z
Numpy Use the python module topas2numpy

By default, output will occur just once, after the entire session. But if you are using Time Features and wish to have separate output from specific runs:

b:Sc/MyScorer/OutputAfterRun = "True" # set True to trigger output of scorer after this run
# If this is always set False, or not defined, we just output at the end of the session.
# If this is always set True, we output after every run.

Additional output control options:

b:Sc/MyScorer/OutputToConsole = "True" # control whether output is also dumped to console
s:Sc/MyScorer/IfOutputFileAlreadyExists = "Increment" # "Exit", "Overwrite" or "Increment"

We keep name and type separate in the above so that one can do things like change all output from csv to AIDA by just changing a single parameter (by setting many OutputType parameters equal to a common relative string paramater).

DICOM Output

DICOM output is handled through the package GDCM, which is pre-built into TOPAS.

DICOM output is in the form of .dcm files that contains DICOM header information (voxel size, spacing, etc.) and then a block of binary image data representing the 3D output. We use the DICOM output format called RTDOSE. Each pixel is represented by a 16 or 32 bit integer.

  • 16 bit is the default.

  • For 32 bit, specify:

    b:Sc/MyScorer/DICOMOutput32BitsPerPixel = "True"
    

TOPAS DICOM output will have a TOPAS-specific root UID:

  • 1.2.826.0.1.3680043.9.5871.

TOPAS can use information from your DICOM dataset so that scored results can be more easily compared to those from treatment planning systems. Some metadata tags (e.g. Study Instance UID, Frame of Reference UID) are copied from input DICOM (TsDicomPatient) to output DICOM (the scorer), which is important for data provenance:

  • The metadata source can be specified by the parameter: ReferencedDicomPatient. This is helpful when scoring on a TsBox.
  • Otherwise, the metadata is copied from the scorer’s Component (if it is a TsDicomPatient)
  • Otherwise, the metadata is generated by TOPAS

Other metadata tags (SOP Instance UID, Series Instance UID, Series Description, Manufacturer, Manufacturer’s Model Name, Dates and Times) are set appropriately.

It is also possible to set a custom Series Description using the SeriesDescription parameter:

s:Sc/MyScorer/SeriesDescription = "Custom description here"

TOPAS can automatically create a Scoring Grid that exactly matches a provided RTDOSE file in your DICOM dataset. This makes it easier to compare TOPAS results to Treatment Planning System results. See Patient in DICOM Format for more details.

Histogram Output

“Root” and “Xml” will generate histogram files. Specify the binning of the scored quantity as follows:

i:Sc/MyScorer/HistogramBins = 100 # number of bins
d:Sc/MyScorer/HistogramMin = 0. MeV # with unit appropriate to scored quantity
d:Sc/MyScorer/HistogramMax = 100. MeV # with unit appropriate to scored quantity

Histograms will be either 1D or 2D depending on how the scoring geometry is divided or the energy is binned (see Binning by Energy).

  • If the geometry is undivided and there is no energy binning, a 1D histogram is produced.
  • If the geometry is undivided and there is energy binning, the second histogram axes will be energy.
  • If the geometry is divided, it can only be divided in one dimension (such as either X, Y or Z for TsBox geometries) and there can be no energy binning. The second histogram axes will be the axes of the geometry division.

All histogram output is combined into a single file, such as topas.root or topas.xml. The histogram file name can be adjusted by:

s:Sc/RootFileName = "topas" # name for ROOT output file
s:Sc/XmlFileName = "topas" # name for XML output file

DVH Output

Physicists often report the quality of a treatment plan by showing Dose Volume Histograms (DVHs). Such histograms represent what fractional volume of a given structure has received a given Dose.

  • In a differential DVH, the bin value indicates what percentage of the structure volume received the given dose.
  • In a cumulative DVH, the bin value indicates what percentage of the structure volume received at least the given dose (the zeroth bin will always have a value of 1, since all bins receive at least zero dose).
  • If you combine TOPAS DVH options with the filtering option OnlyIncludeIfInRTStructure (see Filtering Scorers), you can generate a DVH for a specific contoured structure (such as DVH to R_LUNG).

TOPAS can generate a Volume Histogram for any scored quantity, not just Dose. Just set the scorer’s report parameter to include either "DifferentialVolumeHistogram" or "CumulativeVolumeHistogram", as in:

sv:Sc/DoseAtPhantom/Report = 1 "CumulativeVolumeHistogram"

You cannot specify both types of volume histograms in a single scorer, but you can specify other reporting options, such as the following, which will give a basic histogram of "Sum" and "Mean", plus a "CumulativeVolumeHistogram":

sv:Sc/DoseAtPhantom/Report = 3 "Sum" "Mean" "CumulativeVolumeHistogram"

As with any histogram, you also need to specify HistogramBins, HistogramMin and HistogramMax. For an example, see DoseVolumeHistogram.txt.

If your results has a 1 in the first bin and zero in the other bins, it probably means your HistogramMax was set too high, and thus none of the voxels had enough dose to get beyond the zeroth bin.

Phasespace Output

To specify output file type for the phase space scorer:

s:Sc/MyScorer/OutputType = "ASCII" # "ASCII" or "Binary"

ASCII format has the advantage that it is human-readable text. Binary format has the advantage that it is much more compact, hence suitable for large files.

Miscellaneous

Binning in Dividable Components

When scoring in Dividable Components (TsBox, TsCylinder or TsSphere), you have many binning options. By default, binning will match the divisions of the volume. So if you have divided the component, the score will be divided in the same manner.

You are also free to specify some other binning.

  • In a TsBox, you can specify binning in X, Y and Z:

    i:Sc/MyScorer/XBins = 512
    i:Sc/MyScorer/YBins = 512
    i:Sc/MyScorer/ZBins = 256
    
  • In a TsCylinder, you can specify binning in R, Phi and Z:

    i:Sc/MyScorer/RBins = 100
    i:Sc/MyScorer/PhiBins = 20
    i:Sc/MyScorer/ZBins = 1
    
  • In a TsSphere, you can specify binning in R, Phi and Theta:

    i:Sc/MyScorer/RBins = 20
    i:Sc/MyScorer/PhiBins = 20
    i:Sc/MyScorer/ThetaBins = 1
    

Behind the scenes, TOPAS uses Geant4’s parallel worlds system to support this binning flexibility. When scoring binning is different from the component’s natural binning, TOPAS actually scores in a parallel world copy of the component. This is all done automatically.

Because TOPAS is a fully 3D code, letting you design beams to come from any side, bin 0 may be the first bin hit by the beam, but may also be the last bin hit by the beam. So do not be surprised if beam profiles are the opposite of what you might have expected. If it is important to you that bin 0 be the first bin hit, you may need to change your beam position and direction, or rotate your scoring component by 180 degrees.

Binning by Energy

Any scorer can be binned by particle energy, by adding the following parameters:

i:Sc/MyScorer/EBins = 10 # defaults to 1, that is, un-binned
d:Sc/MyScorer/EBinMin = 0. MeV # defaults to zero
d:Sc/MyScorer/EBinMax = 100. MeV # must be specified if EBins is greater than 1

Note that there are several options for what me mean here by “particle energy.”

From our proton therapy dose calculation roots, the energy binning that we do by default is based not on the energy of the final particle at hit deposition time but instead on the incident particle energy. This is the energy of the final scored particle, or its ancestor, when that particle or ancestor was first incident on the scoring volume.

However, users who have been trying to use this feature to get a spectrum instead need the particle’s energy at the current step.

So we have now have a parameter to control what kind of Energy we use for this binning.:

s:Sc/MyScorer/EBinEnergy = "IncidentTrack" # "IncidentTrack", "PreStep" or "DepositedInStep"
  • “IncidentTrack” is the behavior we have had in the past, the energy that the particle or its ancestor had when it first was incident on the scoring component. This remains the default.
  • “PreStep” is the track’s energy at the start of the current step.
  • “DepositedInStep” is the amount of energy deposited in the current step.

An example shows the effect of the three different choices:

examples/Scoring/EnergyDepositBinnedByEnergy.txt

The output will include two extra bins, one for underflow (energy < EBinMin), one for overflow (energy > EBinMax). And if you have set EBinEnergy to IncidentTrack, there will be one more bin to hold those deposits for which there is no incident track (the primary particle was created already inside the scoring component, so neither it nor any ancestor of it was ever incident upon the scoring component).

Binning by Time

Any scorer can be binned by time-of-flight, the elapsed time since the history was generated (in Geant4 this is called “global time”):

i:Sc/MyScorer/TimeBins = 10 # defaults to 0, that is, un-binned
d:Sc/MyScorer/TimeBinMin = 0. ns # defaults to zero
d:Sc/MyScorer/TimeBinMax = 100. ns # must be specified if TimeBins is greater than 1

The output will include two extra bins, one for underflow (time < TimeBinMin) and one for overflow (time > TimeBinMax). Note that this time-of-flight is not the same as the TOPAS time feature time. To split results based on that TOPAS time, see Splitting by Time Feature.

When radioactive decay is present, some very large times can occur, as decay may be delayed for hours or days. Thus it is not unusual to have some times exceed the TimeBinMax. To get an interesting report on what particles and processes exceed TimeBinMax, set Ts/TrackingVerbosity > 0.

Splitting by Time Feature

To split a scorer into separate scorers depending on the current value of any selected Time Feature:

s:Sc/MyScorer/SplitByTimeFeature = some_time_feature_name

If the time feature is a Step function, one split scorer is made for each of the time feature’s values. If the time feature is a Continuous function, another parameter is expected to specify split values. This will be either a dimensioned double vector, unitless vector or integer vector, depending on the type of controlling time feature, such as:

dv:Sc/DoseAtPhantom/SplitByTimeFeatureValues = 5 0. 90. 180. 270. 360. deg

Example 1 - Splitting under control of a Step Time Feature

To split up a 4D CT simulation’s dose output depending on the CT time slice, where the CT time slice is controlled by:

s:Tf/ImageName/Function = "Step"
sv:Tf/ImageName/Values = 3 "image1" "image2" "image3"

The following will make the scorer DoseAtPhantom split by current value of Tf/ImageName/Value:

s:Sc/DoseAtPhantom/SplitByTimeFeature = "ImageName"

creating one scorer for each value of ImageName:

Sc/DoseAtPhantom-image1
Sc/DoseAtPhantom-image2
Sc/DoseAtPhantom-image3

Example 2 - Splitting under control of a Continuous Time Feature

To split up a simulation’s dose output depending on the position of a propeller, where the propeller position is controlled by:

s:Tf/PropellerRotation/Function = "Linear deg"

The following will make DoseAtPhantom split by current value of Tf/PropellerRotation/Value:

s:Sc/DoseAtPhantom/SplitByTimeFeature = "PropellerRotation"
dv:Sc/DoseAtPhantom/SplitByTimeFeatureValues = 5 0. 90. 180. 270. 360. deg

creating one scorer for each defined range of PropellerRotation:

Sc/DoseAtPhantom-0.-90.deg
Sc/DoseAtPhantom-90.-180.deg
Sc/DoseAtPhantom-180.-270.deg
Sc/DoseAtPhantom-270.-360.deg

See the SplitByTimeFeature.txt and DoseTo4DCT.txt examples.

Statistical Information

By default, scorers will report the sum of the scored quantity over all histories, but many additional reporting options are available:

sv:Sc/MyScorer/Report = 1 "Sum" # One or more of Sum, Mean, Histories, Count_In_Bin, Second_Moment, Variance, Standard_Deviation, Min, Max

Output columns will be in the same order as the values in the Report parameter.

When there is binning by energy or time, and there is more than one Report option (such as "Sum" and "Mean"), the output will be ordered as:

  • Sum (underflow), Mean (underflow), Sum (bin 1), Mean (bin 1), Sum (bin 2), Mean (bin 2), etc.

"Histories" is the total number of histories that were simulated while this scorer was active (that is, excludes any histories that were produced when this scorer was gated to inactive).

"Count_In_Bin" is the number of histories that contributed to this bin (that is, excludes any histories for which no particles hit this bin).

If only "Sum" is requested, simple accumulation is used. If "Mean", "Second_Moment", "Variance" or "Standard_Deviation" is requested, accumulation uses a numerically stable algorithm from: Donald E. Knuth (1998). The Art of Computer Programming, volume 2: Seminumerical Algorithms, 3rd edn., p. 232. Boston: Addison-Wesley:

for x in data:
    n = n+1
    delta = x - mean
    mean = mean + delta/n
    M2 = M2 + delta*(x - mean)
sum = n * mean
variance = M2/(n - 1)
standard deviation = sqrt(variance)

Note that if your geometry has many divisions (such as the 70M voxels of a 512 x 512 x 256 CT), and you ask for "Mean", "Second_Moment", "Variance" or "Standard_Deviation", you will see a speed penalty. This occurs because any bin that has ever been hit will then have to recalculate its mean or second moment to account for the new history (even if the current history doesn’t hit this bin).

TOPAS calculates the variance (and hence the standard deviation) associated with the distribution of the quantity of interest (dose, fluence, etc).

  • For the standard deviation of the mean value, divide the standard deviation from TOPAS by the square root of the total number of histories.
  • For the standard deviation of the sum, multiply the standard deviation from TOPAS by the square root of the total number of histories.

Change Component Color Based on Scoring

You can make TOPAS recolor a component during simulation to reflect a scored value. Using this technique, you can, for example, make a box become darker as it accumulates dose. See the Darkening.txt example.

To activate this feature:

s:Sc/EnergyInPhantom/ColorBy = "Sum" # sum, mean, histories, standard_deviation, min, max

You must then provide a list of colors, and cutoff values, such as:

sv:Sc/EnergyInPhantom/ColorNames = 5 "white" "grey240" "grey220" "grey200" "grey180"
dv:Sc/EnergyInPhantom/ColorValues = 4 1. 1000 2000 3000 MeV

In the above example:

  • if the total energy is from 0 to 1, the phantom will be colored "White".
  • if the total energy is from 1 to 1000, the phantom will be colored "grey240".
  • if the total energy is from 1000 to 2000, the phantom will be colored "grey220".
  • etc.

This feature must be used in conjunction with Time Features, as the color will only update after each run. And your scorer must be set to output after each run:

b:Sc/EnergyInPhantom/OutputAfterRun = "True"

This technique does not currently work in the Dividable Components (TsBox, TsCylinder and TsSphere). We will add this capability in a future TOPAS release. For now it only works in simple components made of single Geant4 solids.

Toggling a Scorer Off and On

To turn off a scorer:

b:Sc/MyScorer/Active = "False" # defaults to "True"

This feature can be combined with boolean Time Features to produce gated scoring. If the scorer skipped any values due to being set inactive at any time, the total number of skipped values is written out at in the scoring summary.

Restoring Results from Files

TOPAS provides an option to read back scored values so that you can then redo the scoring output with different options. Set the parameter:

Ts/RestoreResultsFromFile = "True" # defaults to "False"

With this set, simulation will not be run, but instead the scored values will be restored from the output of previous TOPAS simulations. For each scorer, there must be an appropriate file to read back, specified by name and type:

s:Sc/MyScorer1/InputFile = "MySavedFileName" # match exact case
s:Sc/MyScorer1/InputType = "csv"

The file to read back in must contain the appropriate scored quantity, the appropriate binning, and sufficient information to provide the new Report options. So, for example, if you previously scored "Sum" and "Histories", you could now report "Sum", "Mean", "Histories", and a DVH.

This option is particularly handy if you have been using Outcome Modeling. You can run additional Outcome Model calculations, or repeat previous calculations with different model parameters, without having to repeat the full simulation.

This option can also be used to read in binary output and write out csv, or vice versa.

Graphics

You may have zero, one or more graphics windows active at same time:

s:Gr/MyGraphic1/Type = "OpenGL" # OpenGL, HepRep, VRML, DAWN, RayTracer, RayTracerX

Note that the file-based graphics systems, HepRep, VRML and DAWN may not show any image until at least one history is run. We will revisit this issue when we move to the next Geant4 version.

HepRep files are designed to be viewed in a Java application called HepRApp. Details can be found here.

Note that graphics can be one of the slowest parts of a simulation, so should be disabled if you are running a long simulation. To disable graphics, do one of the following three things:

  • Comment out all of the Gr/*/Type parameters
  • Set all Gr/*/Active to “False”
  • Disable graphics entirely, by setting: b:Gr/Enable = "False"

This last option is essential of you want to run on a batch system that does not contain any OpenGL graphics drivers.

File-based graphics systems will also expect a file name:

s:Gr/MyGraphic1/FileName = "MyFileName" # Defaults to name of view (which here is MyGraphic1).

Will use this filename plus an _n where n increments with each refresh. Due to limitations in Geant4, FileName only affects OpenGL and HepRep. For other cases, the file name is a fixed value, g4_ followed by a file number.

This can be more than just a file name - it can include a relative or absolute file path, as in:

s:Gr/MyGraphic1/FileName = "../MyFileName" # one directory above current directory
s:Gr/MyGraphic1/FileName = "~/SomeSubdirectory/MyFileName"

Basic options:

b:Gr/MyGraphic1/IncludeGeometry = "True" # defaults to "True"
b:Gr/MyGraphic1/IncludeTrajectories = "True" # defaults to "True"
b:Gr/MyGraphic1/IncludeStepPoints = "True" # Show trajectory step points, defaults to "False"

Colors are defined by specifying their red, green, blue components, each on a scale of 0 to 255, as in:

iv:Gr/Color/lightblue = 3 175 255 255

You can optionally provide a fourth value to make colors transparent. This value is called Alpha, with 0 being completely transparent (no color at all) and 255 being fully opaque (the default). So for example, to be 50% transparent:

iv:Gr/Color/transparentred = 3 255 255 255 126

By default, trajectories will be drawn as what Geant4 calls “Smooth Trajectories”, which means they include additional points to make them curve smoothly in a magnetic field. Geant4 does not actually use these “auxiliary points” in its simulation results, they are just present to make visualization in a field look better. In some cases, Geant4 has trouble handling these auxiliary points, and reports:

``!!!!!!!! Filter: auxiliary points are being memory leaked !!!!!``

To work around this, turn off trajectory drawing or tell Geant4 not to making the trajectories smooth:

b:Gr/MyGraphic1/UseSmoothTrajectories = "False" # defaults to "True"

You can add axes to the display. Axes lines are colored red for X, green for Y, blue for Z:

b:Gr/MyGraphic1/IncludeAxes = "True" # defaults to "False"
s:Gr/MyGraphic1/AxesComponent = "World" # Component in which to center the axes. Defaults to World.
d:Gr/MyGraphic1/AxesSize = 3. m # size of axes

Note that on most OpenGL graphics systems, the shadowing on the arrowheads allows you to tell whether a given axis is coming towards or away from you.

You can visualize magnetic fields, with field intensity and direction depicted through a set of arrows:

i:Gr/ViewA/MagneticFieldArrowDensity = 10

Use with caution. When combined with rotation seems to sometimes cause crashes in polycone drawing (involved in drawing the arrowheads).

By default, graphics views will refresh after every run. But you can change this to show each history individually or to accumulate all histories for the entire session (multiple runs). This applies globally to all graphics views:

s:Gr/RefreshEvery = "History" # "History", "Run" or "Session"

If parallel worlds are present, by default they will be visible. If you instead want to see only the main world, specify:

sv:Gr/MyGraphic1/VisibleWorlds = 1 "World" # "World", "All" or one or more specific world names

To turn off a graphic:

b:Gr/MyGraphic1/Active = "False" # defaults to "True"

Extra options used by OpenGL:

u:Gr/MyGraphic1/Zoom = 2. # increase to zoom in, decrease to zoom out
d:Gr/MyGraphic1/Theta = 45. deg # view angle as in /vis/viewer/set/viewpointThetaPhi
d:Gr/MyGraphic1/Phi = 45. deg # view angle as in /vis/viewer/set/viewpointThetaPhi
u:Gr/MyGraphic1/TransX = 0. # move left or right in the view window
d:Gr/MyGraphic1/TransY = 0. # move up or down in the view window
s:Gr/MyGraphic1/Projection = "Perspective" # Defaults to "Orthogonal"
d:Gr/MyGraphic1/PerspectiveAngle = 10. deg # Increase for stronger perspective effect
i:Gr/MyGraphic1/WindowSizeX = 600
i:Gr/MyGraphic1/WindowSizeY = 600
i:Gr/MyGraphic1/WindowPosX = 0
i:Gr/MyGraphic1/WindowPosY = 0
b:Gr/MyGraphic1/HiddenLineRemovalForGeometry = "False" # Remove hidden lines from wireframe geometries, like Geant4’s /vis/viewer/set/hiddenEdge
b:Gr/MyGraphic1/HiddenLineRemovalForTrajectories = "False" # Remove hidden trajectories lines from within geometries, like Geant4’s /vis/viewer/set/hiddenMarker

You can tell TOPAs to center the graphics on a given component:

s:Gr/*/CenterOn = “MyComponent”

Topas will then ignore any parameters of the form:

Gr//TransX or Gr//TransY.

You can scale the image by different amounts in each dimension:

uv:Gr/*/Scale = 3 1. 2. 3.

would scale by 1 in X, by 2 in Y and by 3 in Z.

Zooming to the Nanometer Scale: With very large Gr/*/Zoom values, as one might use to zoom into the nano scale, floating point errors in the graphics card lead to discontinuous jumps in the image position. This makes it difficult to center or size the view as one wishes. An easy workaround has been understood. If one simply makes the world invisible, then because the initial graphics extent only includes the nanometer scale components, one doesn’t need much zoom. This effect and its solution are demonstrated in the example:

examples/Graphics/NanoMeterScaleTest.txt

You can set Topas so that for OpenGL views, the view is copied to a file at the end of each run:

b:Gr/MyGraphic1/CopyOpenGLToPDF = "True" # save to PDF
b:Gr/MyGraphic1/CopyOpenGLToSVG = "True" # save to Scalable Vector Graphics
b:Gr/MyGraphic1/CopyOpenGLToEPS = "True" # save to Encapsulated PostScript
b:Gr/MyGraphic1/CopyOpenGLToPS  = "True" # save to PostScript

Some views may result in one of the following warning messages from Geant4 Visualization. These messages are just informational and can be safely ignored. Note that even if you have set Gr/RefreshEvery = "History", the view will only be copied to a file at the end of the run (not per history).

"WARNING: Viewpoint direction is very close to the up vector direction.
Consider setting the up vector to obtain definable behavior."

"G4PhysicalVolumeSearchScene::FindVolume:
Required volume "Phantom3_10x10x1", copy no. 0, found more than once.
This function is not smart enough to distinguish identical physical volumes which
have different parentage. It is tricky to specify in general. This function gives
you access to the first occurrence only."

To create movies, Zoom, Theta, Phi, TransX, TransY, Projection and PerspectiveAngle can be controlled by Time Features.

Trajectory Coloring:

s:Gr/MyGraphic1/ColorBy = "Charge" # "Charge", "ParticleType", "OriginComponent", "Energy", "Momentum", "Generation", "CreatorProcess"

For ColorBy = "Charge", trajectories default to red, greed, blue for negative, neutral and positive. You can override these defaults with:

sv:Gr/MyGraphic1/ColorByChargeColors = 3 "blue" "green" "red" # colors for neg, neutral, pos

For ColorBy = "ParticleType", colors are Geant4 defaults:

Particle Species Color
gamma green
e- red
e+ blue
pi+ magenta
proton cyan
neutron yellow
other gray

You can override these settings with (particle names are described here):

sv:Gr/MyGraphic1/ColorByParticleTypeNames = 4 "e-" "gamma" "proton" "neutron" # any number of particle names
sv:Gr/MyGraphic1/ColorByParticleTypeColors = 4 "red" "green" "blue" "yellow" # for each particle type above. All other particles will be set to grey.

For ColorBy = "OriginVolume", trajectories are grey unless they come from a named volume in:

sv:Gr/MyGraphic1/ColorByOriginVolumeNames = 1 "Propeller20/Leaf" # one or more volume
sv:Gr/MyGraphic1/ColorByOriginVolumeColors = 1 "red" # one color for each name above

For ColorBy = "OriginComponent", trajectories are grey unless they come from a named component in:

sv:Gr/MyGraphic1/ColorByOriginComponentNames = 1 "jaws" # one or more component names
sv:Gr/MyGraphic1/ColorByOriginComponentColors = 1 "red" # one color for each name above

For ColorBy = "ColorByOriginComponentOrSubComponentOf", trajectories are grey unless they come from a named component or any of its subcomponents in:

sv:Gr/MyGraphic1/ColorByOriginComponentNames = 1 "Nozzle" # one or more components
sv:Gr/MyGraphic1/ColorByOriginComponentColors = 1 "red" # one color for each name above

For ColorBy = "Energy":

dv:Gr/MyGraphic1/ColorByEnergyRanges = 3 1. 4. 8. MeV # limits of energy ranges
sv:Gr/MyGraphic1/ColorByEnergyColors = 4 "red" "green" "blue" "yellow" # one for every energy interval that is defined by those ranges - one more value than number of ranges since includes less than first range value and greater than first range value

For ColorBy = "Momentum":

dv:Gr/MyGraphic1/ColorByMomentumRanges = 3 1. 4. 8. MeV # limits of momentum ranges
sv:Gr/MyGraphic1/ColorByMomentumColors = 4 "red" "green" "blue" "yellow" # one for every energy interval that is defined by those ranges - one more value than number of ranges since includes less than first range value and greater than first range value

For ColorBy = "Generation":

sv:Gr/MyGraphic1/ColorByGenerationColors = 2 "red" "green" # colors for primary and secondaries

For ColorBy = "CreatorProcess":

sv:Gr/MyGraphic1/ColorByCreatorProcessNames = 5 "eBrem" "annihil" "Decay" "eIoni" "hIoni" # one or more process name
sv:Gr/MyGraphic1/ColorByCreatorProcessColors = 5 "red" "green" "blue" "yellow" "magenta" # one for every process name

To filter what trajectories will be in the graphics, use similar syntax to that used for Filtering Scorers and Filtering Sources (applies globally to all graphics views):

sv:Gr/OnlyIncludeParticlesNamed = 2 "proton" "neutron" # one or more particle names
sv:Gr/OnlyIncludeParticlesCharged = 1 "negative" # one or more "positive", "negative" or "neutral"
sv:Gr/OnlyIncludeParticlesFromVolume = 1 "Propeller20/Leaf" # one or more volume
sv:Gr/OnlyIncludeParticlesFromComponent = 1 "Jaws" # one or more component
sv:Gr/OnlyIncludeParticlesFromComponentOrSubComponentsOf = 1 "Nozzle" one or more
d:Gr/OnlyIncludeParticlesWithInitialKEBelow = 1. MeV # maximum energy
d:Gr/OnlyIncludeParticlesWithInitialKEAbove = 10. MeV # minimum energy
d:Gr/OnlyIncludeParticlesWithInitialMomentumBelow = 1. MeV # maximum momentum
d:Gr/OnlyIncludeParticlesWithInitialMomentumAbove = 10. MeV # minimum momentum
sv:Gr/OnlyIncludeParticlesFromProcess = 1 "hIoni" # one or more process name

Note that the following three filters may cause a crash if the particle origin is at the world boundary:

sv:Gr/OnlyIncludeParticlesFromVolume
sv:Gr/OnlyIncludeParticlesFromComponent
sv:Gr/OnlyIncludeParticlesFromComponentOrSubComponentsOf

We will study this issue again when we move to the next Geant4 version.

Visualization control for a specific component is done as part of the Ge/ parameters for that component rather than in the Gr/ parameters:

s:Ge/MyComponent/Color = "red"
s:Ge/MyComponent/DrawingStyle = "Solid" # "Solid", "Wireframe" or "FullWireFrame".
# FullWireFrame includes drawing of additional edge lines that Geant4 calls "soft edges"
# - on many graphics devices WireFrame and FullWireFrame give the same result
i:Ge/MyComponent/VisSegsPerCircle = 100 # Number of line segments to use to approximate a circle, defaults to 24. Set to a larger number if you want a smoother curve
b:Ge/MyComponent/Invisible = "True" # defaults to False meaning visible

We sometimes see error messages from visualization of the following form:

G4PhysicalVolumeSearchScene::FindVolume:
Required volume "PhantomCentralDose_1x1x40", copy no. 0, found more than once...

Such messages can be ignored. They do not affect the simulation results. We will revisit how to solve these error messages once we move to the next Geant4 version.

Time Features

While the repeatability requirements of the TOPAS parameter system require that parameter definitions be well specified, there is still a need to define time-dependent behaviors (such as motion, beam current modulation, starting and stopping of scoring activities). The TOPAS Time Feature system allows such time-dependence to be specified in a manner that is both flexible and repeatable.

A Time Feature is a set of parameters that ultimately describes the change of a time feature Value. You provide parameters that define the time function, such as a linear change over time. TOPAS automatically creates a Value parameter for this function (a parameter you don’t define). TOPAS continually updates this Value parameter to the appropriate value for a given time.

Note

If you’re doing complex things with parameter file chains, you may want to know where in chain this automatically added Tf/.../Value parameter goes: the answer is that it goes into the same virtual file as the Tf/.../Function parameter.

In addition to specifying the time features, you need to specify the overall time sequence for Sequential Time Mode.

First example

Here is an example, a Time Feature called ArmRot that describes a constant rotation:

s:Tf/ArmRot/Function = "Linear deg"
d:Tf/ArmRot/Rate = 2. deg/ms
d:Tf/ArmRot/StartValue = 0.0 deg
d:Tf/ArmRot/RepetitionInterval = 50. ms

TOPAS automatically creates another parameter:

s:Tf/ArmRot/Value

and updates this parameter to the appropriate value for a given time.

You can then use this value to affect a component position through a statement such as:

d:Ge/Arm/RotX = 0. deg + Tf/ArmRot/Value

Linear, Sine, Cosine and Sqrt Functions

For Dimensioned Double or Unitless values, the Function can be any one of:

Function Value(Time)
Linear StartValue + Rate * Time
Sine Sine ( StartValue + Rate * Time )
Cosine Cosine ( StartValue + Rate * Time )
Sqrt Sqrt ( StartValue + Rate * Time )

If the value is Dimensioned Double, you must also provide a unit, such as the deg in:

s:Tf/ArmRot/Function = "Linear deg"

You must provide appropriate StartValue and Rate parameters, such as:

d:Tf/ArmRot/Rate = 2. deg/ms
d:Tf/ArmRot/StartValue = 0.0 deg

RepetitionInterval, is the time interval after which the function will reset to the StartValue. If you do not provide this parameter, the function will not reset.

Step Function

With a Step function, you can control any type of parameter value. You define a set of times at which to change value, and a value for each of those times. The first value you provide specifies the starting value (the value at time zero).

Here is an example of a Step time feature that controls a String:

s:Tf/ImageName/Function = "Step"
dv:Tf/ImageName/Times = 3 10 20 30 ms
sv:Tf/ImageName/Values = 3 "lung-1" "lung-2" "lung-3"
  • The first value is used for times Tf/TimelineStart to 10 ms.
  • If Tf/TimelineStart was not specified, it defaults to 0, so that first value will be used for times 0 to 10 ms.
  • The second value is used for times 10 to 20 ms.
  • The third value is used for times 20 to 30 ms.
  • After 30 ms, the value cycles back to the first value.

Note that the first member of Values is not the time that the first Value should be used. It is the time that the first Change of value should be made. The first Value will be used for the time between Tf/TimelineStart and that first member of Tf/*/Times.

Note that whereas continuous functions (Linear, Sine, Cosine and Sqrt) include a RepetitionInterval, Step Functions do not. They just cycle back to the first Value after the last of the Times is reached.

Here is an example of a Step time feature that controls a Boolean:

s:Tf/ScoringOnOff/Function="Step"
dv:Tf/ScoringOnOff/Times =10 10 20 30 40 50 60 70 80 90 100 ms
bv:Tf/ScoringOnOff/Values=10 "true" "false" "true" "false" "false" "true" "true" "true" "false" "true"

Note that:

  • Tf/.../Times is always of type dv: and has unit of time.
  • Tf/.../Values is a vector of whatever type the function controls.

Any individual member of the Values parameter vector can itself be a parameter, such as:

bv:Tf/ScoringOnOff/Values=4 "true" "false" Some_Other_Boolean_Parameter_Name "false"

Combining Time Features for Complex Behaviors

You can add or multiply time feature Value parameters just as you can add or multiply any other kind of parameter. For example, here is how the number of histories in a run can be controlled by both a beam current and a beam weight:

s:Tf/BeamCurrent/Function = "Step"
dv:Tf/BeamCurrent/Times = 1 10 ms
iv:Tf/BeamCurrent/Values = 1 10

s:Tf/BeamWeight/Function = "Step"
dv:Tf/BeamWeight/Times = 10 1 2 3 4 5 6 7 8 9 10 ms
iv:Tf/BeamWeight/Values = 10 1 1 1 2 2 2 2 4 4 4

i:Tf/BCM/Value = Tf/BeamWeight/Value * Tf/BeamCurrent/Value
i:So/MySource/NumberOfHistoriesInRun = Tf/BCM/Value

By combining Step time features with other time features, you can control complex sequences. The following from PurgingMagnet_move.txt moves a box first in one direction and then in the other:

s:Tf/BackForward/Function = "Step"
dv:Tf/BackForward/Times = 2 100.0 200.0 ms
dv:Tf/BackForward/Values = 2 Tf/BackStep/Value Tf/ForwardStep/Value mm

s:Tf/BackStep/Function = "Linear mm"
d:Tf/BackStep/Rate = 3 mm/ms
d:Tf/BackStep/StartValue = 0.0 mm
d:Tf/BackStep/RepetitionInterval = 100.0 ms

s:Tf/ForwardStep/Function = "Linear mm"
d:Tf/ForwardStep/Rate = -3 mm/ms
d:Tf/ForwardStep/StartValue = 300.0 mm
d:Tf/ForwardStep/RepetitionInterval = 100.0 ms

Some complex examples of time features are in examples/Nozzle. While we have had examples of double scattering and pencil beam scanning for some time, those examples have included proprietary IBA information, so could not be generally shared. The examples found in examples/Nozzle have no vendor confidential information.

Example Description
RasterScanningPattern.txt Time Features for controlling the dipole magnets are implemented. The time varying magnet will scan rectangle fields in a raster pattern.
ScanningStationaryTarget.txt In addition to RasterScanningPattern.txt, a water phantom including a plane target is added.
ScanningTargetMovingHorizontal.txt The perpendicularly moving target is defined. In order to make protons follow the moving target, compensated Time Features for the dipole magnets are implemented. The execution of this file will show the moving target in horizontal direction and the proton beams tracking the moving target.
ScanningTargetMovingInDepth.txt To trace the target moving along with the depth, the changes of proton’s incident energy should be synchronized with the motion.
ScanningNozzle.txt All geometry for the scanning nozzle is defined. The nozzle consists of magnet systems, for example, two quadrupole magnets and two dipole magnets in helium gas filled beam pipe and various monitoring chambers. Magnet fields are set to zero in this parameter file.
ScatteringNozzle.txt All geometry for the scattering nozzle is defined.
ScatteringNozzle_run.txt Range Modulator Wheel rotates over time and scatterers move in and out of the beam.

Warning

Take care when mixing Phase Space Sources with Time Features. While TOPAS can save the current TOPAS time to a phase space file, this time is not automatically applied when reading particles back in from phase space. Thus, if you want to correct replay source particles that were recorded with time features, it is your responsibility to apply the identical time features during the play back simulation. Some additional notes:

  • Do not attempt to change the name of the phase space file over time. Save and replay all particles from a single phase space file.
  • Do not use Random Time Mode. The randomly generated times during playback will not necessarily match the randomly generated times that were saved to the phase space. Only use Fixed Time Mode or Sequential Time Mode.

A future version of TOPAS will provide more tools to synchronize and check playback time features.

Variance Reduction

Introduction

Variance reduction (VR) techniques in TOPAS can be combined to create a very sophisticated setup. However, please note that VR is highly dependent on your specific geometry. Approach these features with caution and test all variance reduced setups against an equivalent setup without variance reduction.

You should also review the Geant4 document that describes which cases are problematic here.

To enable the particle split applied to protons:

b:Vr/UseVarianceReduction = "true"
b:Vr/ParticleSplit/Active = "true"
sv:Vr/ParticleSplit/ParticleName = 1 "proton"

Specify the Split Geometry

The geometry for variance reduction must be in a parallel world. The type of component can be any standard solid (Dividable Components or Generic Components). The geometry must consist of a geometry component with a set of geometry sub-components as daughters. The sub-components must be located in such a way that the boundaries coincide. The split process or Russian roulette will occur at these boundaries. In the next figure a simple scheme is shown.

_images/split_geometry.png

Time Features can be used to move or rotate the component or sub-components. But there is a restriction: the implementation of VR does not allow you to change the dimensions of the component and sub-components.

To set the geometry for VR:

s:Vr/ParticleSplit/Component = "MyComponent"
sv:Vr/ParticleSplit/SubComponents = n "MySubComp_1" ... "MySubComp_n"

Define the Splitting Technique

There are three variance reduction techniques available:

To chose a technique, use for example:

s:Vr/ParticleSplit/Type = "GeometricalParticleSplit"

Geometrical Particle Splitting

TOPAS variance reduction is further described in:

Ramos-Mendez et al, “Geometrical splitting technique to improve the computational efficiency in Monte Carlo calculations for proton therapy,” Med. Phys. 40, 041718 (2013)

This technique was designed for heavy charged particles. In this implementation, you must specify whether the beam entering into the sub-component has cylindrical symmetry or not. This is because the particles may or may not be randomly redistributed around the SplitAxis.

The Russian roulette is applied in a particular direction. That is, at the split plane and prior to being split, the particle is subject to the Russian roulette if its direction does not point towards a Region of Interest (ROI). Then the radius of the ROI and its position on the SplitAxis must to be defined too. Further, the Russian roulette can be turned on/off at specific surfaces between sub-components.

s:Vr/ParticleSplit/Type = "GeometricalParticleSplit"
s:Vr/ParticleSplit/SplitAxis = "zaxis"
d:Vr/ParticleSplit/RussianRoulette/ROIRadius = 7.8 cm
d:Vr/ParticleSplit/RussianRoulette/ROITrans = 10 cm
bv:Vr/ParticleSplit/RussianRoulette = 2 "false" "true"

To set whether the region at each sub-component is symmetric or not and to define the corresponding split number:

bv:Vr/ParticleSplit/Symmetric = 2 "false" "true"
uv:Vr/ParticleSplit/SplitNumber = 2 8 8
_images/geometrical_splitting.png

In addition for this technique, geometrical Russian roulette will be played if a particle leaves the component or the world in a scheme similar to the Importance Sampling technique.

Importance Sampling

In this technique, an importance value is assigned to each sub-component. If a particle is transported into a sub-component with a higher importance, then the particle is split. If it is transported into a sub-component with a lower importance, then Russian roulette is played. By default an importance value of 1 is automatically assigned to the parent component and to the world.

Warning

It is desirable for the thickness of the sub-components to be similar to the mean free path of the physical process to be biased.

The sub-component importance values are defined by hand. For example, to split the particles by a factor of 2 between subsequent sub-components, one must to define:

s:Vr/ParticleSplit/Type = "ImportanceSampling"
uv:Vr/ParticleSplit/ImportanceValues = 5 1 2 4 8 16
_images/importance_sampling.png

Weight Window

In this technique, the split process or Russian roulette will be applied depending on the statistical weight of the particle. Every time that a particle crosses from a sub-component to the next one, the statistical weight is evaluated.

  • Particles with weights greater than a lower bound and smaller than an upper bound will be tracked normally.
  • Particles with weights smaller than a lower bound will be subject to Russian roulette. If it survives, the particle is tracked normally but its weight is increased.
  • Particles with weights greater than an upper bound will be split, and the new particles will be assigned lower weights.

The split number and Russian roulette criteria are internally calculated from an energy map, a weight map, an upper limit factor and a survival factor. In simple geometries the maps can be input by hand.

The user must provide a double vector with upper energy bounds and a unitless vector with lower weight bounds for every sub-component: WeightMap and EnergyMap. The inverse of a parameter named MaximumSplitNumber (100 by default) is used to specify the minimum survival probability to be used in Russian roulette. The parameter PlaceOfAction states whether the split process (or Russian roulette) will occur at the sub-component boundaries, at physics interactions or at both.

The follow configuration is equivalent to importance sampling with importance generator of 2:

s:Vr/ParticleSplit/Type = "WeightWindow"
uv:Vr/ParticleSplit/WeightMap = 4 1. 1. 0.125 0.0615
dv:Vr/ParticleSplit/EnergyMap = 4 1. 1. 1. 1. GeV
u:Vr/ParticleSplit/UpperLimitFactor = 1
u:Vr/ParticleSplit/SurvivalFactor = 1
i:Vr/ParticleSplit/MaximumSplitNumber = 100
s:Vr/ParticleSplit/PlaceOfAction = "onBoundary"
#Others options of PlaceOfAction: "OnCollision" and "OnBoundaryAndCollision"
_images/weight_window.png

Tracking Only Specific Particles

In this option the particles are eliminated just after they were created. The user can choose which particles will be tracked in all components. Nevertheless, the user can specify if a component is going to be neglected. That is, all particles are tracked in such components. This option can be useful when the contribution of certain particles is negligible to the final scored quantity. But it must to be used with caution. This option is not a variance reduction.

To eliminate particles other than protons and electrons in all components but in component named WaterPhantom:

b:Vr/KillOtherParticles/Active = "True"
sv:Vr/KillOtherParticles/HaveNoEffectInComponentsNamed = 1 "WaterPhantom"
sv:Vr/KillOtherParticles/OnlyTrackParticlesNamed = 2 "proton" "e-"

Secondary Biasing

The split of secondary particles created after an electromagnetic interaction is also supported. A common example is the split of secondary photons created in the bremsstrahlung process for conventional radiotherapy simulations.

This variance reduction works per electromagnetic physical process per region. Physics Regions allow multiple components to have specific production cuts. This is useful in complex geometry setups to improve the computational speed by assigning high production cuts in regions where detailed simulation is unimportant. To assign a region to a component:

s:Ge/MyComponent/AssignToRegionNamed = "MyRegion"

The region MyRegion is automatically created if it does not exist. The next step is to set the secondary biasing option:

s:Vr/ParticleSplit/Type = "SecondaryBiasing"

Then three vectors must be defined. One with the name of the electromagnetic processes, one with the split number for each process and one with the maximum energies for each processes. The biased particles with energies larger than these values are subject to Russian roulette:

sv:Vr/ParticleSplit/ForRegion/MyRegion/ProcessesNamed = 2 "eBrem" "compt"
uv:Vr/ParticleSplit/ForRegion/MyRegion/SplitNumber = 2 100 10
dv:Vr/ParticleSplit/ForRegion/MyRegion/MaximumEnergy = 2 6.0 0.511 MeV

If suitable, further CPU time can be saved with a directional Russian roulette for secondary particles created with split (analogous to Geometrical Particle Splitting). For that, a new VRT must be set:

s:Vr/DirectionalFilter/Type = "DirectionalRussianRoulette"

Later, a reference component must to be chosen:

s:Vr/DirectionalFilter/ReferenceComponent = "Target"

And the directional filter is applied:

dv:Vr/DirectionalFilter/ForRegion/MyRegion/DirectionalSplitLimits = 2 1.0 1.0 m
dv:Vr/DirectionalFilter/ForRegion/MyRegion/DirectionalSplitRadius = 2 5.0 5.0 cm
sv:vr/DirectionalFilter/ForRegion/MyRegion/processesNamed = 2 "eBrem" "compt"
_images/secondary_biasing.png

Figure: Biasing particle of secondary photons after a bremsstrahlung process. On the left, no directional Russian roulette is applied. On the right, a directional Russian roulette is applied.

Forced interaction

In this technique, photons are forced to interact by resampling the interaction probability using an scaling distance factor.

Warning

The distance must be smaller than the thickness of the component assigned to the region.

This technique is applied per region, then the user is responsable to create and assign the components desired to a region. In addition, a scaling distance and physical process needs to be provided:

s:Vr/PhotonInteractionForcing/Type = "ForcedInteraction"
sv:Vr/PhotonInteractionForcing/ForRegion/BiasingRegion/ProcessesNamed = 1 "compt"
dv:Vr/PhotonInteractionForcing/ForRegion/BiasingRegion/ForcedDistances = 1 0.1 mm
_images/forced_interaction.png

Cross section enhancement

In this technique, particle’s interaction in a material is enhanced by rescaling the cross-section of a process provided by the user.

This technique is applied at every interaction of the particle. The user needs to provide a unitless scaling factor and the physical processes of interest:

s:Vr/CrossSectionEnhancement/Type = "CrossSectionEnhancement"
sv:Vr/CrossSectionEnhancement/ProcessesNamed = 1 "eBrem"
uv:Vr/CrossSectionEnhancement/EnhancementFactor = 1 20
_images/crosssection_enhancement.png

Outcome Modeling

TOPAS can now directly perform Outcome Modeling such as calculating Tumor Control Probabilities and Normal Tissue Complication Probabilities.

Expanding on TOPAS previous capability to directly produce a Dose Volume Histogram, TOPAS can now directly apply outcome models to the DVH. We provide a variety of standard outcome models from the literature, for each of which you can adjust various parameters. You can also write your own outcome models using the TOPAS Extensions interface.

Starting from an existing scorer, if a differential or cumulative histogram will be scored, TOPAS will takes the corresponding bins (dose and volume) as input of the biological models:

s:Sc/ScorerName/Report= "differentialvolumehistogram" # or "cumulativevolumehistogram"

An example that runs several different outcome models on a patient dose can be seen at TestOutcomeModel.txt

We also allow you to read back in a previously created DVH to have TOPAS apply new outcome models without having to re-do the Monte Carlo simulation phase of the job. Just set the parameter that tells TOPAS to restore results from a previously created file:

Ts/RestoreResultsFromFile = "True"

See the example TestRestoreModel.txt

If no volume histogram is required, as input of the biological models, TOPAS will takes the final full dose distribution in the organ, and by assuming that all voxels have the same dimension, the volume input will be a vector of ones. This assumption relies in the fact that volume bins are internally converted to fractional volume.

To activate the biological models calculation:

b:Sc/ScorerName/CalculateProbabilityOfOutcome = "True"

User may want to scale the dose distribution:

u:Sc/ScorerName/BiologyOutputScaleFactor = 1E6

Set the number and name of models to be calculated:

sv:Sc/ScorerName/ModelName = 2 "LKB" "CriticalElement"

Set the input parameters of the corresponding model:

u:Sc/ScorerName/LKB/n = 0.25
u:Sc/ScorerName/LKB/m = 0.15
u:Sc/ScorerName/LKB/td50 = 60
u:Sc/ScorerName/CriticalElement/m = 0.15
u:Sc/ScorerName/CriticalElement/td50 = 60
s:Sc/ScorerName/CriticalElement/Function="probit" #"logistic"

For LKB, critical element, critical volume and Poisson models, the parameters can be set from an internal data base (see references below) by input the organ name instead of the model parameters as follows:

s:Sc/ScorerName/IncludeParametersFromOrganNamed="brain"

If the organ name is not found, the full list of available names is displayed and TOPAS execution is stopped.

The output (NTCP or TCP in percent) will be displayed on the screen for every model for every scorer. If CSV or Binary DVHs output is chosen, the output will be at the header too.

The follow references contains tables with parameters for several organs for several models:

C. Burman, G. J. Kutcher, B. Emami and M. Goitein, “Fitting of normal tissue tolerance data to an analytic function”, Int. J. Radiation Oncology Biol. Phys. 21, 123-135. (1991)
B. Emami, J. Lyman, A. Brown, L. Coia, M. Goitein, J. E. Munzenrider, B. Shank. L. J. Solin and M Wesson “Tolerance of normal tissue to therapeutic irradiation”, Int. J. Radiation Oncology Biol. Phys. 21, 109-122. (1991)
P. Okunieff, D. Morgan, A. Niemerko and D. Suit “Radiation dose-response of human tumors”, Int. J. Radiation Oncology Biol. Phys. 32(4), 1227-1237. (1995)
P. Stavrev, A. Niemerko, N. Stavreva and M. Goitein, “The application of biological models to clinical data”, Physica Medica, 17(2), 2-13. (2001)

The TOPAS Graphical User Interface

TOPAS includes an optional Graphical User Interface (GUI). The GUI allows the user to easily manipulate graphics (rotate, zoom and click on graphical elements to get more information about the selected geometry element or particle track) and inspect and adjust TOPAS parameters.

The GUI is intended as a rapid prototyping extension of TOPAS. It allows you to easily see and adjust geometry and review the behavior of a small set of particle histories. The GUI then gives you the ability to save the new parameters, such that these saved values can later be loaded back in to a new TOPAS session, with or without the GUI.

For larger, high precision runs, with larger numbers of histories, the user will generally run on a batch system (cluster or cloud) without the GUI.

Future developments will extend the system such that users will be able to directly launch cluster or cloud jobs from the GUI, with the GUI serving to monitor the progress of those jobs and display their results.

The GUI is based on the Qt Toolkit. To activate the GUI, include the following parameter in your TOPAS Parameter Control File:

Ts/UseQt = "True"

TOPAS will then bring up the GUI.

_images/GUI1.png

Mouse Control

The top row of icons determine the behavior of the mouse when one clicks in the graphics window. Going from left to right:

  • Pick to Translate the Image. Moving the mouse will move the image left right up or down
  • Pick to Inquire. A pop-up window will give details about the selected object within the image (name of geometry, material, density etc., or type of particle track, partile energy, etc.).
  • Pick to Zoom out
  • Pick to Zoom in
  • Pick to Rotate. Moving the mouse will rotate the image.

The Parameter Control Table

The Parameter Control Table includes one row for each of the parameters that you can adjust. Click on the given value to adjust. There may be a slider or a text input box, depending on the parameter type. If you type an invalid entry, a warning message will appear in the session console area on the lower right, and the previous value will be restored.

You choose which of your TOPAS parameters will be displayed here by adding the prefix character “c” (for “changeable”) to the parameter type. So, for example, to have the Z Half Length of a component named MyBox be included in this control area, specify it in the parameter control file as:

ic:Ge/MyBox/HLX = 2

Or to have this NOT be present in the control area:

i:Ge/MyBox/HLX = 2

Additional Functions

A set of buttons above the parameter control table support additional functions:

  • Save: saves the current set of parameters to a new file in your current directory. The file name will be displayed in the session console area on the lower right. The new file will NOT overwrite your original parameter file. Rather, it will create a new parameter file that includes only your changes, and that then uses the TOPAS inclueFile mechanism to bring in your original parameter file for the other, unchanged values.
  • +Geom: Brings up a window to let you add a new Geometry Component
  • +Scorer: Brings up a window to let you add a new Scorer. Note that due to constraints in the way Geant4 initializes various functions, you can only add scorers Before the first run.
  • +Source: Brings up a window to let you add a new Particle Source. Note that due to constraints in the way Geant4 initializes various functions, you can only add scorers Before the first run.
  • Run: Runs your simulation. You can issue this as many times as you wish, changing parameters and re-running to see new results.
  • PDF: Saved the current graphics window to a PDF file in your current directory.

Scene Tree

You can switch from the Parameter Control widget to another widget called the Scene Tree. Scene Tree shows you the hierarchy of geometry volumes. You can turn on or off various volumes to better understand your geometry.

Basic

AllParameterForms.txt

# Demonstrates all allowed parameter forms
# and dumps results to TsDumpParameters.html

b:Ts/DumpNonDefaultParameters = "True"

sv:Ph/Default/Modules = 1 "Transportation_Only"

# Parameters used in expressions below
d:A_Double1          = 100. cm
d:A_Double5          = 500. cm
d:A_Double10         = 1000. cm
d:A_Double20         = 2000. cm
u:A_Unitless1        = 1.
u:A_Unitless5        = 5.
u:A_Unitless10       = 10.
u:A_Unitless20       = 20.
i:A_Integer1         = 1
i:A_Integer5         = 5
i:A_Integer10        = 10
i:A_Integer20        = 20
s:A_StringTen        = "Ten"
b:A_BooleanTrue      = "True"
dv:A_DoubleVector1   = 3 1. 1. 1. m
uv:A_UnitlessVector1 = 3 1. 1. 1.
iv:A_IntegerVector1  = 3 1 1 1
sv:A_StringVector1   = 3 "One" "One" "One"

# Double parameters: correct answer is always 10m
d:A_DoubleFromValue               = 10. m
d:A_DoubleFromValuePlusDouble     = 0. m + A_Double10
d:A_DoubleFromValueMinusDouble    = 20. m - A_Double10
d:A_DoubleFromValueTimesUnitless  = 10. m * A_Unitless1
d:A_DoubleFromValueTimesInteger   = 10. m * A_Integer1
d:A_DoubleFromValueTimesDouble    = 1. * A_Double10 m
d:A_DoubleFromDouble              = A_Double10 m
d:A_DoubleFromDoubleTimesValue    = A_Double10 m * 1.
d:A_DoubleFromDoubleTimesUnitless = A_Double10 m * A_Unitless1
d:A_DoubleFromDoubleTimesInteger  = A_Double10 m * A_Integer1
d:A_DoubleFromUnitlessTimesValue  = A_Unitless1 * 10. m
d:A_DoubleFromIntegerTimesValue   = A_Integer1 * 10. m
d:A_DoubleFromDoublePlusValue     = A_Double10 + 0. m
d:A_DoubleFromDoubleMinusValue    = A_Double20 - 10. m
d:A_DoubleFromDoublePlusDouble    = A_Double5 + A_Double5 m
d:A_DoubleFromDoubleMinusDouble   = A_Double20 - A_Double10 m

# Unitless parameters: correct answer is always 10
u:A_UnitlessFromValue                 = 10.
u:A_UnitlessFromValuePlusUnitless     = 0. + A_Unitless10
u:A_UnitlessFromValueMinusUnitless    = 20. - A_Unitless10
u:A_UnitlessFromValueTimesUnitless    = 1. * A_Unitless10
u:A_UnitlessFromValuePlusInteger      = 0. + A_Integer10
u:A_UnitlessFromValueMinusInteger     = 20. - A_Integer10
u:A_UnitlessFromValueTimesInteger     = 1. * A_Integer10
u:A_UnitlessFromUnitless              = A_Unitless10
u:A_UnitlessFromInteger               = A_Integer10
u:A_UnitlessFromUnitlessPlusValue     = A_Unitless10 + 0.
u:A_UnitlessFromUnitlessMinusValue    = A_Unitless20 - 10.
u:A_UnitlessFromUnitlessTimesValue    = A_Unitless10 * 1.
u:A_UnitlessFromIntegerPlusValue      = A_Integer10 + 0.
u:A_UnitlessFromIntegerMinusValue     = A_Integer20 - 10.
u:A_UnitlessFromIntegerTimesValue     = A_Integer10 * 1.
u:A_UnitlessFromUnitlessPlusUnitless  = A_Unitless5 + A_Unitless5
u:A_UnitlessFromUnitlessMinusUnitless = A_Unitless20 - A_Unitless10
u:A_UnitlessFromUnitlessTimesUnitless = A_Unitless10 * A_Unitless1
u:A_UnitlessFromUnitlessPlusInteger   = A_Unitless5 + A_Integer5
u:A_UnitlessFromUnitlessMinusInteger  = A_Unitless20 - A_Integer10
u:A_UnitlessFromUnitlessTimesInteger  = A_Unitless10 * A_Integer1
u:A_UnitlessFromIntegerPlusUnitless   = A_Integer5 + A_Unitless5
u:A_UnitlessFromIntegerMinusUnitless  = A_Integer20 - A_Unitless10
u:A_UnitlessFromIntegerTimesUnitless  = A_Integer10 * A_Unitless1
u:A_UnitlessFromIntegerPlusInteger    = A_Integer5 + A_Integer5
u:A_UnitlessFromIntegerMinusInteger   = A_Integer20 - A_Integer10
u:A_UnitlessFromIntegerTimesInteger   = A_Integer10 * A_Integer1

# Integer parameters: correct answer is always 10
i:A_IntegerFromValue               = 10
i:A_IntegerFromValuePlusInteger    = 0 + A_Integer10
i:A_IntegerFromValueMinusInteger   = 20 - A_Integer10
i:A_IntegerFromValueTimesInteger   = 1 * A_Integer10
i:A_InteterFromInteger             = A_Integer10
i:A_IntegerFromIntegerPlusValue    = A_Integer10 + 0
i:A_IntegerFromIntegerMinusValue   = A_Integer20 - 10
i:A_IntegerFromIntegerTimesValue   = A_Integer10 * 1
i:A_IntegerFromIntegerPlusInteger  = A_Integer5 + A_Integer5
i:A_IntegerFromIntegerMinusInteger = A_Integer20 - A_Integer10
i:A_IntegerFromIntegerTimesInteger = A_Integer10 * A_Integer1

# Boolean parameters: correct answer is always 1 (= True)
b:A_BooleanFromValue               = "True"
b:A_BooleanFromBoolean             = A_BooleanFromValue
b:A_BooleanFromBooleanTimesBoolean = A_BooleanFromValue * A_BooleanTrue

# String parameters: correct answer is always Ten, 10
# or some combination of the two such as TenTen, Ten10, 1010, etc.
s:A_StringFromValue              = "Ten"
s:A_StringFromValuePlusInteger   = "Ten" + A_Integer10
s:A_StringFromValuePlusString    = "Ten" + A_StringTen
s:A_StringFromInteger            = A_Integer10
s:A_StringFromString             = A_StringTen
s:A_StringFromIntegerPlusValue   = A_Integer10 + "Ten"
s:A_StringFromStringPlusValue    = A_StringTen + "Ten"
s:A_StringFromIntegerPlusInteger = A_Integer10 + A_Integer10
s:A_StringFromIntegerPlusString  = A_Integer10 + A_StringTen
s:A_StringFromStringPlusInteger  = A_StringTen + A_Integer10
s:A_StringFromStringPlusString   = A_StringTen + A_StringTen

# Double Vectors: correct answer is always 10. 5. 1. m
dv:A_DoubleVectorFromValue                     = 3 10. 5. 1. m
dv:A_DoubleVectorFromValuePlusDouble           = 3 9. 4. 0. m + A_Double1
dv:A_DoubleVectorFromValueMinusDouble          = 3 11. 6. 2. m - A_Double1
dv:A_DoubleVectorFromValuePlusDoubleVector     = 3 9. 4. 0. m + A_DoubleVector1
dv:A_DoubleVectorFromValueMinusDoubleVector    = 3 11. 6. 2. m - A_DoubleVector1
dv:A_DoubleVectorFromValueTimesUnitless        = 3 10. 5. 1. m * A_Unitless1
dv:A_DoubleVectorFromValueTimesInteger         = 3 10. 5. 1. m * A_Integer1
dv:A_DoubleVectorFromValueTimesUnitlessVector  = 3 10. 5. 1. m * A_UnitlessVector1
dv:A_DoubleVectorFromValueTimesIntegerVector   = 3 10. 5. 1. m * A_IntegerVector1
dv:A_DoubleVectorFromValueTimesDouble          = 3 10. 5. 1. * A_Double1 m
dv:A_DoubleVectorFromValueTimesDoubleVector    = 3 10. 5. 1. * A_DoubleVector1 m
dv:A_DoubleVectorFromDoubleVector              = A_DoubleVectorFromValue m
dv:A_DoubleVectorFromScaleTimesDoubleVector    = 1. * A_DoubleVectorFromValue m
dv:A_DoubleVectorFromIntegerTimesDoubleVector  = A_IntegerFromValue * A_DoubleVectorFromValue m
dv:A_DoubleVectorFromUnitlessTimesDoubleVector = A_UnitlessFromValue * A_DoubleVectorFromValue m

# Unitless Vectors: correct answer is always 10 5 1
uv:A_UnitlessVectorFromValue                       = 3 10. 5. 1.
uv:A_UnitlessVectorFromValuePlusUnitless           = 3 9. 4. 0. + A_Unitless1
uv:A_UnitlessVectorFromValueMinusUnitless          = 3 11. 6. 2. - A_Unitless1
uv:A_UnitlessVectorFromValueTimesUnitless          = 3 10. 5. 1. * A_Unitless1
uv:A_UnitlessVectorFromValuePlusInteger            = 3 9. 4. 0. + A_Integer1
uv:A_UnitlessVectorFromValueMinusInteger           = 3 11. 6. 2. - A_Integer1
uv:A_UnitlessVectorFromValueTimesInteger           = 3 10. 5. 1. * A_Integer1
uv:A_UnitlessVectorFromValuePlusUnitlessVector     = 3 9. 4. 0. + A_UnitlessVector1
uv:A_UnitlessVectorFromValueMinusUnitlessVector    = 3 11. 6. 2. - A_UnitlessVector1
uv:A_UnitlessVectorFromValueTimesUnitlessVector    = 3 10. 5. 1. * A_UnitlessVector1
uv:A_UnitlessVectorFromValuePlusIntegerVector      = 3 9. 4. 0. + A_IntegerVector1
uv:A_UnitlessVectorFromValueMinusIntegerVector     = 3 11. 6. 2. - A_IntegerVector1
uv:A_UnitlessVectorFromValueTimesIntegerVector     = 3 10. 5. 1. * A_IntegerVector1
uv:A_UnitlessVectorFromUnitlessVector              = A_UnitlessVectorFromValue
uv:A_UnitlessVectorFromScaleTimesUnitlessVector    = 1. * A_UnitlessVectorFromValue
uv:A_UnitlessVectorFromUnitlessTimesUnitlessVector = A_UnitlessFromValue * A_UnitlessVectorFromValue
uv:A_UnitlessVectorFromIntegerTimesUnitlessVector  = A_IntegerFromValue * A_UnitlessVectorFromValue

# Integer Vectors: correct answer is always 10 5 1
iv:A_IntegerVectorFromValue                     = 3 10 5 1
iv:A_IntegerVectorFromValuePlusInteger          = 3 9 4 0 + A_Integer1
iv:A_IntegerVectorFromValueMinusInteger         = 3 11 6 2 - A_Integer1
iv:A_IntegerVectorFromValueTimesInteger         = 3 10 5 1 * A_Integer1
iv:A_IntegerVectorFromValuePlusIntegerVector    = 3 9 4 0 + A_IntegerVector1
iv:A_IntegerVectorFromValueMinusIntegerVector   = 3 11 6 2 - A_IntegerVector1
iv:A_IntegerVectorFromValueTimesIntegerVector   = 3 10 5 1 * A_IntegerVector1
iv:A_IntegerVectorFromIntegerVector             = A_IntegerVectorFromValue
iv:A_IntegerVectorFromScaleTimesIntegerVector   = 1 * A_IntegerVectorFromValue
iv:A_IntegerVectorFromIntegerTimesIntegerVector = A_IntegerFromValue * A_IntegerVectorFromValue

# Boolean Vectors: correct answer is always 1 0 1 (= True False True)
bv:A_BooleanVectorFromValue         = 3 "True" "False" "True"
bv:A_BooleanVectorFromBooleanVector = A_BooleanVectorFromValue

# String Vectors: correct answers vary by case
sv:A_StringVectorFromValue                  = 3 "Ten" "Five" "One"
sv:A_StringVectorFromValuePlusInteger       = 3 "Ten" "Five" "One" + A_Integer10
sv:A_StringVectorFromValuePlusString        = 3 "Ten" "Five" "One" + A_StringTen
sv:A_StringVectorFromStringVector           = A_StringVectorFromValue
sv:A_StringVectorFromValuePlusIntegerVector = 3 "Ten" "Five" "One" + A_IntegerVector1
sv:A_StringVectorFromValuePlusStringVector  = 3 "Ten" "Five" "One" + A_StringVector1

BatchJob1.txt

# Demonstrates how to have two separate jobs share everything
# except the seed and output file.

includeFile = BatchJobShared.txt

i:Ts/Seed = 1
s:Sc/DoseAtPhantom/OutputFile = "DoseAtPhantomForSeed" + Ts/Seed

BatchJob2.txt

# Demonstrates how to have two separate jobs share everything
# except the seed and output file.

includeFile = BatchJobShared.txt

i:Ts/Seed = 2
s:Sc/DoseAtPhantom/OutputFile = "DoseAtPhantomForSeed" + Ts/Seed

BatchJobShared.txt

# This file is included either by BatchJob1.txt or BatchJob2.txt
# To show how to have two separate jobs share everything
# except the seed and output file parameters.

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "Air"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 10.0 cm
d:Ge/Phantom/TransZ   = -30. cm
s:Ge/Phantom/Color    = "blue"

s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"

#s:Gr/ViewA/Type                            = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

i:Ts/ShowHistoryCountAtInterval = 10
i:Ts/NumberOfThreads = 7

#b:Ts/PauseBeforeQuit = "True"

BoxRotatedAroundItsCorner.txt

# Example demonsrating a box rotated around its corner
# by placing the box inside of a Group and rotating that group.

s:Ge/MyGroup/Type    = "Group"
s:Ge/MyGroup/Parent = "World"
dc:Ge/MyGroup/RotX   = 0. deg
d:Ge/MyGroup/RotY   = 0. deg
d:Ge/MyGroup/RotZ   = 0. deg
d:Ge/MyGroup/TransZ = -2. m

s:Ge/MyBox/Type     = "TsBox"
s:Ge/MyBox/Material = "G4_WATER"
s:Ge/MyBox/Parent   = "MyGroup"
d:Ge/MyBox/HLX      = 1.5 m
d:Ge/MyBox/HLY      = 1. m
d:Ge/MyBox/HLZ      = 1. m
d:Ge/MyBox/TransX   = Ge/MyBox/HLX m
d:Ge/MyBox/TransY   = Ge/MyBox/HLY m
d:Ge/MyBox/TransZ   = Ge/MyBox/HLZ m
dc:Ge/MyBox/RotX    = 20. deg
d:Ge/MyBox/RotY     = 20. deg
d:Ge/MyBox/RotZ     = 20. deg
s:Ge/MyBox/Color    = "blue"
s:Ge/MyBox/DrawingStyle = "WireFrame"

s:Ge/BoxCorner/Type     = "TsBox"
s:Ge/BoxCorner/Material = "G4_WATER"
s:Ge/BoxCorner/Parent   = "MyBox"
d:Ge/BoxCorner/HLX      = .2 m
d:Ge/BoxCorner/HLY      = .2 m
d:Ge/BoxCorner/HLZ      = .2 m
d:Ge/BoxCorner/TransX   = Ge/BoxCorner/HLX - Ge/MyBox/HLX m
d:Ge/BoxCorner/TransY   = Ge/BoxCorner/HLY - Ge/MyBox/HLY m
d:Ge/BoxCorner/TransZ   = Ge/BoxCorner/HLZ - Ge/MyBox/HLZ m
s:Ge/BoxCorner/Color    = "magenta"
s:Ge/BoxCorner/DrawingStyle = "Solid"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type = "OpenGL"
b:Gr/ViewA/IncludeAxes = "True"
d:Gr/ViewA/AxesSize = 4. m

Ts/UseQt = "True"

DistributedSourcePointsInShell.txt

s:Ge/World/Material  = "G4_W"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/DemoSphere/Type                 = "TsSphere"
s:Ge/DemoSphere/Parent               = "World"
s:Ge/DemoSphere/Material             = "Vacuum"
d:Ge/DemoSphere/RMax                 = 120 mm
d:Ge/DemoSphere/DPhi                 = 180 deg

s:Ge/InnerSphere/Type                 = "TsSphere"
s:Ge/InnerSphere/Parent               = "DemoSphere"
s:Ge/InnerSphere/Material             = "Vacuum"
dc:Ge/InnerSphere/RMax                 = 100 mm
d:Ge/InnerSphere/DPhi                 = 180 deg
sc:Ge/InnerSphere/DrawingStyle = "Solid"

s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
#s:Ge/DemoTwistedTubs/Parent          = "World"
s:Ge/DemoTwistedTubs/Material        = "Vacuum"
d:Ge/DemoTwistedTubs/Twist           = 60 deg
d:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
d:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
d:Ge/DemoTwistedTubs/HLZ             = 20 mm
d:Ge/DemoTwistedTubs/Phi             = 90 deg
s:Ge/DemoTwistedTubs/Color           = "brown"
s:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

s:So/Example/Type                     = "Distributed"
s:So/Example/Component                = "DemoSphere"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 10. keV
u:So/Example/BeamEnergySpread         = 0.
ic:So/Example/NumberOfHistoriesInRun   = 30
ic:So/Example/NumberOfSourcePoints     = 5
bc:So/Example/RedistributePointsOnNewHistory = "False"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type = "OpenGL"
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
Ts/UseQt = "T"

DistributedSourcePointsInSphereGaussian.txt

s:Ge/World/Material  = "G4_W"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/DemoSphere/Type                 = "TsSphere"
s:Ge/DemoSphere/Parent               = "World"
s:Ge/DemoSphere/Material             = "G4_WATER"
d:Ge/DemoSphere/RMax                 = 120 mm

s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
#s:Ge/DemoTwistedTubs/Parent          = "World"
s:Ge/DemoTwistedTubs/Material        = "Vacuum"
d:Ge/DemoTwistedTubs/Twist           = 60 deg
d:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
d:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
d:Ge/DemoTwistedTubs/HLZ             = 20 mm
d:Ge/DemoTwistedTubs/Phi             = 90 deg
s:Ge/DemoTwistedTubs/Color           = "brown"
s:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

s:So/Example/Type                     = "Distributed"
s:So/Example/Component                = "DemoSphere"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 10. keV
u:So/Example/BeamEnergySpread         = 0.
ic:So/Example/NumberOfHistoriesInRun  = 5
ic:So/Example/NumberOfSourcePoints    = 4
bc:So/Example/RedistributePointsOnNewHistory = "False"
s:So/Example/PointDistribution        = "Flat" # default to "Flat"
dc:So/Example/PointDistributionSigma   = 20. mm

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type = "OpenGL"
Ts/UseQt = "T"

DistributedSourcePointsInSphere.txt

s:Ge/World/Material  = "G4_W"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/DemoSphere/Type                 = "TsSphere"
s:Ge/DemoSphere/Parent               = "World"
s:Ge/DemoSphere/Material             = "Vacuum"
d:Ge/DemoSphere/RMax                 = 120 mm

s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
#s:Ge/DemoTwistedTubs/Parent          = "World"
s:Ge/DemoTwistedTubs/Material        = "Vacuum"
d:Ge/DemoTwistedTubs/Twist           = 60 deg
d:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
d:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
d:Ge/DemoTwistedTubs/HLZ             = 20 mm
d:Ge/DemoTwistedTubs/Phi             = 90 deg
s:Ge/DemoTwistedTubs/Color           = "brown"
s:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

s:So/Example/Type                     = "Distributed"
s:So/Example/Component                = "DemoSphere"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 10. keV
u:So/Example/BeamEnergySpread         = 0.
ic:So/Example/NumberOfHistoriesInRun   = 5
ic:So/Example/NumberOfSourcePoints     = 4
bc:So/Example/RedistributePointsOnNewHistory = "False"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type = "OpenGL"
Ts/UseQt = "T"

DistributedSourcePointsInTwistedTubs.txt

s:Ge/World/Material  = "G4_W"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/DemoSphere/Type                 = "TsSphere"
#s:Ge/DemoSphere/Parent               = "World"
s:Ge/DemoSphere/Material             = "Vacuum"
d:Ge/DemoSphere/RMax                 = 120 mm

s:Ge/InnerSphere/Type                 = "TsSphere"
s:Ge/InnerSphere/Parent               = "DemoSphere"
s:Ge/InnerSphere/Material             = "Vacuum"
d:Ge/InnerSphere/RMax                 = 100 mm

s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
s:Ge/DemoTwistedTubs/Parent          = "World"
s:Ge/DemoTwistedTubs/Material        = "Vacuum"
d:Ge/DemoTwistedTubs/Twist           = 60 deg
d:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
d:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
d:Ge/DemoTwistedTubs/HLZ             = 20 mm
d:Ge/DemoTwistedTubs/Phi             = 90 deg
s:Ge/DemoTwistedTubs/Color           = "brown"
s:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

s:So/Example/Type                     = "Distributed"
s:So/Example/Component                = "DemoTwistedTubs"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 10. keV
u:So/Example/BeamEnergySpread         = 0.
ic:So/Example/NumberOfHistoriesInRun   = 5
ic:So/Example/NumberOfSourcePoints     = 4
bc:So/Example/RedistributePointsOnNewHistory = "False"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type = "OpenGL"
Ts/UseQt = "T"

DividedComponents.txt

# Demonstrates use of the Divided Components,
# TsBox, TsCylinder and TsSphere.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

# Save time by turning off overlap check
b:Ge/CheckForOverlaps = "False"

s:Ge/TestBox/Parent   = "World"
s:Ge/TestBox/Type     = "TsBox"
s:Ge/TestBox/Material = "G4_WATER"
d:Ge/TestBox/HLX      = 7.0 cm
d:Ge/TestBox/HLY      = 7.0 cm
d:Ge/TestBox/HLZ      = 9.0 cm
d:Ge/TestBox/TransX   = 0. cm
d:Ge/TestBox/TransY   = 0. cm
d:Ge/TestBox/TransZ   = 0. cm
d:Ge/TestBox/RotX     = 0. deg
d:Ge/TestBox/RotY     = 0. deg
d:Ge/TestBox/RotZ     = 0. deg
s:Ge/TestBox/Color    = "blue"
i:Ge/TestBox/XBins    = 3
i:Ge/TestBox/YBins    = 4
i:Ge/TestBox/ZBins    = 5

s:Ge/TestCylinder/Parent   = "World"
s:Ge/TestCylinder/Type     = "TsCylinder"
s:Ge/TestCylinder/Material = "G4_WATER"
d:Ge/TestCylinder/RMin     = 0.0 cm
d:Ge/TestCylinder/RMax     = 8.0 cm
d:Ge/TestCylinder/HL       = 10.0 cm
d:Ge/TestCylinder/SPhi     = 0. deg
d:Ge/TestCylinder/DPhi     = 360. deg
d:Ge/TestCylinder/TransX   = 0. cm
d:Ge/TestCylinder/TransY   = 0. cm
d:Ge/TestCylinder/TransZ   = 25. cm
d:Ge/TestCylinder/RotX     = 0. deg
d:Ge/TestCylinder/RotY     = 0.0 deg
d:Ge/TestCylinder/RotZ     = 0. deg
s:Ge/TestCylinder/Color    = "blue"
i:Ge/TestCylinder/RBins    = 2
i:Ge/TestCylinder/PhiBins  = 8
i:Ge/TestCylinder/ZBins    = 2

s:Ge/TestSphere/Parent    = "World"
s:Ge/TestSphere/Type      = "TsSphere"
s:Ge/TestSphere/Material  = "G4_WATER"
d:Ge/TestSphere/RMin      = 0.0 cm
d:Ge/TestSphere/RMax      = 10.0 cm
d:Ge/TestSphere/SPhi      = 0. deg
d:Ge/TestSphere/DPhi      = 360. deg
d:Ge/TestSphere/STheta    = 0. deg
d:Ge/TestSphere/DTheta    = 180. deg
d:Ge/TestSphere/TransX    = 0. cm
d:Ge/TestSphere/TransY    = 0. cm
d:Ge/TestSphere/TransZ    = 50. cm
d:Ge/TestSphere/RotX      = 0. deg
d:Ge/TestSphere/RotY      = 0. deg
d:Ge/TestSphere/RotZ      = 0. deg
s:Ge/TestSphere/Color     = "blue"
i:Ge/TestSphere/RBins     = 3
i:Ge/TestSphere/PhiBins   = 4
i:Ge/TestSphere/ThetaBins = 12

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.8
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

b:Ts/PauseBeforeQuit = "True"

DNAModelByRegions.txt

# Demonstrates having G4DNA model defined in specific regions.
# While only one electromagnetic model can be used in a given TOPAS
# physics list, you are free to define a dna-electromagnetic model in
# a user specific region.
# The em models currently supported are: g4em-livermore, g4em-polarized
# g4em-lowep, g4em-penelope and g4em-standard_opt(0-4)
# The dna-electromagnetic model names are: opt0, opt1 and opt2.

# A simple geometry. The material must be G4_WATER.
s:Ge/Target/Parent   = "World"
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
d:Ge/Target/HLZ      = 0.25 um
s:Ge/Target/Color    = "grass"
# Assign a region
s:Ge/Target/AssignToRegionNamed = "target"

d:Ge/World/HLX      = Ge/Target/HLX um
d:Ge/World/HLY      = Ge/Target/HLY um
d:Ge/World/HLZ      = 1.5 * Ge/Target/HLZ um
s:Ge/World/Material = "G4_WATER"
s:Ge/World/Color    = "blue"

# Start with a physics list
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 
s:Ph/Default/ForRegion/target/ActiveG4EmModelFromModule = "g4em-dna"

# Set a source
s:So/Example/Type                     = "Beam"
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 = "None"
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/view/Type = "OpenGl"
b:Ts/PauseBeforeQuit = "True"

Emittance_Gaussian.txt

s:Ge/World/Material = "Vacuum"

#--- Beam
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 94.00 MeV
u:So/Example/BeamEnergySpread         = 1.0
i:So/Example/NumberOfHistoriesInRun   = 10000

#----- Primary: Emittance beam
s:So/Example/Type           = "Emittance"

#1. Bivariate Gaussian: X,X',correlation and Y,Y',correlation
s:So/Example/Distribution   = "BiGaussian"
d:So/Example/SigmaX         = 2.0 mm
u:So/Example/SigmaXprime    = 0.0032  #32 mrad
u:So/Example/CorrelationX   = -0.8
d:So/Example/SigmaY         = 2.0 mm
u:So/Example/SigmaYPrime    = 0.0032
u:So/Example/CorrelationY   = 0.4

# Beam position (S)
s:Ge/BeamPosition/Parent   = "World"
s:Ge/BeamPosition/Type     = "Group"
d:Ge/BeamPosition/TransX   = 0. m
d:Ge/BeamPosition/TransY   = 0. m
d:Ge/BeamPosition/TransZ   = 3.001 m
#flipped cause the beam flies 0 to +z.
d:Ge/BeamPosition/RotX     = 180. deg
d:Ge/BeamPosition/RotY     = 0. deg
d:Ge/BeamPosition/RotZ     = 0. deg

#---- Verbosity
i:Ts/TrackingVerbosity = 0

#---- Sequence
b:Ge/CheckForUnusedComponents = "False"
b:Ts/ShowCPUTime = "true"
i:Ts/ShowHistoryCountAtInterval = 1000
i:Ts/Seed = 10

#--- Physics --
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

#---- Constants
d:Ge/MyBeamSizeInX = 20.0 cm
d:Ge/MyBeamSizeInY = 20.0 cm

#--- Beam Box
s:Ge/PlaneAtBeamPosition/Type      = "TsBox"
s:Ge/PlaneAtBeamPosition/Material  = "Vacuum"
s:Ge/PlaneAtBeamPosition/Parent    = "World"
d:Ge/PlaneAtBeamPosition/HLX       = 0.5 cm + Ge/MyBeamSizeInX
d:Ge/PlaneAtBeamPosition/HLY       = 0.5 cm + Ge/MyBeamSizeInY
d:Ge/PlaneAtBeamPosition/HLZ       = 0.05 mm
d:Ge/PlaneAtBeamPosition/TransX    = 0. m
d:Ge/PlaneAtBeamPosition/TransY    = 0. m
d:Ge/PlaneAtBeamPosition/TransZ    = 3.0 m - Ge/PlaneAtBeamPosition/HLZ
d:Ge/PlaneAtBeamPosition/RotX      = 0. deg
d:Ge/PlaneAtBeamPosition/RotY      = 0. deg
d:Ge/PlaneAtBeamPosition/RotZ      = 0. deg

#--- Phase space scoring at Beam geometry
s:Sc/Beam/Quantity                  = "PhaseSpace"
b:Sc/Beam/OutputToConsole           = "True"
s:Sc/Beam/Surface                   = "PlaneAtBeamPosition/ZPlusSurface"
s:Sc/Beam/OutputType                = "ASCII"
i:Sc/Beam/OutputBufferSize          = 1000
b:Sc/Beam/IncludeRunID              = "True"
b:Sc/Beam/IncludeEventID            = "True"
b:Sc/Beam/IncludeTrackID            = "True"
b:Sc/Beam/IncludeTime               = "True"
b:Sc/Beam/IncludeSeed               = "True"
s:Sc/Beam/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/Beam/OutputFile                = "BeamGaussian"

Emittance_Twiss.txt

includeFile = Emittance_Gaussian.txt

#!!! You can choose one from these three options
s:So/Example/Distribution   = "twiss_gaussian"
#s:So/Example/Distribution   = "twiss_kv"
#s:So/Example/Distribution   = "twiss_waterbag"

u:So/Example/AlphaX      = 0.2
d:So/Example/BetaX       = 600.0 mm #
d:So/Example/EmittanceX  = 0.01 mm  #we don't multiply pi

u:So/Example/AlphaY      = 2.5
d:So/Example/BetaY       = 1400.0  mm
d:So/Example/EmittanceY  = 0.02 mm

#+ twiss gaussian option only
#0.9 means that 90 % particles will be included in ellipse circle
u:So/Example/ParticleFractionX      = 0.90
u:So/Example/ParticleFractionY      = 0.90

s:Sc/Beam/OutputFile = "BeamTwiss"

EmModelByRegions.txt

# Demonstrates having electromagnetic model defined in specific regions.
# While only one electromagnetic model can be used in a given TOPAS
# physics list, you are free to define a electromagnetic model in
# a user specific region.
# The em models currently supported are: g4em-livermore, g4em-polarized
# g4em-lowep, g4em-penelope and g4em-standard_opt(0-4)

# A simple geometry. The material must be G4_WATER.
s:Ge/Target/Parent   = "World"
s:Ge/Target/Type     = "TsBox"
s:Ge/Target/Material = "G4_WATER"
d:Ge/Target/HLX      = 0.5 cm
d:Ge/Target/HLY      = 0.5 cm
d:Ge/Target/HLZ      = 0.25 cm
s:Ge/Target/Color    = "grass"
# Assign a region
s:Ge/Target/AssignToRegionNamed = "target"

d:Ge/World/HLX      = Ge/Target/HLX um
d:Ge/World/HLY      = Ge/Target/HLY um
d:Ge/World/HLZ      = 1.5 * Ge/Target/HLZ um
s:Ge/World/Material = "G4_WATER"
s:Ge/World/Color    = "blue"

# Start with a physics list
sv:Ph/Default/Modules = 6 "g4em-penelope" "g4h-phy_QGSP_BIC_HP" "g4decay" "g4ion-binarycascade" "g4h-elastic_HP" "g4stopping"
s:Ph/Default/ForRegion/target/ActiveG4EmModelFromModule = "g4em-livermore" 

# Set a source
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 80 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/view/Type = "OpenGl"
b:Ts/PauseBeforeQuit = "True"

EnvironmentSource.txt

# Demonstrates Environment Source
# The environment is a radiation field that might be experienced, for
# example, by a spacecraft in a radiation belt, or a robot (or, indeed
# a human) in a damaged nuclear reactor.

# A notional radiation "cavity" is created enclosing all volumes in a
# component. The cavity is a sphere of radius R.  Primary particles are
# generated on the surface of the sphere, directed inwards, following a
# cosine angular distribution (Lambert's cosine law) relative to the inward
# direction. This produces an isotropic, homogeneous, "omnidirectional flux".

# Even if the radiation has some directional dependency it is often the case
# that the instrument (your detector) is rotating or moving about so the
# flux will average to isotropic over time.

# The basic definition of flux, f, which in principle can vary with
# direction and position, is defined by dN/dt = f*da*dOmega, the
# rate of flow of particles out of an element of area da perpendicular to
# the direction into an element of solid angle dOmega. If the flux is
# homogenous and isotropic, we can define the "omnidirectional flux"
# F = 4*pi*f per unit area. It is quoted, for example, as number per cm2
# per second.

# Fluence is simply F*T, the flux F over a time period T, so quoted, for
# example, as number per cm2.

# One can derive equivalent definitions of fluence:
# - the number of particles that enter a sphere of unit cross-sectional
#   area;
# - the track length per unit volume;
# - etc. For more details see TOPAS documentation.

# For N particles (histories), the fluence will be N/(pi*R^2). This is
# printed at the end of run. It is up to you to decide if this is enough
# for your application. Thus:
# - to simulate flux F for time T you need pi*R^2*F*T histories;
# - or, given N histories, you will have simulated a time period
#   T = N/(F*pi*R^2).

# A test sphere of radius r will attract N*r^2/R^2 particles.

# A thin test disc of radius r will attract (N/2)*r^2/R^2 particles.

# This parameter file implements:
# - a test sphere
# - a thin test disc
# - a test cube
# In all cases:
# - the fluence is "measured" by a "Fluence" scorer (scores the sum of all
#   track lengths divides by the volume);
# - the number of tracks crossing a surface is scored, and can be related
#   to the fluence by the above formulae.

# All materials are set to vacuum so that flux is not attenuated
# within the cavity.

# Note: the world must be bigger than the radiation cavity, which may be
# bigger than a box enclosing your geometry. TOPAS will tell you if you
# need to increase the world size.
s:Ge/World/Material = "Vacuum"
s:Ge/World/Type     = "TsBox"
d:Ge/World/HLX      = 5 m
d:Ge/World/HLY      = 5 m
d:Ge/World/HLZ      = 5 m

s:Ge/TestVolumes/Type    = "Group"
s:Ge/TestVolumes/Parent  = "World"
dc:Ge/TestVolumes/RotZ   = 0. deg
dc:Ge/TestVolumes/TransZ = 1 m

s:Ge/TestSphere/Type      = "TsSphere"
s:Ge/TestSphere/Parent    = "TestVolumes"
sc:Ge/TestSphere/Material = "Vacuum"
dc:Ge/TestSphere/RMax     = 50 cm
dc:Ge/TestSphere/TransY   = -2 m
dc:Ge/TestSphere/TransZ   = 0.5 m

s:Ge/TestBox/Type      = "TsBox"
s:Ge/TestBox/Parent    = "TestVolumes"
sc:Ge/TestBox/Material = "Vacuum"
dc:Ge/TestBox/HLX      = 0.5 m
dc:Ge/TestBox/HLY      = 0.5 m
dc:Ge/TestBox/HLZ      = 0.5 m
dc:Ge/TestBox/TransY   = -2 m
dc:Ge/TestBox/TransZ   = -1 m

s:Ge/TestDisc/Type     = "TsCylinder"
s:Ge/TestDisc/Parent   = "TestVolumes"
sc:Ge/TestDisc/Material = "Vacuum"
dc:Ge/TestDisc/RMax     = 50 cm
dc:Ge/TestDisc/HL       = 1 nm
dc:Ge/TestDisc/TransY   = 2 m
dc:Ge/TestDisc/TransZ   = 0.5 m

s:Sc/TestSphereFluenceScorer/Quantity = "Fluence"
s:Sc/TestSphereFluenceScorer/Component = "TestSphere"
b:Sc/TestSphereFluenceScorer/PropagateToChildren = "True"
b:Sc/TestSphereFluenceScorer/OutputToConsole = "True"
b:Sc/TestSphereFluenceScorer/OutputAfterRun = "True"
s:Sc/TestSphereFluenceScorer/OutputType = "csv"
s:Sc/TestSphereFluenceScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/TestSphereTrackScorer/Quantity = "SurfaceTrackCount"
s:Sc/TestSphereTrackScorer/Component = "TestSphere"
s:Sc/TestSphereTrackScorer/Surface = "TestSphere/OuterCurvedSurface"
b:Sc/TestSphereTrackScorer/PropagateToChildren = "True"
b:Sc/TestSphereTrackScorer/OutputToConsole = "True"
b:Sc/TestSphereTrackScorer/OutputAfterRun = "True"
s:Sc/TestSphereTrackScorer/OutputType = "csv"
s:Sc/TestSphereTrackScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/TestBoxFluenceScorer/Quantity = "Fluence"
s:Sc/TestBoxFluenceScorer/Component = "TestBox"
b:Sc/TestBoxFluenceScorer/PropagateToChildren = "True"
b:Sc/TestBoxFluenceScorer/OutputToConsole = "True"
b:Sc/TestBoxFluenceScorer/OutputAfterRun = "True"
s:Sc/TestBoxFluenceScorer/OutputType = "csv"
s:Sc/TestBoxFluenceScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/TestBoxTrackScorer/Quantity = "SurfaceTrackCount"
s:Sc/TestBoxTrackScorer/Component = "TestBox"
s:Sc/TestBoxTrackScorer/Surface = "TestBox/XPlusSurface"
b:Sc/TestBoxTrackScorer/PropagateToChildren = "True"
b:Sc/TestBoxTrackScorer/OutputToConsole = "True"
b:Sc/TestBoxTrackScorer/OutputAfterRun = "True"
s:Sc/TestBoxTrackScorer/OutputType = "csv"
s:Sc/TestBoxTrackScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/TestDiscFluenceScorer/Quantity = "Fluence"
s:Sc/TestDiscFluenceScorer/Component = "TestDisc"
b:Sc/TestDiscFluenceScorer/PropagateToChildren = "True"
b:Sc/TestDiscFluenceScorer/OutputToConsole = "True"
b:Sc/TestDiscFluenceScorer/OutputAfterRun = "True"
s:Sc/TestDiscFluenceScorer/OutputType = "csv"
s:Sc/TestDiscFluenceScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/TestDiscTrackScorer/Quantity = "SurfaceTrackCount"
s:Sc/TestDiscTrackScorer/Surface = "TestDisc/ZMinusSurface"
s:Sc/TestDiscTrackScorer/Component = "TestDisc"
b:Sc/TestDiscTrackScorer/PropagateToChildren = "True"
b:Sc/TestDiscTrackScorer/OutputToConsole = "True"
b:Sc/TestDiscTrackScorer/OutputAfterRun = "True"
s:Sc/TestDiscTrackScorer/OutputType = "csv"
s:Sc/TestDiscTrackScorer/IfOutputFileAlreadyExists = "Overwrite"

s:So/Example/Type                     = "Environment"
s:So/Example/Component                = "TestVolumes"
s:So/Example/BeamParticle             = "proton"
dc:So/Example/BeamEnergy              = 200 MeV
ic:So/Example/NumberOfHistoriesInRun  = 1000000

#i:Ts/Seed = 1
i:Ts/NumberOfThreads = 0  # All available threads
i:Ts/ShowHistoryCountAtInterval = 100000

#s:Gr/ViewA/Type              = "OpenGL"
#b:Gr/ViewA/IncludeStepPoints = "True"
#b:Ts/PauseBeforeQuit = "True"
#b:Ts/UseQt = "True"

FlatteningFilter.txt

# 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

Isotope.txt

# Example of creating an element from specific abundances

sv:Ma/MyUranium/Components  = 1 "MyElU"
uv:Ma/MyUranium/Fractions   = 1 1.0
d:Ma/MyUranium/Density      = 18.95 g/cm3
s:Ma/MyUranium/DefaultColor = "green"

s:El/MyElU/Symbol             = "MyElU"
sv:El/MyElU/IsotopeNames      = 2 "U235" "U238"
uv:El/MyElU/IsotopeAbundances = 2 90. 10.

i:Is/U235/Z = 92
i:Is/U235/N = 235
d:Is/U235/A = 235.01 g/mole
i:Is/U238/Z = 92
i:Is/U238/N = 238
d:Is/U238/A = 238.03 g/mole

s:Ge/MyBox/Type     = "TsBox"
s:Ge/MyBox/Material = "MyUranium"
s:Ge/MyBox/Parent   = "World"
d:Ge/MyBox/HLX      = 2.5 m
d:Ge/MyBox/HLY      = 2. m
d:Ge/MyBox/HLZ      = 10. mm
d:Ge/MyBox/TransX   = 2. m
d:Ge/MyBox/TransY   = 0. m
d:Ge/MyBox/TransZ   = 0. m
d:Ge/MyBox/RotX     = 0. deg
d:Ge/MyBox/RotY     = 0. deg
d:Ge/MyBox/RotZ     = 0. deg

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 2.

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

LayeredMassGeometry.txt

# Demonstrates use of Layered Mass Geometry,
# a Geant4 feature whereby there can be material in a paralle world.

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

sv:Ph/Default/LayeredMassGeometryWorlds = 2 "WaterBox" "IronBox"

s:Ge/AirBox/Parent   = "World"
s:Ge/AirBox/Type     = "TsBox"
s:Ge/AirBox/Material = "Air"
d:Ge/AirBox/HLX      = 1. m
d:Ge/AirBox/HLY      = 1. m
d:Ge/AirBox/HLZ      = 1. m
d:Ge/AirBox/TransX   = 0. m
d:Ge/AirBox/TransY   = 0. m
d:Ge/AirBox/TransZ   = 0. m
d:Ge/AirBox/RotX     = 0. deg
d:Ge/AirBox/RotY     = 0. deg
d:Ge/AirBox/RotZ     = 0. deg

s:Ge/WaterBox/Parent     = "World"
s:Ge/WaterBox/Type       =  "TsBox"
s:Ge/WaterBox/Material   = "G4_WATER"
d:Ge/WaterBox/HLX        = .6 m
d:Ge/WaterBox/HLY        = .6 m
d:Ge/WaterBox/HLZ        = .6 m
d:Ge/WaterBox/TransX     = 0. m
d:Ge/WaterBox/TransY     = 0. m
d:Ge/WaterBox/TransZ     = 0. m
d:Ge/WaterBox/RotX       = 0. deg
d:Ge/WaterBox/RotY       = 0. deg
d:Ge/WaterBox/RotZ       = 0. deg
b:Ge/WaterBox/isParallel = "True"

s:Ge/IronBox/Parent     = "World"
s:Ge/IronBox/Type       =  "TsBox"
s:Ge/IronBox/Material   = "Iron"
d:Ge/IronBox/HLX        = .4 m
d:Ge/IronBox/HLY        = .4 m
d:Ge/IronBox/HLZ        = .4 m
d:Ge/IronBox/TransX     = 0. m
d:Ge/IronBox/TransY     = 0. m
d:Ge/IronBox/TransZ     = 0. m
d:Ge/IronBox/RotX       = 0. deg
d:Ge/IronBox/RotY       = 0. deg
d:Ge/IronBox/RotZ       = 0. deg
b:Ge/IronBox/isParallel = "True"

b:Ts/PauseBeforeQuit = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 270. MeV
u:So/Example/BeamEnergySpread         = 0.757504
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  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type           = "OpenGL"
sv:Gr/ViewA/VisibleWorlds = 1 "All"
i:Gr/ViewA/WindowSizeX    = 900
i:Gr/ViewA/WindowSizeY    = 900
d:Gr/ViewA/Theta          = 90 deg
d:Gr/ViewA/Phi            = 0 deg

OneBox.txt

# Simplest TOPAS example.
# A box in a beam with EM physics.

s:Ge/MyBox/Type     = "TsBox"
s:Ge/MyBox/Material = "Air"
s:Ge/MyBox/Parent   = "World"
d:Ge/MyBox/HLX      = 2.5 m
d:Ge/MyBox/HLY      = 2. m
d:Ge/MyBox/HLZ      = 1. m
d:Ge/MyBox/TransX   = 2. m
d:Ge/MyBox/TransY   = 0. m
d:Ge/MyBox/TransZ   = 0. m
d:Ge/MyBox/RotX     = 0. deg
d:Ge/MyBox/RotY     = 0. deg
d:Ge/MyBox/RotZ     = 0. deg

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
b:Gr/ViewA/IncludeAxes      = "True"
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 2.

b:Ts/PauseBeforeQuit = "True"

OneBoxRotate.txt

# Demonstrates use of includeFile.
# Overrides the RotX value from OneBox.txt

includeFile = OneBox.txt

d:Ge/MyBox/RotX = 45. deg

OneBoxTranslate.txt

# Demonstrates use of includeFile.
# Translates box by a value of -0.5 times the value
# of TransX that was inherited from the includeFile.

includeFile = OneBox.txt

d:Ge/MyBox/TransX = inheritedValue m * -0.5

ParallelWorlds.txt

# Demonstrates use of parallel worlds.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

# Save time by turning off overlap check
b:Ge/CheckForOverlaps = "False"

s:Ge/BoxInMassWorld/Parent   = "World"
s:Ge/BoxInMassWorld/Type     = "TsBox"
sc:Ge/BoxInMassWorld/Material = "G4_WATER"
dc:Ge/BoxInMassWorld/HLX      = 7.0 cm
dc:Ge/BoxInMassWorld/HLY      = 7.0 cm
dc:Ge/BoxInMassWorld/HLZ      = 9.0 cm
sc:Ge/BoxInMassWorld/DrawingStyle = "WireFrame"
ic:Ge/BoxInMassWorld/XBins    = 2
ic:Ge/BoxInMassWorld/YBins    = 2
ic:Ge/BoxInMassWorld/ZBins    = 2
sc:Ge/BoxInMassWorld/Color = "Blue"

s:Ge/BoxInParallelWorld/Parent   = "World"
s:Ge/BoxInParallelWorld/Type     = "TsBox"
b:Ge/BoxInParallelWorld/IsParallel = "True"
dc:Ge/BoxInParallelWorld/HLX      = 7.0 cm
dc:Ge/BoxInParallelWorld/HLY      = 7.0 cm
dc:Ge/BoxInParallelWorld/HLZ      = 9.0 cm
sc:Ge/BoxInParallelWorld/DrawingStyle = "WireFrame"
ic:Ge/BoxInParallelWorld/XBins    = 3
ic:Ge/BoxInParallelWorld/YBins    = 3
ic:Ge/BoxInParallelWorld/ZBins    = 3
sc:Ge/BoxInParallelWorld/Color = "Magenta"

s:Ge/Sphere/Parent   = "World"
s:Ge/Sphere/Type     = "TsSphere"
b:Ge/Sphere/IsParallel = "True"
dc:Ge/Sphere/RMax      = 2.0 cm
sc:Ge/Sphere/DrawingStyle = "WireFrame"
ic:Ge/Sphere/XBins    = 3
ic:Ge/Sphere/YBins    = 3
ic:Ge/Sphere/ZBins    = 3
dc:Ge/Sphere/TransX = 3. cm
dc:Ge/Sphere/TransY = 3. cm
dc:Ge/Sphere/TransZ = 3. cm
sc:Ge/Sphere/Color = "Green"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type = "OpenGL"

Ts/UseQt = "True"

ParticleSourcesFromGroup.txt

# Example demonsrating how to use a Group component to position
# isotropic and beam particle sources.

s:Ge/MyBox/Type     = "TsBox"
sc:Ge/MyBox/Material = "G4_WATER"
sc:Ge/MyBox/Parent   = "World"
dc:Ge/MyBox/HLX      = 1.5 m
dc:Ge/MyBox/HLY      = 1. m
dc:Ge/MyBox/HLZ      = 1. m
dc:Ge/MyBox/TransX   = 0. m
dc:Ge/MyBox/TransY   = 0. m
dc:Ge/MyBox/TransZ   = 0. m
dc:Ge/MyBox/RotX     = 0. deg
dc:Ge/MyBox/RotY     = 0. deg
dc:Ge/MyBox/RotZ     = 0. deg
sc:Ge/MyBox/Color    = "blue"
sc:Ge/MyBox/DrawingStyle = "WireFrame"

s:Ge/BeamGroup/Type    = "Group"
sc:Ge/BeamGroup/Parent = "World"
dc:Ge/BeamGroup/RotX   = -90. deg
dc:Ge/BeamGroup/RotY   = 0. deg
dc:Ge/BeamGroup/RotZ   = 0. deg
dc:Ge/BeamGroup/TransY   = 3. m

s:So/IsotropicFromGroup/Type                     = "Isotropic"
sc:So/IsotropicFromGroup/Component                = "BeamGroup"
sc:So/IsotropicFromGroup/BeamParticle             = "gamma"
dc:So/IsotropicFromGroup/BeamEnergy               = 169.23 MeV
uc:So/IsotropicFromGroup/BeamEnergySpread         = 0.757504
ic:So/IsotropicFromGroup/NumberOfHistoriesInRun   = 10

s:So/BeamFromGroup/Type                     = "Beam"
sc:So/BeamFromGroup/Component                = "BeamGroup"
sc:So/BeamFromGroup/BeamParticle             = "e-"
dc:So/BeamFromGroup/BeamEnergy               = 169.23 MeV
uc:So/BeamFromGroup/BeamEnergySpread         = 0.757504
sc:So/BeamFromGroup/BeamPositionDistribution = "Gaussian"
sc:So/BeamFromGroup/BeamPositionCutoffShape  = "Ellipse"
dc:So/BeamFromGroup/BeamPositionCutoffX      = 10. cm
dc:So/BeamFromGroup/BeamPositionCutoffY      = 10. cm
dc:So/BeamFromGroup/BeamPositionSpreadX      = 0.65 cm
dc:So/BeamFromGroup/BeamPositionSpreadY      = 0.65 cm
sc:So/BeamFromGroup/BeamAngularDistribution  = "Gaussian"
dc:So/BeamFromGroup/BeamAngularCutoffX       = 90. deg
dc:So/BeamFromGroup/BeamAngularCutoffY       = 90. deg
dc:So/BeamFromGroup/BeamAngularSpreadX       = 0.0032 rad
dc:So/BeamFromGroup/BeamAngularSpreadY       = 0.0032 rad
ic:So/BeamFromGroup/NumberOfHistoriesInRun   = 0

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type = "OpenGL"

Ts/UseQt = "True"

PhysicsSetting.txt

# Demonstrates having several physics lists defined.
# While only one physics list can be used in a given TOPAS session,
# you are free to define several different sets in your parameter files.
# The parameter Ph/ListName tells which of these lists is actually used.

s:Ph/ListName = "MyList1"

s:Ph/MyList1/Type           = "Geant4_Modular"
sv:Ph/MyList1/Modules       = 3 "g4decay" "g4em-standard_opt3" "g4h-elastic"
d:Ph/MyList1/CutForGamma    = 0.04 mm
d:Ph/MyList1/CutForElectron = 0.03 mm
d:Ph/MyList1/CutForPositron = 0.02 mm
d:Ph/MyList1/CutForProton   = 0.01 mm

s:Ph/MyList2/Type           = "Geant4_Modular"
sv:Ph/MyList2/Modules       = 1 "g4em-standard_opt0"
d:Ph/MyList2/CutForGamma    = 0.04 mm
d:Ph/MyList2/CutForElectron = 0.03 mm
d:Ph/MyList2/CutForPositron = 0.02 mm
d:Ph/MyList2/CutForProton   = 0.01 mm

s:Ph/MyList3/Type           = "Geant4_Modular"
sv:Ph/MyList3/Modules       = 1 "Transportation_Only"
d:Ph/MyList3/CutForGamma    = 0.04 mm
d:Ph/MyList3/CutForElectron = 0.03 mm
d:Ph/MyList3/CutForPositron = 0.02 mm
d:Ph/MyList3/CutForProton   = 0.01 mm

s:Ph/MyList4/Type               = "QGSP_BERT_HP"
d:Ph/MyList4/CutForAllParticles = 0.03 mm
i:Ph/MyList4/Verbosity          = 2

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 80.0 cm
d:Ge/Phantom/HLY      = 80.0 cm
d:Ge/Phantom/HLZ      = 20.0 cm
d:Ge/Phantom/TransX   = 0. cm
d:Ge/Phantom/TransY   = 0. cm
d:Ge/Phantom/TransZ   = -30. cm
d:Ge/Phantom/RotX     = 0. deg
d:Ge/Phantom/RotY     = 0.0 deg
d:Ge/Phantom/RotZ     = 0. deg
s:Ge/Phantom/Color    = "blue"
i:Ge/Phantom/XBins    = 2

s:Sc/EnergyDepAtPhantom/Quantity    = "DoseToWater"
s:Sc/EnergyDepAtPhantom/Component   = "Phantom"
b:Sc/EnergyDepAtPhantom/OutputToConsole = "TRUE"
s:Sc/EnergyDepAtPhantom/IfOutputFileAlreadyExists = "Overwrite"

s:Gr/ViewA/Type = "OpenGL"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

QtShapeTest.txt

# Demonstrates all of the standard Geant4 solids
# with many parameters controllable from the Qt GUI.
# Shows only the required parameters, omitting the optional ones
# (the ones such as TransX or RMin that have default values).
# Details are given in the TOPAS User Guide
# and in chapter 4 of the Geant4 Application Developer's Guide
# http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch04.html#sect.Geom.Solids

# Box
s:Ge/DemoBox/Type                    = "TsBox"
s:Ge/DemoBox/Parent                  = "World"
sc:Ge/DemoBox/Material                = "Air"
dc:Ge/DemoBox/HLX                     = 30. mm
dc:Ge/DemoBox/HLY                     = 40. mm
dc:Ge/DemoBox/HLZ                     = 60. mm
sc:Ge/DemoBox/Color                   = "white"
sc:Ge/DemoBox/DrawingStyle       = "FullWireFrame"

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

# CutTubs
s:Ge/DemoCutTubs/Type                = "G4CutTubs"
s:Ge/DemoCutTubs/Parent              = "World"
sc:Ge/DemoCutTubs/Material            = "Air"
dc:Ge/DemoCutTubs/TransZ              = 24 cm
dc:Ge/DemoCutTubs/RMax                = 20 mm
dc:Ge/DemoCutTubs/HL                  = 30 mm
uvc:Ge/DemoCutTubs/LowNorm            = 3 0. -0.7  -0.71
uvc:Ge/DemoCutTubs/HighNorm           = 3 0.7 0. 0.71
sc:Ge/DemoCutTubs/Color               = "skyblue"
sc:Ge/DemoCutTubs/DrawingStyle        = "FullWireFrame"

# Cons
s:Ge/DemoCons/Type                   = "G4Cons"
s:Ge/DemoCons/Parent                 = "World"
sc:Ge/DemoCons/Material               = "Air"
dc:Ge/DemoCons/TransZ                 = 36 cm
dc:Ge/DemoCons/RMax1                  = 10 mm
dc:Ge/DemoCons/RMax2                  = 25 mm
dc:Ge/DemoCons/HL                     = 40 mm
sc:Ge/DemoCons/Color                  = "red"
sc:Ge/DemoCons/DrawingStyle           = "FullWireFrame"

# Para
s:Ge/DemoPara/Type                   = "G4Para"
s:Ge/DemoPara/Parent                 = "World"
sc:Ge/DemoPara/Material               = "Air"
dc:Ge/DemoPara/TransX                 = 0 cm
dc:Ge/DemoPara/TransY                 = 0 cm
dc:Ge/DemoPara/TransZ                 = 48 cm
dc:Ge/DemoPara/RotX                   = 0 deg
dc:Ge/DemoPara/RotY                   = 0 deg
dc:Ge/DemoPara/RotZ                   = 0 deg
dc:Ge/DemoPara/HLX                    = 30. mm
dc:Ge/DemoPara/HLY                    = 40. mm
dc:Ge/DemoPara/HLZ                    = 60. mm
dc:Ge/DemoPara/Alpha                  = 0.3 rad
dc:Ge/DemoPara/Theta                  = 0 rad
dc:Ge/DemoPara/Phi                    = 0 rad
sc:Ge/DemoPara/Color                  = "magenta"
sc:Ge/DemoPara/DrawingStyle       = "FullWireFrame"

# Trd
s:Ge/DemoTrd/Type                    = "G4Trd"
s:Ge/DemoTrd/Parent                  = "World"
sc:Ge/DemoTrd/Material                = "Air"
dc:Ge/DemoTrd/TransX                  = 0 cm
dc:Ge/DemoTrd/TransY                  = 0 cm
dc:Ge/DemoTrd/TransZ                  = 66 cm
dc:Ge/DemoTrd/RotX                    = 0 deg
dc:Ge/DemoTrd/RotY                    = 0 deg
dc:Ge/DemoTrd/RotZ                    = 0 deg
dc:Ge/DemoTrd/HLX1                    = 30. mm
dc:Ge/DemoTrd/HLX2                    = 10. mm
dc:Ge/DemoTrd/HLY1                    = 40. mm
dc:Ge/DemoTrd/HLY2                    = 15. mm
dc:Ge/DemoTrd/HLZ                     = 60. mm
sc:Ge/DemoTrd/Color                   = "violet"
sc:Ge/DemoTrd/DrawingStyle       = "FullWireFrame"

# RTrap - Right Angular Wedge Trapezoid
s:Ge/DemoRTrap/Type                  = "G4RTrap"
s:Ge/DemoRTrap/Parent                = "World"
sc:Ge/DemoRTrap/Material              = "Air"
dc:Ge/DemoRTrap/TransX                = 0 cm
dc:Ge/DemoRTrap/TransY                = 0 cm
dc:Ge/DemoRTrap/TransZ                = 84 cm
dc:Ge/DemoRTrap/RotX                  = 0 deg
dc:Ge/DemoRTrap/RotY                  = 0 deg
dc:Ge/DemoRTrap/RotZ                  = 0 deg
dc:Ge/DemoRTrap/LZ                    = 120. mm
dc:Ge/DemoRTrap/LY                    = 80. mm
dc:Ge/DemoRTrap/LX                    = 60. mm
dc:Ge/DemoRTrap/LTX                   = 30. mm
sc:Ge/DemoRTrap/Color                 = "pink"
sc:Ge/DemoRTrap/DrawingStyle       = "FullWireFrame"

# GTrap - General Trapezoid
s:Ge/DemoGTrap/Type                  = "G4GTrap"
s:Ge/DemoGTrap/Parent                = "World"
sc:Ge/DemoGTrap/Material              = "Air"
dc:Ge/DemoGTrap/TransX                = 0 cm
dc:Ge/DemoGTrap/TransY                = 0 cm
dc:Ge/DemoGTrap/TransZ                = 104 cm
dc:Ge/DemoGTrap/RotX                  = 0 deg
dc:Ge/DemoGTrap/RotY                  = 0 deg
dc:Ge/DemoGTrap/RotZ                  = 0 deg
dc:Ge/DemoGTrap/HLZ                   = 60. mm
dc:Ge/DemoGTrap/Theta                 = 20 deg
dc:Ge/DemoGTrap/Phi                   = 5 deg
dc:Ge/DemoGTrap/HLY1                  = 40. mm
dc:Ge/DemoGTrap/HLX1                  = 30. mm
dc:Ge/DemoGTrap/HLX2                  = 40. mm
dc:Ge/DemoGTrap/Alp1                  = 10 deg
dc:Ge/DemoGTrap/HLY2                  = 16. mm
dc:Ge/DemoGTrap/HLX3                  = 10. mm
dc:Ge/DemoGTrap/HLX4                  = 14. mm
dc:Ge/DemoGTrap/Alp2                  = 10 deg
sc:Ge/DemoGTrap/Color                 = "indigo"
sc:Ge/DemoGTrap/DrawingStyle       = "FullWireFrame"

# Sphere
s:Ge/DemoSphere/Type                 = "TsSphere"
s:Ge/DemoSphere/Parent               = "World"
sc:Ge/DemoSphere/Material             = "Air"
dc:Ge/DemoSphere/TransZ               = 124 cm
dc:Ge/DemoSphere/RMax                 = 120 mm
sc:Ge/DemoSphere/Color                = "grass"
sc:Ge/DemoSphere/DrawingStyle         = "FullWireFrame"

# Orb
s:Ge/DemoOrb/Type                    = "G4Orb"
s:Ge/DemoOrb/Parent                  = "World"
sc:Ge/DemoOrb/Material                = "Air"
dc:Ge/DemoOrb/TransX                  = 0 cm
dc:Ge/DemoOrb/TransY                  = 0 cm
dc:Ge/DemoOrb/TransZ                  = 150 cm
dc:Ge/DemoOrb/RotX                    = 0 deg
dc:Ge/DemoOrb/RotY                    = 0 deg
dc:Ge/DemoOrb/RotZ                    = 0 deg
dc:Ge/DemoOrb/R                       = 100 mm
sc:Ge/DemoOrb/Color                   = "orange"
sc:Ge/DemoOrb/DrawingStyle            = "FullWireFrame"

# Torus
s:Ge/DemoTorus/Type                  = "G4Torus"
s:Ge/DemoTorus/Parent                = "World"
sc:Ge/DemoTorus/Material              = "Air"
dc:Ge/DemoTorus/TransZ                = 176 cm
dc:Ge/DemoTorus/RotX                  = 0 deg
dc:Ge/DemoTorus/RMax                  = 60 mm
dc:Ge/DemoTorus/RTor                  = 200 mm
sc:Ge/DemoTorus/Color                 = "purple"
sc:Ge/DemoTorus/DrawingStyle          = "FullWireFrame"

# HPolycone - Hollow Polycone
s:Ge/DemoHPolycone/Type              = "G4HPolycone"
s:Ge/DemoHPolycone/Parent            = "World"
sc:Ge/DemoHPolycone/Material          = "Air"
dc:Ge/DemoHPolycone/TransZ            = 180 cm
dvc:Ge/DemoHPolycone/RInner           = 9 0 1. 1. 1. 2. 2. 3. .5 .2 mm
dvc:Ge/DemoHPolycone/ROuter           = 9 0 10 10 5 5 10 10 2 2 mm
dvc:Ge/DemoHPolycone/Z                = 9 5 7 9 11 25 27 29 31 35 mm
sc:Ge/DemoHPolycone/Color             = "brown"
sc:Ge/DemoHPolycone/DrawingStyle      = "FullWireFrame"

# SPolycone - Solid Polycone
s:Ge/DemoSPolycone/Type              = "G4SPolycone"
s:Ge/DemoSPolycone/Parent            = "World"
sc:Ge/DemoSPolycone/Material          = "Air"
dc:Ge/DemoSPolycone/TransZ            = 186 cm
dvc:Ge/DemoSPolycone/R                = 10 0 10 10 5 5 10 10 2 2 0 mm
dvc:Ge/DemoSPolycone/Z                = 10 5 7 9 11 25 27 29 31 35 35 mm
sc:Ge/DemoSPolycone/Color             = "grey"
sc:Ge/DemoSPolycone/DrawingStyle      = "FullWireFrame"

# GenericPolycone - Generic Polycone
s:Ge/DemoGenericPolycone/Type              = "G4GenericPolycone"
s:Ge/DemoGenericPolycone/Parent            = "World"
sc:Ge/DemoGenericPolycone/Material          = "Air"
dc:Ge/DemoGenericPolycone/TransZ            = 192 cm
dvc:Ge/DemoGenericPolycone/R                = 10 0 10 10 5 5 10 10 2 2 0 mm
dvc:Ge/DemoGenericPolycone/Z                = 10 5 7 9 11 25 27 29 31 35 35 mm
sc:Ge/DemoGenericPolycone/Color             = "magenta"
sc:Ge/DemoGenericPolycone/DrawingStyle      = "FullWireFrame"

# HPolyhedra - Hollow Polyhedra
s:Ge/DemoHPolyhedra/Type             = "G4HPolyhedra"
s:Ge/DemoHPolyhedra/Parent           = "World"
sc:Ge/DemoHPolyhedra/Material         = "Air"
dc:Ge/DemoHPolyhedra/TransZ           = 198 cm
ic:Ge/DemoHPolyhedra/NSides           = 3
dvc:Ge/DemoHPolyhedra/Z               = 7 0 5 8 13 30 32 35 mm
dvc:Ge/DemoHPolyhedra/RInner          = 7 0 2 2 3 1 1 2 mm
dvc:Ge/DemoHPolyhedra/ROuter          = 7 0 15 15 4 4 10 10 mm
sc:Ge/DemoHPolyhedra/Color            = "blue"
sc:Ge/DemoHPolyhedra/DrawingStyle         = "FullWireFrame"

# SPolyhedra - Solid Polyhedra
s:Ge/DemoSPolyhedra/Type             = "G4SPolyhedra"
s:Ge/DemoSPolyhedra/Parent           = "World"
sc:Ge/DemoSPolyhedra/Material         = "Air"
dc:Ge/DemoSPolyhedra/TransZ           = 204 cm
i:Ge/DemoSPolyhedra/NSides           = 100
dvc:Ge/DemoSPolyhedra/R               = 5 0 4 12 8 0 mm
dvc:Ge/DemoSPolyhedra/Z               = 5 0 0 8 16 16 mm
sc:Ge/DemoSPolyhedra/Color            = "green"
sc:Ge/DemoSPolyhedra/DrawingStyle         = "FullWireFrame"

# EllipticalTube
s:Ge/DemoEllipticalTube/Type         = "G4EllipticalTube"
s:Ge/DemoEllipticalTube/Parent       = "World"
sc:Ge/DemoEllipticalTube/Material     = "Air"
dc:Ge/DemoEllipticalTube/TransZ       = 210 cm
dc:Ge/DemoEllipticalTube/HLX          = 5 mm
dc:Ge/DemoEllipticalTube/HLY          = 10 mm
dc:Ge/DemoEllipticalTube/HLZ          = 20 mm
sc:Ge/DemoEllipticalTube/Color        = "yellow"
sc:Ge/DemoEllipticalTube/DrawingStyle = "FullWireFrame"

# Ellipsoid
s:Ge/DemoEllipsoid/Type              = "G4Ellipsoid"
s:Ge/DemoEllipsoid/Parent            = "World"
sc:Ge/DemoEllipsoid/Material          = "Air"
dc:Ge/DemoEllipsoid/TransZ            = 218 cm
dc:Ge/DemoEllipsoid/HLX               = 10 mm
dc:Ge/DemoEllipsoid/HLY               = 20 mm
dc:Ge/DemoEllipsoid/HLZ               = 50 mm
sc:Ge/DemoEllipsoid/Color             = "white"
sc:Ge/DemoEllipsoid/DrawingStyle      = "FullWireFrame"

# EllipticalCone
s:Ge/DemoEllipticalCone/Type         = "G4EllipticalCone"
s:Ge/DemoEllipticalCone/Parent       = "World"
sc:Ge/DemoEllipticalCone/Material     = "Air"
dc:Ge/DemoEllipticalCone/TransZ       = 228 cm
dc:Ge/DemoEllipticalCone/HLX          = .4 mm
dc:Ge/DemoEllipticalCone/HLY          = .8 mm
dc:Ge/DemoEllipticalCone/ZMax         = 50 mm
sc:Ge/DemoEllipticalCone/Color        = "lightblue"
sc:Ge/DemoEllipticalCone/DrawingStyle = "FullWireFrame"

# Paraboloid
s:Ge/DemoParaboloid/Type             = "G4Paraboloid"
s:Ge/DemoParaboloid/Parent           = "World"
sc:Ge/DemoParaboloid/Material         = "Air"
dc:Ge/DemoParaboloid/TransZ           = 240 cm
dc:Ge/DemoParaboloid/HLZ              = 20 mm
dc:Ge/DemoParaboloid/R1               = 20 mm
dc:Ge/DemoParaboloid/R2               = 35 mm
sc:Ge/DemoParaboloid/Color            = "skyblue"
sc:Ge/DemoParaboloid/DrawingStyle     = "FullWireFrame"

# Hype
s:Ge/DemoHype/Type                   = "G4Hype"
s:Ge/DemoHype/Parent                 = "World"
sc:Ge/DemoHype/Material               = "Air"
dc:Ge/DemoHype/TransZ                 = 254 cm
dc:Ge/DemoHype/OR                     = 30 mm
dc:Ge/DemoHype/OS                     = .7 rad
dc:Ge/DemoHype/HLZ                    = 50 mm
sc:Ge/DemoHype/Color                  = "red"
sc:Ge/DemoHype/DrawingStyle           = "FullWireFrame"

# Tet
s:Ge/DemoTet/Type                    = "G4Tet"
s:Ge/DemoTet/Parent                  = "World"
sc:Ge/DemoTet/Material                = "Air"
dc:Ge/DemoTet/TransZ                  = 268 cm
dvc:Ge/DemoTet/Anchor                 = 3 0 0 17.3 mm
dvc:Ge/DemoTet/P2                     = 3 0 16.3 -5.8 mm
dvc:Ge/DemoTet/P3                     = 3 -14.1 -8.2 -5.8 mm
dvc:Ge/DemoTet/P4                     = 3 14.1 -8.2 -5.8 mm
sc:Ge/DemoTet/Color                   = "magenta"
sc:Ge/DemoTet/DrawingStyle         = "FullWireFrame"

# ExtrudedSolid
s:Ge/DemoExtrudedSolid/Type          = "G4ExtrudedSolid"
s:Ge/DemoExtrudedSolid/Parent        = "World"
sc:Ge/DemoExtrudedSolid/Material      = "Air"
dc:Ge/DemoExtrudedSolid/TransZ        = 276 cm
dvc:Ge/DemoExtrudedSolid/Polygons     = 16 -30 -30 -30 30 30 30 30 -30 15 -30 15 15 -15 15 -15 -30 mm
dc:Ge/DemoExtrudedSolid/HLZ           = 20 mm
dvc:Ge/DemoExtrudedSolid/Off1         = 2 10. 10. mm
uc:Ge/DemoExtrudedSolid/Scale1        = 1.
dvc:Ge/DemoExtrudedSolid/Off2         = 2 -10. -10. mm
uc:Ge/DemoExtrudedSolid/Scale2        = 0.6
sc:Ge/DemoExtrudedSolid/Color         = "violet"
sc:Ge/DemoExtrudedSolid/DrawingStyle         = "FullWireFrame"

# TwistedBox
s:Ge/DemoG4TwistedBox/Type           = "G4TwistedBox"
s:Ge/DemoG4TwistedBox/Parent         = "World"
sc:Ge/DemoG4TwistedBox/Material       = "Air"
dc:Ge/DemoG4TwistedBox/TransZ         = 290 cm
dc:Ge/DemoG4TwistedBox/Twist          = 30 deg
dc:Ge/DemoG4TwistedBox/HLX            = 30. mm
dc:Ge/DemoG4TwistedBox/HLY            = 40. mm
dc:Ge/DemoG4TwistedBox/HLZ            = 60. mm
sc:Ge/DemoG4TwistedBox/Color          = "pink"
sc:Ge/DemoG4TwistedBox/DrawingStyle   = "FullWireFrame"

# RTwistedTrap - Right Angular Wedge Twisted Trapezoid
s:Ge/DemoRTwistedTrap/Type           = "G4RTwistedTrap"
s:Ge/DemoRTwistedTrap/Parent         = "World"
sc:Ge/DemoRTwistedTrap/Material       = "Air"
dc:Ge/DemoRTwistedTrap/TransZ         = 308 cm
dc:Ge/DemoRTwistedTrap/Twist          = 30 deg
dc:Ge/DemoRTwistedTrap/HLX1           = 30. mm
dc:Ge/DemoRTwistedTrap/HLX2           = 40. mm
dc:Ge/DemoRTwistedTrap/HLY            = 40. mm
dc:Ge/DemoRTwistedTrap/HLZ            = 60. mm
sc:Ge/DemoRTwistedTrap/Color          = "indigo"
sc:Ge/DemoRTwistedTrap/DrawingStyle   = "FullWireFrame"

# GTwistedTrap - General Twisted Trapezoid
s:Ge/DemoGTwistedTrap/Type           = "G4GTwistedTrap"
s:Ge/DemoGTwistedTrap/Parent         = "World"
sc:Ge/DemoGTwistedTrap/Material       = "Air"
dc:Ge/DemoGTwistedTrap/TransZ         = 326 cm
dc:Ge/DemoGTwistedTrap/Twist          = 30 deg
dc:Ge/DemoGTwistedTrap/HLZ            = 60. mm
dc:Ge/DemoGTwistedTrap/Theta          = 20 deg
dc:Ge/DemoGTwistedTrap/Phi            = 5 deg
dc:Ge/DemoGTwistedTrap/HLY1           = 40. mm
dc:Ge/DemoGTwistedTrap/HLX1           = 30. mm
dc:Ge/DemoGTwistedTrap/HLX2           = 40. mm
dc:Ge/DemoGTwistedTrap/HLY2           = 16. mm
dc:Ge/DemoGTwistedTrap/HLX3           = 10. mm
dc:Ge/DemoGTwistedTrap/HLX4           = 14. mm
dc:Ge/DemoGTwistedTrap/Alpha          = 10 deg
sc:Ge/DemoGTwistedTrap/Color          = "grass"
sc:Ge/DemoGTwistedTrap/DrawingStyle   = "FullWireFrame"

# TwistedTrd
s:Ge/DemoTwistedTrd/Type             = "G4TwistedTrd"
s:Ge/DemoTwistedTrd/Parent           = "World"
sc:Ge/DemoTwistedTrd/Material         = "Air"
dc:Ge/DemoTwistedTrd/TransZ           = 342 cm
dc:Ge/DemoTwistedTrd/HLX1             = 30. mm
dc:Ge/DemoTwistedTrd/HLX2             = 10. mm
dc:Ge/DemoTwistedTrd/HLY1             = 40. mm
dc:Ge/DemoTwistedTrd/HLY2             = 15. mm
dc:Ge/DemoTwistedTrd/HLZ              = 60. mm
dc:Ge/DemoTwistedTrd/Twist            = 30 deg
sc:Ge/DemoTwistedTrd/Color            = "orange"
sc:Ge/DemoTwistedTrd/DrawingStyle     = "FullWireFrame"

# GenericTrap
s:Ge/DemoGenericTrap/Type            = "G4GenericTrap"
s:Ge/DemoGenericTrap/Parent          = "World"
sc:Ge/DemoGenericTrap/Material        = "Air"
dc:Ge/DemoGenericTrap/TransZ          = 356 cm
dc:Ge/DemoGenericTrap/HLZ             = 25 mm
dvc:Ge/DemoGenericTrap/Vertices       = 16 -30 -30 -30 30 30 30 30 -30 -5 -20 -20 20 20 20 20 -20 mm
sc:Ge/DemoGenericTrap/Color           = "purple"
sc:Ge/DemoGenericTrap/DrawingStyle    = "FullWireFrame"

# TwistedTubs
s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
s:Ge/DemoTwistedTubs/Parent          = "World"
sc:Ge/DemoTwistedTubs/Material        = "Air"
dc:Ge/DemoTwistedTubs/TransZ          = 364 cm
dc:Ge/DemoTwistedTubs/Twist           = 60 deg
dc:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
dc:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
dc:Ge/DemoTwistedTubs/HLZ             = 20 mm
dc:Ge/DemoTwistedTubs/Phi             = 90 deg
sc:Ge/DemoTwistedTubs/Color           = "brown"
sc:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

i:So/Demo/NumberOfHistoriesInRun   = 10

b:Ge/World/Invisible = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type = "OpenGL"

Ts/UseQt = "True"

ShapeTestWithAllParameters.txt

# Demonstrates all of the standard Geant4 solids.
# Shows all parameters, including optional ones
# (the ones such as TransX or RMin that have default values).
# Details are given in the TOPAS User Guide
# and in chapter 4 of the Geant4 Application Developer's Guide
# http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch04.html#sect.Geom.Solids

# Box
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"

# 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"
s:Ge/DemoCutTubs/Parent              = "World"
s:Ge/DemoCutTubs/Material            = "Air"
d:Ge/DemoCutTubs/TransX              = 0 cm
d:Ge/DemoCutTubs/TransY              = 0 cm
d:Ge/DemoCutTubs/TransZ              = 24 cm
d:Ge/DemoCutTubs/RotX                = 0 deg
d:Ge/DemoCutTubs/RotY                = 0 deg
d:Ge/DemoCutTubs/RotZ                = 0 deg
d:Ge/DemoCutTubs/RMin                = 12 mm
d:Ge/DemoCutTubs/RMax                = 20 mm
d:Ge/DemoCutTubs/HL                  = 30 mm
d:Ge/DemoCutTubs/SPhi                = 0 rad
d:Ge/DemoCutTubs/DPhi                = 1.5 rad
uv:Ge/DemoCutTubs/LowNorm            = 3 0. -0.7  -0.71
uv:Ge/DemoCutTubs/HighNorm           = 3 0.7 0. 0.71
s:Ge/DemoCutTubs/Color               = "skyblue"
s:Ge/DemoCutTubs/DrawingStyle        = "FullWireFrame"

# Cons
s:Ge/DemoCons/Type                   = "G4Cons"
s:Ge/DemoCons/Parent                 = "World"
s:Ge/DemoCons/Material               = "Air"
d:Ge/DemoCons/TransX                 = 0 cm
d:Ge/DemoCons/TransY                 = 0 cm
d:Ge/DemoCons/TransZ                 = 36 cm
d:Ge/DemoCons/RotX                   = 0 deg
d:Ge/DemoCons/RotY                   = 0 deg
d:Ge/DemoCons/RotZ                   = 0 deg
d:Ge/DemoCons/RMin1                  = 5 mm
d:Ge/DemoCons/RMax1                  = 10 mm
d:Ge/DemoCons/RMin2                  = 20 mm
d:Ge/DemoCons/RMax2                  = 25 mm
d:Ge/DemoCons/HL                     = 40 mm
d:Ge/DemoCons/SPhi                   = 0 rad
d:Ge/DemoCons/DPhi                   = 1.34 rad
s:Ge/DemoCons/Color                  = "red"
s:Ge/DemoCons/DrawingStyle           = "FullWireFrame"

# Para
s:Ge/DemoPara/Type                   = "G4Para"
s:Ge/DemoPara/Parent                 = "World"
s:Ge/DemoPara/Material               = "Air"
d:Ge/DemoPara/TransX                 = 0 cm
d:Ge/DemoPara/TransY                 = 0 cm
d:Ge/DemoPara/TransZ                 = 48 cm
d:Ge/DemoPara/RotX                   = 0 deg
d:Ge/DemoPara/RotY                   = 0 deg
d:Ge/DemoPara/RotZ                   = 0 deg
d:Ge/DemoPara/HLX                    = 30. mm
d:Ge/DemoPara/HLY                    = 40. mm
d:Ge/DemoPara/HLZ                    = 60. mm
d:Ge/DemoPara/Alpha                  = 0.3 rad
d:Ge/DemoPara/Theta                  = 0 rad
d:Ge/DemoPara/Phi                    = 0 rad
s:Ge/DemoPara/Color                  = "magenta"

# Trd
s:Ge/DemoTrd/Type                    = "G4Trd"
s:Ge/DemoTrd/Parent                  = "World"
s:Ge/DemoTrd/Material                = "Air"
d:Ge/DemoTrd/TransX                  = 0 cm
d:Ge/DemoTrd/TransY                  = 0 cm
d:Ge/DemoTrd/TransZ                  = 66 cm
d:Ge/DemoTrd/RotX                    = 0 deg
d:Ge/DemoTrd/RotY                    = 0 deg
d:Ge/DemoTrd/RotZ                    = 0 deg
d:Ge/DemoTrd/HLX1                    = 30. mm
d:Ge/DemoTrd/HLX2                    = 10. mm
d:Ge/DemoTrd/HLY1                    = 40. mm
d:Ge/DemoTrd/HLY2                    = 15. mm
d:Ge/DemoTrd/HLZ                     = 60. mm
s:Ge/DemoTrd/Color                   = "violet"

# RTrap - Right Angular Wedge Trapezoid
s:Ge/DemoRTrap/Type                  = "G4RTrap"
s:Ge/DemoRTrap/Parent                = "World"
s:Ge/DemoRTrap/Material              = "Air"
d:Ge/DemoRTrap/TransX                = 0 cm
d:Ge/DemoRTrap/TransY                = 0 cm
d:Ge/DemoRTrap/TransZ                = 84 cm
d:Ge/DemoRTrap/RotX                  = 0 deg
d:Ge/DemoRTrap/RotY                  = 0 deg
d:Ge/DemoRTrap/RotZ                  = 0 deg
d:Ge/DemoRTrap/LZ                    = 120. mm
d:Ge/DemoRTrap/LY                    = 80. mm
d:Ge/DemoRTrap/LX                    = 60. mm
d:Ge/DemoRTrap/LTX                   = 30. mm
s:Ge/DemoRTrap/Color                 = "pink"

# GTrap - General Trapezoid
s:Ge/DemoGTrap/Type                  = "G4GTrap"
s:Ge/DemoGTrap/Parent                = "World"
s:Ge/DemoGTrap/Material              = "Air"
d:Ge/DemoGTrap/TransX                = 0 cm
d:Ge/DemoGTrap/TransY                = 0 cm
d:Ge/DemoGTrap/TransZ                = 104 cm
d:Ge/DemoGTrap/RotX                  = 0 deg
d:Ge/DemoGTrap/RotY                  = 0 deg
d:Ge/DemoGTrap/RotZ                  = 0 deg
d:Ge/DemoGTrap/HLZ                   = 60. mm
d:Ge/DemoGTrap/Theta                 = 20 deg
d:Ge/DemoGTrap/Phi                   = 5 deg
d:Ge/DemoGTrap/HLY1                  = 40. mm
d:Ge/DemoGTrap/HLX1                  = 30. mm
d:Ge/DemoGTrap/HLX2                  = 40. mm
d:Ge/DemoGTrap/Alp1                  = 10 deg
d:Ge/DemoGTrap/HLY2                  = 16. mm
d:Ge/DemoGTrap/HLX3                  = 10. mm
d:Ge/DemoGTrap/HLX4                  = 14. mm
d:Ge/DemoGTrap/Alp2                  = 10 deg
s:Ge/DemoGTrap/Color                 = "indigo"

# Sphere
s:Ge/DemoSphere/Type                 = "TsSphere"
s:Ge/DemoSphere/Parent               = "World"
s:Ge/DemoSphere/Material             = "Air"
d:Ge/DemoSphere/TransX               = 0 cm
d:Ge/DemoSphere/TransY               = 0 cm
d:Ge/DemoSphere/TransZ               = 124 cm
d:Ge/DemoSphere/RotX                 = 0 deg
d:Ge/DemoSphere/RotY                 = 0 deg
d:Ge/DemoSphere/RotZ                 = 0 deg
d:Ge/DemoSphere/RMin                 = 100 mm
d:Ge/DemoSphere/RMax                 = 120 mm
d:Ge/DemoSphere/SPhi                 = 0 deg
d:Ge/DemoSphere/DPhi                 = 180 deg
d:Ge/DemoSphere/STheta               = 0 deg
d:Ge/DemoSphere/DTheta               = 180 deg
s:Ge/DemoSphere/DrawingStyle         = "FullWireFrame"
s:Ge/DemoSphere/Color                = "grass"

# Orb
s:Ge/DemoOrb/Type                    = "G4Orb"
s:Ge/DemoOrb/Parent                  = "World"
s:Ge/DemoOrb/Material                = "Air"
d:Ge/DemoOrb/TransX                  = 0 cm
d:Ge/DemoOrb/TransY                  = 0 cm
d:Ge/DemoOrb/TransZ                  = 150 cm
d:Ge/DemoOrb/RotX                    = 0 deg
d:Ge/DemoOrb/RotY                    = 0 deg
d:Ge/DemoOrb/RotZ                    = 0 deg
d:Ge/DemoOrb/R                       = 100 mm
s:Ge/DemoOrb/Color                   = "orange"
s:Ge/DemoOrb/DrawingStyle            = "FullWireFrame"

# Torus
s:Ge/DemoTorus/Type                  = "G4Torus"
s:Ge/DemoTorus/Parent                = "World"
s:Ge/DemoTorus/Material              = "Air"
d:Ge/DemoTorus/TransX                = 0 cm
d:Ge/DemoTorus/TransY                = 0 cm
d:Ge/DemoTorus/TransZ                = 176 cm
d:Ge/DemoTorus/RotX                  = 0 deg
d:Ge/DemoTorus/RotY                  = 0 deg
d:Ge/DemoTorus/RotZ                  = 0 deg
d:Ge/DemoTorus/RMin                  = 40 mm
d:Ge/DemoTorus/RMax                  = 60 mm
d:Ge/DemoTorus/RTor                  = 200 mm
d:Ge/DemoTorus/SPhi                  = 0 deg
d:Ge/DemoTorus/DPhi                  = 90 deg
s:Ge/DemoTorus/Color                 = "purple"
s:Ge/DemoTorus/DrawingStyle          = "FullWireFrame"

# HPolycone - Hollow Polycone
s:Ge/DemoHPolycone/Type              = "G4HPolycone"
s:Ge/DemoHPolycone/Parent            = "World"
s:Ge/DemoHPolycone/Material          = "Air"
d:Ge/DemoHPolycone/TransX            = 0 cm
d:Ge/DemoHPolycone/TransY            = 0 cm
d:Ge/DemoHPolycone/TransZ            = 180 cm
d:Ge/DemoHPolycone/RotX              = 0 deg
d:Ge/DemoHPolycone/RotY              = 0 deg
d:Ge/DemoHPolycone/RotZ              = 0 deg
d:Ge/DemoHPolycone/PhiStart          = 0.25 rad
d:Ge/DemoHPolycone/PhiTotal          = 1.5 rad
dv:Ge/DemoHPolycone/RInner           = 9 0 1. 1. 1. 2. 2. 3. .5 .2 mm
dv:Ge/DemoHPolycone/ROuter           = 9 0 10 10 5 5 10 10 2 2 mm
dv:Ge/DemoHPolycone/Z                = 9 5 7 9 11 25 27 29 31 35 mm
s:Ge/DemoHPolycone/Color             = "brown"
s:Ge/DemoHPolycone/DrawingStyle      = "FullWireFrame"

# SPolycone - Solid Polycone
s:Ge/DemoSPolycone/Type              = "G4SPolycone"
s:Ge/DemoSPolycone/Parent            = "World"
s:Ge/DemoSPolycone/Material          = "Air"
d:Ge/DemoSPolycone/TransX            = 0 cm
d:Ge/DemoSPolycone/TransY            = 0 cm
d:Ge/DemoSPolycone/TransZ            = 186 cm
d:Ge/DemoSPolycone/RotX              = 0 deg
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                = 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"

# GenericPolycone - Generic Polycone
s:Ge/DemoGenericPolycone/Type              = "G4GenericPolycone"
s:Ge/DemoGenericPolycone/Parent            = "World"
s:Ge/DemoGenericPolycone/Material          = "Air"
d:Ge/DemoGenericPolycone/TransX            = 0 cm
d:Ge/DemoGenericPolycone/TransY            = 0 cm
d:Ge/DemoGenericPolycone/TransZ            = 192 cm
d:Ge/DemoGenericPolycone/RotX              = 0 deg
d:Ge/DemoGenericPolycone/RotY              = 0 deg
d:Ge/DemoGenericPolycone/RotZ              = 0 deg
d:Ge/DemoGenericPolycone/PhiStart          = 0.25 rad
d:Ge/DemoGenericPolycone/PhiTotal          = 1.5 rad
dv:Ge/DemoGenericPolycone/R                = 10 0 10 10 5 5 10 10 2 2 0 mm
dv:Ge/DemoGenericPolycone/Z                = 10 5 7 9 11 25 27 29 31 35 35 mm
s:Ge/DemoGenericPolycone/Color             = "magenta"
s:Ge/DemoGenericPolycone/DrawingStyle      = "FullWireFrame"

# HPolyhedra - Hollow Polyhedra
s:Ge/DemoHPolyhedra/Type             = "G4HPolyhedra"
s:Ge/DemoHPolyhedra/Parent           = "World"
s:Ge/DemoHPolyhedra/Material         = "Air"
d:Ge/DemoHPolyhedra/TransX           = 0 cm
d:Ge/DemoHPolyhedra/TransY           = 0 cm
d:Ge/DemoHPolyhedra/TransZ           = 198 cm
d:Ge/DemoHPolyhedra/RotX             = 0 deg
d:Ge/DemoHPolyhedra/RotY             = 0 deg
d:Ge/DemoHPolyhedra/RotZ             = 0 deg
d:Ge/DemoHPolyhedra/PhiStart         = -0.25 rad
d:Ge/DemoHPolyhedra/PhiTotal         = 1.25 rad
i:Ge/DemoHPolyhedra/NSides           = 3
dv:Ge/DemoHPolyhedra/Z               = 7 0 5 8 13 30 32 35 mm
dv:Ge/DemoHPolyhedra/RInner          = 7 0 2 2 3 1 1 2 mm
dv:Ge/DemoHPolyhedra/ROuter          = 7 0 15 15 4 4 10 10 mm
s:Ge/DemoHPolyhedra/Color            = "blue"

# SPolyhedra - Solid Polyhedra
s:Ge/DemoSPolyhedra/Type             = "G4SPolyhedra"
s:Ge/DemoSPolyhedra/Parent           = "World"
s:Ge/DemoSPolyhedra/Material         = "Air"
d:Ge/DemoSPolyhedra/TransX           = 0 cm
d:Ge/DemoSPolyhedra/TransY           = 0 cm
d:Ge/DemoSPolyhedra/TransZ           = 204 cm
d:Ge/DemoSPolyhedra/RotX             = 0 deg
d:Ge/DemoSPolyhedra/RotY             = 0 deg
d:Ge/DemoSPolyhedra/RotZ             = 0 deg
d:Ge/DemoSPolyhedra/PhiStart         = -0.25 rad
d:Ge/DemoSPolyhedra/PhiTotal         = 1.25 rad
i:Ge/DemoSPolyhedra/NSides           = 100
dv:Ge/DemoSPolyhedra/R               = 5 0 4 12 8 0 mm
dv:Ge/DemoSPolyhedra/Z               = 5 0 0 8 16 16 mm
s:Ge/DemoSPolyhedra/Color            = "green"

# EllipticalTube
s:Ge/DemoEllipticalTube/Type         = "G4EllipticalTube"
s:Ge/DemoEllipticalTube/Parent       = "World"
s:Ge/DemoEllipticalTube/Material     = "Air"
d:Ge/DemoEllipticalTube/TransX       = 0 cm
d:Ge/DemoEllipticalTube/TransY       = 0 cm
d:Ge/DemoEllipticalTube/TransZ       = 210 cm
d:Ge/DemoEllipticalTube/RotX         = 0 deg
d:Ge/DemoEllipticalTube/RotY         = 0 deg
d:Ge/DemoEllipticalTube/RotZ         = 0 deg
d:Ge/DemoEllipticalTube/HLX          = 5 mm
d:Ge/DemoEllipticalTube/HLY          = 10 mm
d:Ge/DemoEllipticalTube/HLZ          = 20 mm
s:Ge/DemoEllipticalTube/Color        = "yellow"
s:Ge/DemoEllipticalTube/DrawingStyle = "FullWireFrame"

# Ellipsoid
s:Ge/DemoEllipsoid/Type              = "G4Ellipsoid"
s:Ge/DemoEllipsoid/Parent            = "World"
s:Ge/DemoEllipsoid/Material          = "Air"
d:Ge/DemoEllipsoid/TransX            = 0 cm
d:Ge/DemoEllipsoid/TransY            = 0 cm
d:Ge/DemoEllipsoid/TransZ            = 218 cm
d:Ge/DemoEllipsoid/RotX              = 0 deg
d:Ge/DemoEllipsoid/RotY              = 0 deg
d:Ge/DemoEllipsoid/RotZ              = 0 deg
d:Ge/DemoEllipsoid/HLX               = 10 mm
d:Ge/DemoEllipsoid/HLY               = 20 mm
d:Ge/DemoEllipsoid/HLZ               = 50 mm
d:Ge/DemoEllipsoid/ZBottom           = -10 mm
d:Ge/DemoEllipsoid/ZTop              = 40 mm
s:Ge/DemoEllipsoid/Color             = "white"
s:Ge/DemoEllipsoid/DrawingStyle      = "FullWireFrame"

# EllipticalCone
s:Ge/DemoEllipticalCone/Type         = "G4EllipticalCone"
s:Ge/DemoEllipticalCone/Parent       = "World"
s:Ge/DemoEllipticalCone/Material     = "Air"
d:Ge/DemoEllipticalCone/TransX       = 0 cm
d:Ge/DemoEllipticalCone/TransY       = 0 cm
d:Ge/DemoEllipticalCone/TransZ       = 228 cm
d:Ge/DemoEllipticalCone/RotX         = 0 deg
d:Ge/DemoEllipticalCone/RotY         = 0 deg
d:Ge/DemoEllipticalCone/RotZ         = 0 deg
d:Ge/DemoEllipticalCone/RMin         = 10 mm
d:Ge/DemoEllipticalCone/RMax         = 15 mm
d:Ge/DemoEllipticalCone/HLX          = .4 mm
d:Ge/DemoEllipticalCone/HLY          = .8 mm
d:Ge/DemoEllipticalCone/ZMax         = 50 mm
d:Ge/DemoEllipticalCone/ZTop         = 25 mm
s:Ge/DemoEllipticalCone/Color        = "lightblue"
s:Ge/DemoEllipticalCone/DrawingStyle = "FullWireFrame"

# Paraboloid
s:Ge/DemoParaboloid/Type             = "G4Paraboloid"
s:Ge/DemoParaboloid/Parent           = "World"
s:Ge/DemoParaboloid/Material         = "Air"
d:Ge/DemoParaboloid/TransX           = 0 cm
d:Ge/DemoParaboloid/TransY           = 0 cm
d:Ge/DemoParaboloid/TransZ           = 240 cm
d:Ge/DemoParaboloid/RotX             = 0 deg
d:Ge/DemoParaboloid/RotY             = 0 deg
d:Ge/DemoParaboloid/RotZ             = 0 deg
d:Ge/DemoParaboloid/HLZ              = 20 mm
d:Ge/DemoParaboloid/R1               = 20 mm
d:Ge/DemoParaboloid/R2               = 35 mm
s:Ge/DemoParaboloid/Color            = "skyblue"
s:Ge/DemoParaboloid/DrawingStyle     = "FullWireFrame"

# Hype
s:Ge/DemoHype/Type                   = "G4Hype"
s:Ge/DemoHype/Parent                 = "World"
s:Ge/DemoHype/Material               = "Air"
d:Ge/DemoHype/TransX                 = 0 cm
d:Ge/DemoHype/TransY                 = 0 cm
d:Ge/DemoHype/TransZ                 = 254 cm
d:Ge/DemoHype/RotX                   = 0 deg
d:Ge/DemoHype/RotY                   = 0 deg
d:Ge/DemoHype/RotZ                   = 0 deg
d:Ge/DemoHype/IR                     = 20 mm
d:Ge/DemoHype/OR                     = 30 mm
d:Ge/DemoHype/IS                     = .7 rad
d:Ge/DemoHype/OS                     = .7 rad
d:Ge/DemoHype/HLZ                    = 50 mm
s:Ge/DemoHype/Color                  = "red"
s:Ge/DemoHype/DrawingStyle           = "FullWireFrame"

# Tet
s:Ge/DemoTet/Type                    = "G4Tet"
s:Ge/DemoTet/Parent                  = "World"
s:Ge/DemoTet/Material                = "Air"
d:Ge/DemoTet/TransX                  = 0 cm
d:Ge/DemoTet/TransY                  = 0 cm
d:Ge/DemoTet/TransZ                  = 268 cm
d:Ge/DemoTet/RotX                    = 0 deg
d:Ge/DemoTet/RotY                    = 0 deg
d:Ge/DemoTet/RotZ                    = 0 deg
dv:Ge/DemoTet/Anchor                 = 3 0 0 17.3 mm
dv:Ge/DemoTet/P2                     = 3 0 16.3 -5.8 mm
dv:Ge/DemoTet/P3                     = 3 -14.1 -8.2 -5.8 mm
dv:Ge/DemoTet/P4                     = 3 14.1 -8.2 -5.8 mm
s:Ge/DemoTet/Color                   = "magenta"

# ExtrudedSolid
s:Ge/DemoExtrudedSolid/Type          = "G4ExtrudedSolid"
s:Ge/DemoExtrudedSolid/Parent        = "World"
s:Ge/DemoExtrudedSolid/Material      = "Air"
d:Ge/DemoExtrudedSolid/TransX        = 0 cm
d:Ge/DemoExtrudedSolid/TransY        = 0 cm
d:Ge/DemoExtrudedSolid/TransZ        = 276 cm
d:Ge/DemoExtrudedSolid/RotX          = 0 deg
d:Ge/DemoExtrudedSolid/RotY          = 0 deg
d:Ge/DemoExtrudedSolid/RotZ          = 0 deg
dv:Ge/DemoExtrudedSolid/Polygons     = 16 -30 -30 -30 30 30 30 30 -30 15 -30 15 15 -15 15 -15 -30 mm
d:Ge/DemoExtrudedSolid/HLZ           = 20 mm
dv:Ge/DemoExtrudedSolid/Off1         = 2 10. 10. mm
u:Ge/DemoExtrudedSolid/Scale1        = 1.
dv:Ge/DemoExtrudedSolid/Off2         = 2 -10. -10. mm
u:Ge/DemoExtrudedSolid/Scale2        = 0.6
s:Ge/DemoExtrudedSolid/Color         = "violet"

# TwistedBox
s:Ge/DemoG4TwistedBox/Type           = "G4TwistedBox"
s:Ge/DemoG4TwistedBox/Parent         = "World"
s:Ge/DemoG4TwistedBox/Material       = "Air"
d:Ge/DemoG4TwistedBox/TransX         = 0 cm
d:Ge/DemoG4TwistedBox/TransY         = 0 cm
d:Ge/DemoG4TwistedBox/TransZ         = 290 cm
d:Ge/DemoG4TwistedBox/RotX           = 0 deg
d:Ge/DemoG4TwistedBox/RotY           = 0 deg
d:Ge/DemoG4TwistedBox/RotZ           = 0 deg
d:Ge/DemoG4TwistedBox/Twist          = 30 deg
d:Ge/DemoG4TwistedBox/HLX            = 30. mm
d:Ge/DemoG4TwistedBox/HLY            = 40. mm
d:Ge/DemoG4TwistedBox/HLZ            = 60. mm
s:Ge/DemoG4TwistedBox/Color          = "pink"
s:Ge/DemoG4TwistedBox/DrawingStyle   = "FullWireFrame"

# RTwistedTrap - Right Angular Wedge Twisted Trapezoid
s:Ge/DemoRTwistedTrap/Type           = "G4RTwistedTrap"
s:Ge/DemoRTwistedTrap/Parent         = "World"
s:Ge/DemoRTwistedTrap/Material       = "Air"
d:Ge/DemoRTwistedTrap/TransX         = 0 cm
d:Ge/DemoRTwistedTrap/TransY         = 0 cm
d:Ge/DemoRTwistedTrap/TransZ         = 308 cm
d:Ge/DemoRTwistedTrap/RotX           = 0 deg
d:Ge/DemoRTwistedTrap/RotY           = 0 deg
d:Ge/DemoRTwistedTrap/RotZ           = 0 deg
d:Ge/DemoRTwistedTrap/Twist          = 30 deg
d:Ge/DemoRTwistedTrap/HLX1           = 30. mm
d:Ge/DemoRTwistedTrap/HLX2           = 40. mm
d:Ge/DemoRTwistedTrap/HLY            = 40. mm
d:Ge/DemoRTwistedTrap/HLZ            = 60. mm
s:Ge/DemoRTwistedTrap/Color          = "indigo"
s:Ge/DemoRTwistedTrap/DrawingStyle   = "FullWireFrame"

# GTwistedTrap - General Twisted Trapezoid
s:Ge/DemoGTwistedTrap/Type           = "G4GTwistedTrap"
s:Ge/DemoGTwistedTrap/Parent         = "World"
s:Ge/DemoGTwistedTrap/Material       = "Air"
d:Ge/DemoGTwistedTrap/TransX         = 0 cm
d:Ge/DemoGTwistedTrap/TransY         = 0 cm
d:Ge/DemoGTwistedTrap/TransZ         = 326 cm
d:Ge/DemoGTwistedTrap/RotX           = 0 deg
d:Ge/DemoGTwistedTrap/RotY           = 0 deg
d:Ge/DemoGTwistedTrap/RotZ           = 0 deg
d:Ge/DemoGTwistedTrap/Twist          = 30 deg
d:Ge/DemoGTwistedTrap/HLZ            = 60. mm
d:Ge/DemoGTwistedTrap/Theta          = 20 deg
d:Ge/DemoGTwistedTrap/Phi            = 5 deg
d:Ge/DemoGTwistedTrap/HLY1           = 40. mm
d:Ge/DemoGTwistedTrap/HLX1           = 30. mm
d:Ge/DemoGTwistedTrap/HLX2           = 40. mm
d:Ge/DemoGTwistedTrap/HLY2           = 16. mm
d:Ge/DemoGTwistedTrap/HLX3           = 10. mm
d:Ge/DemoGTwistedTrap/HLX4           = 14. mm
d:Ge/DemoGTwistedTrap/Alpha          = 10 deg
s:Ge/DemoGTwistedTrap/Color          = "grass"
s:Ge/DemoGTwistedTrap/DrawingStyle   = "FullWireFrame"

# TwistedTrd
s:Ge/DemoTwistedTrd/Type             = "G4TwistedTrd"
s:Ge/DemoTwistedTrd/Parent           = "World"
s:Ge/DemoTwistedTrd/Material         = "Air"
d:Ge/DemoTwistedTrd/TransX           = 0 cm
d:Ge/DemoTwistedTrd/TransY           = 0 cm
d:Ge/DemoTwistedTrd/TransZ           = 342 cm
d:Ge/DemoTwistedTrd/RotX             = 0 deg
d:Ge/DemoTwistedTrd/RotY             = 0 deg
d:Ge/DemoTwistedTrd/RotZ             = 0 deg
d:Ge/DemoTwistedTrd/HLX1             = 30. mm
d:Ge/DemoTwistedTrd/HLX2             = 10. mm
d:Ge/DemoTwistedTrd/HLY1             = 40. mm
d:Ge/DemoTwistedTrd/HLY2             = 15. mm
d:Ge/DemoTwistedTrd/HLZ              = 60. mm
d:Ge/DemoTwistedTrd/Twist            = 30 deg
s:Ge/DemoTwistedTrd/Color            = "orange"
s:Ge/DemoTwistedTrd/DrawingStyle     = "FullWireFrame"

# GenericTrap
s:Ge/DemoGenericTrap/Type            = "G4GenericTrap"
s:Ge/DemoGenericTrap/Parent          = "World"
s:Ge/DemoGenericTrap/Material        = "Air"
d:Ge/DemoGenericTrap/TransX          = 0 cm
d:Ge/DemoGenericTrap/TransY          = 0 cm
d:Ge/DemoGenericTrap/TransZ          = 356 cm
d:Ge/DemoGenericTrap/RotX            = 0 deg
d:Ge/DemoGenericTrap/RotY            = 0 deg
d:Ge/DemoGenericTrap/RotZ            = 0 deg
d:Ge/DemoGenericTrap/HLZ             = 25 mm
dv:Ge/DemoGenericTrap/Vertices       = 16 -30 -30 -30 30 30 30 30 -30 -5 -20 -20 20 20 20 20 -20 mm
s:Ge/DemoGenericTrap/Color           = "purple"
s:Ge/DemoGenericTrap/DrawingStyle    = "FullWireFrame"

# TwistedTubs
s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
s:Ge/DemoTwistedTubs/Parent          = "World"
s:Ge/DemoTwistedTubs/Material        = "Air"
d:Ge/DemoTwistedTubs/TransX          = 0 cm
d:Ge/DemoTwistedTubs/TransY          = 0 cm
d:Ge/DemoTwistedTubs/TransZ          = 364 cm
d:Ge/DemoTwistedTubs/RotX            = 0 deg
d:Ge/DemoTwistedTubs/RotY            = 0 deg
d:Ge/DemoTwistedTubs/RotZ            = 0 deg
d:Ge/DemoTwistedTubs/Twist           = 60 deg
d:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
d:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
d:Ge/DemoTwistedTubs/HLZ             = 20 mm
d:Ge/DemoTwistedTubs/Phi             = 90 deg
s:Ge/DemoTwistedTubs/Color           = "brown"
s:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

b:Ge/World/Invisible = "True"

s:Gr/MyViewA/Type = "OpenGL"
b:Ts/PauseBeforeQuit = "True"

ShapeTestWithOnlyRequiredParameters.txt

# Demonstrates all of the standard Geant4 solids.
# Shows only the required parameters, omitting the optional ones
# (the ones such as TransX or RMin that have default values).
# Details are given in the TOPAS User Guide
# and in chapter 4 of the Geant4 Application Developer's Guide
# http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch04.html#sect.Geom.Solids

# Box
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/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"
s:Ge/DemoCutTubs/Parent              = "World"
s:Ge/DemoCutTubs/Material            = "Air"
d:Ge/DemoCutTubs/TransZ              = 24 cm
d:Ge/DemoCutTubs/RMax                = 20 mm
d:Ge/DemoCutTubs/HL                  = 30 mm
uv:Ge/DemoCutTubs/LowNorm            = 3 0. -0.7  -0.71
uv:Ge/DemoCutTubs/HighNorm           = 3 0.7 0. 0.71
s:Ge/DemoCutTubs/Color               = "skyblue"
s:Ge/DemoCutTubs/DrawingStyle        = "FullWireFrame"

# Cons
s:Ge/DemoCons/Type                   = "G4Cons"
s:Ge/DemoCons/Parent                 = "World"
s:Ge/DemoCons/Material               = "Air"
d:Ge/DemoCons/TransZ                 = 36 cm
d:Ge/DemoCons/RMax1                  = 10 mm
d:Ge/DemoCons/RMax2                  = 25 mm
d:Ge/DemoCons/HL                     = 40 mm
s:Ge/DemoCons/Color                  = "red"
s:Ge/DemoCons/DrawingStyle           = "FullWireFrame"

# Para
s:Ge/DemoPara/Type                   = "G4Para"
s:Ge/DemoPara/Parent                 = "World"
s:Ge/DemoPara/Material               = "Air"
d:Ge/DemoPara/TransX                 = 0 cm
d:Ge/DemoPara/TransY                 = 0 cm
d:Ge/DemoPara/TransZ                 = 48 cm
d:Ge/DemoPara/RotX                   = 0 deg
d:Ge/DemoPara/RotY                   = 0 deg
d:Ge/DemoPara/RotZ                   = 0 deg
d:Ge/DemoPara/HLX                    = 30. mm
d:Ge/DemoPara/HLY                    = 40. mm
d:Ge/DemoPara/HLZ                    = 60. mm
d:Ge/DemoPara/Alpha                  = 0.3 rad
d:Ge/DemoPara/Theta                  = 0 rad
d:Ge/DemoPara/Phi                    = 0 rad
s:Ge/DemoPara/Color                  = "magenta"

# Trd
s:Ge/DemoTrd/Type                    = "G4Trd"
s:Ge/DemoTrd/Parent                  = "World"
s:Ge/DemoTrd/Material                = "Air"
d:Ge/DemoTrd/TransX                  = 0 cm
d:Ge/DemoTrd/TransY                  = 0 cm
d:Ge/DemoTrd/TransZ                  = 66 cm
d:Ge/DemoTrd/RotX                    = 0 deg
d:Ge/DemoTrd/RotY                    = 0 deg
d:Ge/DemoTrd/RotZ                    = 0 deg
d:Ge/DemoTrd/HLX1                    = 30. mm
d:Ge/DemoTrd/HLX2                    = 10. mm
d:Ge/DemoTrd/HLY1                    = 40. mm
d:Ge/DemoTrd/HLY2                    = 15. mm
d:Ge/DemoTrd/HLZ                     = 60. mm
s:Ge/DemoTrd/Color                   = "violet"

# RTrap - Right Angular Wedge Trapezoid
s:Ge/DemoRTrap/Type                  = "G4RTrap"
s:Ge/DemoRTrap/Parent                = "World"
s:Ge/DemoRTrap/Material              = "Air"
d:Ge/DemoRTrap/TransX                = 0 cm
d:Ge/DemoRTrap/TransY                = 0 cm
d:Ge/DemoRTrap/TransZ                = 84 cm
d:Ge/DemoRTrap/RotX                  = 0 deg
d:Ge/DemoRTrap/RotY                  = 0 deg
d:Ge/DemoRTrap/RotZ                  = 0 deg
d:Ge/DemoRTrap/LZ                    = 120. mm
d:Ge/DemoRTrap/LY                    = 80. mm
d:Ge/DemoRTrap/LX                    = 60. mm
d:Ge/DemoRTrap/LTX                   = 30. mm
s:Ge/DemoRTrap/Color                 = "pink"

# GTrap - General Trapezoid
s:Ge/DemoGTrap/Type                  = "G4GTrap"
s:Ge/DemoGTrap/Parent                = "World"
s:Ge/DemoGTrap/Material              = "Air"
d:Ge/DemoGTrap/TransX                = 0 cm
d:Ge/DemoGTrap/TransY                = 0 cm
d:Ge/DemoGTrap/TransZ                = 104 cm
d:Ge/DemoGTrap/RotX                  = 0 deg
d:Ge/DemoGTrap/RotY                  = 0 deg
d:Ge/DemoGTrap/RotZ                  = 0 deg
d:Ge/DemoGTrap/HLZ                   = 60. mm
d:Ge/DemoGTrap/Theta                 = 20 deg
d:Ge/DemoGTrap/Phi                   = 5 deg
d:Ge/DemoGTrap/HLY1                  = 40. mm
d:Ge/DemoGTrap/HLX1                  = 30. mm
d:Ge/DemoGTrap/HLX2                  = 40. mm
d:Ge/DemoGTrap/Alp1                  = 10 deg
d:Ge/DemoGTrap/HLY2                  = 16. mm
d:Ge/DemoGTrap/HLX3                  = 10. mm
d:Ge/DemoGTrap/HLX4                  = 14. mm
d:Ge/DemoGTrap/Alp2                  = 10 deg
s:Ge/DemoGTrap/Color                 = "indigo"

# Sphere
s:Ge/DemoSphere/Type                 = "TsSphere"
s:Ge/DemoSphere/Parent               = "World"
s:Ge/DemoSphere/Material             = "Air"
d:Ge/DemoSphere/TransZ               = 124 cm
d:Ge/DemoSphere/RMax                 = 120 mm
s:Ge/DemoSphere/DrawingStyle         = "FullWireFrame"
s:Ge/DemoSphere/Color                = "grass"

# Orb
s:Ge/DemoOrb/Type                    = "G4Orb"
s:Ge/DemoOrb/Parent                  = "World"
s:Ge/DemoOrb/Material                = "Air"
d:Ge/DemoOrb/TransX                  = 0 cm
d:Ge/DemoOrb/TransY                  = 0 cm
d:Ge/DemoOrb/TransZ                  = 150 cm
d:Ge/DemoOrb/RotX                    = 0 deg
d:Ge/DemoOrb/RotY                    = 0 deg
d:Ge/DemoOrb/RotZ                    = 0 deg
d:Ge/DemoOrb/R                       = 100 mm
s:Ge/DemoOrb/Color                   = "orange"
s:Ge/DemoOrb/DrawingStyle            = "FullWireFrame"

# Torus
s:Ge/DemoTorus/Type                  = "G4Torus"
s:Ge/DemoTorus/Parent                = "World"
s:Ge/DemoTorus/Material              = "Air"
d:Ge/DemoTorus/TransZ                = 176 cm
d:Ge/DemoTorus/RotX                  = 0 deg
d:Ge/DemoTorus/RMax                  = 60 mm
d:Ge/DemoTorus/RTor                  = 200 mm
s:Ge/DemoTorus/Color                 = "purple"
s:Ge/DemoTorus/DrawingStyle          = "FullWireFrame"

# HPolycone - Hollow Polycone
s:Ge/DemoHPolycone/Type              = "G4HPolycone"
s:Ge/DemoHPolycone/Parent            = "World"
s:Ge/DemoHPolycone/Material          = "Air"
d:Ge/DemoHPolycone/TransZ            = 180 cm
dv:Ge/DemoHPolycone/RInner           = 9 0 1. 1. 1. 2. 2. 3. .5 .2 mm
dv:Ge/DemoHPolycone/ROuter           = 9 0 10 10 5 5 10 10 2 2 mm
dv:Ge/DemoHPolycone/Z                = 9 5 7 9 11 25 27 29 31 35 mm
s:Ge/DemoHPolycone/Color             = "brown"
s:Ge/DemoHPolycone/DrawingStyle      = "FullWireFrame"

# SPolycone - Solid Polycone
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                = 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"

# GenericPolycone - Generic Polycone
s:Ge/DemoGenericPolycone/Type              = "G4GenericPolycone"
s:Ge/DemoGenericPolycone/Parent            = "World"
s:Ge/DemoGenericPolycone/Material          = "Air"
d:Ge/DemoGenericPolycone/TransZ            = 192 cm
dv:Ge/DemoGenericPolycone/R                = 10 0 10 10 5 5 10 10 2 2 0 mm
dv:Ge/DemoGenericPolycone/Z                = 10 5 7 9 11 25 27 29 31 35 35 mm
s:Ge/DemoGenericPolycone/Color             = "magenta"
s:Ge/DemoGenericPolycone/DrawingStyle      = "FullWireFrame"

# HPolyhedra - Hollow Polyhedra
s:Ge/DemoHPolyhedra/Type             = "G4HPolyhedra"
s:Ge/DemoHPolyhedra/Parent           = "World"
s:Ge/DemoHPolyhedra/Material         = "Air"
d:Ge/DemoHPolyhedra/TransZ           = 198 cm
i:Ge/DemoHPolyhedra/NSides           = 3
dv:Ge/DemoHPolyhedra/Z               = 7 0 5 8 13 30 32 35 mm
dv:Ge/DemoHPolyhedra/RInner          = 7 0 2 2 3 1 1 2 mm
dv:Ge/DemoHPolyhedra/ROuter          = 7 0 15 15 4 4 10 10 mm
s:Ge/DemoHPolyhedra/Color            = "blue"

# SPolyhedra - Solid Polyhedra
s:Ge/DemoSPolyhedra/Type             = "G4SPolyhedra"
s:Ge/DemoSPolyhedra/Parent           = "World"
s:Ge/DemoSPolyhedra/Material         = "Air"
d:Ge/DemoSPolyhedra/TransZ           = 204 cm
i:Ge/DemoSPolyhedra/NSides           = 100
dv:Ge/DemoSPolyhedra/R               = 5 0 4 12 8 0 mm
dv:Ge/DemoSPolyhedra/Z               = 5 0 0 8 16 16 mm
s:Ge/DemoSPolyhedra/Color            = "green"

# EllipticalTube
s:Ge/DemoEllipticalTube/Type         = "G4EllipticalTube"
s:Ge/DemoEllipticalTube/Parent       = "World"
s:Ge/DemoEllipticalTube/Material     = "Air"
d:Ge/DemoEllipticalTube/TransZ       = 210 cm
d:Ge/DemoEllipticalTube/HLX          = 5 mm
d:Ge/DemoEllipticalTube/HLY          = 10 mm
d:Ge/DemoEllipticalTube/HLZ          = 20 mm
s:Ge/DemoEllipticalTube/Color        = "yellow"
s:Ge/DemoEllipticalTube/DrawingStyle = "FullWireFrame"

# Ellipsoid
s:Ge/DemoEllipsoid/Type              = "G4Ellipsoid"
s:Ge/DemoEllipsoid/Parent            = "World"
s:Ge/DemoEllipsoid/Material          = "Air"
d:Ge/DemoEllipsoid/TransZ            = 218 cm
d:Ge/DemoEllipsoid/HLX               = 10 mm
d:Ge/DemoEllipsoid/HLY               = 20 mm
d:Ge/DemoEllipsoid/HLZ               = 50 mm
s:Ge/DemoEllipsoid/Color             = "white"
s:Ge/DemoEllipsoid/DrawingStyle      = "FullWireFrame"

# EllipticalCone
s:Ge/DemoEllipticalCone/Type         = "G4EllipticalCone"
s:Ge/DemoEllipticalCone/Parent       = "World"
s:Ge/DemoEllipticalCone/Material     = "Air"
d:Ge/DemoEllipticalCone/TransZ       = 228 cm
d:Ge/DemoEllipticalCone/HLX          = .4 mm
d:Ge/DemoEllipticalCone/HLY          = .8 mm
d:Ge/DemoEllipticalCone/ZMax         = 50 mm
s:Ge/DemoEllipticalCone/Color        = "lightblue"
s:Ge/DemoEllipticalCone/DrawingStyle = "FullWireFrame"

# Paraboloid
s:Ge/DemoParaboloid/Type             = "G4Paraboloid"
s:Ge/DemoParaboloid/Parent           = "World"
s:Ge/DemoParaboloid/Material         = "Air"
d:Ge/DemoParaboloid/TransZ           = 240 cm
d:Ge/DemoParaboloid/HLZ              = 20 mm
d:Ge/DemoParaboloid/R1               = 20 mm
d:Ge/DemoParaboloid/R2               = 35 mm
s:Ge/DemoParaboloid/Color            = "skyblue"
s:Ge/DemoParaboloid/DrawingStyle     = "FullWireFrame"

# Hype
s:Ge/DemoHype/Type                   = "G4Hype"
s:Ge/DemoHype/Parent                 = "World"
s:Ge/DemoHype/Material               = "Air"
d:Ge/DemoHype/TransZ                 = 254 cm
d:Ge/DemoHype/OR                     = 30 mm
d:Ge/DemoHype/OS                     = .7 rad
d:Ge/DemoHype/HLZ                    = 50 mm
s:Ge/DemoHype/Color                  = "red"
s:Ge/DemoHype/DrawingStyle           = "FullWireFrame"

# Tet
s:Ge/DemoTet/Type                    = "G4Tet"
s:Ge/DemoTet/Parent                  = "World"
s:Ge/DemoTet/Material                = "Air"
d:Ge/DemoTet/TransZ                  = 268 cm
dv:Ge/DemoTet/Anchor                 = 3 0 0 17.3 mm
dv:Ge/DemoTet/P2                     = 3 0 16.3 -5.8 mm
dv:Ge/DemoTet/P3                     = 3 -14.1 -8.2 -5.8 mm
dv:Ge/DemoTet/P4                     = 3 14.1 -8.2 -5.8 mm
s:Ge/DemoTet/Color                   = "magenta"

# ExtrudedSolid
s:Ge/DemoExtrudedSolid/Type          = "G4ExtrudedSolid"
s:Ge/DemoExtrudedSolid/Parent        = "World"
s:Ge/DemoExtrudedSolid/Material      = "Air"
d:Ge/DemoExtrudedSolid/TransZ        = 276 cm
dv:Ge/DemoExtrudedSolid/Polygons     = 16 -30 -30 -30 30 30 30 30 -30 15 -30 15 15 -15 15 -15 -30 mm
d:Ge/DemoExtrudedSolid/HLZ           = 20 mm
dv:Ge/DemoExtrudedSolid/Off1         = 2 10. 10. mm
u:Ge/DemoExtrudedSolid/Scale1        = 1.
dv:Ge/DemoExtrudedSolid/Off2         = 2 -10. -10. mm
u:Ge/DemoExtrudedSolid/Scale2        = 0.6
s:Ge/DemoExtrudedSolid/Color         = "violet"

# TwistedBox
s:Ge/DemoG4TwistedBox/Type           = "G4TwistedBox"
s:Ge/DemoG4TwistedBox/Parent         = "World"
s:Ge/DemoG4TwistedBox/Material       = "Air"
d:Ge/DemoG4TwistedBox/TransZ         = 290 cm
d:Ge/DemoG4TwistedBox/Twist          = 30 deg
d:Ge/DemoG4TwistedBox/HLX            = 30. mm
d:Ge/DemoG4TwistedBox/HLY            = 40. mm
d:Ge/DemoG4TwistedBox/HLZ            = 60. mm
s:Ge/DemoG4TwistedBox/Color          = "pink"
s:Ge/DemoG4TwistedBox/DrawingStyle   = "FullWireFrame"

# RTwistedTrap - Right Angular Wedge Twisted Trapezoid
s:Ge/DemoRTwistedTrap/Type           = "G4RTwistedTrap"
s:Ge/DemoRTwistedTrap/Parent         = "World"
s:Ge/DemoRTwistedTrap/Material       = "Air"
d:Ge/DemoRTwistedTrap/TransZ         = 308 cm
d:Ge/DemoRTwistedTrap/Twist          = 30 deg
d:Ge/DemoRTwistedTrap/HLX1           = 30. mm
d:Ge/DemoRTwistedTrap/HLX2           = 40. mm
d:Ge/DemoRTwistedTrap/HLY            = 40. mm
d:Ge/DemoRTwistedTrap/HLZ            = 60. mm
s:Ge/DemoRTwistedTrap/Color          = "indigo"
s:Ge/DemoRTwistedTrap/DrawingStyle   = "FullWireFrame"

# GTwistedTrap - General Twisted Trapezoid
s:Ge/DemoGTwistedTrap/Type           = "G4GTwistedTrap"
s:Ge/DemoGTwistedTrap/Parent         = "World"
s:Ge/DemoGTwistedTrap/Material       = "Air"
d:Ge/DemoGTwistedTrap/TransZ         = 326 cm
d:Ge/DemoGTwistedTrap/Twist          = 30 deg
d:Ge/DemoGTwistedTrap/HLZ            = 60. mm
d:Ge/DemoGTwistedTrap/Theta          = 20 deg
d:Ge/DemoGTwistedTrap/Phi            = 5 deg
d:Ge/DemoGTwistedTrap/HLY1           = 40. mm
d:Ge/DemoGTwistedTrap/HLX1           = 30. mm
d:Ge/DemoGTwistedTrap/HLX2           = 40. mm
d:Ge/DemoGTwistedTrap/HLY2           = 16. mm
d:Ge/DemoGTwistedTrap/HLX3           = 10. mm
d:Ge/DemoGTwistedTrap/HLX4           = 14. mm
d:Ge/DemoGTwistedTrap/Alpha          = 10 deg
s:Ge/DemoGTwistedTrap/Color          = "grass"
s:Ge/DemoGTwistedTrap/DrawingStyle   = "FullWireFrame"

# TwistedTrd
s:Ge/DemoTwistedTrd/Type             = "G4TwistedTrd"
s:Ge/DemoTwistedTrd/Parent           = "World"
s:Ge/DemoTwistedTrd/Material         = "Air"
d:Ge/DemoTwistedTrd/TransZ           = 342 cm
d:Ge/DemoTwistedTrd/HLX1             = 30. mm
d:Ge/DemoTwistedTrd/HLX2             = 10. mm
d:Ge/DemoTwistedTrd/HLY1             = 40. mm
d:Ge/DemoTwistedTrd/HLY2             = 15. mm
d:Ge/DemoTwistedTrd/HLZ              = 60. mm
d:Ge/DemoTwistedTrd/Twist            = 30 deg
s:Ge/DemoTwistedTrd/Color            = "orange"
s:Ge/DemoTwistedTrd/DrawingStyle     = "FullWireFrame"

# GenericTrap
s:Ge/DemoGenericTrap/Type            = "G4GenericTrap"
s:Ge/DemoGenericTrap/Parent          = "World"
s:Ge/DemoGenericTrap/Material        = "Air"
d:Ge/DemoGenericTrap/TransZ          = 356 cm
d:Ge/DemoGenericTrap/HLZ             = 25 mm
dv:Ge/DemoGenericTrap/Vertices       = 16 -30 -30 -30 30 30 30 30 -30 -5 -20 -20 20 20 20 20 -20 mm
s:Ge/DemoGenericTrap/Color           = "purple"
s:Ge/DemoGenericTrap/DrawingStyle    = "FullWireFrame"

# TwistedTubs
s:Ge/DemoTwistedTubs/Type            = "G4TwistedTubs"
s:Ge/DemoTwistedTubs/Parent          = "World"
s:Ge/DemoTwistedTubs/Material        = "Air"
d:Ge/DemoTwistedTubs/TransZ          = 364 cm
d:Ge/DemoTwistedTubs/Twist           = 60 deg
d:Ge/DemoTwistedTubs/EndInnerRad     = 10 mm
d:Ge/DemoTwistedTubs/EndOuterRad     = 15 mm
d:Ge/DemoTwistedTubs/HLZ             = 20 mm
d:Ge/DemoTwistedTubs/Phi             = 90 deg
s:Ge/DemoTwistedTubs/Color           = "brown"
s:Ge/DemoTwistedTubs/DrawingStyle    = "FullWireFrame"

b:Ge/World/Invisible = "True"

s:Gr/MyViewA/Type = "HepRep"

Spectrum.txt

# Demonstrates use of EnergySpectrum.
# Resulting particles can be seen in ASCIIOutput.phsp

s:Ge/World/Material = "Vacuum"

s:So/Example/BeamEnergySpectrumType       = "Continuous"
dv:So/Example/BeamEnergySpectrumValues    = 3 50. 100. 150. MeV
uv:So/Example/BeamEnergySpectrumWeights   = 3 .20 .60 .20

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "Vacuum"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm

s:Sc/PhaseSpaceAtVacFilm/Quantity                  = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole           = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                   = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                = "ASCII" # ASCII, Binary or Limited
s:Sc/PhaseSpaceAtVacFilm/OutputFile                = "ASCIIOutput"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists = "Overwrite"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1000

i:Ts/ShowHistoryCountAtInterval = 10

TwoBeams.txt

# Demonstrates ability to have more than one particle source

s:Ge/World/Material = "Vacuum"

# Second beam component
s:Ge/XRayTube/Parent = "World"
s:Ge/XRayTube/Type   = "Group"
d:Ge/XRayTube/TransX = 200. cm
d:Ge/XRayTube/TransY = 0. m
d:Ge/XRayTube/TransZ = 0. m
d:Ge/XRayTube/RotX   = 0. deg
d:Ge/XRayTube/RotY   = 90. deg
d:Ge/XRayTube/RotZ   = 0. deg

# Second beam source
s:So/Imaging/Type                     = "Beam"
s:So/Imaging/Component                = "XRayTube"
s:So/Imaging/BeamParticle             = "gamma"
d:So/Imaging/BeamEnergy               = 100. keV
u:So/Imaging/BeamEnergySpread         = 0.
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  = "None"
i:So/Imaging/NumberOfHistoriesInRun   = 5

s:So/Therapy/Type                     = "Beam"
s:So/Therapy/Component                = "BeamPosition"
s:So/Therapy/BeamParticle             = "proton"
d:So/Therapy/BeamEnergy               = 169.23 MeV
u:So/Therapy/BeamEnergySpread         = 0.757504
s:So/Therapy/BeamPositionDistribution = "Gaussian"
s:So/Therapy/BeamPositionCutoffShape  = "Ellipse"
d:So/Therapy/BeamPositionCutoffX      = 10. cm
d:So/Therapy/BeamPositionCutoffY      = 10. cm
d:So/Therapy/BeamPositionSpreadX      = 0.65 cm
d:So/Therapy/BeamPositionSpreadY      = 0.65 cm
s:So/Therapy/BeamAngularDistribution  = "Gaussian"
d:So/Therapy/BeamAngularCutoffX       = 90. deg
d:So/Therapy/BeamAngularCutoffY       = 90. deg
d:So/Therapy/BeamAngularSpreadX       = 0.0032 rad
d:So/Therapy/BeamAngularSpreadY       = 0.0032 rad
i:So/Therapy/NumberOfHistoriesInRun   = 10

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
b:Gr/ViewA/IncludeAxes      = "True"
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 2.

b:Ts/PauseBeforeQuit = "True"

VolumetricSource.txt

# Demonstrates use of Volumetric Source
# Source is a group component,
# allowing many different shapes to create a single source.
# Shapes do not even have to be congiguous.
# Several offsets are included as a full test of geometry.
# World is set to lead so that particles stop as
# soon as they leave the source.
# This makes it easy to see particle starting positions

s:Ge/World/Material = "G4_Pb"

s:Ge/OffsetGroup/Type     = "Group"
s:Ge/OffsetGroup/Parent   = "World"
dc:Ge/OffsetGroup/RotX = 0. deg
dc:Ge/OffsetGroup/TransY = 2. m

s:Ge/ActiveSource/Type     = "Group"
s:Ge/ActiveSource/Parent   = "OffsetGroup"
dc:Ge/OffsetGroup/RotZ = 0. deg
dc:Ge/ActiveSource/TransZ = 1. m

s:Ge/SourceCylinder/Type     = "TsCylinder"
s:Ge/SourceCylinder/Parent   = "ActiveSource"
sc:Ge/SourceCylinder/Material = "G4_Pb"
dc:Ge/SourceCylinder/RMax     = 50.0 mm
dc:Ge/SourceCylinder/HL       = 200.0 mm

s:Ge/Inner/Type     = "TsCylinder"
s:Ge/Inner/Parent   = "SourceCylinder"
s:Ge/Inner/Material = "G4_Ir"
d:Ge/Inner/RMax     = 20.0 mm
d:Ge/Inner/HL = 150.0 mm

s:Ge/SourceCapPlusZ/Type     = "TsSphere"
s:Ge/SourceCapPlusZ/Parent   = "ActiveSource"
sc:Ge/SourceCapPlusZ/Material = "G4_Ir"
dc:Ge/SourceCapPlusZ/RMax     = 50.0 mm
dc:Ge/SourceCapPlusZ/STheta   = 0 deg
dc:Ge/SourceCapPlusZ/DTheta   = 90 deg
dc:Ge/SourceCapPlusZ/TransZ   = 200. mm

s:Ge/SourceCapMinusZ/Type     = "TsSphere"
s:Ge/SourceCapMinusZ/Parent   = "ActiveSource"
sc:Ge/SourceCapMinusZ/Material = "G4_Ir"
dc:Ge/SourceCapMinusZ/RMax     = 50.0 mm
dc:Ge/SourceCapMinusZ/STheta   = 90 deg
dc:Ge/SourceCapMinusZ/DTheta.  = 90 deg
dc:Ge/SourceCapMinusZ/TransZ = -200. mm

s:Ge/SourceExtraBit/Type     = "TsSphere"
s:Ge/SourceExtraBit/Parent   = "ActiveSource"
sc:Ge/SourceExtraBit/Material = "G4_Ir"
dc:Ge/SourceExtraBit/RMax     = 50.0 mm
dc:Ge/SourceExtraBit/TransY = -2000. mm
dc:Ge/SourceExtraBit/TransZ = 500. mm

s:So/Example/Type                     = "Volumetric"
s:So/Example/Component                = "ActiveSource"
sc:So/Example/ActiveMaterial		= "G4_Ir"
s:So/Example/BeamParticle             = "e-"
ic:So/Example/NumberOfHistoriesInRun   = 500
b:So/Example/RecursivelyIncludeChildren = "True"
ic:So/Example/MaxNumberOfPointsToSample = 10000000

s:So/Example/BeamEnergySpectrumType       = "Continuous"
dv:So/Example/BeamEnergySpectrumValues    = 117 0.0614 0.0615 0.0616 0.0629 0.063 0.0631 0.065 0.0651 0.0652 0.0667 0.0668 0.0669 0.071 0.0711 0.0712 0.0713 0.0714 0.0715 0.0733 0.0734 0.0735 0.0753 0.0754 0.0755 0.0756 0.0757 0.0758 0.0777 0.0778 0.0779 0.1103 0.1104 0.1105 0.1362 0.1363 0.1364 0.1769 0.177 0.1771 0.2012 0.2013 0.2014 0.2057 0.2058 0.2059 0.2802 0.2803 0.2804 0.2832 0.2833 0.2834 0.2959 0.296 0.2961 0.3084 0.3085 0.3086 0.3164 0.3165 0.3166 0.3291 0.3292 0.3293 0.3744 0.3745 0.3746 0.4164 0.4165 0.4166 0.4204 0.4205 0.4206 0.468 0.4681 0.4682 0.4845 0.4846 0.4847 0.4852 0.4853 0.4854 0.489 0.4891 0.4892 0.5885 0.5886 0.5887 0.5934 0.5935 0.5936 0.5993 0.5994 0.5995 0.6043 0.6044 0.6045 0.6124 0.6125 0.6126 0.7038 0.7039 0.704 0.7657 0.7658 0.7659 0.8844 0.8845 0.8846 1.0614 1.0615 1.0616 1.0898 1.0899 1.089 1.3781 1.3782 1.3783 MeV

uv:So/Example/BeamEnergySpectrumWeightsUnscaled   = 117
1e-08 0.412 1e-08 1e-08 0.7039 1e-08 1e-08 1.1309 1e-08 1e-08 1.9178 1e-08 1e-08 0.0827 1e-08 1e-08 0.16 1e-08 1e-08 0.056 1e-08 1e-08 0.2292 1e-08 1e-08 0.4408 1e-08 1e-08 0.157 1e-08 1e-08 0.0042 1e-08 1e-08 0.086 1e-08 1e-08 0.0018 1e-08 1e-08 0.1624 1e-08 1e-08 1.1468 1e-08 1e-08 0.0039 1e-08 1e-08 0.0913 1e-08 1e-08 12.3498 1e-08 1e-08 12.7626 1e-08 1e-08 35.566 1e-08 1e-08 0.006 1e-08 1e-08 0.2493 1e-08 1e-08 0.2877 1e-08 1e-08 0.0237 1e-08 1e-08 20.5587 1e-08 1e-08 1.0942 1e-08 1e-08 0.001 1e-08 1e-08 0.1504 1e-08 1e-08 1.9423 1e-08 1e-08 0.0181 1e-08 1e-08 0.0017 1e-08 1e-08 3.5361 1e-08 1e-08 2.2962 1e-08 1e-08 0.0018 1e-08 1e-08 0.0006 1e-08 1e-08 0.1251 1e-08 1e-08 0.0228 1e-08 1e-08 0.0005 1e-08 1e-08 0.0005 1e-8

# Scale these values to give total weight of 1.
uv:So/Example/BeamEnergySpectrumWeights   = .0102269 * So/Example/BeamEnergySpectrumWeightsUnscaled

i:Ts/ShowHistoryCountAtInterval = 100

s:Gr/ViewA/Type              = "OpenGL"
b:Gr/ViewA/IncludeStepPoints = "True"
b:Ts/PauseBeforeQuit = "True"
b:Ts/UseQt = "True"

VoxelMaterialsInDividedComponents.txt

# Demonstrates setting material per voxel in each of
# the Divided Components: TsBox, TsCylinder and TsSphere.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

# Save time by turning off overlap check
b:Ge/CheckForOverlaps = "False"

s:Ge/TestBox/Parent   = "World"
s:Ge/TestBox/Type     = "TsBox"
s:Ge/TestBox/Material = "G4_WATER"
d:Ge/TestBox/HLX      = 7.0 cm
d:Ge/TestBox/HLY      = 7.0 cm
d:Ge/TestBox/HLZ      = 9.0 cm
d:Ge/TestBox/TransX   = 0. cm
d:Ge/TestBox/TransY   = 0. cm
d:Ge/TestBox/TransZ   = 0. cm
d:Ge/TestBox/RotX     = 0. deg
d:Ge/TestBox/RotY     = 0. deg
d:Ge/TestBox/RotZ     = 0. deg
sc:Ge/TestBox/DrawingStyle = "Solid"
i:Ge/TestBox/XBins    = 2
i:Ge/TestBox/YBins    = 2
i:Ge/TestBox/ZBins    = 2
sv:Ge/TestBox/VoxelMaterials = 8 "Lucite" "Air" "Carbon" "Nickel" "Tantalum" "Lexan" "Air" "Air"

s:Ge/TestCylinder/Parent   = "World"
s:Ge/TestCylinder/Type     = "TsCylinder"
s:Ge/TestCylinder/Material = "G4_WATER"
d:Ge/TestCylinder/RMin     = 0.0 cm
d:Ge/TestCylinder/RMax     = 8.0 cm
d:Ge/TestCylinder/HL       = 10.0 cm
d:Ge/TestCylinder/SPhi     = 0. deg
d:Ge/TestCylinder/DPhi     = 360. deg
d:Ge/TestCylinder/TransX   = 0. cm
d:Ge/TestCylinder/TransY   = 0. cm
d:Ge/TestCylinder/TransZ   = 25. cm
d:Ge/TestCylinder/RotX     = 0. deg
d:Ge/TestCylinder/RotY     = 0.0 deg
d:Ge/TestCylinder/RotZ     = 0. deg
sc:Ge/TestCylinder/DrawingStyle = "Cloud"
i:Ge/TestCylinder/RBins    = 2
i:Ge/TestCylinder/PhiBins  = 2
i:Ge/TestCylinder/ZBins    = 2
sv:Ge/TestCylinder/VoxelMaterials = 8 "G4_W" "Air" "G4_WATER" "G4_W" "Air" "G4_W" "Air" "Air"

s:Ge/TestSphere/Parent    = "World"
s:Ge/TestSphere/Type      = "TsSphere"
s:Ge/TestSphere/Material  = "G4_WATER"
d:Ge/TestSphere/RMin      = 0.0 cm
d:Ge/TestSphere/RMax      = 10.0 cm
d:Ge/TestSphere/SPhi      = 0. deg
d:Ge/TestSphere/DPhi      = 360. deg
d:Ge/TestSphere/STheta    = 0. deg
d:Ge/TestSphere/DTheta    = 180. deg
d:Ge/TestSphere/TransX    = 0. cm
d:Ge/TestSphere/TransY    = 0. cm
d:Ge/TestSphere/TransZ    = 50. cm
d:Ge/TestSphere/RotX      = 0. deg
d:Ge/TestSphere/RotY      = 0. deg
d:Ge/TestSphere/RotZ      = 0. deg
s:Ge/TestSphere/Color     = "blue"
sc:Ge/TestSphere/DrawingStyle = "Cloud"
i:Ge/TestSphere/RBins     = 2
i:Ge/TestSphere/PhiBins   = 2
i:Ge/TestSphere/ThetaBins = 2
sv:Ge/TestSphere/VoxelMaterials = 8 "Air" "Air" "G4_WATER" "Air" "Air" "Air" "Air" "Air"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type = "OpenGL"

Ts/UseQt = "True"

Brachytherapy

Brachytherapy package for TOPAS

This package has been developed by the Medical Physics Research Group at Laval University [https://physmed.fsg.ulaval.ca](https://physmed.fsg.ulaval.ca) with the close collaboration of the TOPAS developer team.

Collaborators:

  • Francisco Berumen
  • Audran Poher
  • Yunzhi Ma
  • Jose Ramos Mendez
  • Joseph Perl
  • Luc Beaulieu

For any presentation or publication using the track-length estimator or brachytherapy related calculation, please cite the following published works:

  • Francisco Berumen, Yunzhi Ma, José Ramos-Méndez, Joseph Perl, and Luc Beaulieu. “Validation of the TOPAS Monte Carlo toolkit for HDR brachytherapy simulations”, Brachytherapy (2021) https://doi.org/10.1016/j.brachy.2020.12.007
  • Audran Poher, Francisco Berumen, Yunzhi Ma, Joseph Perl, and Luc Beaulieu. “Characterization of LDR brachytherapy sources using the TOPAS Monte Carlo toolkit”, COMP annual meeting 2021.

The Brachytherapy TOPAS package includes 4 examples:

  • DoseTLE.txt
  • HDRSource.txt
  • HDRSourceInApplicator.txt
  • LDRSource.txt

These examples in turn use sources and seeds found in topas/examples/LDR and topas/examples/HDR:

  • 3 HDR sources (Flexisource, TG186, MicroSelectronV2)
  • 12 LDR sources (IsoRay CS-1 Rev2, Bard STM1251, Best 2301, IsoAid IAI-125A, OncoSeed 6711, selectSeed 130.002, SL-125, Theragenics AgX100, Best 2335, IsoAid IAPd-103A, TheraSeed 200 Heavy, TheraSeed 200 Light)

Note that for each source a self-contained parameter file is provided. In such a way, the desired source can be imported with the includeFile method. For some sources, the layered mass geometry method was used, and the corresponding physics parameter is also given at the end.

HDRsource.txt and LDRSource.txt files provide a quick example on how to import a single source and visualize it, comment/uncomment the includeFile line accordingly.

For both Theraseed200 models, the user can define the materials of left and right caps.

The HDRSourceInApplicator.txt file presents the TG186 source inside the TG186 applicator.

The DoseTLE.txt file scores the dose of the previous setup using the TLE. The TLE requires the mass absorption coefficients which are given to TOPAS in the InputFile parameter “Muen.dat”.

References

Track Length Estimator:

  • H Afsharpour et al., “ALGEBRA: ALgorithm for the heterogeneous dosimetry based on GEANT4 for BRAchytherapy”, Physics in Medicine and Biology, 57(11), 3273–3280, 2012. https://doi.org/10.1088/0031-9155/57/11/3273
  • Jeffrey F. Williamson, “Monte Carlo evaluation of kerma at a point for photon transport problems”, Medical Physics 14, 567 (1987). https://doi.org/10.1118/1.596069

Ir-192 sources

TG186 source and applicator:

  • F Ballester et al., “A generic high-dose rate 192Ir brachytherapy source for evaluation of model-based dose calculations beyond the TG-43 formalism”, Medical Physics, Vol. 42, No. 6, June 2015. https://doi.org/10.1118/1.4921020
  • Y Ma et al., “A generic TG-186 shielded applicator for commissioning model-based dose calculation algorithms for high-dose-rate 192Ir brachytherapy”, Medical Physics, 44 (11), November 2017. https://doi.org/10.1002/mp.12459

Micro selectron V2:

Flexisource:

I-125 sources

IsoAid, LLC, Advantage I-125, IAI-125A:

Mills Bio. Pharm., ProstaSeed, 125SL:

Nucletron SelectSeed 130.002:

  • Karaiskos et al , “Monte Carlo dosimetry of the selectSeed 125-I interstitial brachytherapy seed”, Med. Phys., 28 , 1753—1760 (2001). https://doi.org/10.1118/1.1384460
    1. Anagnostopoulos et al , “Thermoluminescent dosimetry of the selectSeed 125-I interstitial brachytherapy seed”, Med. Phys., 29 , 709-716, (2002). https://doi.org/10.1118/1.1469631
  • Mark J. Rivard et al., “Supplement 2 for the 2004 update of the AAPM Task Group No. 43 Report: Joint recommendations by the AAPM and GEC-ESTRO”, Medical Physics 44 (9), e297-e338. https://doi.org/10.1002/mp.12430

Theragenics Co., I-Seed I-125, AgX100:

Bard Urological Division, 125Implant Seeds, STM1251:

  • “Bard Urological Division, 125Implant Seeds, STM1251 | Department of Physics”, consulted July 6th 2020, https://physics.carleton.ca/clrp/egs_brachy/seed_database/I125/STM_1251
  • Assen S. Kirov et Jeffrey F. Williamson, “Monte Carlo-Aided Dosimetry of the Source Tech Medical Model STM1251 I-125 Interstitial Brachytherapy Source”, Medical Physics 28, no 5 (2001): 764‑72, https://doi.org/10.1118/1.1367280
  • Assen S. Kirov et Jeffrey F. Williamson, “Erratum: “Monte Carlo-Aided Dosimetry of the Source Tech Medical Model STM1251 I-125 Interstitial Brachytherapy Source” [Med. Phys. 28, 764–772 (2001)]”, Medical Physics 29, no 2 (2002): 262‑63, https://doi.org/10.1118/1.1446107

Best Industries, Best I-125, 2301:

Amersham, OncoSeed, 6711:

Pd-103 sources

Best Industries, BestPd-103, 2335:

IsoAid, Advantage, IAPd-103A:

Theragenics Co., TheraSeed, 200:

Cs-131 source

IsoRay Medical Inc., Proxcelan, CS-1 Rev2:

DoseTLE.txt

#                                                          #
#  Example: Dose scoring using the Track-Length Estimator  #
#           TG186 source inside the TG186 applicator       #
#           Water cube of 50 cm side                       #
#           Centered dose grid                             #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Import the source inside the applicator ##### 
includeFile = HDRSourceInApplicator.txt

##### Scorer geometry ######
s:Ge/DoseGrid/Type       = "TsBox"
s:Ge/DoseGrid/Parent     = "World"
d:Ge/DoseGrid/HLX        =  10.05 cm
d:Ge/DoseGrid/HLY        =  10.05 cm
d:Ge/DoseGrid/HLZ        =  10.05 cm
s:Ge/DoseGrid/Color      =  "red"
b:Ge/DoseGrid/IsParallel = "T"
i:Ge/DoseGrid/XBins      = 201
i:Ge/DoseGrid/YBins      = 201
i:Ge/DoseGrid/ZBins      = 201

##### Dose scoring using the TLE ####
s:Sc/DoseOnRTGrid/Quantity                   = "TrackLengthEstimator"
sv:Sc/DoseOnRTGrid/Report                    = 1 "Sum"
s:Sc/DoseOnRTGrid/InputFile                  = "Muen.dat"
s:Sc/DoseOnRTGrid/Component                  = "DoseGrid"
b:Sc/DoseOnRTGrid/OutputToConsole            = "F"
s:Sc/DoseOnRTGrid/IfOutputFileAlreadyExists  = "Increment"
s:Sc/DoseOnRTGrid/OutputType                 = "DICOM"
b:Sc/DoseOnRTGrid/DICOMOutput32BitsPerPixel  = "True"
s:Sc/DoseOnRTGrid/OutputFile                 = "DoseTLE"
sv:Sc/DoseOnRTGrid/OnlyIncludeParticlesNamed = 1 "gamma"

##### Local energy deposition of electrons
d:Ph/Default/CutForElectron = 10 cm

##### Run 10000 histories
b:Gr/Enable = "F"
i:So/Source/NumberOfHistoriesInRun = 10000

HDRSource.txt

#                                                          #
#                   Example: HDR source                    #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Import one of the following HDR sources ##### 
includeFile = ./HDR/Ir192_TG186.txt
#includeFile = ./HDR/Ir192_MicroSelectronV2.txt
#includeFile = ./HDR/Ir192_Flexisource.txt

##### Water phantom of 50 cm side #####
d:Ge/World/HLX = 25 cm
d:Ge/World/HLY = 25 cm
d:Ge/World/HLZ = 25 cm
s:Ge/World/Material = "G4_WATER"

##### Physics #####
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

##### Graphics #####
b:Gr/Enable          = "T"
b:Ts/PauseBeforeQuit = "T"

s:Gr/View/Type        = "OpenGL"
u:Gr/View/Zoom        = 75.
d:Gr/View/Phi         = 20 deg
d:Gr/View/Theta       = 90 deg
b:Gr/View/IncludeAxes = "T"
d:Gr/View/AxesSize    = 5 mm

HDRSourceInApplicator.txt

#                                                          #
#     Example: TG186 source inside the TG186 applicator    #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Import the source and applicator ##### 
includeFile = ./HDR/Ir192_TG186.txt
includeFile = ./HDR/TG186Applicator.txt

## Since the TG186 source must be inside the applicator,
## the parent of the "Capsule" group component (TG186 source)
## is the "AirCylinder" applicator's geometry component.
s:Ge/Capsule/Parent = "AirCylinder"

## See the effect of the shielded applicator with more photons
i:So/Source/NumberOfHistoriesInRun    = 150

##### Water phantom of 50 cm side #####
d:Ge/World/HLX = 25 cm
d:Ge/World/HLY = 25 cm
d:Ge/World/HLZ = 25 cm
s:Ge/World/Material = "G4_WATER"

##### Physics #####
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

##### Graphics #####
b:Gr/Enable          = "T"
b:Ts/PauseBeforeQuit = "T"

s:Gr/View/Type        = "OpenGL"
u:Gr/View/Zoom        = 4.5
d:Gr/View/Phi         = 90 deg
d:Gr/View/Theta       = 91 deg
b:Gr/View/IncludeAxes = "F"
d:Gr/View/AxesSize    = 10 cm

Ir192_Flexisource.txt

#                                                          #
#          Isodose Control Flexisource Ir-192 source       #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Materials #####
sv:Ma/StainlessSteel/Components = 6 "Iron" "Chromium" "Nickel" "Manganese" "Silicon" "Carbon"
uv:Ma/StainlessSteel/Fractions  = 6 0.6792 0.19 0.1 0.02 0.01 0.0008
d:Ma/StainlessSteel/Density     = 8.2 g/cm3

##### Radioactive source #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "IridiumCore"
sc:So/ActiveSource/ActiveMaterial            = "G4_Ir"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"

##### Spectrum, NNDC Rivard 2010, 10 keV cut ######
dv:So/ActiveSource/BeamEnergySpectrumValues = 39 61.486 63.0 65.122 66.831 71.079 71.414 73.363 75.368 75.749 77.831 110.4 136.3426 176.98 201.3112 205.79430 280.27 283.2668 295.95650 308.45507 316.50618 329.17 374.4852 416.4688 420.52 468.0688 484.5751 485.30 489.06 588.5810 593.49 599.41 604.41105 612.4621 703.87 765.8 884.5365 1061.48 1089.9 1378.20 keV

uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 39 0.0120 0.0205 0.0263 0.0446 0.00241 0.00466 0.00163 0.00533 0.01025 0.00365 0.000122 0.0020 0.000043 0.00473 0.0334 0.00009 0.00266 0.2872 0.2968 0.8271 0.000174 0.00726 0.00669 0.00069 0.4781 0.03187 0.000023 0.00438 0.04517 0.000421 0.000039 0.0820 0.0534 0.000053 0.000013 0.00291 0.000530 0.000012 0.000012

uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.43492973 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####

s:Ge/CenterStainlessSteelCylinder/Type         = "TsCylinder"
s:Ge/CenterStainlessSteelCylinder/Parent       = "World"
s:Ge/CenterStainlessSteelCylinder/Material     = "StainlessSteel"
d:Ge/CenterStainlessSteelCylinder/RMin         = 0. mm
d:Ge/CenterStainlessSteelCylinder/RMax         = 0.425 mm
d:Ge/CenterStainlessSteelCylinder/SPhi         = 0. deg
d:Ge/CenterStainlessSteelCylinder/DPhi         = 360. deg
d:Ge/CenterStainlessSteelCylinder/HL           = 1.8 mm
d:Ge/CenterStainlessSteelCylinder/TransX       = 0. mm
d:Ge/CenterStainlessSteelCylinder/TransY       = 0. mm
d:Ge/CenterStainlessSteelCylinder/TransZ       = 0. mm
d:Ge/CenterStainlessSteelCylinder/RotX         = 0. deg
d:Ge/CenterStainlessSteelCylinder/RotY         = 0. deg
d:Ge/CenterStainlessSteelCylinder/RotZ         = 0. deg
s:Ge/CenterStainlessSteelCylinder/Color        = "blue"
s:Ge/CenterStainlessSteelCylinder/DrawingStyle = "FullWireFrame"

s:Ge/AirFilling/Type         = "TsCylinder"
s:Ge/AirFilling/Parent       = "CenterStainlessSteelCylinder"
s:Ge/AirFilling/Material     = "G4_AIR"
d:Ge/AirFilling/RMin         = 0. mm
d:Ge/AirFilling/RMax         = 0.335 mm
d:Ge/AirFilling/SPhi         = 0. deg
d:Ge/AirFilling/DPhi         = 360. deg
d:Ge/AirFilling/HL           = 1.8 mm
d:Ge/AirFilling/TransX       = 0. mm
d:Ge/AirFilling/TransY       = 0. mm
d:Ge/AirFilling/TransZ       = 0. mm
d:Ge/AirFilling/RotX         = 0. deg
d:Ge/AirFilling/RotY         = 0. deg
d:Ge/AirFilling/RotZ         = 0. deg
s:Ge/AirFilling/DrawingStyle = "FullWireFrame"
s:Ge/AirFilling/Color        = "white"

s:Ge/IridiumCore/Type         = "TsCylinder"
s:Ge/IridiumCore/Parent       = "AirFilling"
s:Ge/IridiumCore/Material     = "G4_Ir"
d:Ge/IridiumCore/RMin         = 0. mm
d:Ge/IridiumCore/RMax         = 0.3 mm
d:Ge/IridiumCore/SPhi         = 0. deg
d:Ge/IridiumCore/DPhi         = 360. deg
d:Ge/IridiumCore/HL           = 1.75 mm
d:Ge/IridiumCore/TransX       = 0. mm
d:Ge/IridiumCore/TransY       = 0. mm
d:Ge/IridiumCore/TransZ       = 0. mm
d:Ge/IridiumCore/RotX         = 0. deg
d:Ge/IridiumCore/RotY         = 0. deg
d:Ge/IridiumCore/RotZ         = 0. deg
s:Ge/IridiumCore/DrawingStyle = "FullWireFrame"
s:Ge/IridiumCore/Color        = "red"

s:Ge/FullStainlessSteelCylinder/Type         = "TsCylinder"
s:Ge/FullStainlessSteelCylinder/Parent       = "World"
s:Ge/FullStainlessSteelCylinder/Material     = "StainlessSteel"
d:Ge/FullStainlessSteelCylinder/RMin         = 0. mm
d:Ge/FullStainlessSteelCylinder/RMax         = 0.425 mm
d:Ge/FullStainlessSteelCylinder/SPhi         = 0. deg
d:Ge/FullStainlessSteelCylinder/DPhi         = 360. deg
d:Ge/FullStainlessSteelCylinder/HL           = 0.245 mm
d:Ge/FullStainlessSteelCylinder/TransX       = 0. mm
d:Ge/FullStainlessSteelCylinder/TransY       = 0. mm
d:Ge/FullStainlessSteelCylinder/TransZ       = 2.045 mm
d:Ge/FullStainlessSteelCylinder/RotX         = 0. deg
d:Ge/FullStainlessSteelCylinder/RotY         = 0. deg
d:Ge/FullStainlessSteelCylinder/RotZ         = 0. deg
s:Ge/FullStainlessSteelCylinder/DrawingStyle = "FullWireFrame"
s:Ge/FullStainlessSteelCylinder/Color        = "blue"

s:Ge/LeftEndCone/Type                   = "G4Cons"
s:Ge/LeftEndCone/Parent                 = "World"
s:Ge/LeftEndCone/Material               = "StainlessSteel"
d:Ge/LeftEndCone/TransX                 = 0 mm
d:Ge/LeftEndCone/TransY                 = 0 mm
d:Ge/LeftEndCone/TransZ                 = 2.344 mm
d:Ge/LeftEndCone/RotX                   = 0 deg
d:Ge/LeftEndCone/RotY                   = 0 deg
d:Ge/LeftEndCone/RotZ                   = 0 deg
d:Ge/LeftEndCone/RMin1                  = 0 mm
d:Ge/LeftEndCone/RMax1                  = 0.425 mm
d:Ge/LeftEndCone/RMin2                  = 0 mm
d:Ge/LeftEndCone/RMax2                  = 0.17 mm
d:Ge/LeftEndCone/HL                     = 0.054 mm
d:Ge/LeftEndCone/SPhi                   = 0 deg
d:Ge/LeftEndCone/DPhi                   = 360 deg
s:Ge/LeftEndCone/Color                  = "blue"
s:Ge/LeftEndCone/DrawingStyle           = "FullWireFrame"

s:Ge/RightStainlessSteelCone/Type                   = "G4Cons"
s:Ge/RightStainlessSteelCone/Parent                 = "World"
s:Ge/RightStainlessSteelCone/Material               = "StainlessSteel"
d:Ge/RightStainlessSteelCone/TransX                 = 0 mm
d:Ge/RightStainlessSteelCone/TransY                 = 0 mm
d:Ge/RightStainlessSteelCone/TransZ                 = -2 mm
d:Ge/RightStainlessSteelCone/RotX                   = 0 deg
d:Ge/RightStainlessSteelCone/RotY                   = 180 deg
d:Ge/RightStainlessSteelCone/RotZ                   = 0 deg
d:Ge/RightStainlessSteelCone/RMin1                  = 0. mm
d:Ge/RightStainlessSteelCone/RMax1                  = 0.425 mm
d:Ge/RightStainlessSteelCone/RMin2                  = 0. mm
d:Ge/RightStainlessSteelCone/RMax2                  = 0.25 mm
d:Ge/RightStainlessSteelCone/HL                     = 0.2 mm
d:Ge/RightStainlessSteelCone/SPhi                   = 0 deg
d:Ge/RightStainlessSteelCone/DPhi                   = 360 deg
s:Ge/RightStainlessSteelCone/Color                  = "blue"
s:Ge/RightStainlessSteelCone/DrawingStyle           = "FullWireFrame"

s:Ge/CableStainlessSteelCylinder/Type         = "TsCylinder"
s:Ge/CableStainlessSteelCylinder/Parent       = "World"
s:Ge/CableStainlessSteelCylinder/Material     = "StainlessSteel"
d:Ge/CableStainlessSteelCylinder/RMin         = 0. mm
d:Ge/CableStainlessSteelCylinder/RMax         = 0.25 mm
d:Ge/CableStainlessSteelCylinder/SPhi         = 0. deg
d:Ge/CableStainlessSteelCylinder/DPhi         = 360. deg
d:Ge/CableStainlessSteelCylinder/HL           = 2.5 mm
d:Ge/CableStainlessSteelCylinder/TransX       = 0. mm
d:Ge/CableStainlessSteelCylinder/TransY       = 0. mm
d:Ge/CableStainlessSteelCylinder/TransZ       = -4.7 mm
d:Ge/CableStainlessSteelCylinder/RotX         = 0. deg
d:Ge/CableStainlessSteelCylinder/RotY         = 0. deg
d:Ge/CableStainlessSteelCylinder/RotZ         = 0. deg
s:Ge/CableStainlessSteelCylinder/DrawingStyle = "FullWireFrame"
s:Ge/CableStainlessSteelCylinder/Color        = "blue"

Ir192_MicroSelectronV2.txt

#                                                          #
#              MicroSelectron V2 Ir-192 source             #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Materials ######
sv:Ma/CapsuleSteel/Components = 5 "Nickel" "Iron" "Manganese" "Chromium" "Silicon"
uv:Ma/CapsuleSteel/Fractions  = 5 0.12 0.68 0.02 0.17 0.01
d:Ma/CapsuleSteel/Density     = 8.06 g/cm3

sv:Ma/CableSteel/Components = 5 "Nickel" "Iron" "Manganese" "Chromium" "Silicon"
uv:Ma/CableSteel/Fractions  = 5 0.12 0.68 0.02 0.17 0.01
d:Ma/CableSteel/Density     = 4.81 g/cm3

##### Radioactive source #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "G4_Ir"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"

##### Spectrum, NNDC Rivard 2010, 10 keV cut ######
dv:So/ActiveSource/BeamEnergySpectrumValues = 39 61.486 63.0 65.122 66.831 71.079 71.414 73.363 75.368 75.749 77.831 110.4 136.3426 176.98 201.3112 205.79430 280.27 283.2668 295.95650 308.45507 316.50618 329.17 374.4852 416.4688 420.52 468.0688 484.5751 485.30 489.06 588.5810 593.49 599.41 604.41105 612.4621 703.87 765.8 884.5365 1061.48 1089.9 1378.20 keV

uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 39 0.0120 0.0205 0.0263 0.0446 0.00241 0.00466 0.00163 0.00533 0.01025 0.00365 0.000122 0.0020 0.000043 0.00473 0.0334 0.00009 0.00266 0.2872 0.2968 0.8271 0.000174 0.00726 0.00669 0.00069 0.4781 0.03187 0.000023 0.00438 0.04517 0.000421 0.000039 0.0820 0.0534 0.000053 0.000013 0.00291 0.000530 0.000012 0.000012

uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.43492973 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####
s:Ge/Source/Type   = "Group"
s:Ge/Source/Parent = "World"

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "Source"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

s:Ge/ActiveCylinder/Type              = "TsCylinder"
s:Ge/ActiveCylinder/Parent            = "ActiveSourceGeometry"
s:Ge/ActiveCylinder/Material          = "G4_Ir"
d:Ge/ActiveCylinder/RMin              = 0 mm
d:Ge/ActiveCylinder/RMax              = 0.325 mm
d:Ge/ActiveCylinder/HL                = 1.74 mm
d:Ge/ActiveCylinder/SPhi              = 0. deg
d:Ge/ActiveCylinder/DPhi              = 360. deg
s:Ge/ActiveCylinder/Color             = "white"
s:Ge/ActiveCylinder/DrawingStyle      = "Solid"
b:Ge/ActiveCylinder/IsParallel        = "True"
s:Ge/ActiveCylinder/ParallelWorldName = "ActiveSourceWorld"

s:Ge/ActiveCone1/Type              = "G4Cons"
s:Ge/ActiveCone1/Parent            = "ActiveSourceGeometry"
s:Ge/ActiveCone1/Material          = "G4_Ir"
d:Ge/ActiveCone1/TransZ            = Ge/ActiveCylinder/HL + Ge/ActiveCone1/HL mm
d:Ge/ActiveCone1/RMax1             = Ge/ActiveCylinder/RMax mm
d:Ge/ActiveCone1/RMax2             = 0.265 mm
d:Ge/ActiveCone1/HL                = 0.03 mm
s:Ge/ActiveCone1/Color             = "white"
s:Ge/ActiveCone1/DrawingStyle      = "Solid"
b:Ge/ActiveCone1/IsParallel        = "True"
s:Ge/ActiveCone1/ParallelWorldName = "ActiveSourceWorld"

s:Ge/ActiveCone2/Type              = "G4Cons"
s:Ge/ActiveCone2/Parent            = "ActiveSourceGeometry"
s:Ge/ActiveCone2/Material          = "G4_Ir"
d:Ge/ActiveCone2/TransZ            = -1 * Ge/ActiveCone1/TransZ mm
d:Ge/ActiveCone2/RMax1             = Ge/ActiveCone1/RMax2 mm
d:Ge/ActiveCone2/RMax2             = Ge/ActiveCone1/RMax1 mm
d:Ge/ActiveCone2/HL                = 0.03 mm
s:Ge/ActiveCone2/Color             = "white"
s:Ge/ActiveCone2/DrawingStyle      = "Solid"
b:Ge/ActiveCone2/IsParallel        = "True"
s:Ge/ActiveCone2/ParallelWorldName = "ActiveSourceWorld"

##### CAPSULE + CABLE GROUP COMPONENT #####
s:Ge/Capsule/Type              = "Group"
s:Ge/Capsule/Parent            = "Source"
d:Ge/Capsule/TransZ            = -0.25 mm
b:Ge/Capsule/IsParallel        = "True"
s:Ge/Capsule/ParallelWorldName = "ShieldingWorld"
iv:Gr/Color/shieldingcolor  = 4 255 255 255 80

s:Ge/CapsuleCylinder/Type         = "TsCylinder"
s:Ge/CapsuleCylinder/Material     = "CapsuleSteel"
s:Ge/CapsuleCylinder/Parent       = "Capsule"
d:Ge/CapsuleCylinder/RMin         = 0 mm
d:Ge/CapsuleCylinder/RMax         = 0.45 mm
d:Ge/CapsuleCylinder/HL           = 1.95 mm
d:Ge/CapsuleCylinder/SPhi         = 0. deg
d:Ge/CapsuleCylinder/DPhi         = 360. deg
d:Ge/CapsuleCylinder/TransZ       = 0 mm
s:Ge/CapsuleCylinder/Color        = "shieldingcolor"
s:Ge/CapsuleCylinder/DrawingStyle = "Solid"
b:Ge/CapsuleCylinder/IsParallel        = "True"
s:Ge/CapsuleCylinder/ParallelWorldName = "ShieldingWorld"

s:Ge/Capsulecap/Type         = "TsSphere"
s:Ge/Capsulecap/Material     = "CapsuleSteel"
s:Ge/Capsulecap/Parent       = "Capsule"
d:Ge/Capsulecap/RMin         = 0. mm
d:Ge/Capsulecap/RMax         = Ge/CapsuleCylinder/RMax mm
d:Ge/Capsulecap/SPhi         = 0. deg
d:Ge/Capsulecap/DPhi         = 360. deg
d:Ge/Capsulecap/STheta       = 0. deg
d:Ge/Capsulecap/DTheta       = 90. deg
d:Ge/Capsulecap/TransZ       = Ge/CapsuleCylinder/HL mm
s:Ge/Capsulecap/DrawingStyle = "Solid"
s:Ge/Capsulecap/Color        = "shieldingcolor"
b:Ge/Capsulecap/IsParallel        = "True"
s:Ge/Capsulecap/ParallelWorldName = "ShieldingWorld"

s:Ge/CapsuleCone/Type            = "G4Cons"
s:Ge/CapsuleCone/Parent          = "Capsule"
s:Ge/CapsuleCone/Material        = "CapsuleSteel"
d:Ge/CapsuleCone/RMax1           = 0.35 mm
d:Ge/CapsuleCone/RMax2           = Ge/CapsuleCylinder/RMax mm
d:Ge/CapsuleCone/HL              = 0.075 mm
d:Ge/CapsuleCone/TransZ          = -2.025 mm  
s:Ge/CapsuleCone/Color           = "shieldingcolor"
s:Ge/CapsuleCone/DrawingStyle    = "Solid"
b:Ge/CapsuleCone/IsParallel        = "True"
s:Ge/CapsuleCone/ParallelWorldName = "ShieldingWorld"

s:Ge/Cable/Type         = "TsCylinder"
s:Ge/Cable/Material     = "CableSteel"
s:Ge/Cable/Parent       = "Capsule"
d:Ge/Cable/RMin         = 0 mm
d:Ge/Cable/RMax         = 0.35 mm
d:Ge/Cable/HL           = 1.0 mm
d:Ge/Cable/SPhi         = 0. deg
d:Ge/Cable/DPhi         = 360. deg
d:Ge/Cable/TransZ       = -3.1 mm  
s:Ge/Cable/Color        = "Green"
s:Ge/Cable/DrawingStyle = "Solid"
b:Ge/Cable/IsParallel        = "True"
s:Ge/Cable/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds =  2 "ShieldingWorld" "ActiveSourceWorld"

Ir192_TG186.txt

#                                                          #
#                  TG186 Ir-192 source                     #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Materials ######
sv:Ma/CapsuleSteel/Components = 5 "Nickel" "Iron" "Manganese" "Chromium" "Silicon"
uv:Ma/CapsuleSteel/Fractions  = 5 0.12 0.68 0.02 0.17 0.01
d:Ma/CapsuleSteel/Density     = 8.02 g/cm3

sv:Ma/CableSteel/Components = 5 "Nickel" "Iron" "Manganese" "Chromium" "Silicon"
uv:Ma/CableSteel/Fractions  = 5 0.12 0.68 0.02 0.17 0.01
d:Ma/CableSteel/Density     = 5.00 g/cm3

##### Radioactive source #####
s:Ge/ActiveCylinder/Type         = "TsCylinder"
s:Ge/ActiveCylinder/Material     = "G4_Ir"
s:Ge/ActiveCylinder/Parent       = "CapsuleCylinder"
d:Ge/ActiveCylinder/RMin         = 0 mm
d:Ge/ActiveCylinder/RMax         = 0.3 mm
d:Ge/ActiveCylinder/HL           = 1.75 mm
d:Ge/ActiveCylinder/SPhi         = 0. deg
d:Ge/ActiveCylinder/DPhi         = 360. deg
d:Ge/ActiveCylinder/TransZ       = 0.4 mm
s:Ge/ActiveCylinder/Color        = "White"
s:Ge/ActiveCylinder/DrawingStyle = "Solid"

s:So/Source/Type                      = "Volumetric"
s:So/Source/Component                 = "ActiveCylinder"
s:So/Source/ActiveMaterial            = "G4_Ir"
s:So/Source/BeamParticle              = "gamma"
i:So/Source/NumberOfHistoriesInRun    = 10
i:So/Source/MaxNumberOfPointsToSample = 1000000000
s:So/Source/BeamEnergySpectrumType    = "Discrete"

##### Rivard 2010 spectrum, NNDC, 10 keV cut ######
dv:So/Source/BeamEnergySpectrumValues = 39 61.486 63.0 65.122 66.831 71.079 71.414 73.363 75.368 75.749 77.831 110.4 136.3426 176.98 201.3112 205.79430 280.27 283.2668 295.95650 308.45507 316.50618 329.17 374.4852 416.4688 420.52 468.0688 484.5751 485.30 489.06 588.5810 593.49 599.41 604.41105 612.4621 703.87 765.8 884.5365 1061.48 1089.9 1378.20 keV

uv:So/Source/BeamEnergySpectrumWeightsUnscaled = 39 0.0120 0.0205 0.0263 0.0446 0.00241 0.00466 0.00163 0.00533 0.01025 0.00365 0.000122 0.0020 0.000043 0.00473 0.0334 0.00009 0.00266 0.2872 0.2968 0.8271 0.000174 0.00726 0.00669 0.00069 0.4781 0.03187 0.000023 0.00438 0.04517 0.000421 0.000039 0.0820 0.0534 0.000053 0.000013 0.00291 0.000530 0.000012 0.000012

uv:So/Source/BeamEnergySpectrumWeights = 0.43492973 * So/Source/BeamEnergySpectrumWeightsUnscaled

##### Group component, capsule and cable #####
s:Ge/Capsule/Type   = "Group"
s:Ge/Capsule/Parent = "World"

s:Ge/CapsuleCylinder/Type         = "TsCylinder"
s:Ge/CapsuleCylinder/Material     = "CapsuleSteel"
s:Ge/CapsuleCylinder/Parent       = "Capsule"
d:Ge/CapsuleCylinder/RMin         = 0 mm
d:Ge/CapsuleCylinder/RMax         = 0.5 mm
d:Ge/CapsuleCylinder/HL           = 2.25 mm
d:Ge/CapsuleCylinder/SPhi         = 0. deg
d:Ge/CapsuleCylinder/DPhi         = 360. deg
d:Ge/CapsuleCylinder/TransZ       = -0.4 mm
s:Ge/CapsuleCylinder/Color        = "shieldingcolor"
s:Ge/CapsuleCylinder/DrawingStyle = "Solid"

s:Ge/Capsulecap/Type         = "TsSphere"
s:Ge/Capsulecap/Material     = "CapsuleSteel"
s:Ge/Capsulecap/Parent       = "Capsule"
d:Ge/Capsulecap/RMin         = 0. mm
d:Ge/Capsulecap/RMax         = 0.5 mm
d:Ge/Capsulecap/SPhi         = 0. deg
d:Ge/Capsulecap/DPhi         = 360. deg
d:Ge/Capsulecap/STheta       = 0. deg
d:Ge/Capsulecap/DTheta       = 90. deg
d:Ge/Capsulecap/TransZ       = Ge/ActiveCylinder/HL + 0.1 mm
s:Ge/Capsulecap/DrawingStyle = "Solid"
s:Ge/Capsulecap/Color        = "shieldingcolor"

s:Ge/Cable/Type         = "TsCylinder"
s:Ge/Cable/Material     = "CableSteel"
s:Ge/Cable/Parent       = "Capsule"
d:Ge/Cable/RMin         = 0 mm
d:Ge/Cable/RMax         = 0.5 mm
d:Ge/Cable/HL           = 1.0 mm
d:Ge/Cable/SPhi         = 0. deg
d:Ge/Cable/DPhi         = 360. deg
d:Ge/Cable/TransZ       = -3.65 mm
s:Ge/Cable/Color        = "Green"
s:Ge/Cable/DrawingStyle = "Solid"

iv:Gr/Color/shieldingcolor = 4 255 255 255 80

TG186Applicator.txt

#                                                          #
#                     TG186 APPLICATOR                     #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIAL DEFINITION ######
sv:Ma/StainlessSteel316L/Components = 7 "Phosphorus" "Carbon" "Silicon" "Manganese" "Nickel" "Chromium" "Iron"
uv:Ma/StainlessSteel316L/Fractions  = 7 0.00045 0.0008 0.01 0.02 0.095 0.19 0.68375
d:Ma/StainlessSteel316L/Density     = 8.0 g/cm3

sv:Ma/DensimetD176/Components = 3 "Iron" "Nickel" "Tungsten"
uv:Ma/DensimetD176/Fractions  = 3 0.025 0.05 0.925
d:Ma/DensimetD176/Density     = 17.6 g/cm3

sv:Ma/Air40/Components = 5 "Carbon" "Hydrogen" "Argon" "Oxygen" "Nitrogen" 
uv:Ma/Air40/Fractions  = 5 0.000123 0.000732 0.012743 0.236077 0.750325 
d:Ma/Air40/Density     = 1.19 mg/cm3

##### APPLICATOR GEOMETRY #####
s:Ge/PMMAcylinder/Type         = "TsCylinder"
s:Ge/PMMAcylinder/Material     = "Lucite"
s:Ge/PMMAcylinder/Parent       = "World"
d:Ge/PMMAcylinder/RMin         = 0 mm
d:Ge/PMMAcylinder/RMax         = 18.0 mm
d:Ge/PMMAcylinder/HL           = 61.0 mm
d:Ge/PMMAcylinder/SPhi         = 0. deg
d:Ge/PMMAcylinder/DPhi         = 360. deg
s:Ge/PMMAcylinder/DrawingStyle = "Solid"
s:Ge/PMMAcylinder/Color        = "transparentblue"

s:Ge/PMMAcap/Type         = "TsSphere"
s:Ge/PMMAcap/Material     = "Lucite"
s:Ge/PMMAcap/Parent       = "World"
d:Ge/PMMAcap/RMin         = 0. mm
d:Ge/PMMAcap/RMax         = 18. mm
d:Ge/PMMAcap/SPhi         = 0. deg
d:Ge/PMMAcap/DPhi         = 360. deg
d:Ge/PMMAcap/STheta       = 0. deg
d:Ge/PMMAcap/DTheta       = 90. deg
d:Ge/PMMAcap/TransZ       = 61. mm
s:Ge/PMMAcap/DrawingStyle = "Solid"
s:Ge/PMMAcap/Color        = "transparentblue"

s:Ge/Densimet/Type         = "TsCylinder"
s:Ge/Densimet/Material     = "DensimetD176"
s:Ge/Densimet/Parent       = "PMMAcylinder"
d:Ge/Densimet/RMin         = 1.6 mm
d:Ge/Densimet/RMax         = 12.0 mm
d:Ge/Densimet/HL           = 61.0 mm
d:Ge/Densimet/SPhi         = 0. deg
d:Ge/Densimet/DPhi         = 180. deg
d:Ge/Densimet/RotX         = 0. deg
d:Ge/Densimet/RotY         = 0. deg
d:Ge/Densimet/RotZ         = 90. deg
s:Ge/Densimet/DrawingStyle = "Solid"
s:Ge/Densimet/Color        = "transparentgreen"

s:Ge/HalfcylinderAir/Type         = "TsCylinder"
s:Ge/HalfcylinderAir/Material     = "Air40"
s:Ge/HalfcylinderAir/Parent       = "PMMAcylinder"
d:Ge/HalfcylinderAir/RMin         = 1.6 mm
d:Ge/HalfcylinderAir/RMax         = 12.0 mm
d:Ge/HalfcylinderAir/HL           = 61.0 mm
d:Ge/HalfcylinderAir/SPhi         = 0 deg
d:Ge/HalfcylinderAir/DPhi         = 180 deg
d:Ge/HalfcylinderAir/RotZ         = -90. deg
s:Ge/HalfcylinderAir/DrawingStyle = "Solid"
s:Ge/HalfcylinderAir/Color        = "transparentred"

s:Ge/StainlessCylinder/Type         = "TsCylinder"
s:Ge/StainlessCylinder/Material     = "StainlessSteel316L"
s:Ge/StainlessCylinder/Parent       = "PMMAcylinder"
d:Ge/StainlessCylinder/RMin         = 0.5 mm
d:Ge/StainlessCylinder/RMax         = 1.6 mm 
d:Ge/StainlessCylinder/HL           = 61.0 mm
d:Ge/StainlessCylinder/SPhi         = 0. deg
d:Ge/StainlessCylinder/DPhi         = 360. deg
s:Ge/StainlessCylinder/DrawingStyle = "Solid"
s:Ge/StainlessCylinder/Color        = "transparentyellow"

s:Ge/AirCylinder/Type         = "TsCylinder"
s:Ge/AirCylinder/Material     = "Air40"
s:Ge/AirCylinder/Parent       = "PMMAcylinder"
d:Ge/AirCylinder/RMin         = 0.0 mm
d:Ge/AirCylinder/RMax         = 0.5 mm
d:Ge/AirCylinder/HL           = 61.0 mm
d:Ge/AirCylinder/SPhi         = 0. deg
d:Ge/AirCylinder/DPhi         = 360. deg
s:Ge/AirCylinderDrawingStyle = "Solid"
s:Ge/AirCylinder/Color        = "transparentred"

iv:Gr/Color/transparentblue    = 4 50 50 255 80
iv:Gr/Color/transparentgreen  = 4 0 255 0 150
iv:Gr/Color/transparentyellow = 4 255 255 0 100
iv:Gr/Color/transparentred    = 4 255 0 0 100

LDRSource.txt

#                                                          #
#                   Example: LDR source                    #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### Import one of the following LDR sources ##### 
includeFile = ./LDR/Cs131_IsoRay-CS-1-Rev2.txt
#includeFile = ./LDR/I125_BardSTM1251.txt
#includeFile = ./LDR/I125_Best2301.txt
#includeFile = ./LDR/I125_IsoAid_IAI-125A.txt
#includeFile = ./LDR/I125_OncoSeed6711.txt
#includeFile = ./LDR/I125_SelectSeed.txt
#includeFile = ./LDR/I125_SL-125.txt
#includeFile = ./LDR/I125_Theragenic-AgX100.txt
#includeFile = ./LDR/Pd103_Best2335.txt
#includeFile = ./LDR/Pd103_IAPd103A.txt
#includeFile = ./LDR/Pd103_Theraseed200Heavy.txt
#includeFile = ./LDR/Pd103_Theraseed200Light.txt

##### Extra parameters for Theraseed200 models
##### User can define the material of both caps
#s:Ge/EnvironmentLeftCap/Material  = Ge/World/Material
#s:Ge/EnvironmentRightCap/Material = Ge/World/Material

##### Water phantom of 50 cm side #####
d:Ge/World/HLX = 25 cm
d:Ge/World/HLY = 25 cm
d:Ge/World/HLZ = 25 cm
s:Ge/World/Material = "G4_WATER"

##### Physics #####
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

##### Graphics #####
b:Gr/Enable          = "T"
b:Ts/PauseBeforeQuit = "T"

s:Gr/View/Type        = "OpenGL"
u:Gr/View/Zoom        = 75.
d:Gr/View/Phi         = 20 deg
d:Gr/View/Theta       = 90 deg
b:Gr/View/IncludeAxes = "T"
d:Gr/View/AxesSize    = 5 mm

Cs131_IsoRay-CS-1-Rev2.txt

#                                                          #
#                     Cs 131 - IsoRay                      #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIAL DEFINITION #####
sv:Ma/PurePyrex/Components = 8 "Silicon" "Titanium" "Aluminum" "Boron" "Magnesium" "Calcium" "Sodium" "Oxygen"
uv:Ma/PurePyrex/Fractions  = 8 0.2629625 0.0311625 0.0170625 0.0384625 0.0132625 0.0297625 0.1272625 0.4800625 
d:Ma/PurePyrex/Density     = 2.4 g/cm3

sv:Ma/RadioactivePyrex/Components = 9 "Silicon" "Titanium" "Aluminum" "Boron" "Magnesium" "Calcium" "Sodium" "Oxygen" "Caesium"
uv:Ma/RadioactivePyrex/Fractions  = 9 0.2618 0.03 0.0159 0.0373 0.0121 0.0286 0.1261 0.4789 0.0093
d:Ma/RadioactivePyrex/Density     = 2.4 g/cm3

sv:Ma/ArgonGas/Components = 1 "Argon"
uv:Ma/ArgonGas/Fractions  = 1 1
d:Ma/ArgonGas/Density     = 1.784 mg/cm3

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "RadioactivePyrexCylinder"
sc:So/ActiveSource/ActiveMaterial            = "RadioactivePyrex"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 100000000
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM #####
dv:So/ActiveSource/BeamEnergySpectrumValues = 6 4.11 29.461 29.782 33.562 33.624 34.419 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 6 0.086 0.211 0.389 0.0363 0.0702 0.0213
uv:So/ActiveSource/BeamEnergySpectrumWeights = 1.228803146 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "World"
s:Ge/TitaniumCylinder/Material     = "G4_Ti"
d:Ge/TitaniumCylinder/RMin         = 0. mm
d:Ge/TitaniumCylinder/RMax         = 0.415 mm
d:Ge/TitaniumCylinder/SPhi         = 0. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 2.26 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"

#====================
#Argon filling
#====================

s:Ge/ArgonFilling/Type         = "TsCylinder"
s:Ge/ArgonFilling/Parent       = "TitaniumCylinder"
s:Ge/ArgonFilling/Material     = "ArgonGas"
d:Ge/ArgonFilling/RMin         = 0. mm
d:Ge/ArgonFilling/RMax         = 0.355 mm
d:Ge/ArgonFilling/SPhi         = 0. deg
d:Ge/ArgonFilling/DPhi         = 360. deg
d:Ge/ArgonFilling/HL           = 2.16 mm
d:Ge/ArgonFilling/TransX       = 0. mm
d:Ge/ArgonFilling/TransY       = 0. mm
d:Ge/ArgonFilling/TransZ       = 0. mm
d:Ge/ArgonFilling/RotX         = 0. deg
d:Ge/ArgonFilling/RotY         = 0. deg
d:Ge/ArgonFilling/RotZ         = 0. deg
s:Ge/ArgonFilling/DrawingStyle = "FullWireFrame"
s:Ge/ArgonFilling/Color        = "yellow"

#====================
#Gold cylinder
#====================

s:Ge/GoldCylinder/Type         = "TsCylinder"
s:Ge/GoldCylinder/Parent       = "ArgonFilling"
s:Ge/GoldCylinder/Material     = "G4_Au"
d:Ge/GoldCylinder/RMin         = 0. mm
d:Ge/GoldCylinder/RMax         = 0.125 mm
d:Ge/GoldCylinder/SPhi         = 0. deg
d:Ge/GoldCylinder/DPhi         = 360. deg
d:Ge/GoldCylinder/HL           = 2 mm
d:Ge/GoldCylinder/TransX       = 0. mm
d:Ge/GoldCylinder/TransY       = 0. mm
d:Ge/GoldCylinder/TransZ       = 0. mm
d:Ge/GoldCylinder/RotX         = 0. deg
d:Ge/GoldCylinder/RotY         = 0. deg
d:Ge/GoldCylinder/RotZ         = 0. deg
s:Ge/GoldCylinder/DrawingStyle = "FullWireFrame"
s:Ge/GoldCylinder/Color        = "red"

#====================
#Pure Pyrex housing
#====================

#s:Ge/PurePyrexHousing/Type         = "TsCylinder"
#s:Ge/PurePyrexHousing/Parent       = "ArgonFilling"
#s:Ge/PurePyrexHousing/Material     = "PurePyrex"
#d:Ge/PurePyrexHousing/RMin         = 0.15 mm
#d:Ge/PurePyrexHousing/RMax         = 0.2 mm
#d:Ge/PurePyrexHousing/SPhi         = 0. deg
#d:Ge/PurePyrexHousing/DPhi         = 360. deg
#d:Ge/PurePyrexHousing/HL           = 2 mm
#d:Ge/PurePyrexHousing/TransX       = 0. mm
#d:Ge/PurePyrexHousing/TransY       = 0. mm
#d:Ge/PurePyrexHousing/TransZ       = 0. mm
#d:Ge/PurePyrexHousing/RotX         = 0. deg
#d:Ge/PurePyrexHousing/RotY         = 0. deg
#d:Ge/PurePyrexHousing/RotZ         = 0. deg
#s:Ge/PurePyrexHousing/DrawingStyle = "FullWireFrame"
#s:Ge/PurePyrexHousing/Color        = "purple"

#==========================
#Radioactive Pyrex cylinder
#==========================

s:Ge/RadioactivePyrexCylinder/Type         = "TsCylinder"
s:Ge/RadioactivePyrexCylinder/Parent       = "ArgonFilling"
s:Ge/RadioactivePyrexCylinder/Material     = "RadioactivePyrex"
d:Ge/RadioactivePyrexCylinder/RMin         = 0.15 mm
d:Ge/RadioactivePyrexCylinder/RMax         = 0.31 mm
d:Ge/RadioactivePyrexCylinder/SPhi         = 0. deg
d:Ge/RadioactivePyrexCylinder/DPhi         = 360. deg
d:Ge/RadioactivePyrexCylinder/HL           = 2 mm
d:Ge/RadioactivePyrexCylinder/TransX       = 0. mm
d:Ge/RadioactivePyrexCylinder/TransY       = 0. mm
d:Ge/RadioactivePyrexCylinder/TransZ       = 0. mm
d:Ge/RadioactivePyrexCylinder/RotX         = 0. deg
d:Ge/RadioactivePyrexCylinder/RotY         = 0. deg
d:Ge/RadioactivePyrexCylinder/RotZ         = 0. deg
s:Ge/RadioactivePyrexCylinder/DrawingStyle = "FullWireFrame"
s:Ge/RadioactivePyrexCylinder/Color        = "green"

I125_BardSTM1251.txt

#                                                          #
#                   I 125 - BardSTM 1251                   #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "IodineCylinder"
sc:So/ActiveSource/ActiveMaterial            = "G4_I"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 10000000#00 
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM
dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.3922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.6269199 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

#====================
#Iodine cylinder
#====================

s:Ge/IodineCylinder/Type         = "TsCylinder"
s:Ge/IodineCylinder/Parent       = "DryAirCylinder"
s:Ge/IodineCylinder/Material     = "G4_I"
d:Ge/IodineCylinder/RMin         = 0. mm
d:Ge/IodineCylinder/RMax         = 0.259417 mm
d:Ge/IodineCylinder/SPhi         = 0. deg
d:Ge/IodineCylinder/DPhi         = 360. deg
d:Ge/IodineCylinder/HL           = 1.909417 mm
d:Ge/IodineCylinder/TransX       = 0. mm
d:Ge/IodineCylinder/TransY       = 0. mm
d:Ge/IodineCylinder/TransZ       = 0. mm
d:Ge/IodineCylinder/RotX         = 0. deg
d:Ge/IodineCylinder/RotY         = 0. deg
d:Ge/IodineCylinder/RotZ         = 0. deg
s:Ge/IodineCylinder/DrawingStyle = "FullWireFrame"
s:Ge/IodineCylinder/Color        = "yellow"

#====================
#Copper cylinder
#====================

s:Ge/CopperCylinder/Type         = "TsCylinder"
s:Ge/CopperCylinder/Parent       = "IodineCylinder"
s:Ge/CopperCylinder/Material     = "G4_Cu"
d:Ge/CopperCylinder/RMin         = 0. mm
d:Ge/CopperCylinder/RMax         = 0.2594 mm
d:Ge/CopperCylinder/SPhi         = 0. deg
d:Ge/CopperCylinder/DPhi         = 360. deg
d:Ge/CopperCylinder/HL           = 1.9094 mm
d:Ge/CopperCylinder/TransX       = 0. mm
d:Ge/CopperCylinder/TransY       = 0. mm
d:Ge/CopperCylinder/TransZ       = 0. mm
d:Ge/CopperCylinder/RotX         = 0. deg
d:Ge/CopperCylinder/RotY         = 0. deg
d:Ge/CopperCylinder/RotZ         = 0. deg
s:Ge/CopperCylinder/DrawingStyle = "FullWireFrame"
s:Ge/CopperCylinder/Color        = "brown"

#====================
#Nickel cylinder
#====================

s:Ge/NickelCylinder/Type         = "TsCylinder"
s:Ge/NickelCylinder/Parent       = "CopperCylinder"
s:Ge/NickelCylinder/Material     = "G4_Ni"
d:Ge/NickelCylinder/RMin         = 0. mm
d:Ge/NickelCylinder/RMax         = 0.2569 mm
d:Ge/NickelCylinder/SPhi         = 0. deg
d:Ge/NickelCylinder/DPhi         = 360. deg
d:Ge/NickelCylinder/HL           = 1.9069 mm
d:Ge/NickelCylinder/TransX       = 0. mm
d:Ge/NickelCylinder/TransY       = 0. mm
d:Ge/NickelCylinder/TransZ       = 0. mm
d:Ge/NickelCylinder/RotX         = 0. deg
d:Ge/NickelCylinder/RotY         = 0. deg
d:Ge/NickelCylinder/RotZ         = 0. deg
s:Ge/NickelCylinder/DrawingStyle = "FullWireFrame"
s:Ge/NickelCylinder/Color        = "grey"

#====================
#Aluminium cylinder
#====================

s:Ge/AluminiumCylinder/Type         = "TsCylinder"
s:Ge/AluminiumCylinder/Parent       = "NickelCylinder"
s:Ge/AluminiumCylinder/Material     = "G4_Al"
d:Ge/AluminiumCylinder/RMin         = 0. mm
d:Ge/AluminiumCylinder/RMax         = 0.255 mm
d:Ge/AluminiumCylinder/SPhi         = 0. deg
d:Ge/AluminiumCylinder/DPhi         = 360. deg
d:Ge/AluminiumCylinder/HL           = 1.905 mm
d:Ge/AluminiumCylinder/TransX       = 0. mm
d:Ge/AluminiumCylinder/TransY       = 0. mm
d:Ge/AluminiumCylinder/TransZ       = 0. mm
d:Ge/AluminiumCylinder/RotX         = 0. deg
d:Ge/AluminiumCylinder/RotY         = 0. deg
d:Ge/AluminiumCylinder/RotZ         = 0. deg
s:Ge/AluminiumCylinder/DrawingStyle = "FullWireFrame"
s:Ge/AluminiumCylinder/Color        = "purple"

#====================
#Gold cylinder
#====================

s:Ge/GoldCylinder/Type         = "TsCylinder"
s:Ge/GoldCylinder/Parent       = "AluminiumCylinder"
s:Ge/GoldCylinder/Material     = "G4_Au"
d:Ge/GoldCylinder/RMin         = 0. mm
d:Ge/GoldCylinder/RMax         = 0.09 mm
d:Ge/GoldCylinder/SPhi         = 0. deg
d:Ge/GoldCylinder/DPhi         = 360. deg
d:Ge/GoldCylinder/HL           = 1.905 mm
d:Ge/GoldCylinder/TransX       = 0. mm
d:Ge/GoldCylinder/TransY       = 0. mm
d:Ge/GoldCylinder/TransZ       = 0. mm
d:Ge/GoldCylinder/RotX         = 0. deg
d:Ge/GoldCylinder/RotY         = 0. deg
d:Ge/GoldCylinder/RotZ         = 0. deg
s:Ge/GoldCylinder/DrawingStyle = "FullWireFrame"
s:Ge/GoldCylinder/Color        = "red"

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "World"
s:Ge/TitaniumCylinder/Material     = "G4_Ti"
d:Ge/TitaniumCylinder/RMin         = 0. mm
d:Ge/TitaniumCylinder/RMax         = 0.405 mm
d:Ge/TitaniumCylinder/SPhi         = 180. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 2.275 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "TitaniumCylinder"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.325 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 2.145 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"

I125_Best2301.txt

#                                                          #
#                     I 125 - Best 2301                    #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIALS ######
sv:Ma/MatOrganicMatrix/Components = 2 "Hydrogen" "Carbon"
uv:Ma/MatOrganicMatrix/Fractions = 2 0.077 0.923
d:Ma/MatOrganicMatrix/Density    = 1.06 g/cm3

sv:Ma/Tungsten/Components = 1 "Tungsten"
uv:Ma/Tungsten/Fractions  = 1 1 
d:Ma/Tungsten/Density     = 19.3 g/cm3

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "MatOrganicMatrix"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM #####
dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.3922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.6269199 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####
s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

#====================
#Organic cylinder
#====================

s:Ge/OrganicCylinder/Type         = "TsCylinder"
s:Ge/OrganicCylinder/Parent       = "ActiveSourceGeometry"
s:Ge/OrganicCylinder/Material     = "MatOrganicMatrix"
d:Ge/OrganicCylinder/RMin         = 0.125 mm
d:Ge/OrganicCylinder/RMax         = 0.225 mm
d:Ge/OrganicCylinder/SPhi         = 0. deg
d:Ge/OrganicCylinder/DPhi         = 360. deg
d:Ge/OrganicCylinder/HL           = 1.75 mm
d:Ge/OrganicCylinder/TransX       = 0. mm
d:Ge/OrganicCylinder/TransY       = 0. mm
d:Ge/OrganicCylinder/TransZ       = 0. mm
d:Ge/OrganicCylinder/RotX         = 0. deg
d:Ge/OrganicCylinder/RotY         = 0. deg
d:Ge/OrganicCylinder/RotZ         = 0. deg
s:Ge/OrganicCylinder/DrawingStyle = "FullWireFrame"
s:Ge/OrganicCylinder/Color        = "pink"
b:Ge/OrganicCylinder/IsParallel   = "T"
s:Ge/OrganicCylinder/ParallelWorldName = "ActiveSourceWorld"

#===============================
#Left cap of organic matrix 
#===============================

s:Ge/OrganicLeftCap/Type         = "TsSphere"
s:Ge/OrganicLeftCap/Parent       = "ActiveSourceGeometry"
s:Ge/OrganicLeftCap/Material     = "MatOrganicMatrix"
d:Ge/OrganicLeftCap/RMin         = 0.125 mm
d:Ge/OrganicLeftCap/RMax         = 0.225 mm
d:Ge/OrganicLeftCap/SPhi         = 0. deg
d:Ge/OrganicLeftCap/DPhi         = 360. deg
d:Ge/OrganicLeftCap/STheta       = 0. deg
d:Ge/OrganicLeftCap/DTheta       = 90. deg
d:Ge/OrganicLeftCap/TransX       = 0. mm
d:Ge/OrganicLeftCap/TransY       = 0. mm
d:Ge/OrganicLeftCap/TransZ       = 1.75 mm
d:Ge/OrganicLeftCap/RotX         = 0. deg
d:Ge/OrganicLeftCap/RotY         = 0. deg
d:Ge/OrganicLeftCap/RotZ         = 0. deg
s:Ge/OrganicLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/OrganicLeftCap/Color        = "pink"
b:Ge/OrganicLeftCap/IsParallel   = "T"
s:Ge/OrganicLeftCap/ParallelWorldName = "ActiveSourceWorld"

#===============================
#Right cap of organic matrix 
#===============================

s:Ge/OrganicRightCap/Type         = "TsSphere"
s:Ge/OrganicRightCap/Parent       = "ActiveSourceGeometry"
s:Ge/OrganicRightCap/Material     = "MatOrganicMatrix"
d:Ge/OrganicRightCap/RMin         = 0.125 mm
d:Ge/OrganicRightCap/RMax         = 0.225 mm
d:Ge/OrganicRightCap/SPhi         = 0. deg
d:Ge/OrganicRightCap/DPhi         = 360. deg
d:Ge/OrganicRightCap/STheta       = 0. deg
d:Ge/OrganicRightCap/DTheta       = 90. deg
d:Ge/OrganicRightCap/TransX       = 0. mm
d:Ge/OrganicRightCap/TransY       = 0. mm
d:Ge/OrganicRightCap/TransZ       = -1.75 mm
d:Ge/OrganicRightCap/RotX         = 180. deg
d:Ge/OrganicRightCap/RotY         = 0. deg
d:Ge/OrganicRightCap/RotZ         = 0. deg
s:Ge/OrganicRightCap/DrawingStyle = "FullWireFrame"
s:Ge/OrganicRightCap/Color        = "pink"
b:Ge/OrganicRightCap/IsParallel   = "T"
s:Ge/OrganicRightCap/ParallelWorldName = "ActiveSourceWorld"

#====================
#Tungsten cylinder
#====================

s:Ge/TungstenCylinder/Type         = "TsCylinder"
s:Ge/TungstenCylinder/Parent       = "ActiveSourceGeometry"
s:Ge/TungstenCylinder/Material     = "Tungsten"
d:Ge/TungstenCylinder/RMin         = 0. mm
d:Ge/TungstenCylinder/RMax         = 0.125 mm
d:Ge/TungstenCylinder/SPhi         = 0. deg
d:Ge/TungstenCylinder/DPhi         = 360. deg
d:Ge/TungstenCylinder/HL           = 1.75 mm
d:Ge/TungstenCylinder/TransX       = 0. mm
d:Ge/TungstenCylinder/TransY       = 0. mm
d:Ge/TungstenCylinder/TransZ       = 0. mm
d:Ge/TungstenCylinder/RotX         = 0. deg
d:Ge/TungstenCylinder/RotY         = 0. deg
d:Ge/TungstenCylinder/RotZ         = 0. deg
s:Ge/TungstenCylinder/DrawingStyle = "FullWireFrame"
s:Ge/TungstenCylinder/Color        = "grey"
b:Ge/TungstenCylinder/IsParallel   = "T"
s:Ge/TungstenCylinder/ParallelWorldName = "ActiveSourceWorld"

#===============================
#Left cap of Tungsten 
#===============================

s:Ge/TungstenLeftCap/Type         = "TsSphere"
s:Ge/TungstenLeftCap/Parent       = "ActiveSourceGeometry"
s:Ge/TungstenLeftCap/Material     = "Tungsten"
d:Ge/TungstenLeftCap/RMin         = 0. mm
d:Ge/TungstenLeftCap/RMax         = 0.125 mm
d:Ge/TungstenLeftCap/SPhi         = 0. deg
d:Ge/TungstenLeftCap/DPhi         = 360. deg
d:Ge/TungstenLeftCap/STheta       = 0. deg
d:Ge/TungstenLeftCap/DTheta       = 90. deg
d:Ge/TungstenLeftCap/TransX       = 0. mm
d:Ge/TungstenLeftCap/TransY       = 0. mm
d:Ge/TungstenLeftCap/TransZ       = 1.75 mm
d:Ge/TungstenLeftCap/RotX         = 0. deg
d:Ge/TungstenLeftCap/RotY         = 0. deg
d:Ge/TungstenLeftCap/RotZ         = 0. deg
s:Ge/TungstenLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TungstenLeftCap/Color        = "grey"
b:Ge/TungstenLeftCap/IsParallel   = "T"
s:Ge/TungstenLeftCap/ParallelWorldName = "ActiveSourceWorld"

#===============================
#Right cap of Tungsten 
#===============================

s:Ge/TungstenRightCap/Type         = "TsSphere"
s:Ge/TungstenRightCap/Parent       = "ActiveSourceGeometry"
s:Ge/TungstenRightCap/Material     = "Tungsten"
d:Ge/TungstenRightCap/RMin         = 0. mm
d:Ge/TungstenRightCap/RMax         = 0.125 mm
d:Ge/TungstenRightCap/SPhi         = 0. deg
d:Ge/TungstenRightCap/DPhi         = 360. deg
d:Ge/TungstenRightCap/STheta       = 0. deg
d:Ge/TungstenRightCap/DTheta       = 90. deg
d:Ge/TungstenRightCap/TransX       = 0. mm
d:Ge/TungstenRightCap/TransY       = 0. mm
d:Ge/TungstenRightCap/TransZ       = -1.75 mm
d:Ge/TungstenRightCap/RotX         = 180. deg
d:Ge/TungstenRightCap/RotY         = 0. deg
d:Ge/TungstenRightCap/RotZ         = 0. deg
s:Ge/TungstenRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TungstenRightCap/Color        = "grey"
b:Ge/TungstenRightCap/IsParallel   = "T"
s:Ge/TungstenRightCap/ParallelWorldName = "ActiveSourceWorld"

##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "Titanium"
d:Ge/TitaniumCylinder/RMin         = 0.32 mm
d:Ge/TitaniumCylinder/RMax         = 0.40 mm
d:Ge/TitaniumCylinder/SPhi         = 180. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 2.1 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "T"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "Titanium"
d:Ge/TitaniumLeftCap/RMin         = 0.32 mm
d:Ge/TitaniumLeftCap/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 2.1 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 0. deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "T"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "Titanium"
d:Ge/TitaniumRightCap/RMin         = 0.32 mm
d:Ge/TitaniumRightCap/RMax         = 0.4 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -2.1 mm
d:Ge/TitaniumRightCap/RotX         = 180. deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "T"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"

#===============================
#Left cap of air 
#===============================

s:Ge/AirLeftCap/Type         = "TsSphere"
s:Ge/AirLeftCap/Parent       = "ShieldingGeo"
s:Ge/AirLeftCap/Material     = "G4_AIR"
d:Ge/AirLeftCap/RMin         = 0. mm
d:Ge/AirLeftCap/RMax         = 0.32 mm
d:Ge/AirLeftCap/SPhi         = 0. deg
d:Ge/AirLeftCap/DPhi         = 360. deg
d:Ge/AirLeftCap/STheta       = 0. deg
d:Ge/AirLeftCap/DTheta       = 90. deg
d:Ge/AirLeftCap/TransX       = 0. mm
d:Ge/AirLeftCap/TransY       = 0. mm
d:Ge/AirLeftCap/TransZ       = 2.1 mm
d:Ge/AirLeftCap/RotX         = 0. deg
d:Ge/AirLeftCap/RotY         = 0. deg
d:Ge/AirLeftCap/RotZ         = 0. deg
s:Ge/AirLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/AirLeftCap/Color        = "white"
b:Ge/AirLeftCap/IsParallel   = "T"
s:Ge/AirLeftCap/ParallelWorldName = "ShieldingWorld"

#===============================
#Right cap of air 
#===============================

s:Ge/AirRightCap/Type         = "TsSphere"
s:Ge/AirRightCap/Parent       = "ShieldingGeo"
s:Ge/AirRightCap/Material     = "G4_AIR"
d:Ge/AirRightCap/RMin         = 0. mm
d:Ge/AirRightCap/RMax         = 0.32 mm
d:Ge/AirRightCap/SPhi         = 0. deg
d:Ge/AirRightCap/DPhi         = 360. deg
d:Ge/AirRightCap/STheta       = 0. deg
d:Ge/AirRightCap/DTheta       = 90. deg
d:Ge/AirRightCap/TransX       = 0. mm
d:Ge/AirRightCap/TransY       = 0. mm
d:Ge/AirRightCap/TransZ       = -2.1 mm
d:Ge/AirRightCap/RotX         = 180. deg
d:Ge/AirRightCap/RotY         = 0. deg
d:Ge/AirRightCap/RotZ         = 0. deg
s:Ge/AirRightCap/DrawingStyle = "FullWireFrame"
s:Ge/AirRightCap/Color        = "white"
b:Ge/AirRightCap/IsParallel   = "T"
s:Ge/AirRightCap/ParallelWorldName = "ShieldingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "ShieldingGeo"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.32 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 2.1 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "T"
s:Ge/DryAirCylinder/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds = 2 "ShieldingWorld" "ActiveSourceWorld"

I125_IsoAid_IAI-125A.txt

#                                                          #
#                 I 125 - IsoAid IAI-125 A                 #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

###### MATERIALS #######
sv:Ma/MatRadioactiveLayer/Components = 2 "Silver" "Iodine"
uv:Ma/MatRadioactiveLayer/Fractions  = 2 0.4595 0.5405
d:Ma/MatRadioactiveLayer/Density     = 6.003 g/cm3

sv:Ma/MatSilverRod/Components = 1 "Silver"
uv:Ma/MatSilverRod/Fractions  = 1 1
d:Ma/MatSilverRod/Density     = 10.5 g/cm3

##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "Titanium"
d:Ge/TitaniumCylinder/RMin         = 0. mm
d:Ge/TitaniumCylinder/RMax         = 0.40 mm
d:Ge/TitaniumCylinder/SPhi         = 0. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.85 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "True"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "Titanium"
d:Ge/TitaniumLeftCap/RMin         = 0 mm
d:Ge/TitaniumLeftCap/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.85 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 0. deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "True"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "Titanium"
d:Ge/TitaniumRightCap/RMin         = 0 mm
d:Ge/TitaniumRightCap/RMax         = 0.4 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.85 mm
d:Ge/TitaniumRightCap/RotX         = 180. deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "True"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"


##### FILLING GEOMETRY #####

s:Ge/FillingGeometry/Type              = "Group"
s:Ge/FillingGeometry/Parent            = "World"
b:Ge/FillingGeometry/IsParallel        = "True"
s:Ge/FillingGeometry/ParallelWorldName = "FillingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "FillingGeometry"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.35 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.65 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "True"
s:Ge/DryAirCylinder/ParallelWorldName = "FillingWorld"


#==================
#Left cap dry air
#==================

s:Ge/LeftCapDryAir/Type         = "TsSphere"
s:Ge/LeftCapDryAir/Parent       = "FillingGeometry"
s:Ge/LeftCapDryAir/Material     = "G4_AIR"
d:Ge/LeftCapDryAir/RMin         = 0. mm
d:Ge/LeftCapDryAir/RMax         = 0.35 mm
d:Ge/LeftCapDryAir/SPhi         = 0. deg
d:Ge/LeftCapDryAir/DPhi         = 360. deg
d:Ge/LeftCapDryAir/STheta       = 0. deg
d:Ge/LeftCapDryAir/DTheta       = 90. deg
d:Ge/LeftCapDryAir/TransX       = 0. mm
d:Ge/LeftCapDryAir/TransY       = 0. mm
d:Ge/LeftCapDryAir/TransZ       = 1.65 mm
d:Ge/LeftCapDryAir/RotX         = 0. deg
d:Ge/LeftCapDryAir/RotY         = 0. deg
d:Ge/LeftCapDryAir/RotZ         = 0. deg
s:Ge/LeftCapDryAir/DrawingStyle = "FullWireFrame"
s:Ge/LeftCapDryAir/Color        = "white"
b:Ge/LeftCapDryAir/IsParallel   = "True"
s:Ge/LeftCapDryAir/ParallelWorldName = "FillingWorld"

#==================
#Right cap dry air
#==================

s:Ge/RightCapDryAir/Type         = "TsSphere"
s:Ge/RightCapDryAir/Parent       = "FillingGeometry"
s:Ge/RightCapDryAir/Material     = "G4_AIR"
d:Ge/RightCapDryAir/RMin         = 0. mm
d:Ge/RightCapDryAir/RMax         = 0.35 mm
d:Ge/RightCapDryAir/SPhi         = 0. deg
d:Ge/RightCapDryAir/DPhi         = 360. deg
d:Ge/RightCapDryAir/STheta       = 0. deg
d:Ge/RightCapDryAir/DTheta       = 90. deg
d:Ge/RightCapDryAir/TransX       = 0. mm
d:Ge/RightCapDryAir/TransY       = 0. mm
d:Ge/RightCapDryAir/TransZ       = -1.65 mm
d:Ge/RightCapDryAir/RotX         = 180. deg
d:Ge/RightCapDryAir/RotY         = 0. deg
d:Ge/RightCapDryAir/RotZ         = 0. deg
s:Ge/RightCapDryAir/DrawingStyle = "FullWireFrame"
s:Ge/RightCapDryAir/Color        = "white"
b:Ge/RightCapDryAir/IsParallel   = "True"
s:Ge/RightCapDryAir/ParallelWorldName = "FillingWorld"

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

#========================
#Active Source of I_125.
#========================

s:Ge/ActiveSource/Type         = "TsCylinder"
s:Ge/ActiveSource/Parent       = "ActiveSourceGeometry"
s:Ge/ActiveSource/Material     = "MatRadioactiveLayer"
d:Ge/ActiveSource/RMin         = 0. mm
d:Ge/ActiveSource/RMax         = 0.251 mm
d:Ge/ActiveSource/SPhi         = 180. deg
d:Ge/ActiveSource/DPhi         = 360. deg
d:Ge/ActiveSource/HL           = 1.501 mm
d:Ge/ActiveSource/TransX       = 0. mm
d:Ge/ActiveSource/TransY       = 0. mm
d:Ge/ActiveSource/TransZ       = 0. mm
d:Ge/ActiveSource/RotX         = 0. deg
d:Ge/ActiveSource/RotY         = 0. deg
d:Ge/ActiveSource/RotZ         = 0. deg
s:Ge/ActiveSource/Color        = "yellow"
s:Ge/ActiveSource/DrawingStyle = "FullWireFrame"
b:Ge/ActiveSource/IsParallel   = "T"
s:Ge/ActiveSource/ParallelWorldName = "ActiveSourceWorld"

s:So/ActiveSource/Type                      = "Volumetric"
s:So/ActiveSource/Component                 = "ActiveSource"
sc:So/ActiveSource/ActiveMaterial           = "MatRadioactiveLayer"
s:So/ActiveSource/BeamParticle              = "gamma"
s:So/ActiveSource/BeamEnergySpectrumType    = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun   = 10
i:So/ActiveSource/MaxNumberOfPointsToSample = 1000000000

##### SPECTRUM #####

dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.3922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.6269199 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

#=====================
#Silver X-Ray Marquer
#=====================

s:Ge/SilverXRayMarker/Type         = "TsCylinder"
s:Ge/SilverXRayMarker/Parent       = "ActiveSource"
s:Ge/SilverXRayMarker/Material     = "MatSilverRod"
d:Ge/SilverXRayMarker/RMin         = 0. mm
d:Ge/SilverXRayMarker/RMax         = 0.25 mm
d:Ge/SilverXRayMarker/SPhi         = 180. deg
d:Ge/SilverXRayMarker/DPhi         = 360. deg
d:Ge/SilverXRayMarker/HL           = 1.5 mm
d:Ge/SilverXRayMarker/TransX       = 0. mm
d:Ge/SilverXRayMarker/TransY       = 0. mm
d:Ge/SilverXRayMarker/TransZ       = 0. mm
d:Ge/SilverXRayMarker/RotX         = 0. deg
d:Ge/SilverXRayMarker/RotY         = 0. deg
d:Ge/SilverXRayMarker/RotZ         = 0. deg
s:Ge/SilverXRayMarker/Color        = "red"
s:Ge/SilverXRayMarker/DrawingStyle = "FullWireFrame"
b:Ge/SilverXRayMarker/IsParallel   = "T"
s:Ge/SilverXRayMarker/ParallelWorldName = "ActiveSourceWorld"

sv:Ph/Default/LayeredMassGeometryWorlds =  3 "ShieldingWorld" "FillingWorld" "ActiveSourceWorld" 

I125_OncoSeed6711.txt

#                                                          #
#                  I 125 - OncoSeed 6711                   #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #


##### MATERIALS ######
sv:Ma/MatRadioMatrix/Components = 3 "Silver" "Iodine" "Bromine"
uv:Ma/MatRadioMatrix/Fractions = 3 0.5416 0.30396 0.15444
d:Ma/MatRadioMatrix/Density    = 6.2 g/cm3

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "MatRadioMatrix"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

###### SPECTRUM ######
dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.3922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.6269199 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

#====================
#Radioactive cylinder
#====================

s:Ge/RadioactiveCylinder/Type         = "TsCylinder"
s:Ge/RadioactiveCylinder/Parent       = "ActiveSourceGeometry"
s:Ge/RadioactiveCylinder/Material     = "MatRadioMatrix"
d:Ge/RadioactiveCylinder/RMin         = 0.25 mm
d:Ge/RadioactiveCylinder/RMax         = 0.25175 mm
d:Ge/RadioactiveCylinder/SPhi         = 0. deg
d:Ge/RadioactiveCylinder/DPhi         = 360. deg
d:Ge/RadioactiveCylinder/HL           = 1.325 mm
d:Ge/RadioactiveCylinder/TransX       = 0. mm
d:Ge/RadioactiveCylinder/TransY       = 0. mm
d:Ge/RadioactiveCylinder/TransZ       = 0. mm
d:Ge/RadioactiveCylinder/RotX         = 0. deg
d:Ge/RadioactiveCylinder/RotY         = 0. deg
d:Ge/RadioactiveCylinder/RotZ         = 0. deg
s:Ge/RadioactiveCylinder/DrawingStyle = "FullWireFrame"
s:Ge/RadioactiveCylinder/Color        = "yellow"
b:Ge/RadioactiveCylinder/IsParallel   = "T"
s:Ge/RadioactiveCylinder/ParallelWorldName = "ActiveSourceWorld"

#=====================
#Radioactive left end
#=====================
s:Ge/RadioactiveLeftEnd/Type                   = "G4Cons"
s:Ge/RadioactiveLeftEnd/Parent                 = "ActiveSourceGeometry"
s:Ge/RadioactiveLeftEnd/Material               = "MatRadioMatrix"
d:Ge/RadioactiveLeftEnd/TransX                 = 0 mm
d:Ge/RadioactiveLeftEnd/TransY                 = 0 mm
d:Ge/RadioactiveLeftEnd/TransZ                 = 1.363375 mm
d:Ge/RadioactiveLeftEnd/RotX                   = 0 deg
d:Ge/RadioactiveLeftEnd/RotY                   = 0 deg
d:Ge/RadioactiveLeftEnd/RotZ                   = 0 deg
d:Ge/RadioactiveLeftEnd/RMin1                  = 0. mm
d:Ge/RadioactiveLeftEnd/RMax1                  = 0.25175 mm
d:Ge/RadioactiveLeftEnd/RMin2                  = 0. mm
d:Ge/RadioactiveLeftEnd/RMax2                  = 0.17675 mm
d:Ge/RadioactiveLeftEnd/HL                     = 0.038375 mm
d:Ge/RadioactiveLeftEnd/SPhi                   = 0 deg
d:Ge/RadioactiveLeftEnd/DPhi                   = 360 deg
s:Ge/RadioactiveLeftEnd/Color                  = "yellow"
s:Ge/RadioactiveLeftEnd/DrawingStyle           = "FullWireFrame"
b:Ge/RadioactiveLeftEnd/IsParallel             = "T"
s:Ge/RadioactiveLeftEnd/ParallelWorldName      = "ActiveSourceWorld"

#=====================
#Radioactive right end
#=====================
s:Ge/RadioactiveRightEnd/Type                   = "G4Cons"
s:Ge/RadioactiveRightEnd/Parent                 = "ActiveSourceGeometry"
s:Ge/RadioactiveRightEnd/Material               = "MatRadioMatrix"
d:Ge/RadioactiveRightEnd/TransX                 = 0 mm
d:Ge/RadioactiveRightEnd/TransY                 = 0 mm
d:Ge/RadioactiveRightEnd/TransZ                 = -1.363375 mm
d:Ge/RadioactiveRightEnd/RotX                   = 0 deg
d:Ge/RadioactiveRightEnd/RotY                   = 180 deg
d:Ge/RadioactiveRightEnd/RotZ                   = 0 deg
d:Ge/RadioactiveRightEnd/RMin1                  = 0. mm
d:Ge/RadioactiveRightEnd/RMax1                  = 0.25175 mm
d:Ge/RadioactiveRightEnd/RMin2                  = 0. mm
d:Ge/RadioactiveRightEnd/RMax2                  = 0.17675 mm
d:Ge/RadioactiveRightEnd/HL                     = 0.038375 mm
d:Ge/RadioactiveRightEnd/SPhi                   = 0 deg
d:Ge/RadioactiveRightEnd/DPhi                   = 360 deg
s:Ge/RadioactiveRightEnd/Color                  = "yellow"
s:Ge/RadioactiveRightEnd/DrawingStyle           = "FullWireFrame"
b:Ge/RadioactiveRightEnd/IsParallel             = "T"
s:Ge/RadioactiveRightEnd/ParallelWorldName      = "ActiveSourceWorld"

#====================
#Silver cylinder
#====================

s:Ge/SilverCylinder/Type         = "TsCylinder"
s:Ge/SilverCylinder/Parent       = "ActiveSourceGeometry"
s:Ge/SilverCylinder/Material     = "G4_Ag"
d:Ge/SilverCylinder/RMin         = 0. mm
d:Ge/SilverCylinder/RMax         = 0.25 mm
d:Ge/SilverCylinder/SPhi         = 0. deg
d:Ge/SilverCylinder/DPhi         = 360. deg
d:Ge/SilverCylinder/HL           = 1.325 mm
d:Ge/SilverCylinder/TransX       = 0. mm
d:Ge/SilverCylinder/TransY       = 0. mm
d:Ge/SilverCylinder/TransZ       = 0. mm
d:Ge/SilverCylinder/RotX         = 0. deg
d:Ge/SilverCylinder/RotY         = 0. deg
d:Ge/SilverCylinder/RotZ         = 0. deg
s:Ge/SilverCylinder/DrawingStyle = "FullWireFrame"
s:Ge/SilverCylinder/Color        = "grey"
b:Ge/SilverCylinder/IsParallel   = "T"
s:Ge/SilverCylinder/ParallelWorldName = "ActiveSourceWorld"

#=================
#Silver left end
#=================

s:Ge/SilverLeftEnd/Type                   = "G4Cons"
s:Ge/SilverLeftEnd/Parent                 = "RadioactiveLeftEnd"
s:Ge/SilverLeftEnd/Material               = "G4_Ag"
d:Ge/SilverLeftEnd/TransX                 = 0 mm
d:Ge/SilverLeftEnd/TransY                 = 0 mm
d:Ge/SilverLeftEnd/TransZ                 = -0.000875 mm
d:Ge/SilverLeftEnd/RotX                   = 0 deg
d:Ge/SilverLeftEnd/RotY                   = 0 deg
d:Ge/SilverLeftEnd/RotZ                   = 0 deg
d:Ge/SilverLeftEnd/RMin1                  = 0 mm
d:Ge/SilverLeftEnd/RMax1                  = 0.25 mm
d:Ge/SilverLeftEnd/RMin2                  = 0 mm
d:Ge/SilverLeftEnd/RMax2                  = 0.175 mm
d:Ge/SilverLeftEnd/HL                     = 0.0375 mm
d:Ge/SilverLeftEnd/SPhi                   = 0 deg
d:Ge/SilverLeftEnd/DPhi                   = 360 deg
s:Ge/SilverLeftEnd/Color                  = "grey"
s:Ge/SilverLeftEnd/DrawingStyle           = "FullWireFrame"
b:Ge/SilverLeftEnd/IsParallel             = "T"
s:Ge/SilverLeftEnd/ParallelWorldName      = "ActiveSourceWorld"

#=================
#Silver right end
#=================

s:Ge/SilverRightEnd/Type                   = "G4Cons"
s:Ge/SilverRightEnd/Parent                 = "RadioactiveRightEnd"
s:Ge/SilverRightEnd/Material               = "G4_Ag"
d:Ge/SilverRightEnd/TransX                 = 0 mm
d:Ge/SilverRightEnd/TransY                 = 0 mm
d:Ge/SilverRightEnd/TransZ                 = -0.000875 mm
d:Ge/SilverRightEnd/RotX                   = 0 deg
d:Ge/SilverRightEnd/RotY                   = 0 deg
d:Ge/SilverRightEnd/RotZ                   = 0 deg
d:Ge/SilverRightEnd/RMin1                  = 0 mm
d:Ge/SilverRightEnd/RMax1                  = 0.25 mm
d:Ge/SilverRightEnd/RMin2                  = 0 mm
d:Ge/SilverRightEnd/RMax2                  = 0.175 mm
d:Ge/SilverRightEnd/HL                     = 0.0375 mm
d:Ge/SilverRightEnd/SPhi                   = 0 deg
d:Ge/SilverRightEnd/DPhi                   = 360 deg
s:Ge/SilverRightEnd/Color                  = "grey"
s:Ge/SilverRightEnd/DrawingStyle           = "FullWireFrame"
b:Ge/SilverRightEnd/IsParallel             = "T"
s:Ge/SilverRightEnd/ParallelWorldName      = "ActiveSourceWorld"

##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"


#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "Titanium"
d:Ge/TitaniumCylinder/RMin         = 0.33 mm
d:Ge/TitaniumCylinder/RMax         = 0.40 mm
d:Ge/TitaniumCylinder/SPhi         = 180. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.875 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "T"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "Titanium"
d:Ge/TitaniumLeftCap/RMin         = 0. mm
d:Ge/TitaniumLeftCap/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.875 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 0. deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "T"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "Titanium"
d:Ge/TitaniumRightCap/RMin         = 0. mm
d:Ge/TitaniumRightCap/RMax         = 0.4 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.875 mm
d:Ge/TitaniumRightCap/RotX         = 180. deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "T"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "ShieldingGeo"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.33 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.875 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "T"
s:Ge/DryAirCylinder/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds = 2 "ShieldingWorld" "ActiveSourceWorld"

I125_SelectSeed.txt

#                                                          #
#                 Iodine 125 - Select Seed                 #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                Author: Francisco Berumen                 #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIAL DEFINITION ######
sv:Ma/MatTitaniumTube/Components = 1 "Titanium"
uv:Ma/MatTitaniumTube/Fractions  = 1 1
d:Ma/MatTitaniumTube/Density     = 4.51 g/cm3

sv:Ma/MatRadioactiveLayer/Components = 3 "Silver" "Chlorine" "Iodine"
uv:Ma/MatRadioactiveLayer/Fractions  = 3 0.557 0.083 0.360
d:Ma/MatRadioactiveLayer/Density     = 5.64 g/cm3

sv:Ma/MatSilverRod/Components = 1 "Silver"
uv:Ma/MatSilverRod/Fractions  = 1 1
d:Ma/MatSilverRod/Density     = 10.5 g/cm3

s:Ge/Seed/Type              = "Group"
s:Ge/Seed/Parent            = "World"
b:Ge/Seed/IsParallel        = "True"
s:Ge/Seed/ParallelWorldName = "SeedsWorld"

##### TITANIUM TUBE
s:Ge/TitaniumTube/Type         = "TsCylinder"
s:Ge/TitaniumTube/Material     = "MatTitaniumTube"
s:Ge/TitaniumTube/Parent       = "Seed"
d:Ge/TitaniumTube/RMin         = 0 mm
d:Ge/TitaniumTube/RMax         = 0.4 mm
d:Ge/TitaniumTube/HL           = 1.85 mm
d:Ge/TitaniumTube/SPhi         = 0. deg
d:Ge/TitaniumTube/DPhi         = 360. deg
s:Ge/TitaniumTube/Color        = "transparentgray2"
s:Ge/TitaniumTube/DrawingStyle = "Solid"
b:Ge/TitaniumTube/IsParallel        = "True"
s:Ge/TitaniumTube/ParallelWorldName = "SeedsWorld"

##### TITANIUM CAP L
s:Ge/TitaniumCapL/Type         = "TsSphere"
s:Ge/TitaniumCapL/Material     = "MatTitaniumTube"
s:Ge/TitaniumCapL/Parent       = "Seed"
d:Ge/TitaniumCapL/RMin         = 0. mm
d:Ge/TitaniumCapL/RMax         = 0.4 mm
d:Ge/TitaniumCapL/SPhi         = 0. deg
d:Ge/TitaniumCapL/DPhi         = 360. deg
d:Ge/TitaniumCapL/STheta       = 0. deg
d:Ge/TitaniumCapL/DTheta       = 90. deg
d:Ge/TitaniumCapL/TransZ       = 1.85 mm
s:Ge/TitaniumCapL/DrawingStyle = "Solid"
s:Ge/TitaniumCapL/Color        = "transparentgray2"
b:Ge/TitaniumCapL/IsParallel        = "True"
s:Ge/TitaniumCapL/ParallelWorldName = "SeedsWorld"

##### TITANIUM CAP R
s:Ge/TitaniumCapR/Type         = "TsSphere"
s:Ge/TitaniumCapR/Material     = "MatTitaniumTube"
s:Ge/TitaniumCapR/Parent       = "Seed"
d:Ge/TitaniumCapR/RMin         = 0. mm
d:Ge/TitaniumCapR/RMax         = 0.4 mm
d:Ge/TitaniumCapR/SPhi         = 0. deg
d:Ge/TitaniumCapR/DPhi         = 360. deg
d:Ge/TitaniumCapR/STheta       = 90. deg
d:Ge/TitaniumCapR/DTheta       = 180. deg
d:Ge/TitaniumCapR/TransZ       = -1.85 mm
s:Ge/TitaniumCapR/DrawingStyle = "Solid"
s:Ge/TitaniumCapR/Color        = "transparentgray2"
b:Ge/TitaniumCapR/IsParallel        = "True"
s:Ge/TitaniumCapR/ParallelWorldName = "SeedsWorld"

##### AIR
s:Ge/InsideAir/Type         = "TsCylinder"
s:Ge/InsideAir/Material     = "G4_AIR"
s:Ge/InsideAir/Parent       = "TitaniumTube"
d:Ge/InsideAir/RMin         = 0 mm
d:Ge/InsideAir/RMax         = Ge/TitaniumTube/RMax - 0.05 mm
d:Ge/InsideAir/HL           = 1.85 mm
d:Ge/InsideAir/SPhi         = 0. deg
d:Ge/InsideAir/DPhi         = 360. deg
s:Ge/InsideAir/Color        = "transparentgray"
s:Ge/InsideAir/DrawingStyle = "Solid"
b:Ge/InsideAir/IsParallel        = "True"
s:Ge/InsideAir/ParallelWorldName = "SeedsWorld"

##### RADIOACTIVE LAYER
s:Ge/RadioactiveLayer/Type         = "TsCylinder"
s:Ge/RadioactiveLayer/Material     = "MatRadioactiveLayer"
s:Ge/RadioactiveLayer/Parent       = "InsideAir"
d:Ge/RadioactiveLayer/RMin         = 0 mm
d:Ge/RadioactiveLayer/RMax         = 0.258 mm
d:Ge/RadioactiveLayer/HL           = 1.703 mm
d:Ge/RadioactiveLayer/SPhi         = 0. deg
d:Ge/RadioactiveLayer/DPhi         = 360. deg
b:Ge/RadioactiveLayer/Invisible    = "True" 
b:Ge/RadioactiveLayer/IsParallel        = "True"
s:Ge/RadioactiveLayer/ParallelWorldName = "SeedsWorld"

##### CYLINDRICAL SILVER ROD
s:Ge/SilverRod/Type         = "TsCylinder"
s:Ge/SilverRod/Material     = "MatSilverRod"
s:Ge/SilverRod/Parent       = "RadioactiveLayer"
d:Ge/SilverRod/RMin         = 0 mm
d:Ge/SilverRod/RMax         = Ge/RadioactiveLayer/RMax - 0.003 mm
d:Ge/SilverRod/HL           = Ge/RadioactiveLayer/HL - 0.003 mm
d:Ge/SilverRod/SPhi         = 0. deg
d:Ge/SilverRod/DPhi         = 360. deg
s:Ge/SilverRod/Color        = "White"
s:Ge/SilverRod/DrawingStyle = "Solid"
b:Ge/SilverRod/IsParallel        = "True"
s:Ge/SilverRod/ParallelWorldName = "SeedsWorld"

iv:Gr/Color/transparentgray = 4 255 255 255 100
iv:Gr/Color/transparentgray2 = 4 200 200 200 100

s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "RadioactiveLayer"
sc:So/ActiveSource/ActiveMaterial            = "MatRadioactiveLayer"
s:So/ActiveSource/BeamParticle               = "gamma"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"

#### I-125 SPECTRUM ####
dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.4922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.626919 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

sv:Ph/Default/LayeredMassGeometryWorlds =  1 "SeedsWorld"

I125_SL-125.txt

#                                                          #
#                      I 125 - SL-125                      #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #


##### MATERIAL DEFINITION #####
sv:Ma/MatSilverRod/Components = 1 "Silver"
uv:Ma/MatSilverRod/Fractions  = 1 1
d:Ma/MatSilverRod/Density     = 10.5 g/cm3

sv:Ma/MatRadioactiveLayer/Components = 1 "Iodine"
uv:Ma/MatRadioactiveLayer/Fractions  = 1 1
d:Ma/MatRadioactiveLayer/Density     = 4.93 g/cm3

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "MatRadioactiveLayer"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM ######
dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.3922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.6269199 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

========================
#125I sphere layer center
#========================

s:Ge/SphereLayerCenter/Type         = "TsSphere"
s:Ge/SphereLayerCenter/Parent       = "ActiveSourceGeometry"
s:Ge/SphereLayerCenter/Material     = "MatRadioactiveLayer"
d:Ge/SphereLayerCenter/RMin         = 0.249 mm
d:Ge/SphereLayerCenter/RMax         = 0.25 mm
d:Ge/SphereLayerCenter/SPhi         = 0. deg
d:Ge/SphereLayerCenter/DPhi         = 360. deg
d:Ge/SphereLayerCenter/STheta       = 0. deg
d:Ge/SphereLayerCenter/DTheta       = 180. deg
d:Ge/SphereLayerCenter/TransX       = 0. mm
d:Ge/SphereLayerCenter/TransY       = 0. mm
d:Ge/SphereLayerCenter/TransZ       = 0. mm
d:Ge/SphereLayerCenter/RotX         = 0. deg
d:Ge/SphereLayerCenter/RotY         = 0. deg
d:Ge/SphereLayerCenter/RotZ         = 0. deg
s:Ge/SphereLayerCenter/DrawingStyle = "FullWireFrame"
s:Ge/SphereLayerCenter/Color        = "yellow"
b:Ge/SphereLayerCenter/IsParallel   = "T"
s:Ge/SphereLayerCenter/ParallelWorldName = "ActiveSourceWorld"

#========================
#125I sphere layer mid right
#========================

s:Ge/SphereLayerMidRight/Type         = "TsSphere"
s:Ge/SphereLayerMidRight/Parent       = "ActiveSourceGeometry"
s:Ge/SphereLayerMidRight/Material     = "MatRadioactiveLayer"
d:Ge/SphereLayerMidRight/RMin         = 0.249 mm
d:Ge/SphereLayerMidRight/RMax         = 0.25 mm
d:Ge/SphereLayerMidRight/SPhi         = 0. deg
d:Ge/SphereLayerMidRight/DPhi         = 360. deg
d:Ge/SphereLayerMidRight/STheta       = 0. deg
d:Ge/SphereLayerMidRight/DTheta       = 180. deg
d:Ge/SphereLayerMidRight/TransX       = 0. mm
d:Ge/SphereLayerMidRight/TransY       = 0. mm
d:Ge/SphereLayerMidRight/TransZ       = -0.6 mm
d:Ge/SphereLayerMidRight/RotX         = 0. deg
d:Ge/SphereLayerMidRight/RotY         = 0. deg
d:Ge/SphereLayerMidRight/RotZ         = 0. deg
s:Ge/SphereLayerMidRight/DrawingStyle = "FullWireFrame"
s:Ge/SphereLayerMidRight/Color        = "yellow"
b:Ge/SphereLayerMidRight/IsParallel   = "True"
s:Ge/SphereLayerMidRight/ParallelWorldName = "ActiveSourceWorld"

#========================
#125I sphere layer far right
#========================

s:Ge/SphereLayerFarRight/Type         = "TsSphere"
s:Ge/SphereLayerFarRight/Parent       = "ActiveSourceGeometry"
s:Ge/SphereLayerFarRight/Material     = "MatRadioactiveLayer"
d:Ge/SphereLayerFarRight/RMin         = 0.249 mm
d:Ge/SphereLayerFarRight/RMax         = 0.25 mm
d:Ge/SphereLayerFarRight/SPhi         = 0. deg
d:Ge/SphereLayerFarRight/DPhi         = 360. deg
d:Ge/SphereLayerFarRight/STheta       = 0. deg
d:Ge/SphereLayerFarRight/DTheta       = 180. deg
d:Ge/SphereLayerFarRight/TransX       = 0. mm
d:Ge/SphereLayerFarRight/TransY       = 0. mm
d:Ge/SphereLayerFarRight/TransZ       = -1.2 mm
d:Ge/SphereLayerFarRight/RotX         = 0. deg
d:Ge/SphereLayerFarRight/RotY         = 0. deg
d:Ge/SphereLayerFarRight/RotZ         = 0. deg
s:Ge/SphereLayerFarRight/DrawingStyle = "FullWireFrame"
s:Ge/SphereLayerFarRight/Color        = "yellow"
b:Ge/SphereLayerFarRight/IsParallel   = "True"
s:Ge/SphereLayerFarRight/ParallelWorldName = "ActiveSourceWorld"

#========================
#125I sphere layer mid left
#========================

s:Ge/SphereLayerMidLeft/Type         = "TsSphere"
s:Ge/SphereLayerMidLeft/Parent       = "ActiveSourceGeometry"
s:Ge/SphereLayerMidLeft/Material     = "MatRadioactiveLayer"
d:Ge/SphereLayerMidLeft/RMin         = 0.249 mm
d:Ge/SphereLayerMidLeft/RMax         = 0.25 mm
d:Ge/SphereLayerMidLeft/SPhi         = 0. deg
d:Ge/SphereLayerMidLeft/DPhi         = 360. deg
d:Ge/SphereLayerMidLeft/STheta       = 0. deg
d:Ge/SphereLayerMidLeft/DTheta       = 180. deg
d:Ge/SphereLayerMidLeft/TransX       = 0. mm
d:Ge/SphereLayerMidLeft/TransY       = 0. mm
d:Ge/SphereLayerMidLeft/TransZ       = 0.6 mm
d:Ge/SphereLayerMidLeft/RotX         = 0. deg
d:Ge/SphereLayerMidLeft/RotY         = 0. deg
d:Ge/SphereLayerMidLeft/RotZ         = 0. deg
s:Ge/SphereLayerMidLeft/DrawingStyle = "FullWireFrame"
s:Ge/SphereLayerMidLeft/Color        = "yellow"
b:Ge/SphereLayerMidLeft/IsParallel   = "True"
s:Ge/SphereLayerMidLeft/ParallelWorldName = "ActiveSourceWorld"

#========================
#125I sphere layer far left
#========================

s:Ge/SphereLayerFarLeft/Type         = "TsSphere"
s:Ge/SphereLayerFarLeft/Parent       = "ActiveSourceGeometry"
s:Ge/SphereLayerFarLeft/Material     = "MatRadioactiveLayer"
d:Ge/SphereLayerFarLeft/RMin         = 0.249 mm
d:Ge/SphereLayerFarLeft/RMax         = 0.25 mm
d:Ge/SphereLayerFarLeft/SPhi         = 0. deg
d:Ge/SphereLayerFarLeft/DPhi         = 360. deg
d:Ge/SphereLayerFarLeft/STheta       = 0. deg
d:Ge/SphereLayerFarLeft/DTheta       = 180. deg
d:Ge/SphereLayerFarLeft/TransX       = 0. mm
d:Ge/SphereLayerFarLeft/TransY       = 0. mm
d:Ge/SphereLayerFarLeft/TransZ       = 1.2 mm
d:Ge/SphereLayerFarLeft/RotX         = 0. deg
d:Ge/SphereLayerFarLeft/RotY         = 0. deg
d:Ge/SphereLayerFarLeft/RotZ         = 0. deg
s:Ge/SphereLayerFarLeft/DrawingStyle = "FullWireFrame"
s:Ge/SphereLayerFarLeft/Color        = "yellow"
b:Ge/SphereLayerFarLeft/IsParallel   = "True"
s:Ge/SphereLayerFarLeft/ParallelWorldName = "ActiveSourceWorld"

#==================
#Silver bead center
#==================

s:Ge/SBC/Type         = "TsSphere"
s:Ge/SBC/Parent       = "ActiveSourceGeometry"
s:Ge/SBC/Material     = "MatSilverRod"
d:Ge/SBC/RMin         = 0. mm
d:Ge/SBC/RMax         = 0.249 mm
d:Ge/SBC/SPhi         = 0. deg
d:Ge/SBC/DPhi         = 360. deg
d:Ge/SBC/STheta       = 0. deg
d:Ge/SBC/DTheta       = 180. deg
d:Ge/SBC/TransX       = 0. mm
d:Ge/SBC/TransY       = 0. mm
d:Ge/SBC/TransZ       = 0. mm
d:Ge/SBC/RotX         = 0. deg
d:Ge/SBC/RotY         = 0. deg
d:Ge/SBC/RotZ         = 0. deg
s:Ge/SBC/DrawingStyle = "FullWireFrame"
s:Ge/SBC/Color        = "red"
b:Ge/SBC/IsParallel   = "True"
s:Ge/SBC/ParallelWorldName = "ActiveSourceWorld"

#=====================
#Silver bead mid right
#=====================

s:Ge/SBmR/Type         = "TsSphere"
s:Ge/SBmR/Parent       = "ActiveSourceGeometry"
s:Ge/SBmR/Material     = "MatSilverRod"
d:Ge/SBmR/RMin         = 0. mm
d:Ge/SBmR/RMax         = 0.249 mm
d:Ge/SBmR/SPhi         = 0. deg
d:Ge/SBmR/DPhi         = 360. deg
d:Ge/SBmR/STheta       = 0. deg
d:Ge/SBmR/DTheta       = 180. deg
d:Ge/SBmR/TransX       = 0. mm
d:Ge/SBmR/TransY       = 0. mm
d:Ge/SBmR/TransZ       = -0.6 mm
d:Ge/SBmR/RotX         = 0. deg
d:Ge/SBmR/RotY         = 0. deg
d:Ge/SBmR/RotZ         = 0. deg
s:Ge/SBmR/DrawingStyle = "FullWireFrame"
s:Ge/SBmR/Color        = "red"
b:Ge/SBmR/IsParallel   = "True"
s:Ge/SBmR/ParallelWorldName = "ActiveSourceWorld"

#=====================
#Silver bead far right
#=====================

s:Ge/SBfR/Type         = "TsSphere"
s:Ge/SBfR/Parent       = "ActiveSourceGeometry"
s:Ge/SBfR/Material     = "MatSilverRod"
d:Ge/SBfR/RMin         = 0. mm
d:Ge/SBfR/RMax         = 0.249 mm
d:Ge/SBfR/SPhi         = 0. deg
d:Ge/SBfR/DPhi         = 360. deg
d:Ge/SBfR/STheta       = 0. deg
d:Ge/SBfR/DTheta       = 180. deg
d:Ge/SBfR/TransX       = 0. mm
d:Ge/SBfR/TransY       = 0. mm
d:Ge/SBfR/TransZ       = -1.2 mm
d:Ge/SBfR/RotX         = 0. deg
d:Ge/SBfR/RotY         = 0. deg
d:Ge/SBfR/RotZ         = 0. deg
s:Ge/SBfR/DrawingStyle = "FullWireFrame"
s:Ge/SBfR/Color        = "red"
b:Ge/SBfR/IsParallel   = "True"
s:Ge/SBfR/ParallelWorldName = "ActiveSourceWorld"

#====================
#Silver bead mid left
#====================

s:Ge/SBmL/Type         = "TsSphere"
s:Ge/SBmL/Parent       = "ActiveSourceGeometry"
s:Ge/SBmL/Material     = "MatSilverRod"
d:Ge/SBmL/RMin         = 0. mm
d:Ge/SBmL/RMax         = 0.249 mm
d:Ge/SBmL/SPhi         = 0. deg
d:Ge/SBmL/DPhi         = 360. deg
d:Ge/SBmL/STheta       = 0. deg
d:Ge/SBmL/DTheta       = 180. deg
d:Ge/SBmL/TransX       = 0. mm
d:Ge/SBmL/TransY       = 0. mm
d:Ge/SBmL/TransZ       = 0.6 mm
d:Ge/SBmL/RotX         = 0. deg
d:Ge/SBmL/RotY         = 0. deg
d:Ge/SBmL/RotZ         = 0. deg
s:Ge/SBmL/DrawingStyle = "FullWireFrame"
s:Ge/SBmL/Color        = "red"
b:Ge/SBmL/IsParallel   = "True"
s:Ge/SBmL/ParallelWorldName = "ActiveSourceWorld"

#====================
#Silver bead far left
#====================

s:Ge/SBfL/Type         = "TsSphere"
s:Ge/SBfL/Parent       = "ActiveSourceGeometry"
s:Ge/SBfL/Material     = "MatSilverRod"
d:Ge/SBfL/RMin         = 0. mm
d:Ge/SBfL/RMax         = 0.249 mm
d:Ge/SBfL/SPhi         = 0. deg
d:Ge/SBfL/DPhi         = 360. deg
d:Ge/SBfL/STheta       = 0. deg
d:Ge/SBfL/DTheta       = 180. deg
d:Ge/SBfL/TransX       = 0. mm
d:Ge/SBfL/TransY       = 0. mm
d:Ge/SBfL/TransZ       = 1.2 mm
d:Ge/SBfL/RotX         = 0. deg
d:Ge/SBfL/RotY         = 0. deg
d:Ge/SBfL/RotZ         = 0. deg
s:Ge/SBfL/DrawingStyle = "FullWireFrame"
s:Ge/SBfL/Color        = "red"
b:Ge/SBfL/IsParallel   = "True"
s:Ge/SBfL/ParallelWorldName = "ActiveSourceWorld"

##### FILLING GEOMETRY #####

s:Ge/FillingGeometry/Type              = "Group"
s:Ge/FillingGeometry/Parent            = "World"
b:Ge/FillingGeometry/IsParallel        = "True"
s:Ge/FillingGeometry/ParallelWorldName = "FillingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "FillingGeometry"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.35 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.6 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "True"
s:Ge/DryAirCylinder/ParallelWorldName = "FillingWorld"

#===============================
#Left cap of air 
#===============================

s:Ge/AirLeftCap/Type         = "TsSphere"
s:Ge/AirLeftCap/Parent       = "FillingGeometry"
s:Ge/AirLeftCap/Material     = "G4_AIR"
d:Ge/AirLeftCap/RMin         = 0. mm
d:Ge/AirLeftCap/RMax         = 0.35 mm
d:Ge/AirLeftCap/SPhi         = 0. deg
d:Ge/AirLeftCap/DPhi         = 360. deg
d:Ge/AirLeftCap/STheta       = 0. deg
d:Ge/AirLeftCap/DTheta       = 90. deg
d:Ge/AirLeftCap/TransX       = 0. mm
d:Ge/AirLeftCap/TransY       = 0. mm
d:Ge/AirLeftCap/TransZ       = 1.6 mm
d:Ge/AirLeftCap/RotX         = 0. deg
d:Ge/AirLeftCap/RotY         = 0. deg
d:Ge/AirLeftCap/RotZ         = 0. deg
s:Ge/AirLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/AirLeftCap/Color        = "white"
b:Ge/AirLeftCap/IsParallel   = "True"
s:Ge/AirLeftCap/ParallelWorldName = "FillingWorld"

#================================
#Right cap of air
#================================

s:Ge/AirRightCap/Type         = "TsSphere"
s:Ge/AirRightCap/Parent       = "FillingGeometry"
s:Ge/AirRightCap/Material     = "G4_AIR"
d:Ge/AirRightCap/RMin         = 0. mm
d:Ge/AirRightCap/RMax         = 0.35 mm
d:Ge/AirRightCap/SPhi         = 0. deg
d:Ge/AirRightCap/DPhi         = 360. deg
d:Ge/AirRightCap/STheta       = 0. deg
d:Ge/AirRightCap/DTheta       = 90. deg
d:Ge/AirRightCap/TransX       = 0. mm
d:Ge/AirRightCap/TransY       = 0. mm
d:Ge/AirRightCap/TransZ       = -1.6 mm
d:Ge/AirRightCap/RotX         = 180. deg
d:Ge/AirRightCap/RotY         = 0. deg
d:Ge/AirRightCap/RotZ         = 0. deg
s:Ge/AirRightCap/DrawingStyle = "FullWireFrame"
s:Ge/AirRightCap/Color        = "white"
b:Ge/AirRightCap/IsParallel   = "True"
s:Ge/AirRightCap/ParallelWorldName = "FillingWorld"

##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "Titanium"
d:Ge/TitaniumCylinder/RMin         = 0. mm
d:Ge/TitaniumCylinder/RMax         = 0.40 mm
d:Ge/TitaniumCylinder/SPhi         = 180. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.85 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "True"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "Titanium"
d:Ge/TitaniumLeftCap/RMin         = 0 mm
d:Ge/TitaniumLeftCap/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.85 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 0. deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "True"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "Titanium"
d:Ge/TitaniumRightCap/RMin         = 0 mm
d:Ge/TitaniumRightCap/RMax         = 0.4 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.85 mm
d:Ge/TitaniumRightCap/RotX         = 180. deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "True"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds =  3 "ShieldingWorld" "FillingWorld" "ActiveSourceWorld"

I125_Theragenic-AgX100.txt

#                                                          #
#               I 125 - Theragenic AgX 100                 #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIALS #####
sv:Ma/MatRadioactiveLayer/Components = 2 "Silver" "Iodine"
uv:Ma/MatRadioactiveLayer/Fractions  = 2 0.45946 0.54054
d:Ma/MatRadioactiveLayer/Density     = 5.675 g/cm3

sv:Ma/MatSilverRod/Components = 1 "Silver"
uv:Ma/MatSilverRod/Fractions  = 1 1
d:Ma/MatSilverRod/Density     = 10.49 g/cm3

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "World"
s:Ge/TitaniumCylinder/Material     = "G4_Ti"
d:Ge/TitaniumCylinder/RMin         = 0.35 mm
d:Ge/TitaniumCylinder/RMax         = 0.40 mm
d:Ge/TitaniumCylinder/SPhi         = 180. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.85 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "World"
s:Ge/TitaniumLeftCap/Material     = "G4_Ti"
d:Ge/TitaniumLeftCap/RMin         = 0. mm
d:Ge/TitaniumLeftCap/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.85 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 0. deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "World"
s:Ge/TitaniumRightCap/Material     = "G4_Ti"
d:Ge/TitaniumRightCap/RMin         = 0. mm
d:Ge/TitaniumRightCap/RMax         = 0.4 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.85 mm
d:Ge/TitaniumRightCap/RotX         = 180. deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "World"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.35 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.85 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"

#========================
#Active Source of I_125.
#========================

s:Ge/ActiveSource/Type         = "TsCylinder"
s:Ge/ActiveSource/Parent       = "DryAirCylinder"
s:Ge/ActiveSource/Material     = "MatRadioactiveLayer"
d:Ge/ActiveSource/RMin         = 0. mm
d:Ge/ActiveSource/RMax         = 0.295 mm
d:Ge/ActiveSource/SPhi         = 180. deg
d:Ge/ActiveSource/DPhi         = 360. deg
d:Ge/ActiveSource/HL           = 1.75 mm
d:Ge/ActiveSource/TransX       = 0. mm
d:Ge/ActiveSource/TransY       = 0. mm
d:Ge/ActiveSource/TransZ       = 0. mm
d:Ge/ActiveSource/RotX         = 0. deg
d:Ge/ActiveSource/RotY         = 0. deg
d:Ge/ActiveSource/RotZ         = 0. deg
s:Ge/ActiveSource/Color        = "yellow"
s:Ge/ActiveSource/DrawingStyle = "FullWireFrame"

s:So/ActiveSource/Type                      = "Volumetric"
s:So/ActiveSource/Component                 = "ActiveSource"
sc:So/ActiveSource/ActiveMaterial           = "MatRadioactiveLayer"
s:So/ActiveSource/BeamParticle              = "gamma"
i:So/ActiveSource/MaxNumberOfPointsToSample = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType    = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun   = 10

##### SPECTRUM ######
dv:So/ActiveSource/BeamEnergySpectrumValues = 7 3.77 27.202 27.472 30.944 30.995 31.704 35.3922 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 7 0.149 0.401 0.740 0.0683 0.132 0.0380 0.0668
uv:So/ActiveSource/BeamEnergySpectrumWeights = 0.6269199 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

#=====================
#Silver X-Ray Marquer
#=====================

s:Ge/SilverXRayMarker/Type         = "TsCylinder"
s:Ge/SilverXRayMarker/Parent       = "ActiveSource"
s:Ge/SilverXRayMarker/Material     = "MatSilverRod"
d:Ge/SilverXRayMarker/RMin         = 0. mm
d:Ge/SilverXRayMarker/RMax         = 0.293 mm
d:Ge/SilverXRayMarker/SPhi         = 180. deg
d:Ge/SilverXRayMarker/DPhi         = 360. deg
d:Ge/SilverXRayMarker/HL           = 1.748 mm
d:Ge/SilverXRayMarker/TransX       = 0. mm
d:Ge/SilverXRayMarker/TransY       = 0. mm
d:Ge/SilverXRayMarker/TransZ       = 0. mm
d:Ge/SilverXRayMarker/RotX         = 0. deg
d:Ge/SilverXRayMarker/RotY         = 0. deg
d:Ge/SilverXRayMarker/RotZ         = 0. deg
s:Ge/SilverXRayMarker/Color        = "red"
s:Ge/SilverXRayMarker/DrawingStyle = "FullWireFrame"

Pd103_Best2335.txt

#                                                          #
#                 Pd 103 - Best 2335 Seed                  #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#        Authors: Audran Poher and Francisco Berumen       #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIAL DEFINITION ######
sv:Ma/MatPolymer/Components = 4 "Carbon" "Hydrogen" "Oxygen" "Nitrogen"
uv:Ma/MatPolymer/Fractions  = 4 0.8973 0.0785 0.0168 0.0074
d:Ma/MatPolymer/Density     = 1.0 g/cm3

####### SHIELDING
s:Ge/Seed/Type              = "Group"
s:Ge/Seed/Parent            = "World"
b:Ge/Seed/IsParallel        = "True"
s:Ge/Seed/ParallelWorldName = "SeedsWorld"

##### TITANIUM TUBE
s:Ge/TitaniumTube/Type         = "TsCylinder"
s:Ge/TitaniumTube/Material     = "Titanium"
s:Ge/TitaniumTube/Parent       = "Seed"
d:Ge/TitaniumTube/RMin         = 0 mm
d:Ge/TitaniumTube/RMax         = 0.4 mm
d:Ge/TitaniumTube/HL           = 2.1 mm
d:Ge/TitaniumTube/SPhi         = 0. deg
d:Ge/TitaniumTube/DPhi         = 360. deg
s:Ge/TitaniumTube/Color        = "transparent1"
s:Ge/TitaniumTube/DrawingStyle = "Solid"
b:Ge/TitaniumTube/IsParallel        = "True"
s:Ge/TitaniumTube/ParallelWorldName = "SeedsWorld"

##### TITANIUM CAP L
s:Ge/TitaniumCapL/Type         = "TsSphere"
s:Ge/TitaniumCapL/Material     = "Titanium"
s:Ge/TitaniumCapL/Parent       = "Seed"
d:Ge/TitaniumCapL/RMin         = 0. mm
d:Ge/TitaniumCapL/RMax         = 0.4 mm
d:Ge/TitaniumCapL/SPhi         = 0. deg
d:Ge/TitaniumCapL/DPhi         = 360. deg
d:Ge/TitaniumCapL/STheta       = 0. deg
d:Ge/TitaniumCapL/DTheta       = 90. deg
d:Ge/TitaniumCapL/TransZ       = 2.1 mm
s:Ge/TitaniumCapL/DrawingStyle = "Solid"
s:Ge/TitaniumCapL/Color        = "transparent1"
b:Ge/TitaniumCapL/IsParallel        = "True"
s:Ge/TitaniumCapL/ParallelWorldName = "SeedsWorld"

##### TITANIUM CAP R
s:Ge/TitaniumCapR/Type         = "TsSphere"
s:Ge/TitaniumCapR/Material     = "Titanium"
s:Ge/TitaniumCapR/Parent       = "Seed"
d:Ge/TitaniumCapR/RMin         = 0. mm
d:Ge/TitaniumCapR/RMax         = 0.4 mm
d:Ge/TitaniumCapR/SPhi         = 0. deg
d:Ge/TitaniumCapR/DPhi         = 360. deg
d:Ge/TitaniumCapR/STheta       = 90. deg
d:Ge/TitaniumCapR/DTheta       = 180. deg
d:Ge/TitaniumCapR/TransZ       = -2.1 mm
s:Ge/TitaniumCapR/DrawingStyle = "Solid"
s:Ge/TitaniumCapR/Color        = "transparent1"
b:Ge/TitaniumCapR/IsParallel        = "True"
s:Ge/TitaniumCapR/ParallelWorldName = "SeedsWorld"

##### AIR TUBE
s:Ge/AirTube/Type         = "TsCylinder"
s:Ge/AirTube/Material     = "Air"
s:Ge/AirTube/Parent       = "TitaniumTube"
d:Ge/AirTube/RMin         = 0 mm
d:Ge/AirTube/RMax         = 0.32 mm
d:Ge/AirTube/HL           = 2.1 mm
d:Ge/AirTube/SPhi         = 0. deg
d:Ge/AirTube/DPhi         = 360. deg
s:Ge/AirTube/Color        = "transparent2"
s:Ge/AirTube/DrawingStyle = "Solid"
b:Ge/AirTube/IsParallel        = "True"
s:Ge/AirTube/ParallelWorldName = "SeedsWorld"

##### AIR CAP L
s:Ge/AirCapL/Type         = "TsSphere"
s:Ge/AirCapL/Material     = "Air"
s:Ge/AirCapL/Parent       = "TitaniumCapL"
d:Ge/AirCapL/RMin         = 0. mm
d:Ge/AirCapL/RMax         = 0.32 mm
d:Ge/AirCapL/SPhi         = 0. deg
d:Ge/AirCapL/DPhi         = 360. deg
d:Ge/AirCapL/STheta       = 0. deg
d:Ge/AirCapL/DTheta       = 90. deg
s:Ge/AirCapL/DrawingStyle = "Solid"
s:Ge/AirCapL/Color        = "transparent2"
b:Ge/AirCapL/IsParallel        = "True"
s:Ge/AirCapL/ParallelWorldName = "SeedsWorld"

##### AIR CAP R
s:Ge/AirCapR/Type         = "TsSphere"
s:Ge/AirCapR/Material     = "Air"
s:Ge/AirCapR/Parent       = "TitaniumCapR"
d:Ge/AirCapR/RMin         = 0. mm
d:Ge/AirCapR/RMax         = 0.32 mm
d:Ge/AirCapR/SPhi         = 0. deg
d:Ge/AirCapR/DPhi         = 360. deg
d:Ge/AirCapR/STheta       = 90. deg
d:Ge/AirCapR/DTheta       = 180. deg
s:Ge/AirCapR/DrawingStyle = "Solid"
s:Ge/AirCapR/Color        = "transparent2"
b:Ge/AirCapR/IsParallel        = "True"
s:Ge/AirCapR/ParallelWorldName = "SeedsWorld"

##### TUNGSTEN MARKER
s:Ge/Marker/Type         = "TsCylinder"
s:Ge/Marker/Material     = "G4_W"
s:Ge/Marker/Parent       = "AirTube"
d:Ge/Marker/RMin         = 0 mm
d:Ge/Marker/RMax         = 0.25 mm
d:Ge/Marker/HL           = 0.6 mm
d:Ge/Marker/SPhi         = 0. deg
d:Ge/Marker/DPhi         = 360. deg
s:Ge/Marker/Color        = "blue"
s:Ge/Marker/DrawingStyle = "Solid"
b:Ge/Marker/IsParallel        = "True"
s:Ge/Marker/ParallelWorldName = "SeedsWorld"

###### ACTIVE SOURCE
s:Ge/ActiveSource/Type              = "Group"
s:Ge/ActiveSource/Parent            = "World"
b:Ge/ActiveSource/IsParallel        = "True"
s:Ge/ActiveSource/ParallelWorldName = "ActiveSourceWorld"

##### SPHERICAL POLYMER 1
s:Ge/Sphere1/Type         = "TsSphere"
s:Ge/Sphere1/Material     = "G4_Pd"
s:Ge/Sphere1/Parent       = "ActiveSource"
d:Ge/Sphere1/RMin         = 0. mm
d:Ge/Sphere1/RMax         = 0.2801 mm 
d:Ge/Sphere1/SPhi         = 0. deg
d:Ge/Sphere1/DPhi         = 360. deg
d:Ge/Sphere1/STheta       = 0. deg
d:Ge/Sphere1/DTheta       = 180. deg
d:Ge/Sphere1/TransZ       = 2.1 mm
s:Ge/Sphere1/DrawingStyle = "Solid"
s:Ge/Sphere1/Color        = "green"
b:Ge/Sphere1/IsParallel        = "True"
s:Ge/Sphere1/ParallelWorldName = "ActiveSourceWorld"

s:Ge/Sphere1Polymer/Type         = "TsSphere"
s:Ge/Sphere1Polymer/Material     = "MatPolymer"
s:Ge/Sphere1Polymer/Parent       = "Sphere1"
d:Ge/Sphere1Polymer/RMin         = 0. mm
d:Ge/Sphere1Polymer/RMax         = 0.28 mm 
d:Ge/Sphere1Polymer/SPhi         = 0. deg
d:Ge/Sphere1Polymer/DPhi         = 360. deg
d:Ge/Sphere1Polymer/STheta       = 0. deg
d:Ge/Sphere1Polymer/DTheta       = 180. deg
s:Ge/Sphere1Polymer/DrawingStyle = "Solid"
s:Ge/Sphere1Polymer/Color        = "green"
b:Ge/Sphere1Polymer/IsParallel        = "True"
s:Ge/Sphere1Polymer/ParallelWorldName = "ActiveSourceWorld"

##### SPHERICAL POLYMER 2
s:Ge/Sphere2/Type         = "TsSphere"
s:Ge/Sphere2/Material     = "G4_Pd"
s:Ge/Sphere2/Parent       = "ActiveSource"
d:Ge/Sphere2/RMin         = 0. mm
d:Ge/Sphere2/RMax         = 0.2801 mm 
d:Ge/Sphere2/SPhi         = 0. deg
d:Ge/Sphere2/DPhi         = 360. deg
d:Ge/Sphere2/STheta       = 0. deg
d:Ge/Sphere2/DTheta       = 180. deg
d:Ge/Sphere2/TransZ       = 1.5 mm
s:Ge/Sphere2/DrawingStyle = "Solid"
s:Ge/Sphere2/Color        = "green"
b:Ge/Sphere2/IsParallel        = "True"
s:Ge/Sphere2/ParallelWorldName = "ActiveSourceWorld"

s:Ge/Sphere2Polymer/Type         = "TsSphere"
s:Ge/Sphere2Polymer/Material     = "MatPolymer"
s:Ge/Sphere2Polymer/Parent       = "Sphere2"
d:Ge/Sphere2Polymer/RMin         = 0. mm
d:Ge/Sphere2Polymer/RMax         = 0.28 mm 
d:Ge/Sphere2Polymer/SPhi         = 0. deg
d:Ge/Sphere2Polymer/DPhi         = 360. deg
d:Ge/Sphere2Polymer/STheta       = 0. deg
d:Ge/Sphere2Polymer/DTheta       = 180. deg
s:Ge/Sphere2Polymer/DrawingStyle = "Solid"
s:Ge/Sphere2Polymer/Color        = "green"
b:Ge/Sphere2Polymer/IsParallel        = "True"
s:Ge/Sphere2Polymer/ParallelWorldName = "ActiveSourceWorld"

##### SPHERICAL POLYMER 3
s:Ge/Sphere3/Type         = "TsSphere"
s:Ge/Sphere3/Material     = "G4_Pd"
s:Ge/Sphere3/Parent       = "ActiveSource"
d:Ge/Sphere3/RMin         = 0. mm
d:Ge/Sphere3/RMax         = 0.2801 mm 
d:Ge/Sphere3/SPhi         = 0. deg
d:Ge/Sphere3/DPhi         = 360. deg
d:Ge/Sphere3/STheta       = 0. deg
d:Ge/Sphere3/DTheta       = 180. deg
d:Ge/Sphere3/TransZ       = 0.9 mm
s:Ge/Sphere3/DrawingStyle = "Solid"
s:Ge/Sphere3/Color        = "green"
b:Ge/Sphere3/IsParallel        = "True"
s:Ge/Sphere3/ParallelWorldName = "ActiveSourceWorld"

s:Ge/Sphere3Polymer/Type         = "TsSphere"
s:Ge/Sphere3Polymer/Material     = "MatPolymer"
s:Ge/Sphere3Polymer/Parent       = "Sphere3"
d:Ge/Sphere3Polymer/RMin         = 0. mm
d:Ge/Sphere3Polymer/RMax         = 0.28 mm 
d:Ge/Sphere3Polymer/SPhi         = 0. deg
d:Ge/Sphere3Polymer/DPhi         = 360. deg
d:Ge/Sphere3Polymer/STheta       = 0. deg
d:Ge/Sphere3Polymer/DTheta       = 180. deg
s:Ge/Sphere3Polymer/DrawingStyle = "Solid"
s:Ge/Sphere3Polymer/Color        = "green"
b:Ge/Sphere3Polymer/IsParallel        = "True"
s:Ge/Sphere3Polymer/ParallelWorldName = "ActiveSourceWorld"

##### SPHERICAL POLYMER 4
s:Ge/Sphere4/Type         = "TsSphere"
s:Ge/Sphere4/Material     = "G4_Pd"
s:Ge/Sphere4/Parent       = "ActiveSource"
d:Ge/Sphere4/RMin         = 0. mm
d:Ge/Sphere4/RMax         = 0.2801 mm 
d:Ge/Sphere4/SPhi         = 0. deg
d:Ge/Sphere4/DPhi         = 360. deg
d:Ge/Sphere4/STheta       = 0. deg
d:Ge/Sphere4/DTheta       = 180. deg
d:Ge/Sphere4/TransZ       = -0.9 mm
s:Ge/Sphere4/DrawingStyle = "Solid"
s:Ge/Sphere4/Color        = "green"
b:Ge/Sphere4/IsParallel        = "True"
s:Ge/Sphere4/ParallelWorldName = "ActiveSourceWorld"

s:Ge/Sphere4Polymer/Type         = "TsSphere"
s:Ge/Sphere4Polymer/Material     = "MatPolymer"
s:Ge/Sphere4Polymer/Parent       = "Sphere4"
d:Ge/Sphere4Polymer/RMin         = 0. mm
d:Ge/Sphere4Polymer/RMax         = 0.28 mm 
d:Ge/Sphere4Polymer/SPhi         = 0. deg
d:Ge/Sphere4Polymer/DPhi         = 360. deg
d:Ge/Sphere4Polymer/STheta       = 0. deg
d:Ge/Sphere4Polymer/DTheta       = 180. deg
s:Ge/Sphere4Polymer/DrawingStyle = "Solid"
s:Ge/Sphere4Polymer/Color        = "green"
b:Ge/Sphere4Polymer/IsParallel        = "True"
s:Ge/Sphere4Polymer/ParallelWorldName = "ActiveSourceWorld"

##### SPHERICAL POLYMER 5
s:Ge/Sphere5/Type         = "TsSphere"
s:Ge/Sphere5/Material     = "G4_Pd"
s:Ge/Sphere5/Parent       = "ActiveSource"
d:Ge/Sphere5/RMin         = 0. mm
d:Ge/Sphere5/RMax         = 0.2801 mm 
d:Ge/Sphere5/SPhi         = 0. deg
d:Ge/Sphere5/DPhi         = 360. deg
d:Ge/Sphere5/STheta       = 0. deg
d:Ge/Sphere5/DTheta       = 180. deg
d:Ge/Sphere5/TransZ       = -1.5 mm
s:Ge/Sphere5/DrawingStyle = "Solid"
s:Ge/Sphere5/Color        = "green"
b:Ge/Sphere5/IsParallel        = "True"
s:Ge/Sphere5/ParallelWorldName = "ActiveSourceWorld"

s:Ge/Sphere5Polymer/Type         = "TsSphere"
s:Ge/Sphere5Polymer/Material     = "MatPolymer"
s:Ge/Sphere5Polymer/Parent       = "Sphere5"
d:Ge/Sphere5Polymer/RMin         = 0. mm
d:Ge/Sphere5Polymer/RMax         = 0.28 mm 
d:Ge/Sphere5Polymer/SPhi         = 0. deg
d:Ge/Sphere5Polymer/DPhi         = 360. deg
d:Ge/Sphere5Polymer/STheta       = 0. deg
d:Ge/Sphere5Polymer/DTheta       = 180. deg
s:Ge/Sphere5Polymer/DrawingStyle = "Solid"
s:Ge/Sphere5Polymer/Color        = "green"
b:Ge/Sphere5Polymer/IsParallel        = "True"
s:Ge/Sphere5Polymer/ParallelWorldName = "ActiveSourceWorld"

##### SPHERICAL POLYMER 6
s:Ge/Sphere6/Type         = "TsSphere"
s:Ge/Sphere6/Material     = "G4_Pd"
s:Ge/Sphere6/Parent       = "ActiveSource"
d:Ge/Sphere6/RMin         = 0. mm
d:Ge/Sphere6/RMax         = 0.2801 mm 
d:Ge/Sphere6/SPhi         = 0. deg
d:Ge/Sphere6/DPhi         = 360. deg
d:Ge/Sphere6/STheta       = 0. deg
d:Ge/Sphere6/DTheta       = 180. deg
d:Ge/Sphere6/TransZ       = -2.1 mm
s:Ge/Sphere6/DrawingStyle = "Solid"
s:Ge/Sphere6/Color        = "green"
b:Ge/Sphere6/IsParallel        = "True"
s:Ge/Sphere6/ParallelWorldName = "ActiveSourceWorld"

s:Ge/Sphere6Polymer/Type         = "TsSphere"
s:Ge/Sphere6Polymer/Material     = "MatPolymer"
s:Ge/Sphere6Polymer/Parent       = "Sphere6"
d:Ge/Sphere6Polymer/RMin         = 0. mm
d:Ge/Sphere6Polymer/RMax         = 0.28 mm 
d:Ge/Sphere6Polymer/SPhi         = 0. deg
d:Ge/Sphere6Polymer/DPhi         = 360. deg
d:Ge/Sphere6Polymer/STheta       = 0. deg
d:Ge/Sphere6Polymer/DTheta       = 180. deg
s:Ge/Sphere6Polymer/DrawingStyle = "Solid"
s:Ge/Sphere6Polymer/Color        = "green"
b:Ge/Sphere6Polymer/IsParallel        = "True"
s:Ge/Sphere6Polymer/ParallelWorldName = "ActiveSourceWorld"

iv:Gr/Color/transparent1 = 4 255 255 255 50
iv:Gr/Color/transparent2 = 4 255 255 255 120

s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSource"
sc:So/ActiveSource/ActiveMaterial            = "G4_Pd"
s:So/ActiveSource/BeamParticle               = "gamma"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

#### Pd-103 SPECTRUM ####
dv:So/ActiveSource/BeamEnergySpectrumValues = 15 2.7 20.074 20.216 22.699 22.724 23.172 39.748 53.29 62.41 241.88 294.98 317.72 357.45 443.79 497.08 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 15 0.0873 0.224 0.425 0.0354 0.0685 0.0164 0.000683 0.0000003 0.0000104 0.000000005 0.000028 0.00000015 0.000221 0.00000015 0.0000396
uv:So/ActiveSource/BeamEnergySpectrumWeights = 1.1660684279 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

sv:Ph/Default/LayeredMassGeometryWorlds =  2 "SeedsWorld" "ActiveSourceWorld"

Pd103_IAPd103A.txt

#                                                          #
#                    Pd 103 - IA Pd103-A                   #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "G4_POLYSTYRENE"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM #####
dv:So/ActiveSource/BeamEnergySpectrumValues = 15 2.7 20.074 20.216 22.699 22.724 23.172 39.748 53.29 62.41 241.88 294.98 317.72 357.45 443.79 497.08 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 15 0.0873 0.224 0.425 0.0354 0.0685 0.0164 0.000683 0.0000003 0.0000104 0.000000005 0.000028 0.00000015 0.000221 0.00000015 0.0000396
uv:So/ActiveSource/BeamEnergySpectrumWeights = 1.16607197 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

#=====================
#Polystyrene bead mid left
#=====================

s:Ge/PolystyreneSphereMidLeft/Type         = "TsSphere"
s:Ge/PolystyreneSphereMidLeft/Parent       = "ActiveSourceGeometry"
s:Ge/PolystyreneSphereMidLeft/Material     = "G4_POLYSTYRENE"
d:Ge/PolystyreneSphereMidLeft/RMin         = 0. mm
d:Ge/PolystyreneSphereMidLeft/RMax         = 0.25 mm
d:Ge/PolystyreneSphereMidLeft/SPhi         = 0. deg
d:Ge/PolystyreneSphereMidLeft/DPhi         = 360. deg
d:Ge/PolystyreneSphereMidLeft/STheta       = 0. deg
d:Ge/PolystyreneSphereMidLeft/DTheta       = 180. deg
d:Ge/PolystyreneSphereMidLeft/TransX       = 0. mm
d:Ge/PolystyreneSphereMidLeft/TransY       = 0. mm
d:Ge/PolystyreneSphereMidLeft/TransZ       = 0.968 mm
d:Ge/PolystyreneSphereMidLeft/RotX         = 0. deg
d:Ge/PolystyreneSphereMidLeft/RotY         = 0. deg
d:Ge/PolystyreneSphereMidLeft/RotZ         = 0. deg
s:Ge/PolystyreneSphereMidLeft/DrawingStyle = "FullWireFrame"
s:Ge/PolystyreneSphereMidLeft/Color        = "green"
b:Ge/PolystyreneSphereMidLeft/IsParallel   = "T"
s:Ge/PolystyreneSphereMidLeft/ParallelWorldName = "ActiveSourceWorld"

#========================
#Polystyrene bead mid right
#========================

s:Ge/PolystyreneSphereMidRight/Type         = "TsSphere"
s:Ge/PolystyreneSphereMidRight/Parent       = "ActiveSourceGeometry"
s:Ge/PolystyreneSphereMidRight/Material     = "G4_POLYSTYRENE"
d:Ge/PolystyreneSphereMidRight/RMin         = 0. mm
d:Ge/PolystyreneSphereMidRight/RMax         = 0.25 mm
d:Ge/PolystyreneSphereMidRight/SPhi         = 0. deg
d:Ge/PolystyreneSphereMidRight/DPhi         = 360. deg
d:Ge/PolystyreneSphereMidRight/STheta       = 0. deg
d:Ge/PolystyreneSphereMidRight/DTheta       = 180. deg
d:Ge/PolystyreneSphereMidRight/TransX       = 0. mm
d:Ge/PolystyreneSphereMidRight/TransY       = 0. mm
d:Ge/PolystyreneSphereMidRight/TransZ       = -0.968 mm
d:Ge/PolystyreneSphereMidRight/RotX         = 0. deg
d:Ge/PolystyreneSphereMidRight/RotY         = 0. deg
d:Ge/PolystyreneSphereMidRight/RotZ         = 0. deg
s:Ge/PolystyreneSphereMidRight/DrawingStyle = "FullWireFrame"
s:Ge/PolystyreneSphereMidRight/Color        = "green"
b:Ge/PolystyreneSphereMidRight/IsParallel   = "T"
s:Ge/PolystyreneSphereMidRight/ParallelWorldName = "ActiveSourceWorld"

#=====================
#Polystyrene bead far left
#=====================

s:Ge/PolystyreneSphereFarLeft/Type         = "TsSphere"
s:Ge/PolystyreneSphereFarLeft/Parent       = "ActiveSourceGeometry"
s:Ge/PolystyreneSphereFarLeft/Material     = "G4_POLYSTYRENE"
d:Ge/PolystyreneSphereFarLeft/RMin         = 0. mm
d:Ge/PolystyreneSphereFarLeft/RMax         = 0.25 mm
d:Ge/PolystyreneSphereFarLeft/SPhi         = 0. deg
d:Ge/PolystyreneSphereFarLeft/DPhi         = 360. deg
d:Ge/PolystyreneSphereFarLeft/STheta       = 0. deg
d:Ge/PolystyreneSphereFarLeft/DTheta       = 180. deg
d:Ge/PolystyreneSphereFarLeft/TransX       = 0. mm
d:Ge/PolystyreneSphereFarLeft/TransY       = 0. mm
d:Ge/PolystyreneSphereFarLeft/TransZ       = 1.56 mm
d:Ge/PolystyreneSphereFarLeft/RotX         = 0. deg
d:Ge/PolystyreneSphereFarLeft/RotY         = 0. deg
d:Ge/PolystyreneSphereFarLeft/RotZ         = 0. deg
s:Ge/PolystyreneSphereFarLeft/DrawingStyle = "FullWireFrame"
s:Ge/PolystyreneSphereFarLeft/Color        = "green"
b:Ge/PolystyreneSphereFarLeft/IsParallel   = "T"
s:Ge/PolystyreneSphereFarLeft/ParallelWorldName = "ActiveSourceWorld"

#========================
#Polystyrene bead far right
#========================

s:Ge/PolystyreneSphereFarRight/Type         = "TsSphere"
s:Ge/PolystyreneSphereFarRight/Parent       = "ActiveSourceGeometry"
s:Ge/PolystyreneSphereFarRight/Material     = "G4_POLYSTYRENE"
d:Ge/PolystyreneSphereFarRight/RMin         = 0. mm
d:Ge/PolystyreneSphereFarRight/RMax         = 0.25 mm
d:Ge/PolystyreneSphereFarRight/SPhi         = 0. deg
d:Ge/PolystyreneSphereFarRight/DPhi         = 360. deg
d:Ge/PolystyreneSphereFarRight/STheta       = 0. deg
d:Ge/PolystyreneSphereFarRight/DTheta       = 180. deg
d:Ge/PolystyreneSphereFarRight/TransX       = 0. mm
d:Ge/PolystyreneSphereFarRight/TransY       = 0. mm
d:Ge/PolystyreneSphereFarRight/TransZ       = -1.56 mm
d:Ge/PolystyreneSphereFarRight/RotX         = 0. deg
d:Ge/PolystyreneSphereFarRight/RotY         = 0. deg
d:Ge/PolystyreneSphereFarRight/RotZ         = 0. deg
s:Ge/PolystyreneSphereFarRight/DrawingStyle = "FullWireFrame"
s:Ge/PolystyreneSphereFarRight/Color        = "green"
b:Ge/PolystyreneSphereFarRight/IsParallel   = "T"
s:Ge/PolystyreneSphereFarRight/ParallelWorldName = "ActiveSourceWorld"

#====================
#Silver marker
#====================

s:Ge/SilverMarker/Type         = "TsCylinder"
s:Ge/SilverMarker/Parent       = "ActiveSourceGeometry"
s:Ge/SilverMarker/Material     = "G4_Ag"
d:Ge/SilverMarker/RMin         = 0. mm
d:Ge/SilverMarker/RMax         = 0.25 mm
d:Ge/SilverMarker/SPhi         = 0. deg
d:Ge/SilverMarker/DPhi         = 360. deg
d:Ge/SilverMarker/HL           = 0.625 mm
d:Ge/SilverMarker/TransX       = 0. mm
d:Ge/SilverMarker/TransY       = 0. mm
d:Ge/SilverMarker/TransZ       = 0. mm
d:Ge/SilverMarker/RotX         = 0. deg
d:Ge/SilverMarker/RotY         = 0. deg
d:Ge/SilverMarker/RotZ         = 0. deg
s:Ge/SilverMarker/DrawingStyle = "FullWireFrame"
s:Ge/SilverMarker/Color        = "grey"
b:Ge/SilverMarker/IsParallel   = "True"
s:Ge/SilverMarker/ParallelWorldName = "ActiveSourceWorld"

##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "ShieldingGeo"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.35 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.85 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "True"
s:Ge/DryAirCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left cap of air 
#===============================

s:Ge/LeftAirCap/Type             = "G4Paraboloid"
s:Ge/LeftAirCap/Parent           = "TitaniumLeftCap"
s:Ge/LeftAirCap/Material         = "G4_AIR"
d:Ge/LeftAirCap/TransX           = 0 mm
d:Ge/LeftAirCap/TransY           = 0 mm
d:Ge/LeftAirCap/TransZ           = 0.025 mm
d:Ge/LeftAirCap/RotX             = 0 deg
d:Ge/LeftAirCap/RotY             = 180 deg
d:Ge/LeftAirCap/RotZ             = 0 deg
d:Ge/LeftAirCap/HLZ              = 0.025 mm
d:Ge/LeftAirCap/R1               = 0 mm
d:Ge/LeftAirCap/R2               = 0.35 mm
s:Ge/LeftAirCap/Color            = "white"
s:Ge/LeftAirCap/DrawingStyle     = "FullWireFrame"
b:Ge/LeftAirCap/IsParallel       = "True"
s:Ge/LeftAirCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right cap of air
#================================

s:Ge/RightAirCap/Type             = "G4Paraboloid"
s:Ge/RightAirCap/Parent           = "TitaniumRightCap"
s:Ge/RightAirCap/Material         = "G4_AIR"
d:Ge/RightAirCap/TransX           = 0 mm
d:Ge/RightAirCap/TransY           = 0 mm
d:Ge/RightAirCap/TransZ           = 0.025 mm
d:Ge/RightAirCap/RotX             = 0 deg
d:Ge/RightAirCap/RotY             = 180 deg
d:Ge/RightAirCap/RotZ             = 0 deg
d:Ge/RightAirCap/HLZ              = 0.025 mm
d:Ge/RightAirCap/R1               = 0 mm
d:Ge/RightAirCap/R2               = 0.35 mm
s:Ge/RightAirCap/Color            = "white"
s:Ge/RightAirCap/DrawingStyle     = "FullWireFrame"
b:Ge/RightAirCap/IsParallel       = "True"
s:Ge/RightAirCap/ParallelWorldName = "ShieldingWorld"

#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "G4_Ti"
d:Ge/TitaniumCylinder/RMin         = 0.35 mm
d:Ge/TitaniumCylinder/RMax         = 0.40 mm
d:Ge/TitaniumCylinder/SPhi         = 0. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.85 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "True"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "G4_Ti"
d:Ge/TitaniumLeftCap/RMin         = 0. mm
d:Ge/TitaniumLeftCap/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.85 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 0. deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "True"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "G4_Ti"
d:Ge/TitaniumRightCap/RMin         = 0. mm
d:Ge/TitaniumRightCap/RMax         = 0.4 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.85 mm
d:Ge/TitaniumRightCap/RotX         = 180. deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "True"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds =  2 "ShieldingWorld" "ActiveSourceWorld"

Pd103_Theraseed200Heavy.txt

#                                                          #
#               Pd 103 - Theraseed 200 Heavy               #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #


##### MATERIAL DEFINITION #####
sv:Ma/Graphite/Components = 1 "Carbon"
uv:Ma/Graphite/Fractions  = 1 1
d:Ma/Graphite/Density     = 2.09 g/cm3

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "G4_Pd"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM #####
dv:So/ActiveSource/BeamEnergySpectrumValues = 15 2.7 20.074 20.216 22.699 22.724 23.172 39.748 53.29 62.41 241.88 294.98 317.72 357.45 443.79 497.08 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 15 0.0873 0.224 0.425 0.0354 0.0685 0.0164 0.000683 0.0000003 0.0000104 0.000000005 0.000028 0.00000015 0.000221 0.00000015 0.0000396
uv:So/ActiveSource/BeamEnergySpectrumWeights = 1.16607197 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Left pellet of graphite 
#===========================

s:Ge/LeftGraphitePellet/Type         = "TsCylinder"
s:Ge/LeftGraphitePellet/Parent       = "LeftPalladiumCoating"
s:Ge/LeftGraphitePellet/Material     = "Graphite"
d:Ge/LeftGraphitePellet/RMin         = 0. mm
d:Ge/LeftGraphitePellet/RMax         = 0.28 mm
d:Ge/LeftGraphitePellet/SPhi         = 0. deg
d:Ge/LeftGraphitePellet/DPhi         = 360. deg
d:Ge/LeftGraphitePellet/HL           = 0.445 mm
d:Ge/LeftGraphitePellet/TransX       = 0. mm
d:Ge/LeftGraphitePellet/TransY       = 0. mm
d:Ge/LeftGraphitePellet/TransZ       = 0. mm
d:Ge/LeftGraphitePellet/RotX         = 0. deg
d:Ge/LeftGraphitePellet/RotY         = 0. deg
d:Ge/LeftGraphitePellet/RotZ         = 0. deg
s:Ge/LeftGraphitePellet/Color        = "green"
s:Ge/LeftGraphitePellet/DrawingStyle = "FullWireFrame"
b:Ge/LeftGraphitePellet/IsParallel   = "True"
s:Ge/LeftGraphitePellet/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Right pellet of graphite 
#===========================

s:Ge/RightGraphitePellet/Type         = "TsCylinder"
s:Ge/RightGraphitePellet/Parent       = "RightPalladiumCoating"
s:Ge/RightGraphitePellet/Material     = "Graphite"
d:Ge/RightGraphitePellet/RMin         = 0. mm
d:Ge/RightGraphitePellet/RMax         = 0.28 mm
d:Ge/RightGraphitePellet/SPhi         = 0. deg
d:Ge/RightGraphitePellet/DPhi         = 360. deg
d:Ge/RightGraphitePellet/HL           = 0.445 mm
d:Ge/RightGraphitePellet/TransX       = 0. mm
d:Ge/RightGraphitePellet/TransY       = 0. mm
d:Ge/RightGraphitePellet/TransZ       = 0. mm
d:Ge/RightGraphitePellet/RotX         = 0. deg
d:Ge/RightGraphitePellet/RotY         = 0. deg
d:Ge/RightGraphitePellet/RotZ         = 0. deg
s:Ge/RightGraphitePellet/Color        = "green"
s:Ge/RightGraphitePellet/DrawingStyle = "FullWireFrame"
b:Ge/RightGraphitePellet/IsParallel   = "True"
s:Ge/RightGraphitePellet/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Left Heavy coating of palladium 
#===========================

s:Ge/LeftPalladiumCoating/Type         = "TsCylinder"
s:Ge/LeftPalladiumCoating/Parent       = "ActiveSourceGeometry"
s:Ge/LeftPalladiumCoating/Material     = "G4_Pd"
d:Ge/LeftPalladiumCoating/RMin         = 0. mm
d:Ge/LeftPalladiumCoating/RMax         = 0.2905 mm
d:Ge/LeftPalladiumCoating/SPhi         = 0. deg
d:Ge/LeftPalladiumCoating/DPhi         = 360. deg
d:Ge/LeftPalladiumCoating/HL           = 0.4555 mm
d:Ge/LeftPalladiumCoating/TransX       = 0. mm
d:Ge/LeftPalladiumCoating/TransY       = 0. mm
d:Ge/LeftPalladiumCoating/TransZ       = 1.0575 mm
d:Ge/LeftPalladiumCoating/RotX         = 0. deg
d:Ge/LeftPalladiumCoating/RotY         = 0. deg
d:Ge/LeftPalladiumCoating/RotZ         = 0. deg
s:Ge/LeftPalladiumCoating/Color        = "red"
s:Ge/LeftPalladiumCoating/DrawingStyle = "FullWireFrame"
b:Ge/LeftPalladiumCoating/IsParallel   = "True"
s:Ge/LeftPalladiumCoating/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Right Heavy coating of palladium 
#===========================

s:Ge/RightPalladiumCoating/Type         = "TsCylinder"
s:Ge/RightPalladiumCoating/Parent       = "ActiveSourceGeometry"
s:Ge/RightPalladiumCoating/Material     = "G4_Pd"
d:Ge/RightPalladiumCoating/RMin         = 0. mm
d:Ge/RightPalladiumCoating/RMax         = 0.2905 mm
d:Ge/RightPalladiumCoating/SPhi         = 0. deg
d:Ge/RightPalladiumCoating/DPhi         = 360. deg
d:Ge/RightPalladiumCoating/HL           = 0.4555 mm
d:Ge/RightPalladiumCoating/TransX       = 0. mm
d:Ge/RightPalladiumCoating/TransY       = 0. mm
d:Ge/RightPalladiumCoating/TransZ       = -1.0575 mm
d:Ge/RightPalladiumCoating/RotX         = 0. deg
d:Ge/RightPalladiumCoating/RotY         = 0. deg
d:Ge/RightPalladiumCoating/RotZ         = 0. deg
s:Ge/RightPalladiumCoating/Color        = "red"
s:Ge/RightPalladiumCoating/DrawingStyle = "FullWireFrame"
b:Ge/RightPalladiumCoating/IsParallel   = "True"
s:Ge/RightPalladiumCoating/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Lead marker
#===========================

s:Ge/LeadMarker/Type         = "TsCylinder"
s:Ge/LeadMarker/Parent       = "ActiveSourceGeometry"
s:Ge/LeadMarker/Material     = "G4_Pb"
d:Ge/LeadMarker/RMin         = 0. mm
d:Ge/LeadMarker/RMax         = 0.255 mm
d:Ge/LeadMarker/SPhi         = 0. deg
d:Ge/LeadMarker/DPhi         = 360. deg
d:Ge/LeadMarker/HL           = 0.545 mm
d:Ge/LeadMarker/TransX       = 0. mm
d:Ge/LeadMarker/TransY       = 0. mm
d:Ge/LeadMarker/TransZ       = 0. mm
d:Ge/LeadMarker/RotX         = 0. deg
d:Ge/LeadMarker/RotY         = 0. deg
d:Ge/LeadMarker/RotZ         = 0. deg
s:Ge/LeadMarker/Color        = "brown"
s:Ge/LeadMarker/DrawingStyle = "FullWireFrame"
b:Ge/LeadMarker/IsParallel   = "True"
s:Ge/LeadMarker/ParallelWorldName = "ActiveSourceWorld"

##### FILLING GEOMETRY #####

s:Ge/FillingGeometry/Type              = "Group"
s:Ge/FillingGeometry/Parent            = "World"
b:Ge/FillingGeometry/IsParallel        = "True"
s:Ge/FillingGeometry/ParallelWorldName = "FillingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "FillingGeometry"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.357 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.916 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "True"
s:Ge/DryAirCylinder/ParallelWorldName = "FillingWorld"

##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
d:Ge/ShieldingGeo/TransZ            = 0 mm
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"

#===========================
#Center Cylinder of Titanium
#===========================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "G4_Ti"
d:Ge/TitaniumCylinder/RMin         = 0.357 mm
d:Ge/TitaniumCylinder/RMax         = 0.413 mm
d:Ge/TitaniumCylinder/SPhi         = 0. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.916 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "True"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#=========================
#Left cylinder of titanium
#=========================

s:Ge/LeftTitaniumCylinder/Type         = "TsCylinder"
s:Ge/LeftTitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/LeftTitaniumCylinder/Material     = "G4_Ti"
d:Ge/LeftTitaniumCylinder/RMin         = 0.306 mm
d:Ge/LeftTitaniumCylinder/RMax         = 0.413 mm
d:Ge/LeftTitaniumCylinder/SPhi         = 0. deg
d:Ge/LeftTitaniumCylinder/DPhi         = 360. deg
d:Ge/LeftTitaniumCylinder/HL           = 0.167 mm
d:Ge/LeftTitaniumCylinder/TransX       = 0. mm
d:Ge/LeftTitaniumCylinder/TransY       = 0. mm
d:Ge/LeftTitaniumCylinder/TransZ       = 2.083 mm
d:Ge/LeftTitaniumCylinder/RotX         = 0. deg
d:Ge/LeftTitaniumCylinder/RotY         = 0. deg
d:Ge/LeftTitaniumCylinder/RotZ         = 0. deg
s:Ge/LeftTitaniumCylinder/Color        = "blue"
s:Ge/LeftTitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/LeftTitaniumCylinder/IsParallel   = "True"
s:Ge/LeftTitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#=========================
#Right cylinder of titanium
#=========================

s:Ge/RightTitaniumCylinder/Type         = "TsCylinder"
s:Ge/RightTitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/RightTitaniumCylinder/Material     = "G4_Ti"
d:Ge/RightTitaniumCylinder/RMin         = 0.306 mm
d:Ge/RightTitaniumCylinder/RMax         = 0.413 mm
d:Ge/RightTitaniumCylinder/SPhi         = 0. deg
d:Ge/RightTitaniumCylinder/DPhi         = 360. deg
d:Ge/RightTitaniumCylinder/HL           = 0.167 mm
d:Ge/RightTitaniumCylinder/TransX       = 0. mm
d:Ge/RightTitaniumCylinder/TransY       = 0. mm
d:Ge/RightTitaniumCylinder/TransZ       = -2.083 mm
d:Ge/RightTitaniumCylinder/RotX         = 0. deg
d:Ge/RightTitaniumCylinder/RotY         = 0. deg
d:Ge/RightTitaniumCylinder/RotZ         = 0. deg
s:Ge/RightTitaniumCylinder/Color        = "blue"
s:Ge/RightTitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/RightTitaniumCylinder/IsParallel   = "True"
s:Ge/RightTitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "G4_Ti"
d:Ge/TitaniumLeftCap/RMin         = 0.306 mm
d:Ge/TitaniumLeftCap/RMax         = 0.346 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.916 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 180 deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "True"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "G4_Ti"
d:Ge/TitaniumRightCap/RMin         = 0.306 mm
d:Ge/TitaniumRightCap/RMax         = 0.346 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.916 mm
d:Ge/TitaniumRightCap/RotX         = 0 deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "True"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"

#========================================
#Left half-sphere of environment material 
#========================================

s:Ge/EnvironmentLeftCap/Type         = "TsSphere"
s:Ge/EnvironmentLeftCap/Parent       = "ShieldingGeo"
s:Ge/EnvironmentLeftCap/Material     = "Vacuum"
d:Ge/EnvironmentLeftCap/RMin         = 0. mm
d:Ge/EnvironmentLeftCap/RMax         = 0.306 mm
d:Ge/EnvironmentLeftCap/SPhi         = 0. deg
d:Ge/EnvironmentLeftCap/DPhi         = 360. deg
d:Ge/EnvironmentLeftCap/STheta       = 0. deg
d:Ge/EnvironmentLeftCap/DTheta       = 90. deg
d:Ge/EnvironmentLeftCap/TransX       = 0. mm
d:Ge/EnvironmentLeftCap/TransY       = 0. mm
d:Ge/EnvironmentLeftCap/TransZ       = 1.916 mm
d:Ge/EnvironmentLeftCap/RotX         = 0. deg
d:Ge/EnvironmentLeftCap/RotY         = 180 deg
d:Ge/EnvironmentLeftCap/RotZ         = 0. deg
s:Ge/EnvironmentLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/EnvironmentLeftCap/Color        = "grey"
b:Ge/EnvironmentLeftCap/IsParallel   = "True"
s:Ge/EnvironmentLeftCap/ParallelWorldName = "ShieldingWorld"

#=========================================
#Right half-sphere of environment material
#=========================================

s:Ge/EnvironmentRightCap/Type         = "TsSphere"
s:Ge/EnvironmentRightCap/Parent       = "ShieldingGeo"
s:Ge/EnvironmentRightCap/Material     = "Vacuum"
d:Ge/EnvironmentRightCap/RMin         = 0. mm
d:Ge/EnvironmentRightCap/RMax         = 0.306 mm
d:Ge/EnvironmentRightCap/SPhi         = 0. deg
d:Ge/EnvironmentRightCap/DPhi         = 360. deg
d:Ge/EnvironmentRightCap/STheta       = 0. deg
d:Ge/EnvironmentRightCap/DTheta       = 90. deg
d:Ge/EnvironmentRightCap/TransX       = 0. mm
d:Ge/EnvironmentRightCap/TransY       = 0. mm
d:Ge/EnvironmentRightCap/TransZ       = -1.916 mm
d:Ge/EnvironmentRightCap/RotX         = 0 deg
d:Ge/EnvironmentRightCap/RotY         = 0. deg
d:Ge/EnvironmentRightCap/RotZ         = 0. deg
s:Ge/EnvironmentRightCap/DrawingStyle = "FullWireFrame"
s:Ge/EnvironmentRightCap/Color        = "grey"
b:Ge/EnvironmentRightCap/IsParallel   = "True"
s:Ge/EnvironmentRightCap/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds =  3 "FillingWorld" "ShieldingWorld" "ActiveSourceWorld"

Pd103_Theraseed200Light.txt

#                                                          #
#               Pd 103 - Theraseed 200 Light               #
#                                                          #
#                                                          #
#                Latest version - May 2021                 #
#                  Author: Audran Poher                    #
#              Contact - fberumenm@gmail.com               #
#       https://doi.org/10.1016/j.brachy.2020.12.007       #
#                                                          #

##### MATERIAL DEFINITION #####
sv:Ma/Graphite/Components = 1 "Carbon"
uv:Ma/Graphite/Fractions  = 1 1
d:Ma/Graphite/Density     = 2.09 g/cm3

##### SOURCE #####
s:So/ActiveSource/Type                       = "Volumetric"
s:So/ActiveSource/Component                  = "ActiveSourceGeometry"
sc:So/ActiveSource/ActiveMaterial            = "G4_Pd"
s:So/ActiveSource/BeamParticle               = "gamma"
b:So/ActiveSource/RecursivelyIncludeChildren = "T"
i:So/ActiveSource/MaxNumberOfPointsToSample  = 1000000000
s:So/ActiveSource/BeamEnergySpectrumType     = "Discrete"
ic:So/ActiveSource/NumberOfHistoriesInRun    = 10

##### SPECTRUM ######
dv:So/ActiveSource/BeamEnergySpectrumValues = 15 2.7 20.074 20.216 22.699 22.724 23.172 39.748 53.29 62.41 241.88 294.98 317.72 357.45 443.79 497.08 keV
uv:So/ActiveSource/BeamEnergySpectrumWeightsUnscaled = 15 0.0873 0.224 0.425 0.0354 0.0685 0.0164 0.000683 0.0000003 0.0000104 0.000000005 0.000028 0.00000015 0.000221 0.00000015 0.0000396
uv:So/ActiveSource/BeamEnergySpectrumWeights = 1.16607197 * So/ActiveSource/BeamEnergySpectrumWeightsUnscaled

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry/Type              = "Group"
s:Ge/ActiveSourceGeometry/Parent            = "World"
b:Ge/ActiveSourceGeometry/IsParallel        = "True"
s:Ge/ActiveSourceGeometry/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Left pellet of graphite 
#===========================

s:Ge/LeftGraphitePellet/Type         = "TsCylinder"
s:Ge/LeftGraphitePellet/Parent       = "LeftPalladiumCoating"
s:Ge/LeftGraphitePellet/Material     = "Graphite"
d:Ge/LeftGraphitePellet/RMin         = 0. mm
d:Ge/LeftGraphitePellet/RMax         = 0.28 mm
d:Ge/LeftGraphitePellet/SPhi         = 0. deg
d:Ge/LeftGraphitePellet/DPhi         = 360. deg
d:Ge/LeftGraphitePellet/HL           = 0.445 mm
d:Ge/LeftGraphitePellet/TransX       = 0. mm
d:Ge/LeftGraphitePellet/TransY       = 0. mm
d:Ge/LeftGraphitePellet/TransZ       = 0. mm
d:Ge/LeftGraphitePellet/RotX         = 0. deg
d:Ge/LeftGraphitePellet/RotY         = 0. deg
d:Ge/LeftGraphitePellet/RotZ         = 0. deg
s:Ge/LeftGraphitePellet/Color        = "green"
s:Ge/LeftGraphitePellet/DrawingStyle = "FullWireFrame"
b:Ge/LeftGraphitePellet/IsParallel   = "True"
s:Ge/LeftGraphitePellet/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Right pellet of graphite 
#===========================

s:Ge/RightGraphitePellet/Type         = "TsCylinder"
s:Ge/RightGraphitePellet/Parent       = "RightPalladiumCoating"
s:Ge/RightGraphitePellet/Material     = "Graphite"
d:Ge/RightGraphitePellet/RMin         = 0. mm
d:Ge/RightGraphitePellet/RMax         = 0.28 mm
d:Ge/RightGraphitePellet/SPhi         = 0. deg
d:Ge/RightGraphitePellet/DPhi         = 360. deg
d:Ge/RightGraphitePellet/HL           = 0.445 mm
d:Ge/RightGraphitePellet/TransX       = 0. mm
d:Ge/RightGraphitePellet/TransY       = 0. mm
d:Ge/RightGraphitePellet/TransZ       = 0. mm
d:Ge/RightGraphitePellet/RotX         = 0. deg
d:Ge/RightGraphitePellet/RotY         = 0. deg
d:Ge/RightGraphitePellet/RotZ         = 0. deg
s:Ge/RightGraphitePellet/Color        = "green"
s:Ge/RightGraphitePellet/DrawingStyle = "FullWireFrame"
b:Ge/RightGraphitePellet/IsParallel   = "True"
s:Ge/RightGraphitePellet/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Left Light coating of palladium 
#===========================

s:Ge/LeftPalladiumCoating/Type         = "TsCylinder"
s:Ge/LeftPalladiumCoating/Parent       = "ActiveSourceGeometry"
s:Ge/LeftPalladiumCoating/Material     = "G4_Pd"
d:Ge/LeftPalladiumCoating/RMin         = 0. mm
d:Ge/LeftPalladiumCoating/RMax         = 0.2822 mm
d:Ge/LeftPalladiumCoating/SPhi         = 0. deg
d:Ge/LeftPalladiumCoating/DPhi         = 360. deg
d:Ge/LeftPalladiumCoating/HL           = 0.4472 mm
d:Ge/LeftPalladiumCoating/TransX       = 0. mm
d:Ge/LeftPalladiumCoating/TransY       = 0. mm
d:Ge/LeftPalladiumCoating/TransZ       = 1.0575 mm
d:Ge/LeftPalladiumCoating/RotX         = 0. deg
d:Ge/LeftPalladiumCoating/RotY         = 0. deg
d:Ge/LeftPalladiumCoating/RotZ         = 0. deg
s:Ge/LeftPalladiumCoating/Color        = "red"
s:Ge/LeftPalladiumCoating/DrawingStyle = "FullWireFrame"
b:Ge/LeftPalladiumCoating/IsParallel   = "True"
s:Ge/LeftPalladiumCoating/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Right Light coating of palladium 
#===========================

s:Ge/RightPalladiumCoating/Type         = "TsCylinder"
s:Ge/RightPalladiumCoating/Parent       = "ActiveSourceGeometry"
s:Ge/RightPalladiumCoating/Material     = "G4_Pd"
d:Ge/RightPalladiumCoating/RMin         = 0. mm
d:Ge/RightPalladiumCoating/RMax         = 0.2822 mm
d:Ge/RightPalladiumCoating/SPhi         = 0. deg
d:Ge/RightPalladiumCoating/DPhi         = 360. deg
d:Ge/RightPalladiumCoating/HL           = 0.4472 mm
d:Ge/RightPalladiumCoating/TransX       = 0. mm
d:Ge/RightPalladiumCoating/TransY       = 0. mm
d:Ge/RightPalladiumCoating/TransZ       = -1.0575 mm
d:Ge/RightPalladiumCoating/RotX         = 0. deg
d:Ge/RightPalladiumCoating/RotY         = 0. deg
d:Ge/RightPalladiumCoating/RotZ         = 0. deg
s:Ge/RightPalladiumCoating/Color        = "red"
s:Ge/RightPalladiumCoating/DrawingStyle = "FullWireFrame"
b:Ge/RightPalladiumCoating/IsParallel   = "True"
s:Ge/RightPalladiumCoating/ParallelWorldName = "ActiveSourceWorld"

#===========================
#Lead marker
#===========================

s:Ge/LeadMarker/Type         = "TsCylinder"
s:Ge/LeadMarker/Parent       = "ActiveSourceGeometry"
s:Ge/LeadMarker/Material     = "G4_Pb"
d:Ge/LeadMarker/RMin         = 0. mm
d:Ge/LeadMarker/RMax         = 0.255 mm
d:Ge/LeadMarker/SPhi         = 0. deg
d:Ge/LeadMarker/DPhi         = 360. deg
d:Ge/LeadMarker/HL           = 0.545 mm
d:Ge/LeadMarker/TransX       = 0. mm
d:Ge/LeadMarker/TransY       = 0. mm
d:Ge/LeadMarker/TransZ       = 0. mm
d:Ge/LeadMarker/RotX         = 0. deg
d:Ge/LeadMarker/RotY         = 0. deg
d:Ge/LeadMarker/RotZ         = 0. deg
s:Ge/LeadMarker/Color        = "brown"
s:Ge/LeadMarker/DrawingStyle = "FullWireFrame"
b:Ge/LeadMarker/IsParallel   = "True"
s:Ge/LeadMarker/ParallelWorldName = "ActiveSourceWorld"

##### FILLING GEOMETRY #####

s:Ge/FillingGeometry/Type              = "Group"
s:Ge/FillingGeometry/Parent            = "World"
b:Ge/FillingGeometry/IsParallel        = "True"
s:Ge/FillingGeometry/ParallelWorldName = "FillingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder/Type         = "TsCylinder"
s:Ge/DryAirCylinder/Parent       = "FillingGeometry"
s:Ge/DryAirCylinder/Material     = "G4_AIR"
d:Ge/DryAirCylinder/RMin         = 0. mm
d:Ge/DryAirCylinder/RMax         = 0.357 mm
d:Ge/DryAirCylinder/SPhi         = 0. deg
d:Ge/DryAirCylinder/DPhi         = 360. deg
d:Ge/DryAirCylinder/HL           = 1.916 mm
d:Ge/DryAirCylinder/TransX       = 0. mm
d:Ge/DryAirCylinder/TransY       = 0. mm
d:Ge/DryAirCylinder/TransZ       = 0. mm
d:Ge/DryAirCylinder/RotX         = 0. deg
d:Ge/DryAirCylinder/RotY         = 0. deg
d:Ge/DryAirCylinder/RotZ         = 0. deg
s:Ge/DryAirCylinder/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder/Color        = "white"
b:Ge/DryAirCylinder/IsParallel   = "True"
s:Ge/DryAirCylinder/ParallelWorldName = "FillingWorld"


##### SHIELDING #####

s:Ge/ShieldingGeo/Type              = "Group"
s:Ge/ShieldingGeo/Parent            = "World"
b:Ge/ShieldingGeo/IsParallel        = "True"
s:Ge/ShieldingGeo/ParallelWorldName = "ShieldingWorld"

#===========================
#Center Cylinder of Titanium
#===========================

s:Ge/TitaniumCylinder/Type         = "TsCylinder"
s:Ge/TitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/TitaniumCylinder/Material     = "G4_Ti"
d:Ge/TitaniumCylinder/RMin         = 0.357 mm
d:Ge/TitaniumCylinder/RMax         = 0.413 mm
d:Ge/TitaniumCylinder/SPhi         = 0. deg
d:Ge/TitaniumCylinder/DPhi         = 360. deg
d:Ge/TitaniumCylinder/HL           = 1.916 mm
d:Ge/TitaniumCylinder/TransX       = 0. mm
d:Ge/TitaniumCylinder/TransY       = 0. mm
d:Ge/TitaniumCylinder/TransZ       = 0. mm
d:Ge/TitaniumCylinder/RotX         = 0. deg
d:Ge/TitaniumCylinder/RotY         = 0. deg
d:Ge/TitaniumCylinder/RotZ         = 0. deg
s:Ge/TitaniumCylinder/Color        = "blue"
s:Ge/TitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder/IsParallel   = "True"
s:Ge/TitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#=========================
#Left cylinder of titanium
#=========================

s:Ge/LeftTitaniumCylinder/Type         = "TsCylinder"
s:Ge/LeftTitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/LeftTitaniumCylinder/Material     = "G4_Ti"
d:Ge/LeftTitaniumCylinder/RMin         = 0.306 mm
d:Ge/LeftTitaniumCylinder/RMax         = 0.413 mm
d:Ge/LeftTitaniumCylinder/SPhi         = 0. deg
d:Ge/LeftTitaniumCylinder/DPhi         = 360. deg
d:Ge/LeftTitaniumCylinder/HL           = 0.167 mm
d:Ge/LeftTitaniumCylinder/TransX       = 0. mm
d:Ge/LeftTitaniumCylinder/TransY       = 0. mm
d:Ge/LeftTitaniumCylinder/TransZ       = 2.083 mm
d:Ge/LeftTitaniumCylinder/RotX         = 0. deg
d:Ge/LeftTitaniumCylinder/RotY         = 0. deg
d:Ge/LeftTitaniumCylinder/RotZ         = 0. deg
s:Ge/LeftTitaniumCylinder/Color        = "blue"
s:Ge/LeftTitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/LeftTitaniumCylinder/IsParallel   = "True"
s:Ge/LeftTitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#=========================
#Right cylinder of titanium
#=========================

s:Ge/RightTitaniumCylinder/Type         = "TsCylinder"
s:Ge/RightTitaniumCylinder/Parent       = "ShieldingGeo"
s:Ge/RightTitaniumCylinder/Material     = "G4_Ti"
d:Ge/RightTitaniumCylinder/RMin         = 0.306 mm
d:Ge/RightTitaniumCylinder/RMax         = 0.413 mm
d:Ge/RightTitaniumCylinder/SPhi         = 0. deg
d:Ge/RightTitaniumCylinder/DPhi         = 360. deg
d:Ge/RightTitaniumCylinder/HL           = 0.167 mm
d:Ge/RightTitaniumCylinder/TransX       = 0. mm
d:Ge/RightTitaniumCylinder/TransY       = 0. mm
d:Ge/RightTitaniumCylinder/TransZ       = -2.083 mm
d:Ge/RightTitaniumCylinder/RotX         = 0. deg
d:Ge/RightTitaniumCylinder/RotY         = 0. deg
d:Ge/RightTitaniumCylinder/RotZ         = 0. deg
s:Ge/RightTitaniumCylinder/Color        = "blue"
s:Ge/RightTitaniumCylinder/DrawingStyle = "FullWireFrame"
b:Ge/RightTitaniumCylinder/IsParallel   = "True"
s:Ge/RightTitaniumCylinder/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap/Type         = "TsSphere"
s:Ge/TitaniumLeftCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumLeftCap/Material     = "G4_Ti"
d:Ge/TitaniumLeftCap/RMin         = 0.306 mm
d:Ge/TitaniumLeftCap/RMax         = 0.346 mm
d:Ge/TitaniumLeftCap/SPhi         = 0. deg
d:Ge/TitaniumLeftCap/DPhi         = 360. deg
d:Ge/TitaniumLeftCap/STheta       = 0. deg
d:Ge/TitaniumLeftCap/DTheta       = 90. deg
d:Ge/TitaniumLeftCap/TransX       = 0. mm
d:Ge/TitaniumLeftCap/TransY       = 0. mm
d:Ge/TitaniumLeftCap/TransZ       = 1.916 mm
d:Ge/TitaniumLeftCap/RotX         = 0. deg
d:Ge/TitaniumLeftCap/RotY         = 180 deg
d:Ge/TitaniumLeftCap/RotZ         = 0. deg
s:Ge/TitaniumLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap/Color        = "blue"
b:Ge/TitaniumLeftCap/IsParallel   = "True"
s:Ge/TitaniumLeftCap/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap/Type         = "TsSphere"
s:Ge/TitaniumRightCap/Parent       = "ShieldingGeo"
s:Ge/TitaniumRightCap/Material     = "G4_Ti"
d:Ge/TitaniumRightCap/RMin         = 0.306 mm
d:Ge/TitaniumRightCap/RMax         = 0.346 mm
d:Ge/TitaniumRightCap/SPhi         = 0. deg
d:Ge/TitaniumRightCap/DPhi         = 360. deg
d:Ge/TitaniumRightCap/STheta       = 0. deg
d:Ge/TitaniumRightCap/DTheta       = 90. deg
d:Ge/TitaniumRightCap/TransX       = 0. mm
d:Ge/TitaniumRightCap/TransY       = 0. mm
d:Ge/TitaniumRightCap/TransZ       = -1.916 mm
d:Ge/TitaniumRightCap/RotX         = 0 deg
d:Ge/TitaniumRightCap/RotY         = 0. deg
d:Ge/TitaniumRightCap/RotZ         = 0. deg
s:Ge/TitaniumRightCap/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap/Color        = "blue"
b:Ge/TitaniumRightCap/IsParallel   = "True"
s:Ge/TitaniumRightCap/ParallelWorldName = "ShieldingWorld"

#========================================
#Left half-sphere of environment material 
#========================================

s:Ge/EnvironmentLeftCap/Type         = "TsSphere"
s:Ge/EnvironmentLeftCap/Parent       = "ShieldingGeo"
s:Ge/EnvironmentLeftCap/Material     = "Vacuum"
d:Ge/EnvironmentLeftCap/RMin         = 0. mm
d:Ge/EnvironmentLeftCap/RMax         = 0.306 mm
d:Ge/EnvironmentLeftCap/SPhi         = 0. deg
d:Ge/EnvironmentLeftCap/DPhi         = 360. deg
d:Ge/EnvironmentLeftCap/STheta       = 0. deg
d:Ge/EnvironmentLeftCap/DTheta       = 90. deg
d:Ge/EnvironmentLeftCap/TransX       = 0. mm
d:Ge/EnvironmentLeftCap/TransY       = 0. mm
d:Ge/EnvironmentLeftCap/TransZ       = 1.916 mm
d:Ge/EnvironmentLeftCap/RotX         = 0. deg
d:Ge/EnvironmentLeftCap/RotY         = 180 deg
d:Ge/EnvironmentLeftCap/RotZ         = 0. deg
s:Ge/EnvironmentLeftCap/DrawingStyle = "FullWireFrame"
s:Ge/EnvironmentLeftCap/Color        = "grey"
b:Ge/EnvironmentLeftCap/IsParallel   = "True"
s:Ge/EnvironmentLeftCap/ParallelWorldName = "ShieldingWorld"

#=========================================
#Right half-sphere of environment material
#=========================================

s:Ge/EnvironmentRightCap/Type         = "TsSphere"
s:Ge/EnvironmentRightCap/Parent       = "ShieldingGeo"
s:Ge/EnvironmentRightCap/Material     = "Vacuum"
d:Ge/EnvironmentRightCap/RMin         = 0. mm
d:Ge/EnvironmentRightCap/RMax         = 0.306 mm
d:Ge/EnvironmentRightCap/SPhi         = 0. deg
d:Ge/EnvironmentRightCap/DPhi         = 360. deg
d:Ge/EnvironmentRightCap/STheta       = 0. deg
d:Ge/EnvironmentRightCap/DTheta       = 90. deg
d:Ge/EnvironmentRightCap/TransX       = 0. mm
d:Ge/EnvironmentRightCap/TransY       = 0. mm
d:Ge/EnvironmentRightCap/TransZ       = -1.916 mm
d:Ge/EnvironmentRightCap/RotX         = 0 deg
d:Ge/EnvironmentRightCap/RotY         = 0. deg
d:Ge/EnvironmentRightCap/RotZ         = 0. deg
s:Ge/EnvironmentRightCap/DrawingStyle = "FullWireFrame"
s:Ge/EnvironmentRightCap/Color        = "grey"
b:Ge/EnvironmentRightCap/IsParallel   = "True"
s:Ge/EnvironmentRightCap/ParallelWorldName = "ShieldingWorld"

sv:Ph/Default/LayeredMassGeometryWorlds =  3 "FillingWorld" "ShieldingWorld" "ActiveSourceWorld"

Graphics

ColorByCreatorProcess.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "CreatorProcess"
sv:Gr/MyOGL/ColorByCreatorProcessNames      = 10 "primary" "protonInelastic" "phot" "compt" "eIoni" "eBrem" "hadElastic" "hIoni" "neutronInelastic" "nCapture"
sv:Gr/MyOGL/ColorByCreatorProcessColors     = 10 "blue" "purple" "green" "red" "yellow" "teal" "fuchsia" "olive" "maroon" "aqua"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByEnergy.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "Energy"
dv:Gr/MyOGL/ColorByEnergyRanges          = 4 1. 10. 250. 398. MeV
sv:Gr/MyOGL/ColorByEnergyColors          = 5 "red" "yellow" "green" "blue" "white"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByGeneration.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "Generation"
sv:Gr/MyOGL/ColorByGenerationColors = 2 "green" "red"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByMomentum.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "Momentum"
dv:Gr/MyOGL/ColorByMomentumRanges          = 4 1. 10. 450. 1000. MeV
sv:Gr/MyOGL/ColorByMomentumColors          = 5 "red" "yellow" "green" "blue" "white"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByOriginComponent.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories that originate in the component named Outer
# or any of its subcomponents will be colored red.
# All others will be colored grey.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "OriginComponent"
sv:Gr/MyOGL/ColorByOriginComponentNames  = 5 "World" "Outer" "Film1" "Film2" "Box"
sv:Gr/MyOGL/ColorByOriginComponentColors = 5 "Red" "Blue" "Yellow" "Pink" "Green"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByOriginComponentOrSubComponent.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories that originate in the component named Outer
# or any of its subcomponents will be colored red.
# All others will be colored grey.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "OriginComponentOrSubComponentOf"
sv:Gr/MyOGL/ColorByOriginComponentNames  = 3 "World" "Outer" "Box"
sv:Gr/MyOGL/ColorByOriginComponentColors = 3 "Red" "Blue" "Green"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByOriginVolume.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories that originate in the component named Outer
# or any of its subcomponents will be colored red.
# All others will be colored grey.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "OriginVolume"
sv:Gr/MyOGL/ColorByOriginVolumeNames  = 6 "World" "Outer" "Film1" "Film2" "Film1/Film1_Z_Division" "Box"
sv:Gr/MyOGL/ColorByOriginVolumeColors = 6 "Red" "Blue" "Yellow" "Pink" "Magenta" "Green"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorByParticleType.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
s:Gr/MyOGL/ColorBy     = "ParticleType"
sv:Gr/MyOGL/ColorByParticleTypeNames      = 4 "e-" "gamma" "proton" "neutron"
sv:Gr/MyOGL/ColorByParticleTypeColors     = 4 "yellow" "pink" "aqua" "grass"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

ColorTest.txt

# Demonstrate the 16 standard colors from HTML 4.01 specification

s:Ge/Box01/Type     = "TsBox"
s:Ge/Box01/Parent   = "World"
s:Ge/Box01/Material = "G4_WATER"
d:Ge/Box01/HLX      = 1. cm
d:Ge/Box01/HLY      = 0.5 cm
d:Ge/Box01/HLZ      = 1. cm
d:Ge/Box01/TransY   = 16. cm
s:Ge/Box01/DrawingStyle = "Solid"
s:Ge/Box01/Color    = "White"

s:Ge/Box02/Type     = "TsBox"
s:Ge/Box02/Parent   = "World"
s:Ge/Box02/Material = "G4_WATER"
d:Ge/Box02/HLX      = 1. cm
d:Ge/Box02/HLY      = 0.5 cm
d:Ge/Box02/HLZ      = 1. cm
d:Ge/Box02/TransY   = 15. cm
s:Ge/Box02/DrawingStyle = "Solid"
s:Ge/Box02/Color    = "Silver"

s:Ge/Box03/Type     = "TsBox"
s:Ge/Box03/Parent   = "World"
s:Ge/Box03/Material = "G4_WATER"
d:Ge/Box03/HLX      = 1. cm
d:Ge/Box03/HLY      = 0.5 cm
d:Ge/Box03/HLZ      = 1. cm
d:Ge/Box03/TransY   = 14. cm
s:Ge/Box03/DrawingStyle = "Solid"
s:Ge/Box03/Color    = "Gray"

s:Ge/Box04/Type     = "TsBox"
s:Ge/Box04/Parent   = "World"
s:Ge/Box04/Material = "G4_WATER"
d:Ge/Box04/HLX      = 1. cm
d:Ge/Box04/HLY      = 0.5 cm
d:Ge/Box04/HLZ      = 1. cm
d:Ge/Box04/TransY   = 13. cm
s:Ge/Box04/DrawingStyle = "Solid"
s:Ge/Box04/Color    = "Black"

s:Ge/Box05/Type     = "TsBox"
s:Ge/Box05/Parent   = "World"
s:Ge/Box05/Material = "G4_WATER"
d:Ge/Box05/HLX      = 1. cm
d:Ge/Box05/HLY      = 0.5 cm
d:Ge/Box05/HLZ      = 1. cm
d:Ge/Box05/TransY   = 12. cm
s:Ge/Box05/DrawingStyle = "Solid"
s:Ge/Box05/Color    = "Red"

s:Ge/Box06/Type     = "TsBox"
s:Ge/Box06/Parent   = "World"
s:Ge/Box06/Material = "G4_WATER"
d:Ge/Box06/HLX      = 1. cm
d:Ge/Box06/HLY      = 0.5 cm
d:Ge/Box06/HLZ      = 1. cm
d:Ge/Box06/TransY   = 11. cm
s:Ge/Box06/DrawingStyle = "Solid"
s:Ge/Box06/Color    = "Maroon"

s:Ge/Box07/Type     = "TsBox"
s:Ge/Box07/Parent   = "World"
s:Ge/Box07/Material = "G4_WATER"
d:Ge/Box07/HLX      = 1. cm
d:Ge/Box07/HLY      = 0.5 cm
d:Ge/Box07/HLZ      = 1. cm
d:Ge/Box07/TransY   = 10. cm
s:Ge/Box07/DrawingStyle = "Solid"
s:Ge/Box07/Color    = "Yellow"

s:Ge/Box08/Type     = "TsBox"
s:Ge/Box08/Parent   = "World"
s:Ge/Box08/Material = "G4_WATER"
d:Ge/Box08/HLX      = 1. cm
d:Ge/Box08/HLY      = 0.5 cm
d:Ge/Box08/HLZ      = 1. cm
d:Ge/Box08/TransY   = 9. cm
s:Ge/Box08/DrawingStyle = "Solid"
s:Ge/Box08/Color    = "Olive"

s:Ge/Box09/Type     = "TsBox"
s:Ge/Box09/Parent   = "World"
s:Ge/Box09/Material = "G4_WATER"
d:Ge/Box09/HLX      = 1. cm
d:Ge/Box09/HLY      = 0.5 cm
d:Ge/Box09/HLZ      = 1. cm
d:Ge/Box09/TransY   = 8. cm
s:Ge/Box09/DrawingStyle = "Solid"
s:Ge/Box09/Color    = "Lime"

s:Ge/Box10/Type     = "TsBox"
s:Ge/Box10/Parent   = "World"
s:Ge/Box10/Material = "G4_WATER"
d:Ge/Box10/HLX      = 1. cm
d:Ge/Box10/HLY      = 0.5 cm
d:Ge/Box10/HLZ      = 1. cm
d:Ge/Box10/TransY   = 7. cm
s:Ge/Box10/DrawingStyle = "Solid"
s:Ge/Box10/Color    = "Green"

s:Ge/Box11/Type     = "TsBox"
s:Ge/Box11/Parent   = "World"
s:Ge/Box11/Material = "G4_WATER"
d:Ge/Box11/HLX      = 1. cm
d:Ge/Box11/HLY      = 0.5 cm
d:Ge/Box11/HLZ      = 1. cm
d:Ge/Box11/TransY   = 6. cm
s:Ge/Box11/DrawingStyle = "Solid"
s:Ge/Box11/Color    = "Aqua"

s:Ge/Box12/Type     = "TsBox"
s:Ge/Box12/Parent   = "World"
s:Ge/Box12/Material = "G4_WATER"
d:Ge/Box12/HLX      = 1. cm
d:Ge/Box12/HLY      = 0.5 cm
d:Ge/Box12/HLZ      = 1. cm
d:Ge/Box12/TransY   = 5. cm
s:Ge/Box12/DrawingStyle = "Solid"
s:Ge/Box12/Color    = "Teal"

s:Ge/Box13/Type     = "TsBox"
s:Ge/Box13/Parent   = "World"
s:Ge/Box13/Material = "G4_WATER"
d:Ge/Box13/HLX      = 1. cm
d:Ge/Box13/HLY      = 0.5 cm
d:Ge/Box13/HLZ      = 1. cm
d:Ge/Box13/TransY   = 4. cm
s:Ge/Box13/DrawingStyle = "Solid"
s:Ge/Box13/Color    = "Blue"

s:Ge/Box14/Type     = "TsBox"
s:Ge/Box14/Parent   = "World"
s:Ge/Box14/Material = "G4_WATER"
d:Ge/Box14/HLX      = 1. cm
d:Ge/Box14/HLY      = 0.5 cm
d:Ge/Box14/HLZ      = 1. cm
d:Ge/Box14/TransY   = 3. cm
s:Ge/Box14/DrawingStyle = "Solid"
s:Ge/Box14/Color    = "Navy"

s:Ge/Box15/Type     = "TsBox"
s:Ge/Box15/Parent   = "World"
s:Ge/Box15/Material = "G4_WATER"
d:Ge/Box15/HLX      = 1. cm
d:Ge/Box15/HLY      = 0.5 cm
d:Ge/Box15/HLZ      = 1. cm
d:Ge/Box15/TransY   = 2. cm
s:Ge/Box15/DrawingStyle = "Solid"
s:Ge/Box15/Color    = "Fuchsia"

s:Ge/Box16/Type     = "TsBox"
s:Ge/Box16/Parent   = "World"
s:Ge/Box16/Material = "G4_WATER"
d:Ge/Box16/HLX      = 1. cm
d:Ge/Box16/HLY      = 0.5 cm
d:Ge/Box16/HLZ      = 1. cm
d:Ge/Box16/TransY   = 1. cm
s:Ge/Box16/DrawingStyle = "Solid"
s:Ge/Box16/Color    = "Purple"

b:Ge/World/Invisible  = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type       = "OpenGL"

b:Ts/PauseBeforeQuit  = "True"

FilterByCreatorProcess.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
sv:Gr/OnlyIncludeParticlesFromProcess = 2 "primary" "compt"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 300 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

FilterByEnergy.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
d:Gr/OnlyIncludeParticlesWithInitialKEAbove = 200. MeV

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 300 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

FilterByMomentum.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
d:Gr/OnlyIncludeParticlesWithInitialMomentumAbove = 200. MeV

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 300 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

FilterByOriginComponent.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
sv:Gr/OnlyIncludeParticlesFromComponent = 1 "Film2"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 300 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

FilterByParticleCharge.txt

# Demonstrates changing color scheme of trajectories.
# Trajectories are colored based on the process that created the trajectory.

s:Ge/Box/Type       = "TsBox"
s:Ge/Box/Parent     = "World"
s:Ge/Box/Material   = "G4_WATER"
d:Ge/Box/HLX        = 4. m
d:Ge/Box/HLY        = 4. m
d:Ge/Box/HLZ       = .4 m
d:Ge/Box/TransX     = 0. m
d:Ge/Box/TransY     = 0. m
d:Ge/Box/TransZ    = -3. m
d:Ge/Box/RotX       = 0. deg
d:Ge/Box/RotY       = 0. deg
d:Ge/Box/RotZ       = 0. deg

s:Ge/Outer/Type     = "TsBox"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "G4_AIR"
d:Ge/Outer/HLX     = 3.2 m
d:Ge/Outer/HLY     = 3.2 m
d:Ge/Outer/HLZ     = 2. m
d:Ge/Outer/TransX   = 0. m
d:Ge/Outer/TransY   = 0. m
d:Ge/Outer/TransZ  = 1. m
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Outer"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
d:Ge/Film1/TransX   = 0. m
d:Ge/Film1/TransY   = 0. m
d:Ge/Film1/TransZ   = 1. m
d:Ge/Film1/RotX     = 0. deg
d:Ge/Film1/RotY     = 0. deg
d:Ge/Film1/RotZ     = 0. deg
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Film2/Type     = "TsBox"
s:Ge/Film2/Parent   = "Outer"
s:Ge/Film2/Material = "G4_WATER"
d:Ge/Film2/HLX      = 3. m
d:Ge/Film2/HLY      = 3. m
d:Ge/Film2/HLZ      = .1 m
d:Ge/Film2/TransX   = 0. m
d:Ge/Film2/TransY   = 0. m
d:Ge/Film2/TransZ   = -1. m
d:Ge/Film2/RotX     = 0. deg
d:Ge/Film2/RotY     = 0. deg
d:Ge/Film2/RotZ     = 0. deg

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
sv:Gr/OnlyIncludeParticlesCharged = 2 "Negative" "Positive" # "Neutral"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 300 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"
Ts/UseQt = "False"

NanoMeterScaleTest.txt

# This example demonstrates an issue that occurs when there
# is a very large zoom factor and how to work around that issue.
# You will see that the display is not exactly centered on the
# desired component, and that, if you try to adjust the Theta or Phi,
# the change is not smooth but instead has discontinuities.
# The issue is resolved if one makes the world invisible,
# as this means the initial extent of the displayed scene only
# contains the nm scale components, so little or no zoom is required.

d:Ge/World/HLX      = 20. cm
d:Ge/World/HLY      = 20. cm
d:Ge/World/HLZ      = 20. cm
#b:Ge/World/Invisible = "True" # Uncomment to solve zoom issue

s:Ge/CenterBox/Type     = "TsBox"
s:Ge/CenterBox/Material = "Air"
s:Ge/CenterBox/Parent   = "World"
d:Ge/CenterBox/HLX      = 2.5 nm
d:Ge/CenterBox/HLY      = 2. nm
d:Ge/CenterBox/HLZ      = 1. nm
s:Ge/CenterBox/Color = "White"

s:Ge/PlusXBox/Type     = "TsBox"
s:Ge/PlusXBox/Material = "Air"
s:Ge/PlusXBox/Parent   = "World"
d:Ge/PlusXBox/HLX      = 2.5 nm
d:Ge/PlusXBox/HLY      = 2. nm
d:Ge/PlusXBox/HLZ      = 1. nm
d:Ge/PlusXBox/TransX   = 10. nm
s:Ge/PlusXBox/Color = "Blue"

s:Ge/PlusYBox/Type     = "TsBox"
s:Ge/PlusYBox/Material = "Air"
s:Ge/PlusYBox/Parent   = "World"
d:Ge/PlusYBox/HLX      = 2.5 nm
d:Ge/PlusYBox/HLY      = 2. nm
d:Ge/PlusYBox/HLZ      = 1. nm
d:Ge/PlusYBox/TransY   = 10. nm
s:Ge/PlusYBox/Color = "Red"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type             = "OpenGL"
uv:Gr/ViewA/Scale = 3 1000 1000 1000 # Comment out to solve zoom issue
u:Gr/ViewA/Zoom = 40000 # Comment out to solve zoom issue
d:Gr/ViewA/Theta       = 45. deg
d:Gr/ViewA/Phi         = 45. deg

s:Gr/ViewA/CenterOn = "PlusYBox"

b:Ts/PauseBeforeQuit = "True"

QtTest.txt

# Qt example.
# Parameters marked Changeable with the "c:" syntax appear in GUI

s:Ge/MyBox/Type     = "TsBox"
sc:Ge/MyBox/Material = "G4_WATER"
s:Ge/MyBox/Parent   = "World"
dc:Ge/MyBox/HLX      = 1.5 m
dc:Ge/MyBox/HLY      = 1. m
dc:Ge/MyBox/HLZ      = 1. m
dc:Ge/MyBox/TransX   = 0. m
dc:Ge/MyBox/TransY   = 0. m
dc:Ge/MyBox/TransZ   = 1.5 m
dc:Ge/MyBox/RotX     = 0. deg
dc:Ge/MyBox/RotY     = 0. deg
dc:Ge/MyBox/RotZ     = 0. deg
ic:Ge/MyBox/XBins    = 1
ic:Ge/MyBox/YBins    = 1
ic:Ge/MyBox/ZBins    = 1
sc:Ge/MyBox/Color    = "blue"
sc:Ge/MyBox/DrawingStyle = "WireFrame"
bc:Ge/MyBox/Invisible = "False"

s:So/Therapy/Type                     = "Beam"
sc:So/Therapy/Component                = "BeamPosition"
sc:So/Therapy/BeamParticle             = "e-"
dc:So/Therapy/BeamEnergy               = 169.23 MeV
uc:So/Therapy/BeamEnergySpread         = 0.757504
sc:So/Therapy/BeamPositionDistribution = "Gaussian"
sc:So/Therapy/BeamPositionCutoffShape  = "Ellipse"
dc:So/Therapy/BeamPositionCutoffX      = 10. cm
dc:So/Therapy/BeamPositionCutoffY      = 10. cm
dc:So/Therapy/BeamPositionSpreadX      = 0.65 cm
dc:So/Therapy/BeamPositionSpreadY      = 0.65 cm
sc:So/Therapy/BeamAngularDistribution  = "Gaussian"
dc:So/Therapy/BeamAngularCutoffX       = 90. deg
dc:So/Therapy/BeamAngularCutoffY       = 90. deg
dc:So/Therapy/BeamAngularSpreadX       = 0.0032 rad
dc:So/Therapy/BeamAngularSpreadY       = 0.0032 rad
ic:So/Therapy/NumberOfHistoriesInRun   = 10

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Gr/ViewA/Type              = "OpenGL"

Ts/UseQt = "True"

SolidSphere.txt

# Demonstrate effect of drawing style and hidden line removal

s:Ge/Sphere/Type         = "TsSphere"
s:Ge/Sphere/Parent       = "World"
s:Ge/Sphere/Material     = "G4_WATER"
d:Ge/Sphere/RMin         = 0. m
d:Ge/Sphere/RMax         = 2. m
d:Ge/Sphere/SPhi         = 0. deg
d:Ge/Sphere/DPhi         = 360. deg
d:Ge/Sphere/STheta       = 0. deg
d:Ge/Sphere/DTheta       = 180. deg
d:Ge/Sphere/TransX       = 0. m
d:Ge/Sphere/TransY       = 0. m
d:Ge/Sphere/TransZ       = 0. m
d:Ge/Sphere/RotX         = 0. deg
d:Ge/Sphere/RotY         = 0. deg
d:Ge/Sphere/RotZ         = 0. deg
s:Ge/Sphere/DrawingStyle = "Solid"

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0
d:Gr/MyOGL/Theta       = 30. deg
d:Gr/MyOGL/Phi         = 30. deg
u:Gr/MyOGL/Zoom        = 3.
s:Gr/MyOGL/ColorBy     = "particletype"
b:Gr/MyOGL/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

b:Ts/PauseBeforeQuit = "True"

TestGraphics.txt

# Demonstrates a variety of Graphics options

s:Ge/Box/Type         = "TsBox"
s:Ge/Box/Parent       = "World"
s:Ge/Box/Material     = "G4_WATER"
d:Ge/Box/HLX          = 1. m
d:Ge/Box/HLY          = 1. m
d:Ge/Box/HLZ          = .4 m
s:Ge/Box/DrawingStyle = "Solid"

s:Gr/MyOGL/Type                             = "OpenGL"
b:Gr/MyOGL/CopyOpenGLToEPS                  = "True"
i:Gr/MyOGL/WindowSizeX                      = 600
i:Gr/MyOGL/WindowSizeY                      = 600
i:Gr/MyOGL/WindowPosX                       = 0
i:Gr/MyOGL/WindowPosY                       = 0
u:Gr/MyOGL/Zoom                             = 3.
d:Gr/MyOGL/Theta                            = 30. deg
d:Gr/MyOGL/Phi                              = 30. deg
b:Gr/MyOGL/IncludeGeometry                  = "t"
b:Gr/MyOGL/IncludeTrajectories              = "t"
b:Gr/MyOGL/HiddenLineRemovalForGeometry     = "f"
b:Gr/MyOGL/HiddenLineRemovalForTrajectories = "f"

# ColorBy options are "Charge", "ParticleType", "OriginComponent", "Energy",
# "Momentum", "Generation" and  "CreatorProcess"
s:Gr/MyOGL/ColorBy                       = "particletype"
sv:Gr/MyOGL/ColorByChargeColors          = 3 "red" "red" "red"
sv:Gr/MyOGL/ColorByParticleTypeNames     = 2 "proton" "e-"
sv:Gr/MyOGL/ColorByParticleTypeColors    = 2 "red" "green"
sv:Gr/MyOGL/ColorByOriginComponentNames  = 2 "World" "Box"
sv:Gr/MyOGL/ColorByOriginComponentColors = 2 "yellow" "red"
dv:Gr/MyOGL/ColorByEnergyRanges          = 4 .3 2. 100. 200. MeV
sv:Gr/MyOGL/ColorByEnergyColors          = 5 "red" "yellow" "green" "blue" "white"
dv:Gr/MyOGL/ColorByMomentumRanges        = 4 .3 2. 200. 646. MeV
sv:Gr/MyOGL/ColorByMomentumColors        = 5 "red" "yellow" "green" "blue" "white"
sv:Gr/MyOGL/ColorByCreatorProcessNames   = 5 "eBrem" "annihil" "Decay" "eIoni" "hIoni"
sv:Gr/MyOGL/ColorByCreatorProcessColors  = 5 "red" "green" "blue" "yellow" "magenta"

s:Gr/MyHepRep/Type     = "HepRep"
s:Gr/MyHepRep/FileName = "Above200MeV"

#s:Gr/MyVRML/Type = "VRML"

#s:Gr/MyRayTracer/Type = "RayTracer"

#s:Gr/MyRayTracerX/Type = "RayTracerX"
i:Gr/MyRayTracerX/WindowSizeX = 200
i:Gr/MyRayTracerX/WindowSizeY = 800
i:Gr/MyRayTracerX/WindowPosX  = 100
i:Gr/MyRayTracerX/WindowPosY  = 300

#s:Gr/MyDAWN/Type = "DAWN"

s:Gr/RefreshEvery = "Run"
#sv:Gr/OnlyIncludeParticlesNamed = 1 "proton"
#sv:Gr/OnlyIncludeParticlesCharged = 1 "negative neutral"
d:Gr/OnlyIncludeParticlesWithInitialKEAbove = 199. MeV
d:Gr/OnlyIncludeParticlesWithInitialKEBelow = 202. MeV
#sv:Gr/OnlyIncludeParticlesFromProcess = 1 "eBrem"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 200. MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

TwoProjections.txt

# Demonstrate two different kinds of graphical projections.

s:Gr/MyOGLa/Type        = "OpenGL"
i:Gr/MyOGLa/WindowSizeX = 400
i:Gr/MyOGLa/WindowSizeY = 400
i:Gr/MyOGLa/WindowPosX  = 0
i:Gr/MyOGLa/WindowPosY  = 0
s:Gr/MyOGLa/Projection  = "Orthogonal"
d:Gr/MyOGLa/Theta       = 45. deg
d:Gr/MyOGLa/Phi         = 45. deg

s:Gr/MyOGLb/Type             = "OpenGL"
i:Gr/MyOGLb/WindowSizeX      = 400
i:Gr/MyOGLb/WindowSizeY      = 400
i:Gr/MyOGLb/WindowPosX       = 0
i:Gr/MyOGLb/WindowPosY       = 400
s:Gr/MyOGLb/Projection       = "Perspective"
d:Gr/MyOGLb/PerspectiveAngle = 10. deg
d:Gr/MyOGLb/Theta            = 45. deg
d:Gr/MyOGLb/Phi              = 45. deg

s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Parent   = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX      = 1. m
d:Ge/Box/HLY      = 1. m
d:Ge/Box/HLZ      = .4 m
d:Ge/Box/TransX   = 0. m
d:Ge/Box/TransY   = 0. m
d:Ge/Box/TransZ   = 0. m
d:Ge/Box/RotX     = 0. deg
d:Ge/Box/RotY     = 0. deg
d:Ge/Box/RotZ     = 0. deg

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 200. MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

MVLinac

Linear Accelerator Treatment Head Simulation

This example is intended for both demonstration purposes and to provide an excellent starting point for simulation of most the treatment head of most any linear accelerator (linac) used in radiotherapy. A Siemens Oncor treatment head is simulated. The co-ordinate systems, shown in the figure below, are in compliance with IEC 61217. Note that the use of directional bremsstrahlung splitting and other variance reduction techniques (VRTs), essential for efficient simulation, requires a gantry angle of zero degrees; that is, the region used to specify the preferred bremsstrahlung direction is positioned along (ZW), the Z axis in the Geant4 world co-ordinate system.

_images/TOPAS_IEC.png

Co-ordinate systems compliant with IEC 61217, used in the linac example.

The relationship between the Geant4 world coordinate system and the IEC fixed, gantry, beam limiting device and patient support coordinate systems is shown in the above diagram. The machine isocenter is at the origin of the world and IEC co-ordinate systems, coinciding with the intersection of the axes of rotation of the collimator and gantry (discounting gantry sag, wobble in the gantry and collimator bearings, etc.). The Geant4 world coordinates in black (XW, YW, ZW) coincide with the IEC fixed coordinates in red (Xf, Yf, Zf). The IEC gantry coordinates in green (Xg, Yg, Zg) provide for gantry rotation about Yg(coincident with Yf), in the sense of Zfto Xf. The IEC beam limiting device coordinates in purple (Xb, Yb, Zb) provide for collimator rotation about Zb(coincident with Zg), in the sense of Xb to Yb. The IEC patient support coordinates in orange (Xs, Ys, Zs) provide for couch rotation about Zs(coincident with Zf), in the sense of Xs to Ys.

The material and geometry of the exit window, target and monitor chamber are from Jabbari et al, “Monte Carlo simulation of Siemens ONCOR linear accelerator with BEAMnrc and DOSXYnrc code,” J Med Signals & Sensors, 3(3):172-9, 2013. The source details and the rest of the geometry are from Sawkey and Faddegon, “Simulation of large x-ray fields using independently measured source and geometry details,” Med Phys 36(12):5622-32 and references therein, supplemented with direct measurement. The latter publication provides our recommended procedure for accurate simulation of linac x-ray beams. For electron beams, refer to Tuathan P O’Shea, Daren L Sawkey, Mark J Foley, Bruce A Faddegon, “Monte Carlo commissioning of clinical electron beams using large field measurements,” Phys. Med. Biol. 55:4083–4105, 2010, PMID: 20601775 and references therein. Another helpful reference is Ma et al, “Beam modeling and beam model commissioning for MC dose calculation based radiation therapy treatment planning - The AAPM Task Group 157 Report,” Med. Phys. 47 (1):e1-e18, 2020.

The position of each major component in the treatment head is provided by the user as the distance from the nominal target position to the upstream surface of the component. The nominal target position is at a distance of the source-axis distance (SAD) from the machine isocenter along Zf. The major components are the exit window, target, primary collimator, flattening filter, monitor chamber, mirror, a pair of asymmetric jaws and opposing banks of a doubly diverging multi-leaf collimator (MLC). The axis of travel of the jaws and MLC is specified as either Xb or Yb. The distance of travel is specified as the field size setting or MLC leaf position setting; that is, the position of the jaw or MLC leaf as projected to the plane containing the isocenter and perpendicular to the gantry rotation axis Zg. These are the setting generally given in the planning system or at the treatment machine.

The full set of parameter control files provided with the linac example are shown in the figure below. Three distinctly separate simulations are provided in MainTxHead.txt through the selection of one and only onee of FullTxHead.txt, FixedTxHead.txt or Field.txt. The file selection in the TOPAS distribution is FullTxHead.txt. This file is used for simulation of the full treatment head. In this case, the TOPAS GUI is set to be used to observe particles traversing the treatment head from the electron source upstream of the exit window, through the fixed positions (shown in blue) and variable portions (shown in red) of the treatment head, into a water box. Changeable parameters are available in the GUI to observe their effect on the simulation.

_images/ParameterControlFiles.png

Filenames of the parameter control files comprising the TOPAS linac example (filetype .txt). Parameter values set in files to the left override those in files to the right. For example, patient-specific field settings for the gantry and collimator angles and the jaw and MLC leaf positions contained in the full treatment head simulation includeFile FullTxHead.txt and the Field.txt includeFile override the settings in the component includeFile files Jaws.txt and MLC.txt. Two flattening filters are provided, Flattener6MV.txt and Flattener18MV.txt. Files for scoring beam quantities and dose are provided.

The following command makes the assumption that your TOPAS executable resides in /Applications/topas/bin/topas. To begin the simulation from the command line in your terminal window, change the directory to the directory containing the parameter control files for the linac example, and enter the following from the command line:

/Applications/topas/bin/topas MainTxHead.txt

It is common practice to generate phase-space data along a plane situated between the fixed and movable portions of the treatment head for all energies and beam types (x-rays with or without flattening filter, electrons) available on the linac and to use the stored phase-space data for field-dependent simulations. The full treatment head simulation may be broken into two parts for this purpose: the fixed portion of the treatment head upstream of the jaws, and the field portion of the treatment head for simulation with patient-specific field settings. In this example, the fixed portion is used to generate a phase-space file containing the energy, position and direction of all particles that reach the Scoring Plane positioned, as shown in the figure, just upstream of the jaws. The field portion consists of an asymmetric pair of jaws and an MLC. The particle source for these field-dependent simulations is the phase-space file generated from the fixed treatment head simulation. Long runs may be done in the fixed portion to record a sufficient number of x-rays in phase space files for high precision runs in the field portion, without repeating simulation of the fixed portion. An important advantage of pre-calculated phase-space files is to provide confidence in the accuracy of the results calculated with this source data, such as dose distributions, as this can be pre-determined through a commissioning procedure with simulations covering the clinical range of field size, source-to-surface distance, and so on.

Two additional parameter control files are provided for this purpose: FixedTxHead.txt and Field.txt. In order to run the simulation with FixedTxHead.txt, edit MainTxHead.txt to comment out the line #include FullTxHead.txt by adding the comment character “#” at the start of the line and remove the comment character from the line #include FixedTxHead.txt. Then, enter the same command on the command line as used previously:

/Applications/topas/bin/topas MainTxHead.txt

This time the TOPAS GUI will not be initiated, but instead a large number of histories will be run. Uniform bremsstrahlung splitting, a VRT to improve calculation efficiency, will be utilized to generate a phase-space file with a large number of source particles for the field-dependent portion of the simulation.

Once this simulation is complete, in order to run the simulation with Field.txt, edit MainTxHead.txt to comment out the line include FixedTxHead.txt and remove the comment character # from the line #include Field.txt. Then, enter the same command on the command line as used previously, this time to run the variable field portion of the treatment head simulation:

/Applications/topas/bin/topas MainTxHead.txt

Again, the TOPAS GUI will not be initiated. All of the particles in the phase space from the fixed portion of the simulation will be run for the field-dependent portion of the simulation and a dose distribution will be scored in a water phantom positioned with its surface at the SAD.

The following include files are available in MainTxHead.txt. Only one of these should be selected at a time:

  1. FullTxHead.txt: Simulation of the full treatment head from the electron source position in vacuum through the fixed and variable portions of the treatment head, into a water box, with the water surface coinciding with the machine isocenter. While a few parameters are set in FullTxHead.txt, most are set in the component includeFile files. Simulation parameter values in these files may be changed, for example, to simulate a treatment head from a different vendor. Parameters set in FullTxHead.txt include graphics parameters, the random number seed, the SAD, and the electron source details of mean energy and peak width, width of the angular distribution, and spot size. The TOPAS GUI is set to display the linac and run the simulation.
  2. FixedTxHead.txt: Simulation of the fixed components of the linac, with phase-space scored on a plane perpendicular to the primary collimator axis just upstream of the jaws. Uniform bremsstrahlung splitting variance reduction is used to improve the efficiency of the simulation. The parameter file is set to run a large number of histories without displaying the simulation. The electron source for the 6 MV Oncor x-ray beam is given by default. The electron source for the 18 MV Oncor x-ray beam is available, commented out. The Siemens Oncor flattener for the 18 MV x-ray beam is provided in Flattener18MV.txt (available as an includeFile in place of the Flattener6MV.txt includeFile).
  3. Field.txt: Simulation of a field with specified gantry and collimator angles, and jaw and MLC leaf positions. The parameter file is set to run the pre-recorded phase-space recorded from the second example (FixedTxHead.txt), without displaying the simulation. The phase-space is repeated multiple times to improve statistical precision.
  4. TestComponent.txt: This parameter control file is provided for users to easily display components in the TOPAS GUI separately or together, to visually see changes the user makes in the default parameters for each component, discussed next.

Additional parameter control files are used to set default parameter values for the fixed and variable components in the treatment head. In general, once set for a particular treatment machine, these parameters need not be changed again. Any field-specific settings can be changed in FullTxHead.txt or Field.txt. The parameter control files used to provide values for the parameters of the various fixed components are:

  1. Target.txt: Exit window and target.
  2. PrimaryCollimator.txt: Primary collimator.
  3. Flattener6MV.txt: Flattener for 6 MV x-ray beam. Comment out this includeFile to simulate an unflattened beam.
  4. Flattener18MV.txt: Flattener for 18 MV x-ray beam. Replace the Flattener6MV.txt includeFile with Flattener18MV.txt and change source parameter values as shown in FixedTxHead.txt to simulate an 18 MV flattened beam.
  5. Monitor.txt: Monitor chamber with mirror.

The parameter control files used to provide values for the parameters of the various field-dependent and patient-dependent components follow. Field.txt is provided to override field-dependent values set in these parameter control files.

  1. Jaws.txt: All jaw parameters.
  2. MLC.txt: All MLC parameters.
  3. WaterBox.txt: A simple one region water box used in FullTxHead.txt to display the water box with the TOPAS GUI. Use of a large number of regions (voxels) is discouraged when using the GUI, since this can take an inordinate amount of time to process and display.
  4. WaterPhantom.txt: A multi-voxel water phantom used in Field.txt to score dose distributions.
  5. LinacDefaults.txt: This file is required to provide default values of certain parameters to allow users to set preferred values of these parameters in higher level include files.
A set of parameter control files are provided to score information about the simulated beam on the scoring plane positioned just upstream of the jaws:
  1. ScorePhaseSpace.txt: Default in FixedTxHead.txt
  2. ScoreEnergyFluence.txt: An option is provided, for demonstration purposes, to score the spatial distribution of energy fluence in FixedTxHead.txt.
  3. ScoreEnergySpectrum.txt: An option is provided, for demonstration purposes, to score the energy spectrum in FixedTxHead.txt.

Field.txt

# Field.txt contains specific source and geometry parameters.
# The parameters settings in this file override parameter settings in the files in the
# includeFile statement below and in LinacDefaults.txt.
#
# Use this parameter control file to set field and patient specific parameters. 
# See Main.txt for additional documentation.
# 
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179
# References for electron source incident on x-ray target: 
#   Sawkey and Faddegon, Med Phys 36(3):698-707 (2009)
#   Sawkey and Faddegon, Med Phys 36(12):5622-32 (2009)
# The beam angular divergence from the 36(3) reference is for the manufacture specified 
# water cooling channel thickness.

########################## Key Parameters In Field.txt ###############################
# Parameters marked with "^" are set to be changeable in the TOPAS GUI
# Geometry parameters for one field, including...
# SAD: Source axis distance (distance from nominal source position to isocenter)
# ^IEC_G/RotY_G: IEC gantry rotation angle
# ^IEC_B/RotZ_B: IEC secondary collimator (jaw and MLC) rotation angle
# JawTravelAxis: Direction of jaw travel, along IEC_B axis Xb or Yb
# LeafTravelAxis: Direction of leaf travel, along IEC_B axis Xb or Yb
# ^NegativeFieldSetting: Jaw or MLC leaf position on negative side, projected to isocenter
# ^PositiveFieldSetting: Jaw or MLC leaf position on positive side, projected to isocenter
# LeafWidths: Width of each leaf as projected to isocenter, same width on opposing bank
#
# Source parameters, including...
# BeamEnergySpread: Standard deviation of energy spread in percent 
# NumberOfHistoriesInRun: Total number of source particles to run for simulation
# ShowHistoryCountAtInterval: Number of histories between report of histories run
# Bremsstrahlung splitting used for variance reduction - see user manual
######################################################################################

includeFile = Jaws.txt MLC.txt WaterPhantom.txt  

# Graphics
# Use Gr/Enable to show geometry for a few histories, otherwise set "False" 
#b:Gr/Enable                                  = "True"
b:Gr/Enable                                   = "False"
# Use Ts/UseQT to start TOPAS GUI for a few histories, otherwise set "False" 
#b:Ts/UseQT                                   = "True"
b:Ts/UseQT                                    = "False"

# Random number seed for simulation of this field
i:Ts/Seed                                     = 10

# SAD: Source axis distance (nominal distance from x-ray target to gantry rotation axis)
d:Ge/SAD				      = 100. cm

# Source just upstream of beam limiting devices (jaws, MLC)
s:So/MySource/Type                            = "PhaseSpace"
s:So/MySource/Component                       = "IEC_G"
s:So/MySource/PhaseSPaceFileName              = "PhaseSpaceFixed"
b:So/MySource/PhaseSpaceIncludeEmptyHistories = "True"

i:Ts/ShowHistoryCountAtInterval               = 100000

# Linac geometry field-dependent components
# IEC gantry rotation angle (in the opposite sense of RotY)
dc:Ge/IEC_G/RotY_G                           = 0. deg
d:Ge/IEC_G/RotY                              = -1 * Ge/IEC_G/RotY_G deg

# IEC collimator rotation angle (in the same sense of RotZ)
dc:Ge/IEC_B/RotZ_B                           = 0. deg
d:Ge/IEC_B/RotZ                              = 1 * Ge/IEC_B/RotZ_B deg 

# Asymmetric jaw field settings along IEC coordinates Xb or Yb, projected to isocenter
s:Ge/Jaw/JawTravelAxis                        = "Y" # Jaw travel axis, "X" or "Y"
dc:Ge/Jaw/NegativeFieldSetting                = -20. cm
dc:Ge/Jaw/PositiveFieldSetting                = 20. cm

# MLC leaf widths and positions, projected to isocenter
s:Ge/MLC/LeafTravelAxis                       = "X" # MLC leaf travel "X" or "Y"
dv:Ge/MLC/LeafWidths = 42 5. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 5. cm
# 10 cm x 20 cm field, the field setting for each leaf is that as projected at isocenter
dv:Ge/MLC/NegativeFieldSetting = 42 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. cm
dv:Ge/MLC/PositiveFieldSetting = 42 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. cm

# Patient and couch field-dependent components
# IEC couch rotation angle (in the opposite sense of RotZ)
dc:Ge/IEC_S/RotZ_S                           = 0.0 deg
d:Ge/IEC_S/RotZ                              = -1 * Ge/IEC_S/RotZ_S deg

FixedTxHead.txt

# Field.txt contains specific source and geometry parameters.
# The parameters settings in this file override parameter settings in the files in the
# includeFile statement below and in LinacDefaults.txt.
#
# Use this parameter control file to set field and patient specific parameters. 
# See Main.txt for additional documentation.
#
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179
# References for electron source incident on x-ray target: 
#   Sawkey and Faddegon, Med Phys 36(3):698-707 (2009)
#   Sawkey and Faddegon, Med Phys 36(12):5622-32 (2009)
# The beam angular divergence from the 36(3) reference is for the manufacture specified 
# water cooling channel thickness.

########################## Key Parameters In Field.txt ###############################
# Parameters marked with "^" are set to be changeable in the TOPAS GUI
# Geometry parameters for one field, including...
# SAD: Source axis distance (distance from nominal source position to isocenter)
# ^Pos: Distance along beam axis Zg from nominal target position (SAD from isocenter)
# TransZ: Position of center of object along Zg
#
# Source parameters, including...
# BeamEnergySpread: Standard deviation of energy spread in percent 
# NumberOfHistoriesInRun: Total number of source particles to run for simulation
# ShowHistoryCountAtInterval: Number of histories between report of histories run
# Uniform bremsstrahlung splitting used for variance reduction - see user manual
######################################################################################

# Linac treatment head components
includeFile = Target.txt PrimaryCollimator.txt Monitor.txt 

#Choose one flattening filter, commment out the others (choose appropriate ElectronSource)
includeFile = Flattener6MV.txt #6MV flattening filter
#includeFile = Flattener18MV.txt #18 MV flattening filter

# For scoring, choose one of the following, comment out the others: 
# 1. Phase-space, 2. spatial distribution of energy fluence, or 3. energy spectrum
includeFile = ScorePhaseSpace.txt
#includeFile = ScoreEnergyFluence.txt
#includeFile = ScoreEnergySpectrum.txt

# Graphics
# Use Gr/Enable to show geometry for a few histories, otherwise set "False" 
#b:Gr/Enable                                         = "True"
b:Gr/Enable                                          = "False"
# Use Ts/UseQT to start TOPAS GUI for a few histories, otherwise set "False" 
#b:Ts/UseQT                                          = "True"
b:Ts/UseQT                                           = "False"

# Random number seed for simulation of this field
i:Ts/Seed                                            = 10

# SAD: Source axis distance (nominal distance from x-ray target to gantry rotation axis)
d:Ge/SAD				             = 100. cm

# Source at exit window
# Parent is the gantry with coordinates IEC_G (see Main.txt)
s:Ge/BeamPosition/Parent                             = "IEC_G"
dc:Ge/BeamPosition/Pos                               = -1.0 cm #In vacuum
d:Ge/BeamPosition/TransZ                             = Ge/SAD - Ge/BeamPosition/Pos cm

s:So/ElectronSource/Type                             = "Beam"
s:So/ElectronSource/Component                        = "BeamPosition"
s:So/ElectronSource/BeamParticle                     = "e-"

#Choose either the 6 MV or 18 MV parameter value to match the flattening filter chosen
d:So/ElectronSource/BeamEnergy                       = 6.51 MeV #6 MV Oncor
#d:So/ElectronSource/BeamEnergy                       = 13.94 MeV #18 MV Oncor
u:So/ElectronSource/BeamEnergySpread                 = 4.2 #10% FWHM 6 MV Oncor
#u:So/ElectronSource/BeamEnergySpread                 = 3.0 #7% FWHM 18 MV Oncor

#The following ElectronSource parameter values are the same for the 6 MV and 18 MV beams
s:So/ElectronSource/BeamPositionDistribution         = "Gaussian"
s:So/ElectronSource/BeamPositionCutoffShape          = "Ellipse"
d:So/ElectronSource/BeamPositionCutoffX              = 1.2 mm     #2 standard deviations
d:So/ElectronSource/BeamPositionCutoffY              = 1.2 mm
d:So/ElectronSource/BeamPositionSpreadX              = 0.6 mm     #1.5 mm FWHM
d:So/ElectronSource/BeamPositionSpreadY              = 0.6 mm     #1.5 mm FWHM
s:So/ElectronSource/BeamAngularDistribution          = "None"

# Number of histories in run
ic:So/ElectronSource/NumberOfHistoriesInRun          = 10 * Ts/ShowHistoryCountAtInterval
i:Ts/ShowHistoryCountAtInterval                      = 10000

# Variance reduction with uniform bremsstrahlung splitting
b:Vr/UseVarianceReduction                            = "True"
b:Vr/ParticleSplit/Active                            = "True"
s:Vr/ParticleSplit/Type                              = "secondarybiasing"
sv:Vr/ParTicleSplit/ForRegion/target/processesNamed  = 1 "eBrem"
uv:Vr/ParticleSplit/ForRegion/target/SplitNumber     = 1  100.0
dv:Vr/ParticleSplit/ForRegion/target/MaximumEnergies = 1  So/ElectronSource/BeamEnergy MeV 

Flattener6MV.txt

# Flattening filter for Siemens Oncor 6 MV x-ray beam
# Reference for geometry: Sawkey and Faddegon, Med Phys 36(12):5622-32, 2009
# 
###################### Key Parameters In Flattener6MV.txt ############################
# Parameters set in another parameter control file...
# SAD: Source axis distance (distance from nominal source position to isocenter)
#
# Parameters available for adjustment...
# Pos: Distance along beam axis Zg from nominal target position (SAD from isocenter)
# RInner: Inner radius of HPolycone for each layer (Vector)
# ROuter: Outer radius of HPolycone for each layer (Vector)
# Z: Thickness for each layer (Vector)
#
# Parameters calculated from above parameters...
# TransZ: Position of center of object along Zg
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

# 6 MV Siemens Oncor flattening filter 
# Split into central portion 1 plus outer downstream portion 2

iv:Gr/Color/TransparentOrange       = 4 241 224   0 200

sv:Ma/StainlessSteel/Components     = 6 "Carbon" "Silicon" "Chromium" "Manganese" "Iron" "Nickel"  
uv:Ma/StainlessSteel/Fractions      = 6 .001 .007 .18 .01 .712 .09
d:Ma/StainlessSteel/Density         = 7.84 g/cm3 
s:Ma/StainlessSteel/DefaultColor    = "TransparentOrange"

s:Ge/FlatteningFilter1/Parent       = "IEC_G"
s:Ge/FlatteningFilter1/Type	    = "G4HPolycone"
s:Ge/FlatteningFilter1/Material     = "StainlessSteel"
d:Ge/FlatteningFilter1/Pos          = 7.91 cm
dv:Ge/FlatteningFilter1/RInner      = 9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 cm
dv:Ge/FlatteningFilter1/ROuter      = 9 0.127 0.302 0.33 0.907 1.384 2.776 2.776 1.758 1.471 cm 
dv:Ge/FlatteningFilter1/Z           = 9 0.0 -0.32 -0.371 -1.12 -1.666 -1.666 -1.768 -1.768 -2.093 cm 
d:Ge/FlatteningFilter1/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter1/Color        = "TransparentOrange"
s:Ge/FlatteningFilter1/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter2/Parent       = "IEC_G"
s:Ge/FlatteningFilter2/Type	    = "G4HPolycone"
s:Ge/FlatteningFilter2/Material     = "StainlessSteel"
dv:Ge/FlatteningFilter2/RInner      = 2 1.859 2.045 cm
dv:Ge/FlatteningFilter2/ROuter      = 2 2.776 2.776 cm 
dv:Ge/FlatteningFilter2/Z           = 2 -1.768 -2.174 cm 
d:Ge/FlatteningFilter2/Pos          = 7.91 cm
d:Ge/FlatteningFilter2/TransZ       = Ge/SAD - Ge/FlatteningFilter2/Pos cm 
s:Ge/FlatteningFilter2/Color        = "Grey"
s:Ge/FlatteningFilter2/DrawingStyle = "Solid" 

Flattener18MV.txt

# Flattening filter for Siemens Oncor 18 MV x-ray beam
# Reference for geometry: Sawkey and Faddegon, Med Phys 36(12):5622-32, 2009

###################### Key Parameters In Flattener6MV.txt ############################
# Parameters set in another parameter control file...
# SAD: Source axis distance (distance from nominal source position to isocenter)
#
# Parameters available for adjustment...
# Pos: Distance along beam axis Zg from nominal target position (SAD from isocenter)
# RInner: Inner radius of HPolycone for each layer (Vector)
# ROuter: Outer radius of HPolycone for each layer (Vector)
# Z: Thickness for each layer (Vector)
#
# Parameters calculated from above parameters...
# TransZ: Position of center of object along Zg
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

# 18 MV Siemens Oncor flattening filter
# Split into 9 separate parts: Part 1 fits extends into the collimator


iv:Gr/Color/TransparentOrange      = 4 241 224   0 200
d:Ge/Flattener/Pos                 = 4.87 cm # **** Jose had 4.856 cm ****

sv:Ma/StainlessSteel/Components    = 6 "Carbon" "Silicon" "Chromium" "Manganese" "Iron" "Nickel"  
uv:Ma/StainlessSteel/Fractions     = 6 .001 .007 .18 .01 .712 .09
d:Ma/StainlessSteel/Density        = 7.84 g/cm3 
s:Ma/StainlessSteel/DefaultColor   = "TransparentOrange"

s:Ge/FlatteningFilter1/Parent       = "IEC_G"
s:Ge/FlatteningFilter1/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter1/Material     = "StainlessSteel"
d:Ge/FlatteningFilter1/Pos          = Ge/Flattener/Pos cm
dv:Ge/FlatteningFilter1/RInner      = 10 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 cm
dv:Ge/FlatteningFilter1/ROuter      = 10 0.14 0.203 0.267 0.293 0.673 0.686 0.894 1.125 1.354 1.384 cm 
dv:Ge/FlatteningFilter1/Z           = 10 0.0 -0.279 -0.533 -0.622 -1.928 -1.969 -2.64 -3.316 -3.994 -4.032 cm 
d:Ge/FlatteningFilter1/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter1/Color        = "TransparentOrange"
s:Ge/FlatteningFilter1/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter2/Parent       = "IEC_G"
s:Ge/FlatteningFilter2/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter2/Material     = "StainlessSteel"
d:Ge/FlatteningFilter2/Pos          = Ge/Flattener/Pos cm
dv:Ge/FlatteningFilter2/RInner      = 11 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 cm
dv:Ge/FlatteningFilter2/ROuter      = 11 0.653 0.59 0.502 0.419 0.347 0.306 0.278 0.216 0.186 0.166 0.149 cm 
dv:Ge/FlatteningFilter2/Z           = 11 -4.032 -4.037 -4.062 -4.11 -4.181 -4.247 -4.323 -4.572 -4.661 -4.725 -4.776 cm 
d:Ge/FlatteningFilter2/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter2/Color        = "TransparentOrange"
s:Ge/FlatteningFilter2/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter3/Parent       = "IEC_G"
s:Ge/FlatteningFilter3/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter3/Material     = "StainlessSteel"
d:Ge/FlatteningFilter3/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter3/RInner      = 11 0.653 0.715 0.803 0.886 0.958 1.009 1.068 1.259 1.328 1.377 1.403 cm
dv:Ge/FlatteningFilter3/ROuter      = 11 1.384 1.387 1.403 1.434 1.479 1.52 1.568 1.725 1.781 2.54 2.54 cm 
dv:Ge/FlatteningFilter3/Z           = 11 -4.032 -4.037 -4.062 -4.11 -4.181 -4.247 -4.323 -4.572 -4.661 -4.725 -4.776 cm 
d:Ge/FlatteningFilter3/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter3/Color        = "TransparentOrange"
s:Ge/FlatteningFilter3/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter4/Parent       = "IEC_G"
s:Ge/FlatteningFilter4/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter4/Material     = "StainlessSteel"
d:Ge/FlatteningFilter4/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter4/RInner      = 2 0.0 0.0 cm
dv:Ge/FlatteningFilter4/ROuter      = 2 0.149 0.107 cm 
dv:Ge/FlatteningFilter4/Z           = 2 -4.776 -4.906 cm 
d:Ge/FlatteningFilter4/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter4/Color        = "TransparentOrange"
s:Ge/FlatteningFilter4/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter5/Parent       = "IEC_G"
s:Ge/FlatteningFilter5/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter5/Material     = "StainlessSteel"
d:Ge/FlatteningFilter5/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter5/RInner      = 2 1.403 1.469 cm
dv:Ge/FlatteningFilter5/ROuter      = 2 1.885 1.818 cm 
dv:Ge/FlatteningFilter5/Z           = 2 -4.776 -4.906 cm 
d:Ge/FlatteningFilter5/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter5/Color        = "TransparentOrange"
s:Ge/FlatteningFilter5/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter6/Parent       = "IEC_G"
s:Ge/FlatteningFilter6/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter6/Material     = "StainlessSteel"
d:Ge/FlatteningFilter6/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter6/RInner      = 2 2.118 2.54 cm
dv:Ge/FlatteningFilter6/ROuter      = 2 2.169 2.54 cm 
dv:Ge/FlatteningFilter6/Z           = 2 -4.776 -4.906 cm 
d:Ge/FlatteningFilter6/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter6/Color        = "TransparentOrange"
s:Ge/FlatteningFilter6/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter7/Parent       = "IEC_G"
s:Ge/FlatteningFilter7/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter7/Material     = "StainlessSteel"
d:Ge/FlatteningFilter7/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter7/RInner      = 2 1.469 1.506 cm
dv:Ge/FlatteningFilter7/ROuter      = 2 1.818 1.781 cm 
dv:Ge/FlatteningFilter7/Z           = 2 -4.906 -4.98 cm 
d:Ge/FlatteningFilter7/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter7/Color        = "TransparentOrange"
s:Ge/FlatteningFilter7/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter8/Parent       = "IEC_G"
s:Ge/FlatteningFilter8/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter8/Material     = "StainlessSteel"
d:Ge/FlatteningFilter8/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter8/RInner      = 2 2.169 2.197 cm
dv:Ge/FlatteningFilter8/ROuter      = 2 2.54 2.54 cm 
dv:Ge/FlatteningFilter8/Z           = 2 -4.906 -4.98 cm 
d:Ge/FlatteningFilter8/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter8/Color        = "TransparentOrange"
s:Ge/FlatteningFilter8/DrawingStyle = "Solid" 

s:Ge/FlatteningFilter9/Parent       = "IEC_G"
s:Ge/FlatteningFilter9/Type	   = "G4HPolycone"
s:Ge/FlatteningFilter9/Material     = "StainlessSteel"
d:Ge/FlatteningFilter9/Pos          = Ge/Flattener/Pos  cm
dv:Ge/FlatteningFilter9/RInner      = 2 0.0 0.0 cm
dv:Ge/FlatteningFilter9/ROuter      = 2 2.54 2.54 cm 
dv:Ge/FlatteningFilter9/Z           = 2 -4.98 -5.147 cm 
d:Ge/FlatteningFilter9/TransZ       = Ge/SAD - Ge/FlatteningFilter1/Pos cm 
s:Ge/FlatteningFilter9/Color        = "TransparentOrange"
s:Ge/FlatteningFilter9/DrawingStyle = "Solid" 

FullTxHeadField.txt

# FullTxHeadField.txt contains parameter values for a specific source and geometry
# in this example, a 6 MV Siemens Oncor x-ray beam.
#
# The parameters settings in this file override parameter settings in the files in the
# includeFile statement below and in LinacDefaults.txt.
#
# Use this parameter control file to set field and patient specific parameters. 
# See Main.txt for additional documentation.
#
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179
# References for electron source incident on x-ray target: 
#   Sawkey and Faddegon, Med Phys 36(3):698-707 (2009)
#   Sawkey and Faddegon, Med Phys 36(12):5622-32 (2009)
# The beam angular divergence from the 36(3) reference is for the manufacture specified 
# water cooling channel thickness.

###################### Key Parameters In FullTxHeadField.txt ##########################
# Parameters marked with "^" are set to be changeable in the TOPAS GUI
# Source parameters, including...
# BeamEnergySpread: Standard deviation of energy spread in percent 
# NumberOfHistoriesInRun: Total number of source particles to run for simulation
# ShowHistoryCountAtInterval: Number of histories between report of histories run
#
# Geometry parameters for one field, including...
# SAD: Source axis distance (distance from nominal source position to isocenter)
# ^IEC_G/RotY_G: IEC gantry rotation angle
# ^IEC_B/RotZ_B: IEC secondary collimator (jaw and MLC) rotation angle
# ^IEC_S/RotZ_S: IEC Patient Couch rotation angle
# ^Pos: Distance along beam axis Zg from nominal target position (SAD from isocenter)
# TransZ: Position of center of object along Zg
# JawTravelAxis: Direction of jaw travel, along IEC_B axis Xb or Yb
# LeafTravelAxis: Direction of leaf travel, along IEC_B axis Xb or Yb
# ^NegativeFieldSetting: Jaw or MLC leaf position on negative side, projected to isocenter
# ^PositiveFieldSetting: Jaw or MLC leaf position on positive side, projected to isocenter
# LeafWidths: Width of each leaf as projected to isocenter, same width on opposing bank
######################################################################################

######################################################################################
# Source at exit window and fixed treatment head components follow...

includeFile = Target.txt PrimaryCollimator.txt Flattener6MV.txt Monitor.txt 

# Graphics
# Use Gr/Enable to show geometry for a few histories, otherwise set "False" 
b:Gr/Enable                                  = "True"
#b:Gr/Enable                                 = "False"
# Use Ts/UseQT to start TOPAS GUI for a few histories, otherwise set "False" 
b:Ts/UseQT                                   = "True"
#b:Ts/UseQT                                  = "False"

# Random number seed for simulation of this field
i:Ts/Seed                                    = 10

# Linac geometry fixed components
# SAD: Source axis distance (nominal distance from x-ray target to gantry rotation axis)
d:Ge/SAD				     = 100. cm

# Source at exit window
# Parent is the gantry with coordinates IEC_G (see Main.txt)
s:Ge/BeamPosition/Parent                     = "IEC_G"
dc:Ge/BeamPosition/Pos                       = -1.0 cm #In vacuum
d:Ge/BeamPosition/TransZ                     = Ge/SAD - Ge/BeamPosition/Pos cm

s:So/ElectronSource/Type                     = "Beam"
s:So/ElectronSource/Component                = "BeamPosition"
s:So/ElectronSource/BeamParticle             = "e-"
d:So/ElectronSource/BeamEnergy               = 6.51 MeV
u:So/ElectronSource/BeamEnergySpread         = 4.2        #10% FWHM
s:So/ElectronSource/BeamPositionDistribution = "Gaussian"
s:So/ElectronSource/BeamPositionCutoffShape  = "Ellipse"
d:So/ElectronSource/BeamPositionCutoffX      = 1.2 mm     #2 standard deviations
d:So/ElectronSource/BeamPositionCutoffY      = 1.2 mm
d:So/ElectronSource/BeamPositionSpreadX      = 0.6 mm     #1.5 mm FWHM
d:So/ElectronSource/BeamPositionSpreadY      = 0.6 mm     #1.5 mm FWHM
s:So/ElectronSource/BeamAngularDistribution  = "None"

# Number of histories in run
ic:So/ElectronSource/NumberOfHistoriesInRun  = 1 * Ts/ShowHistoryCountAtInterval
i:Ts/ShowHistoryCountAtInterval              = 1

######################################################################################
# Field-dependent angles (gantry, collimator) and components follow...

includeFile = Jaws.txt MLC.txt WaterBox.txt

# Linac geometry field-dependent components
# IEC gantry rotation angle (in the opposite sense of RotY)
dc:Ge/IEC_G/RotY_G                           = 0. deg
d:Ge/IEC_G/RotY                              = -1 * Ge/IEC_G/RotY_G deg

# IEC collimator rotation angle (in the same sense of RotZ)
dc:Ge/IEC_B/RotZ_B                           = 0. deg
d:Ge/IEC_B/RotZ                              = 1 * Ge/IEC_B/RotZ_B deg 

# Asymmetric jaw field settings along IEC coordinates X or Y, projected to isocenter
s:Ge/Jaw/JawTravelAxis                       = "Y" # Jaw travel axis, "X" or "Y"
dc:Ge/Jaw/NegativeFieldSetting               = -5. cm
dc:Ge/Jaw/PositiveFieldSetting               = 5. cm

# MLC leaf widths and positions, projected to isocenter
s:Ge/MLC/LeafTravelAxis                      = "X" # Leaf travel axis, "X" or "Y"
dv:Ge/MLC/LeafWidths           = 42 5. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 5. cm
# 10 cm x 20 cm field, the field setting for each leaf is that as projected at isocenter
dv:Ge/MLC/NegativeFieldSetting = 42 0. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. 0. cm
dv:Ge/MLC/PositiveFieldSetting = 42 0. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 0. cm

# Patient and couch field-dependent components
# IEC couch rotation angle (in the opposite sense of RotZ)
dc:Ge/IEC_S/RotZ_S                           = 0.0 deg
d:Ge/IEC_S/RotZ                              = -1 * Ge/IEC_S/RotZ_S deg

Jaws.txt

# Jaws for Siemens Oncor: Uses TOPAS component Jaws
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179

############################# Parameter Descriptions #################################
# SAD: Source axis distance (nominal distance from x-ray target to gantry rotation axis)
# SourceToUpstreamSurfaceDistance: Distance from x-ray target to jaw
# PositiveFieldSetting: Positive jaw position projected to isocenter 
# NegativeFieldSetting: NegativeFieldSetting <= PositiveFieldSetting
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

#######################################################################################
s:Ge/Jaw/JawTravelAxis  = "Y" # Jaw travel axis, "X" or "Y"
dc:Ge/Jaw/PositiveFieldSetting  = 20 cm
dc:Ge/Jaw/NegativeFieldSetting  = -20 cm

s:Ge/Jaw/Parent         = "IEC_B"
s:Ge/Jaw/Type           = "TsJaws"
s:Ge/Jaw/Material       = "G4_W"

d:Ge/Jaw/LX             = 20. cm  # Actual jaw width along JawTravelAxis
d:Ge/Jaw/LY             = 20. cm  # Actual jaw length perpendicular to JawTravelAxis
d:Ge/Jaw/LZ             = 7.80 cm # Jaw thickness along IEC Zb axis
dc:Ge/Jaw/SourceToUpstreamSurfaceDistance = 19.73 cm #Distance from x-ray target to jaw 
d:Ge/Jaw/SAD        	= Ge/SAD cm

s:Ge/Jaw/DrawingStyle   = "Solid"
#######################################################################################

LinacDefaults.txt

# The LinacDefaults parameter control file is the final includeFile in the chain 
# Parameters provided in this file are intended to be overridden 
# See FullTxHead.txt, FixedTxHead.txt, and Field.txt
#
############################# Parameter Descriptions #################################
# Linac geometry fixed components
# SAD: Source axis distance (distance from nominal source position to isocenter)
#######################################################################################

d:Ge/SAD = 100. cm

MLC.txt

# MLC for Siemens Oncor: Uses DivergingMLC TOPAS generic MLC component
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179

########################### Key Parameters In MLC.txt ################################
# Parameters available for adjustment...
# SourceToUpstreamSurfaceDistance: Distance from x-ray target to MLC
# LeafTravelAxis: Direction of jaw travel, either along IEC_B Xb or Yb
# MaximumLeafOpen: Maximum distance permitted for leaf to open on either side of Zb
# Thickness: Thickness of the MLC leaves in Zb
# Length: Length of the MLC leaves in direction of travel
# LeafWidths: Vector of leaf widths, same sequence of leaf widths on each MLC bank     
# NegativeFieldSetting: NegativeFieldSetting <= PositiveFieldSetting for opposing leaves
# PositiveFieldSetting: Positive leaf positions projected to isocenter 
#
# Parameters calculated from other parameters...
# SAD: Source to axis distance (isocenter coincides with gantry co-ordinates origin) 
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

s:Ge/MLC/Parent           = "IEC_B" # IEC beam limiting device coordinates
s:Ge/MLC/Type             = "TsDivergingMLC"
s:Ge/MLC/Material         = "G4_W"
d:Ge/MLC/SAD              = Ge/SAD cm 

d:Ge/MLC/SourceToUpstreamSurfaceDistance = 28.26  cm # Distance from source to MLC bank
s:Ge/MLC/LeafTravelAxis   = "X" # Leaf travel axis, "X" or "Y"
d:Ge/MLC/MaximumLeafOpen  = 20.0 cm # Actual limit of leaf travel
d:Ge/MLC/Thickness        = 7.56 cm # Actual thickness of MLC leaves along IEC Zb
d:Ge/MLC/Length           = 20.0 cm # Length of MLC leaves in direction of travel

# MLC leaf widths and positions, projected to isocenter for 10 cm x 20 cm field
dv:Ge/MLC/LeafWidths           = 42 5. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 5. cm
dv:Ge/MLC/NegativeFieldSetting = 42 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. -5. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. cm
dv:Ge/MLC/PositiveFieldSetting = 42 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. cm

s:Ge/MLC/DrawingStyle     = "Solid"
b:Ge/MLC/PrintInformation = "True"

MainTxHead.txt

# This is the top-level TOPAS parameter control file used to simulate a linear
# accelerator treatment head. The linac is modeled after a Siemens Oncor machine.
#
# The exit window, target and monitor chamber are largely from Jabbari et al,
# "Monte Carlo simulation of Siemens ONCOR linear accelerator with BEAMnrc and
# DOSXYnrc code," J Med Signals & Sensors, 3(3):172-9, 2013.
#
# The water channel thickness in the exit window, source details and the rest
# of the geometry are from Sawkey and Faddegon, "Simulation of large x-ray fields
# using independently measured source and geometry details," Med Phys 36(12):5622-32
# and references therein, supplemented with direct measurement.
#
# Treatment head components are positioned at distance from source according to SAD.
#
# Example prepared by KyungDon Choi, Jose Ramos Mendez and Bruce Faddegon. May 28, 2021.

# Uncomment one and only one of the following four includeFile lines:
includeFile = FullTxHeadField.txt
#includeFile = FixedTxHead.txt
#includeFile = Field.txt
#includeFile = TestComponent.txt
#
# FullTxHeadField.txt
#    Simulates the full treatment head, from the exit window of the waveguide
#    through to the isocenter. Does not contain any scoring.
#
# FixedTxHead.txt
#    Simulates the fixed components of the treatment head from the exit window
#    to just upstream of the jaws. Scores phase space.
#
# Field.txt
#    Simulates the movable components of the treatment head, including Gantry,
#    collimator angle, jaw and MLC leaves. Scores dose distributions.
#
# TestComponent.txt
#    Displays one or more of the linac components in the GUI.

# The above four includeFiles in turn include one or more of the following:
# Target.txt: Exit window and target
# Flattener.txt: Primary collimator and flattening filter
# Monitor.txt: Monitor chamber  
# Jaws.txt: Pair of asymmetric beam-defining jaws
# MLC.txt: Opposing banks of doubly-diverging MLC leaves of different widths and travel
# PhaseSpace.txt: Phase-space scored on plane perpendicular to beam axis
# WaterPhantom.txt: Voxelized water phantom for scoring dose distributions
# Pelvis.txt: DICOM pelvic phantom
# LinacDefaults.txt: Default field and patient specific parameters

# Parameter Descriptions
# IEC 61217 co-ordinates are used in this example. See the TOPAS user guide for details
# Axis names Xa, Ya, Za, rotation angles RotXa, RotYa, RotZa "a" from IEC as follows:
#   Fixed system IEC_F, parent Geant4 world - e.g. Xf; (Xf,Yf,Zf) is world (-Z,-X,Y) 
#   Gantry system IEC_G, parent IEC_F - e.g. Xg; Gantry rotates about Yg by IEC_G/RotY
#   Beam limiting system IEC_B, parent IEC_G; Collimator rotates about Zb by IEC_B/RotZ
#   Patient support system (couch) IEC_S, parent IEC_F - couch rotates by RotZs
#   In this example, table top eccentric rotation and translation combined with patient 
#   Patient (in this example, DICOM CT image) IECp, parent IEC_S - rotate about all axes
#
# HLX/Y/Z: half length of X/Y/Z axes
# TransX/Y/Z: translation of X/Y/Z axes relative to co-ordinates of parent
# RotX/Y/Z: rotation of X/Y/Z axes relative to co-ordinates of parent

# The parameters in this TOPAS control file need not be changed.
# Parameters the user may wish to adjust are in the includeFile included above.

# Graphics
iv:Gr/Color/TransparentRed  = 4 255 0 255 200
iv:Gr/Color/TransparentBlue = 4 0 0 255 200

s:Gr/ViewA/Type              = "OpenGL"
i:Gr/ViewA/WindowSizeX       = 1400
i:Gr/ViewA/WindowSizeY       = 700
u:Gr/ViewA/Zoom              = 1.0
d:Gr/ViewA/Theta             = 89 deg
d:Gr/ViewA/Phi               = -90 deg
b:Gr/ViewA/IncludeAxes       = "True"
d:Gr/ViewA/AxesSize          = 10 cm

# Geometry
b:Ge/CheckForOverlaps       = "True"

s:Ge/World/Material         = "Air"
d:Ge/World/HLX              = 1.25 m
d:Ge/World/HLY              = 1.25 m
d:Ge/World/HLZ              = 1.25 m
b:Ge/World/Invisible        = "True"

# Fixed system IEC_F, parent Geant4 world - e.g. Xf; (Xf,Yf,Zf) is world (X,Y,Z)
s:Ge/IEC_F/Parent           = "World"
s:Ge/IEC_F/Type             = "Group"
d:Ge/IEC_F/TransX           = 0.0 cm
d:Ge/IEC_F/TransY           = 0.0 cm
d:Ge/IEC_F/TransZ           = 0.0 cm

# Gantry system IEC_G, parent IEC_F - e.g. Xg; Gantry rotates about Yg by IEC_G/RotY
# Gantry rotation, if any, is applied in the includeFile (see above)
s:Ge/IEC_G/Parent           = "IEC_F"
s:Ge/IEC_G/Type             = "Group"
d:Ge/IEC_G/TransX           = 0. m
d:Ge/IEC_G/TransY           = 0. m
d:Ge/IEC_G/TransZ           = 0. m

# Beam limiting system IEC_B, parent IEC_G - e.g. Xb; Collimator rotates about Zb by IEC_B/RotZ
# Collimator rotation, if any, is applied in the includeFile (see above)
s:Ge/IEC_B/Parent           = "IEC_G"
s:Ge/IEC_B/Type             = "Group"
d:Ge/IEC_B/TransX           = 0. m
d:Ge/IEC_B/TransY           = 0. m
d:Ge/IEC_B/TransZ           = 0. m

# Patient support system (couch) IEC_S, parent IEC_F - couch rotates by RotZs
# Couch rotation, if any, is applied in the includeFile (see above)
s:Ge/IEC_S/Parent           = "IEC_F"
s:Ge/IEC_S/Type             = "Group"
d:Ge/IEC_S/TransX           = 0. m
d:Ge/IEC_S/TransY           = 0. m
d:Ge/IEC_S/TransZ           = 0. m

# Physics
sv:Ph/Default/Modules       = 1 "g4em-standard_opt4"

# Overall TOPAS control
Ts/NumberOfThreads          = 1 # Change to 0 to use all available threads
b:Ts/ShowCPUTime            = "True"
b:Ts/PauseBeforeQuit        = Gr/Enable

Monitor.txt

# Monitor chamber with mirror for Siemens Oncor
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179

########################## Key Parameters In Monitor.txt ##############################
# Parameters set in another parameter control file...
# SAD: Source axis distance (distance from nominal source position to isocenter)
#
# Parameters available for adjustment...
# Pos: Distance along beam axis Zg from nominal target position (SAD from isocenter)
# Rmax: Maximum radius of Cylinder
# HL: Half of cylinder's thickness
# RotX: Mirror angle
#
# Parameters calculated from other parameters...
# Reloc: Distance along beam axis Zg from isocenter, set by parameters SAD and Pos
# TransZ1: Position of lower surface of previous object along Zg
# TransZ: Position of center of object along Zg
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

############################## Monitor Chamber ########################################
# Average value of ceramic density from the following link was used:
# https://www.ceramicindustry.com/ceramic-materials-properties-charts/#Alumina%20Al2O3 
sv:Ma/Ceramic/Components  = 2 "Aluminum" "Oxygen"  
uv:Ma/Ceramic/Fractions   = 2 0.529412 0.470588  
d:Ma/Ceramic/Density      = 3.835 g/cm3 
s:Ma/Ceramic/DefaultColor = "skyblue"

s:Ge/IC/W1/Parent         = "IEC_G" #IEC gantry coordinates
s:Ge/IC/W1/Type           = "TsCylinder"
s:Ge/IC/W1/Material       = "Ceramic"

d:Ge/IC/W1/Pos               = 10.734 cm
d:Ge/IC/W1/RMax           = 6. cm
d:Ge/IC/W1/Reloc          = Ge/SAD - Ge/IC/W1/Pos cm
d:Ge/IC/W1/HL             = 0.076 cm
d:Ge/IC/W1/TransZ         = Ge/IC/W1/Reloc - Ge/IC/W1/HL cm
s:Ge/IC/W1/Color          = "Green"
s:Ge/IC/W1/DrawingStyle   = "Solid"

s:Ge/IC/P1/Parent         = "IEC_G"
s:Ge/IC/P1/Type           = "TsCylinder"
s:Ge/IC/P1/Material       = "G4_lN2"
d:Ge/IC/P1/RMax           = 6. cm
d:Ge/IC/P1/HL             = 0.092 cm 
d:Ge/IC/P1/TransZ1        = Ge/IC/W1/TransZ - Ge/IC/W1/HL cm
d:Ge/IC/P1/TransZ         = Ge/IC/P1/TransZ1 - Ge/IC/P1/HL cm
s:Ge/IC/P1/Color          = "Green"
s:Ge/IC/P1/DrawingStyle   = "Solid"
 
s:Ge/IC/W2/Parent         = "IEC_G"
s:Ge/IC/W2/Type           = "TsCylinder"
s:Ge/IC/W2/Material       = "Ceramic"
d:Ge/IC/W2/RMax           = 6. cm 
d:Ge/IC/W2/HL             = 0.076 cm
d:Ge/IC/W2/TransZ1        = Ge/IC/P1/TransZ - Ge/IC/P1/HL cm
d:Ge/IC/W2/TransZ         = Ge/IC/W2/TransZ1 - Ge/IC/W2/HL cm
s:Ge/IC/W2/Color          = "Green"
s:Ge/IC/W2/DrawingStyle   = "Solid"

s:Ge/IC/P2/Parent         = "IEC_G"
s:Ge/IC/P2/Type           = "TsCylinder"
s:Ge/IC/P2/Material       = "G4_lN2"
d:Ge/IC/P2/RMax           = 6. cm
d:Ge/IC/P2/HL             = 0.092 cm 
d:Ge/IC/P2/TransZ1        = Ge/IC/W2/TransZ - Ge/IC/W2/HL cm
d:Ge/IC/P2/TransZ         = Ge/IC/P2/TransZ1 - Ge/IC/P2/HL cm
s:Ge/IC/P2/Color          = "Green"
s:Ge/IC/P2/DrawingStyle   = "Solid"
 
s:Ge/IC/W3/Parent         = "IEC_G"
s:Ge/IC/W3/Type           = "TsCylinder"
s:Ge/IC/W3/Material       = "Ceramic"
d:Ge/IC/W3/RMax           = 6. cm
d:Ge/IC/W3/HL             = 0.076 cm
d:Ge/IC/W3/TransZ1        = Ge/IC/P2/TransZ - Ge/IC/P2/HL cm
d:Ge/IC/W3/TransZ         = Ge/IC/W3/TransZ1 - Ge/IC/W3/HL cm
s:Ge/IC/W3/Color          = "Green"
s:Ge/IC/W3/DrawingStyle   = "Solid"

################################### Mirror ############################################
s:Ge/IC/P3/Parent         = "IEC_G" #Mirror closest to jaw +Yb, furthest -Yb
s:Ge/IC/P3/Type           = "TsCylinder"
s:Ge/IC/P3/Material       = "G4_lN2"

d:Ge/IC/P3/Pos            = 16.603 cm
d:Ge/IC/P3/RMax           = 3. cm
d:Ge/IC/P3/HL             = 0.1045 cm 
d:Ge/IC/P3/RotX           = 40 deg #Mirror angle from direct measurement

d:Ge/IC/P3/Reloc          = Ge/SAD - Ge/IC/P3/Pos cm
d:Ge/IC/P3/TransZ         = Ge/IC/P3/Reloc - Ge/IC/P3/HL cm
s:Ge/IC/P3/Color          = "Green"
s:Ge/IC/P3/DrawingStyle   = "Solid"

ScoreEnergyFluence.txt

# Scorer - Energy fluence distribution on plane through isocenter

#################### Key Parameters In ScoreEnergyFluence.txt ########################
# HLX/Y/Z: Half lengths of voxels used for scoring
# X/YBins: Number of bins in IEC_G Xg and Yg
# TransZ: Distance from isocenter to center of scoring region along IEC_G Zg
#######################################################################################

s:Sc/EnergyFluence/Quantity = "EnergyFluence"
s:Sc/EnergyFluence/Component= "Isocenter"
s:Sc/EnergyFluence/IfOutputFileAlreadyExists = "Exit" # "Exit", "Overwrite" or "Increment"
s:Sc/EnergyFluence/OutputType = "binary"

# Isocenter
s:Ge/Isocenter/Parent = "IEC_G"
s:Ge/Isocenter/Type   = "TsBox"
s:Ge/Isocenter/Material = "air"
d:Ge/Isocenter/HLX      = 30 cm 
d:Ge/Isocenter/HLY      = 30 cm 
d:Ge/Isocenter/HLZ      = 0.05 cm 
i:Ge/Isocenter/XBins    = 60
i:Ge/Isocenter/YBins    = 60
d:Ge/Isocenter/TransZ   = 0 cm 
s:Ge/Isocenter/DrawingStyle = "Solid"
s:Ge/Isocenter/Color = "skyblue"

ScoreEnergySpectrum.txt

# Scorer - Energy spectrum in 10 cm x 10 cm region at isocenter

#################### Key Parameters In ScoreEnergySpectrum.txt ########################
# Ebins: Number of energy bins to be scored
# EBinMin/Max: Minimum and maximum energy to be scored
# EBinLog: Scoring bins logarithmically spaced if true, linearily spaced if false
# HLX/Y/Z: Half lengths of voxels used for scoring
# X/YBins: Number of bins in IEC_G Xg and Yg
# TransZ: Distance from isocenter to center of scoring region along IEC_G Zg
#######################################################################################

s:Sc/EnergySpectrum/Quantity = "Fluence"
s:Sc/EnergySpectrum/Component= "Isocenter"
s:Sc/EnergySpectrum/IfOutputFileAlreadyExists = "Exit" # "Exit", "Overwrite" or "Increment"
s:Sc/EnergySpectrum/OutputType = "CSV"

sv:Sc/EnergySpectrum/OnlyIncludeParticlesNamed = 1 "gamma"

i:Sc/EnergySpectrum/EBins = 50
d:Sc/EnergySpectrum/EBinMin = 0 MeV
d:Sc/EnergySpectrum/EBinMax = 10 MeV
# If you need log scale...
#b:Sc/EnergySpectrum/EBinLog = “True”

# Isocenter scoring volume (thin plane for scoring spectrum)
s:Ge/Isocenter/Parent = "IEC_G"
s:Ge/Isocenter/Type   = "TsBox"
s:Ge/Isocenter/Material = "air"
d:Ge/Isocenter/HLX      = 5 cm 
d:Ge/Isocenter/HLY      = 5 cm 
d:Ge/Isocenter/HLZ      = 0.01 cm 
i:Ge/Isocenter/XBins    = 1
i:Ge/Isocenter/YBins    = 1
d:Ge/Isocenter/TransZ   = 0 cm 
s:Ge/Isocenter/DrawingStyle = "Solid"
s:Ge/Isocenter/Color = "skyblue"

ScorePhaseSpace.txt

# Phase space scored on plane perpendicular to beam axis Zg

##################### Key Parameters In ScorePhaseSpace.txt ##########################
# Parameters marked with "^" are set to be changeable in the TOPAS GUI
# ^Pos: Distance along beam axis Zg from the nominal target position (defined by SAD)
# HLX/Y/Z: Half lengths of voxels used for scoring
# X/YBins: Number of bins in IEC_G Xg and Yg
# TransX/Y/Z: Distance from IEC_G origin to center of scoring region in Xg, Yg, Zg
# RotX/Y/Z: Rotation of scoring region in Xg, Yg, Zg
######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt overriden in Field.txt

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "IEC_G"
s:Ge/VacFilm/Material = "G4_AIR"
d:Ge/VacFilm/HLX      = 10.0 cm
d:Ge/VacFilm/HLY      = 10.0 cm
d:Ge/VacFilm/HLZ      = 0.05 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
dc:Ge/VacFilm/Pos     = 19.0 cm
d:Ge/VacFilm/TransZ   = Ge/SAD - Ge/VacFilm/Pos cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole             = "False"
s:Sc/PhaseSpaceAtVacFilm/Surface                     = "VacFilm/ZPlusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                  = "ASCII" # ASCII, Binary, Limited or ROOT
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists   = "Exit" # "Exit", "Overwrite" or "Increment"
s:Sc/PhaseSpaceAtVacFilm/OutputFile                  = "PhaseSpaceFixed"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize            = 1000

Target.txt

# Exit window and target for Siemens Oncor
# Reference for geometry: Jabbari et al, J Med Signal Sens 3(3):172-179, 2013
# Exit window water channel thickness: Sawkey and Faddegon, Med Phys 36(12):5622-32
# Additional target details: Faddegon et al, Med Phys 31(1):91-97, 2004
#
# Positioning relative to nominal source position using parameters Pos and Reloc
# Simulation of three distinct regions: vacuum, exit window and target
# All regions are simulated as cylinders, using TOPAS component TsCylinder
#
########################## Key Parameters In Target.txt ###############################
# Parameters set in another parameter control file...
# SAD: Source axis distance (distance from nominal source position to isocenter)
#
# Parameters available for adjustment...
# Rmax:    Maximum radius of cylinder
# HL:      Half of cylinder's thickness
# Pos:     Distance along gantry axis Zg from nominal target position (defined by SAD)
#
# Parameters calculated from above parameters...
# Reloc:   Distance from isocenter to center of the first object in the region
# TransZ1: Position of lower surface of previous object along Zg
# TransZ:  Position of center of object along Zg
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

s:Ge/Window/Parent                 = "IEC_G" #IEC gantry coordinates
s:Ge/Window/Type                   = "Group"

#From data sheet Nicoro R BAu-3, see:
#https://www.morganbrazealloys.com/media/6955/wesgo_nicoro_technical-data-sheet-2018.pdf
sv:Ma/NICORO/Components            = 3 "Gold" "Copper" "Nickel"
uv:Ma/NICORO/Fractions             = 3 0.35 0.62 0.03
d:Ma/NICORO/Density                = 10.9 g/cm3 
s:Ma/NICORO/DefaultColor           = "yellow"

################################### Vacuum #########################################
s:Ge/ExitWindow/Parent             = "Window"
s:Ge/ExitWindow/Type               = "TsCylinder"
s:Ge/ExitWindow/Material           = "G4_Galactic" #density of 10E-25 g/cm3
d:Ge/ExitWindow/Rmax               = 1.0 cm #W radius 3 mm, C 6 mm, steel 16 mm
d:Ge/ExitWindow/HL                 = 0.5 cm
d:Ge/ExitWindow/Pos                = -1.424 cm
d:Ge/ExitWindow/Reloc              = Ge/SAD - Ge/ExitWindow/Pos cm
d:Ge/ExitWindow/TransZ             = Ge/ExitWindow/Reloc - Ge/ExitWindow/HL cm
s:Ge/ExitWindow/Color              = "Yellow"
s:Ge/ExitWindow/DrawingStyle       = "WireFrame"
s:Ge/ExitWindow/AssignToRegionNamed = "target"

################################# Exit Window ######################################
# Upstream titanium layer
s:Ge/ExitW_Ti_1/Parent             = "Window"
s:Ge/ExitW_Ti_1/Type               = "TsCylinder"
s:Ge/ExitW_Ti_1/Material           = "G4_Ti" 
d:Ge/ExitW_Ti_1/Rmax               = 1.0 cm #W radius 3 mm, C 6 mm, steel 16 mm
d:Ge/ExitW_Ti_1/HL                 = 0.0025 cm
d:Ge/ExitW_Ti_1/Pos                = -0.424 cm
d:Ge/ExitW_Ti_1/Reloc              = Ge/SAD - Ge/ExitW_Ti_1/Pos cm
d:Ge/ExitW_Ti_1/TransZ             = Ge/ExitW_Ti_1/Reloc - Ge/ExitW_Ti_1/HL cm
s:Ge/ExitW_Ti_1/Color              = "Red"
s:Ge/ExitW_Ti_1/DrawingStyle       = "Solid"
s:Ge/ExitW_Ti_1/AssignToRegionNamed = "target"

# Cooling water channel
s:Ge/ExitW_Water/Parent            = "Window"
s:Ge/ExitW_Water/Type              = "TsCylinder"
s:Ge/ExitW_Water/Material          = "G4_WATER" 
d:Ge/ExitW_Water/Rmax              = 1.0 cm
d:Ge/ExitW_Water/HL                = 0.066 cm
d:Ge/ExitW_Water/TransZ1           = Ge/ExitW_Ti_1/TransZ - Ge/ExitW_Ti_1/HL cm
d:Ge/ExitW_Water/TransZ            = Ge/ExitW_Water/TransZ1 - Ge/ExitW_Water/HL cm
s:Ge/ExitW_Water/Color             = "Blue"
s:Ge/ExitW_Water/DrawingStyle      = "Solid"
s:Ge/ExitW_Water/AssignToRegionNamed = "target"

# Downstream titanium layer
s:Ge/ExitW_Ti_2/Parent             = "Window"
s:Ge/ExitW_Ti_2/Type               = "TsCylinder"
s:Ge/ExitW_Ti_2/Material           = "G4_Ti" 
d:Ge/ExitW_Ti_2/Rmax               = 1.0 cm
d:Ge/ExitW_Ti_2/HL                 = 0.0025 cm
d:Ge/ExitW_Ti_2/TransZ1            = Ge/ExitW_Water/TransZ - Ge/ExitW_Water/HL cm
d:Ge/ExitW_Ti_2/TransZ             = Ge/ExitW_Ti_2/TransZ1 - Ge/ExitW_Ti_2/HL cm
s:Ge/ExitW_Ti_2/Color              = "Red"
s:Ge/ExitW_Ti_2/DrawingStyle       = "Solid"
s:Ge/ExitW_Ti_2/AssignToRegionNamed = "target"

# Target for Siemens Oncor
s:Ge/Target/Parent                 = "IEC_G"
s:Ge/Target/Type                   = "Group"

#################################### Target ##########################################
# Tungsten target
s:Ge/Target_W/Parent               = "Target"
s:Ge/Target_W/Type                 = "TsCylinder"
s:Ge/Target_W/Material             = "G4_W" 
d:Ge/Target_W/Rmax                 = 1.0 cm
d:Ge/Target_W/HL                   = 0.032 cm
d:Ge/Target_W/Pos                  = 0.117 cm
d:Ge/Target_W/Reloc                = Ge/SAD - Ge/Target_W/Pos  cm
d:Ge/Target_W/TransZ               = Ge/Target_W/Reloc - Ge/Target_W/HL cm
s:Ge/Target_W/Color                = "Orange"
s:Ge/Target_W/DrawingStyle         = "Solid"
s:Ge/Target_W/AssignToRegionNamed  = "target"

# NICORO brazing
s:Ge/Target_NICORO_1/Parent        = "Target"
s:Ge/Target_NICORO_1/Type          = "TsCylinder"
s:Ge/Target_NICORO_1/Material      = "NICORO" 
d:Ge/Target_NICORO_1/Rmax          = 1.0 cm
d:Ge/Target_NICORO_1/HL            = 0.0075 cm
d:Ge/Target_NICORO_1/TransZ1       = Ge/Target_W/TransZ - Ge/Target_W/HL cm 
d:Ge/Target_NICORO_1/TransZ        = Ge/Target_NICORO_1/TransZ1 - Ge/Target_NICORO_1/HL cm
s:Ge/Target_NICORO_1/Color         = "Blue"
s:Ge/Target_NICORO_1/DrawingStyle  = "Solid"
s:Ge/Target_NICORO_1/AssignToRegionNamed = "target"

# Copper 
s:Ge/Target_Cu/Parent              = "Target"
s:Ge/Target_Cu/Type                = "TsCylinder"
s:Ge/Target_Cu/Material            = "G4_Cu" 
d:Ge/Target_Cu/Rmax                = 1.0 cm
d:Ge/Target_Cu/HL                  = 0.0825 cm
d:Ge/Target_Cu/TransZ1             = Ge/Target_NICORO_1/TransZ - Ge/Target_NICORO_1/HL cm 
d:Ge/Target_Cu/TransZ              = Ge/Target_Cu/TransZ1 - Ge/Target_Cu/HL cm
s:Ge/Target_Cu/Color               = "Yellow"
s:Ge/Target_Cu/DrawingStyle        = "Solid"
s:Ge/Target_Cu/AssignToRegionNamed = "target"

# NICORO brazing
s:Ge/Target_NICORO_2/Parent        = "Target"
s:Ge/Target_NICORO_2/Type          = "TsCylinder"
s:Ge/Target_NICORO_2/Material      = "NICORO" 
d:Ge/Target_NICORO_2/Rmax          = 1.0 cm
d:Ge/Target_NICORO_2/HL            = 0.0025 cm
d:Ge/Target_NICORO_2/TransZ1       = Ge/Target_Cu/TransZ - Ge/Target_Cu/HL cm 
d:Ge/Target_NICORO_2/TransZ        = Ge/Target_NICORO_2/TransZ1 - Ge/Target_NICORO_2/HL cm
s:Ge/Target_NICORO_2/Color         = "Blue"
s:Ge/Target_NICORO_2/DrawingStyle  = "Solid"
s:Ge/Target_NICORO_2/AssignToRegionNamed = "target"

# Stainless steel
s:Ge/Target_SS_1/Parent            = "Target"
s:Ge/Target_SS_1/Type              = "TsCylinder"
s:Ge/Target_SS_1/Material          = "G4_STAINLESS-STEEL" 
d:Ge/Target_SS_1/Rmax              = 1.0 cm
d:Ge/Target_SS_1/HL                = 0.051 cm
d:Ge/Target_SS_1/TransZ1           = Ge/Target_NICORO_2/TransZ - Ge/Target_NICORO_2/HL cm 
d:Ge/Target_SS_1/TransZ            = Ge/Target_SS_1/TransZ1 - Ge/Target_SS_1/HL cm
s:Ge/Target_SS_1/Color             = "Silver"
s:Ge/Target_SS_1/DrawingStyle      = "Solid"
s:Ge/Target_SS_1/AssignToRegionNamed = "target"

# Graphite
s:Ge/Target_GP_1/Parent            = "Target"
s:Ge/Target_GP_1/Type              = "TsCylinder"
s:Ge/Target_GP_1/Material          = "G4_GRAPHITE" 
d:Ge/Target_GP_1/Rmax              = 1.0 cm
d:Ge/Target_GP_1/HL                = 0.508 cm
d:Ge/Target_GP_1/TransZ1           = Ge/Target_SS_1/TransZ - Ge/Target_SS_1/HL cm 
d:Ge/Target_GP_1/TransZ            = Ge/Target_GP_1/TransZ1 - Ge/Target_GP_1/HL cm
s:Ge/Target_GP_1/Color             = "Grey"
s:Ge/Target_GP_1/DrawingStyle      = "Solid"
s:Ge/Target_GP_1/AssignToRegionNamed = "target"

# Stainless steel
s:Ge/Target_SS_2/Parent            = "Target"
s:Ge/Target_SS_2/Type              = "TsCylinder"
s:Ge/Target_SS_2/Material          = "G4_STAINLESS-STEEL" 
d:Ge/Target_SS_2/Rmax              = 1.0 cm
d:Ge/Target_SS_2/HL                = 0.002 cm
d:Ge/Target_SS_2/TransZ1           = Ge/Target_GP_1/TransZ - Ge/Target_GP_1/HL cm 
d:Ge/Target_SS_2/TransZ            = Ge/Target_SS_2/TransZ1 - Ge/Target_SS_2/HL cm
s:Ge/Target_SS_2/Color             = "Silver"
s:Ge/Target_SS_2/DrawingStyle      = "Solid"
s:Ge/Target_SS_2/AssignToRegionNamed = "target"

TestComponent.txt

# Parameter control file for testing individual components
# Components are displayed in the GUI
b:Gr/Enable                                  = "True"
b:Ts/UseQT                                   = "True"

# Components are situated relative to the SAD
# For viewing components in the GUI, set SAD small, i.e., to 0 cm
# Note: SAD needs to be set properly for jaw and MLC leaf positions, i.e., to 100 cm
d:Ge/SAD = 0. cm 
#d:Ge/SAD = 100. cm 

# Comment out includeFile files that you want to be left out of the GUI
includeFile = Target.txt  
includeFile = PrimaryCollimator.txt
#includeFile = Flattener6MV.txt #Comment out at least one of the flatteners
includeFile = Flattener18MV.txt #Comment out at least one of the flatteners
#includeFile = Monitor.txt 
#includeFile = Jaws.txt #Comment out at least one of the secondary collimators
#includeFile = MLC.txt #Comment out at least one of the secondary collimators
#includeFile = WaterBox.txt #Comment out at least one of the dose scoring regions
#includeFile = WaterPhantom.txt #Comment out at least one of the dose scoring regions

VRT_1b.txt

# This is the top-level TOPAS parameter control file. The following files are all also read to set the simulation parameters.

includeFile = MainTxHead.txt 

s:Sc/phaseSpace/OutputFile = "particleSplit"

# Activate VRT
b:Vr/UseVarianceReduction = "True"

# Uniform split
b:Vr/ParticleSplit1/Active = "True"
s:Vr/ParticleSplit/Type   = "secondarybiasing"
svc:Vr/ParTicleSplit/ForRegion/target/processesNamed   = 1 "eBrem"
uvc:Vr/ParticleSplit/ForRegion/target/SplitNumber     = 1  1.0
dv:Vr/ParticleSplit/ForRegion/target/MaximumEnergies  = 1  10.0  MeV

bc:Vr/ParticleSplit/UseDirectionalSplitting = "False"
d:Vr/ParticleSplit/TransX = 0 cm
d:Vr/ParticleSplit/TransY = 0 cm
dc:Vr/ParticleSplit/TransZ = 0 cm
dc:Vr/ParticleSplit/RMax   = 10 cm

ic:So/electronBeam/NumberOfHistoriesInRun = 100

i:Ts/ShowHistoryCountAtInterval  = 100
b:Ts/ShowCPUTime = "True"

VRT_2.txt

#
includeFile = VRT_1.txt

uvc:Vr/ParticleSplit/ForRegion/target/SplitNumber     = 1  100
bc:Vr/ParticleSplit/UseDirectionalSplitting = "True"
ic:So/electronBeam/NumberOfHistoriesInRun = 100

s:Sc/phaseSpace/OutputFile = "productionCutsPerRegion"
b:Sc/phaseSpace/KillAfterPhaseSpace = "True"

s:Ge/Jaw/AssignToRegionNamed = "Jaws"
s:Ge/MLC/AssignToRegionNamed = "MLC"

s:Ge/FlatteningFilter1/AssignToRegionNamed = "FlatteningFilter"
s:Ge/FlatteningFilter2/AssignToRegionNamed = "FlatteningFilter"

s:Ge/Collimator_1/AssignToRegionNamed = "Collimator"
s:Ge/Collimator_2/AssignToRegionNamed = "Collimator"
s:Ge/Collimator_3/AssignToRegionNamed = "Collimator"
s:Ge/Collimator_4/AssignToRegionNamed = "Collimator"
s:Ge/Collimator_5/AssignToRegionNamed = "Collimator"
s:Ge/Collimator_6/AssignToRegionNamed = "Collimator"

# Production cuts
# Elsewhere
d:Ph/Default/CutForElectron = 10. mm
d:Ph/Default/CutForPositron = 10. mm
d:Ph/Default/CutForGamma = 10. mm

# Target and collimator
d:Ph/Default/ForRegion/Target/CutForElectron = 1. mm
d:Ph/Default/ForRegion/Target/CutForPositron = 1. mm
d:Ph/Default/ForRegion/Target/CutForGamma = 10 mm
d:Ph/Default/ForRegion/Collimator/CutForElectron = 0.1 mm
d:Ph/Default/ForRegion/Collimator/CutForPositron = 0.1 mm
d:Ph/Default/ForRegion/Collimator/CutForGamma = 10 mm

# Flattening filter
d:Ph/Default/ForRegion/Flattening/CutForElectron = 1. mm
d:Ph/Default/ForRegion/Flattening/CutForPositron = 1. mm
d:Ph/Default/ForRegion/Flattening/CutForGamma = 10 mm

# Jaws
d:Ph/Default/ForRegion/Jaws/CutForElectron = 0.3 mm
d:Ph/Default/ForRegion/Jaws/CutForPositron = 0.3 mm
d:Ph/Default/ForRegion/Jaws/CutForGamma = 1.0 mm

# MLC
d:Ph/Default/ForRegion/MLC/CutForElectron = 0.3 mm
d:Ph/Default/ForRegion/MLC/CutForPositron = 0.3 mm
d:Ph/Default/ForRegion/MLC/CutForGamma = 1.0 mm

b:Ts/ShowCPUTime = "True"

VRT_3.txt

includeFile = VRT_2.txt 

b:Sc/phaseSpace/KillAfterPhaseSpace         = "True"
Sc/phaseSpace/OutputFile = "limitRegion"

s:Ge/VrtParallelWorld/Parent = "World"
s:Ge/VrtParallelWorld/Type = "TsBox"
b:Ge/VrtParallelWorld/IsParallel = "True"
d:Ge/VrtParallelWorld/HLX = Ge/World/HLX cm
d:Ge/VrtParallelWorld/HLY = Ge/World/HLY cm
d:Ge/VrtParallelWorld/HLZ = Ge/World/HLZ cm

s:Ge/impCell1/Parent = "VrtParallelWorld"
s:Ge/impCell1/Type = "TsBox"
b:Ge/impCell1/IsParallel = "True"
d:Ge/impCell1/HLX = Ge/World/HLX cm
d:Ge/impCell1/HLY = Ge/World/HLY cm
d:Ge/impCell1/HLZ = Ge/World/HLZ cm

d:Ge/impCell2/PhiStart = 0. deg
d:Ge/impCell2/PhiTotal = 360 deg
d:Ge/impCell2/RotX = 0. deg
d:Ge/impCell2/RotY = 0. deg
d:Ge/impCell2/RotZ = 45 deg
d:Ge/impCell2/TransX = 0. mm
d:Ge/impCell2/TransY = 0. mm
d:Ge/impCell2/TransZ = 0. mm
dv:Ge/impCell2/ROuter = 4 Ge/World/HLX Ge/World/HLX Ge/World/HLX Ge/World/HLX mm 
dv:Ge/impCell2/RInner = 4 240 240 45 45 mm 
dv:Ge/impCell2/Z = 4 -400 803 896 Ge/World/HLZ mm
i:Ge/impCell2/NSides = 4
s:Ge/impCell2/Parent = "impCell1"
s:Ge/impCell2/Type = "G4HPolyhedra"
s:Ge/impCell2/Color = "transparentred"
s:Ge/impCell2/DrawingStyle = "Solid"
b:Ge/impCell2/IsParallel = "True"

iv:Gr/Color/TransparentRed = 4 255 0 0 100

# Importance sampling
b:Vr/ImportanceSampling/Active         = "true"
sv:Vr/ImportanceSampling/ParticleName  = 2 "gamma" "e-"
s:Vr/ImportanceSampling/Component      = "VrtParallelWorld"
sv:Vr/ImportanceSampling/SubComponents = 2 "impCell1"  "impCell2"
s:Vr/ImportanceSampling/Type = "ImportanceSampling"
uvc:Vr/ImportanceSampling/ImportanceValues = 2 1 1

b:Ts/ShowCPUTime = "True"

VRT_HD.txt

includeFile = VRT_3.txt

Ph/Default/Modules = 1 "g4em-standard_opt4"
# early termination of electrons 
d:Ph/Default/LowestElectronEnergy = 189 keV

b:Gr/Enable = "False"
b:Ts/UseQT = "False"

So/electronBeam/NumberOfHistoriesInRun = 10 * Ts/ShowHistoryCountAtInterval
Ts/ShowHistoryCountAtInterval          = 100000

# Multithreading
i:Ts/NumberOfThreads = 0
i:Ts/Seed = 1

# Uniform splitting
Vr/ParTicleSplit/ForRegion/target/processesNamed   = 1 "eBrem" 
Vr/ParticleSplit/ForRegion/target/SplitNumber      = 1  1000
Vr/ParticleSplit/ForRegion/target/MaximumEnergies  = 1  10.0 MeV 

# Directional brem
Vr/ParticleSplit/UseDirectionalSplitting = "True"
Vr/ParticleSplit/TransX = 0 cm
Vr/ParticleSplit/TransY = 0 cm
Vr/ParticleSplit/TransZ = 0.0 cm
Vr/ParticleSplit/RMax   = 10.0 cm

# Trimming
Vr/ImportanceSampling/ImportanceValues = 2 1000 1

# Scoring
Sc/phaseSpace/OutputFile = "VarianceReduction"
Sc/phaseSpace/KillAfterPhaseSpace = "False"

s:Sc/Dose/Quantity                  = "DoseToMedium"
s:Sc/Dose/Component                 = "ScoringRegion"
s:Sc/Dose/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/Dose/OutputType                = "Binary"
u:Sc/Dose/OnlyIncludeParticlesWithWeightBelow = 1

s:Sc/DoseFat/Quantity                  = "DoseToMedium"
s:Sc/DoseFat/Component                 = "ScoringRegion"
s:Sc/DoseFat/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseFat/OutputType                = "Binary"

# Scoring in a voxelized slice improves speed 
s:Ge/ScoringRegion/Parent = "WaterPhantom"
s:Ge/ScoringRegion/Type   = "TsBox"
s:Ge/ScoringRegion/Material = "G4_WATER"
d:Ge/ScoringRegion/HLX   = 100 mm 
d:Ge/ScoringRegion/HLY   = 2.5 mm 
d:Ge/ScoringRegion/HLZ   = 100 mm
i:Ge/ScoringRegion/XBins  = 40
i:Ge/ScoringRegion/YBins  = 1
i:Ge/ScoringRegion/ZBins  = 80
s:Ge/ScoringRegion/Color = "red"
d:Ge/ScoringRegion/TransZ = Ge/WaterPhantom/HLZ - Ge/ScoringRegion/HLZ cm
s:Ge/ScoringRegion/DrawingStyle = "Solid"

b:Ts/ShowCPUTime = "True"

WaterBox.txt

# Rectangular parallelopiped filled with water, aligned with IEC fixed Z axis Zf
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt may be overriden

s:Ge/WaterPhantom/Parent            = "IEC_S"
s:Ge/WaterPhantom/Type              = "TsBox"
s:Ge/WaterPhantom/Material          = "G4_WATER"
d:Ge/WaterPhantom/HLX               = 20. cm 
d:Ge/WaterPhantom/HLY               = 20. cm 
d:Ge/WaterPhantom/HLZ               = 20. cm 
i:Ge/WaterPhantom/XBins             = 1
i:Ge/WaterPhantom/YBins             = 1
i:Ge/WaterPhantom/ZBins             = 1
d:Ge/WaterPhantom/TransZ            = -20. cm 
s:Ge/WaterPhantom/DrawingStyle      = "Solid"
s:Ge/WaterPhantom/Color             = "skyblue"

WaterPhantom.txt

# Rectangular parallelopiped filled with water, aligned with IEC fixed Z axis Zf.
# WaterPhantom has voxels for scoring.
#######################################################################################

includeFile = LinacDefaults.txt #Values in LinacDafaults.txt overriden in Field.txt

# Scorer - Dose distribution in 40 cm x 40 cm x 40 cm water box at 100 cm SSD
s:Sc/Dose/Quantity                  = "DoseToWater"
s:Sc/Dose/Component                 = "WaterPhantom"
s:Sc/Dose/IfOutputFileAlreadyExists = "Exit" # "Exit", "Overwrite" or "Increment"
s:Sc/Dose/OutputType                = "CSV"


# Isocenter scoring volume (thin plane for scoring fluence)
s:Ge/WaterPhantom/Parent            = "IEC_S"
s:Ge/WaterPhantom/Type              = "TsBox"
s:Ge/WaterPhantom/Material          = "G4_WATER"
d:Ge/WaterPhantom/HLX               = 20. cm 
d:Ge/WaterPhantom/HLY               = 20. cm 
d:Ge/WaterPhantom/HLZ               = 20. cm 
i:Ge/WaterPhantom/XBins             = 80
i:Ge/WaterPhantom/YBins             = 80
i:Ge/WaterPhantom/ZBins             = 80
d:Ge/WaterPhantom/TransZ            = -20. cm 
s:Ge/WaterPhantom/DrawingStyle      = "Solid"
s:Ge/WaterPhantom/Color             = "skyblue"

Nozzle

ConstantsForNozzles.txt

# These values are used in all of the nozzle examples.

#All coordination information comes from TsDefaultParameters.
#IEC 61217 compliance

#Fixed Reference system (If)     => World volume
#Gantry coordination system (Ig) => GantryCoordination
#Source coordination system (S)  => BeamPosition rotateX(180), Z position w.r.t GantryCoordination
#Beam source coordinate system rotate 180 and translate along z w.r.t g.
#-> Y is -Y. we have to flip phase space data.
#Isocenter coordination system (Io)

d:Ge/World/HLX = 1. m
d:Ge/World/HLY = 1. m
d:Ge/World/HLZ = 3. m

#S2I
#d:Ge/S2I = 3.0 m

#Gantry coordination system (Ig)
s:Ge/Gantry/Parent = "World"
s:Ge/Gantry/Type   = "Group"
d:Ge/Gantry/TransX = 0. m
d:Ge/Gantry/TransY = 0. m
d:Ge/Gantry/TransZ = 0. m
d:Ge/Gantry/RotX   = 0. deg
d:Ge/Gantry/RotY   = 0. deg
d:Ge/Gantry/RotZ   = 0. deg

# Default Beam position
s:Ge/BeamPosition/Parent = "Gantry"
s:Ge/BeamPosition/Type   = "Group"
d:Ge/BeamPosition/TransX = 0. m
d:Ge/BeamPosition/TransY = 0. m
d:Ge/BeamPosition/TransZ = 3.0 m
d:Ge/BeamPosition/RotX   = 180. deg
d:Ge/BeamPosition/RotY   = 0. deg
d:Ge/BeamPosition/RotZ   = 0. deg

b:Ts/ShowCPUTime                  = "true"
i:Ts/ShowHistoryCountAtInterval   = 0
b:Ts/ShowHistoryCountOnSingleLine = "False"

########################################
#Material
#NitrogenGas for Chamber
#HeliumGas   for Pipe
########################################
sv:Ma/NiGas/Components = 1 "Nitrogen"
uv:Ma/NiGas/Fractions  = 1 1.0
d:Ma/NiGas/Density     = 0.001251 g/cm3
#0.001251 g/cm3 (gas, 0 C, 101.325 kPa)

sv:Ma/HeGas/Components = 1 "Helium"
uv:Ma/HeGas/Fractions  = 1 1.0
d:Ma/HeGas/Density     = 0.000166322 g/cm3

sv:Ma/Gold/Components          = 1 "Gold"
uv:Ma/Gold/Fractions           = 1 1.0
d:Ma/Gold/Density              = 19.3 g/cm3
d:Ma/Gold/MeanExcitationEnergy = 790.0 eV
s:Ma/Gold/DefaultColor         = "orange"

sv:Ma/CompensatorLucite/Components          = 3 "Hydrogen" "Carbon" "Oxygen"
uv:Ma/CompensatorLucite/Fractions           = 3 0.080538 0.599848 0.319614
d:Ma/CompensatorLucite/Density              = 1.181 g/cm3
d:Ma/CompensatorLucite/MeanExcitationEnergy = 74.0 eV
s:Ma/CompensatorLucite/DefaultColor         = "grey"


########################################
# Dummy 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 = "None"
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10


########################################
# Physics
########################################
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

i:Tf/Verbosity = 1

########################################
# Sequence control
########################################
b:Ts/PauseBeforeSequence = "F"

RasterScanningPattern.txt

# Defines a raster scanning pattern used in some demonstrations.

includeFile = ScanningNozzle.txt

# Time Features for Scanning Magnets
d:Ge/BFieldX_max   = 0.15 tesla
d:Ge/BFieldX_min   = Ge/BFieldX_max tesla * -1.0
d:Ge/BFieldX_range = Ge/BFieldX_max tesla * 2.0

s:Tf/BField2nd/Function = "Step"
dv:Tf/BField2nd/Times   = 2 125.0 250.0 ms
dv:Tf/BField2nd/Values  = 2 Tf/BField2ndLeft/Value Tf/BField2ndRight/Value tesla

s:Tf/BField2ndLeft/Function           = "Linear tesla"
d:Tf/BField2ndLeft/RepetitionInterval = 125.0 ms
d:Tf/BField2ndLeft/Rate               = 0.0024 tesla/ms
d:Tf/BField2ndLeft/StartValue         = Ge/BFieldX_min  tesla

s:Tf/BField2ndRight/Function           = "Linear tesla"
d:Tf/BField2ndRight/RepetitionInterval = 125.0 ms
d:Tf/BField2ndRight/Rate               = -0.0024 tesla/ms
d:Tf/BField2ndRight/StartValue         = Ge/BFieldX_max tesla

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/MagneticFieldStrength = Tf/BField1st/Value tesla
d:Ge/Dipole2/MagneticFieldStrength = Tf/BField2nd/Value tesla

ScanningNozzle.txt

# Scanning nozzle used in some demonstrations.

includeFile = ConstantsForNozzles.txt

#Ts/DumpParameters = "T"

########################################
#1. Beam Exit Window
#100 um thickness Mylar window
########################################
s:Ge/ExitWindow/Parent       = "Gantry"
s:Ge/ExitWindow/Type         = "TsCylinder"
s:Ge/ExitWindow/Material     = "Mylar"
d:Ge/ExitWindow/RMin         = 0.0  mm
d:Ge/ExitWindow/RMax         = 50.0 mm
d:Ge/ExitWindow/HL           = 0.05 mm
d:Ge/ExitWindow/SPhi         = 0.0   deg
d:Ge/ExitWindow/DPhi         = 360.0 deg
d:Ge/ExitWindow/TransX       = 0.0 mm
d:Ge/ExitWindow/TransY       = 0.0 mm
d:Ge/ExitWindow/TransZ       = 299.8 cm
d:Ge/ExitWindow/RotX         = 0.0 deg
d:Ge/ExitWindow/RotY         = 0.0 deg
d:Ge/ExitWindow/RotZ         = 0.0 deg
b:Ge/ExitWindow/Include      = "TRUE"
s:Ge/ExitWindow/DrawingStyle = "Solid"

d:Ge/DistanceOf_CenterExitWindow_To_TopMon1 = -30.0 mm
d:Ge/ZPlusOf_Mon1 = Ge/ExitWindow/TransZ + Ge/DistanceOf_CenterExitWindow_To_TopMon1 cm

########################################
#2. Monitor chamber 1.
# Filled with Nitrogen Gas, 3 layers
# Thickness, position, Material
#            1.0       Gold
#            0.0 	   Aluminum
#           -1.0       Gold
########################################
s:Ge/MonitorChamber1/Parent   = "Gantry"
s:Ge/MonitorChamber1/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Material = "NiGas"
d:Ge/MonitorChamber1/RMin     = 0.0   mm
d:Ge/MonitorChamber1/RMax     = 100.0 mm
d:Ge/MonitorChamber1/HL       = 15.0  mm
d:Ge/MonitorChamber1/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/RotX     = 0.0 deg
d:Ge/MonitorChamber1/RotY     = 0.0 deg
d:Ge/MonitorChamber1/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/TransX   = 0.0 mm
d:Ge/MonitorChamber1/TransY   = 0.0 mm
d:Ge/MonitorChamber1/TransZ   = Ge/ZPlusOf_Mon1 - Ge/MonitorChamber1/HL mm
b:Ge/MonitorChamber1/Include  = "TRUE"

s:Ge/MonitorChamber1/Layer1/Parent   = "MonitorChamber1"
s:Ge/MonitorChamber1/Layer1/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Layer1/Material = "Gold"
d:Ge/MonitorChamber1/Layer1/RMin     = 0.0   mm
d:Ge/MonitorChamber1/Layer1/RMax     = 90.0 mm
d:Ge/MonitorChamber1/Layer1/HL       = 0.002  mm
d:Ge/MonitorChamber1/Layer1/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/Layer1/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/Layer1/RotX     = 0.0 deg
d:Ge/MonitorChamber1/Layer1/RotY     = 0.0 deg
d:Ge/MonitorChamber1/Layer1/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/Layer1/TransX   = 0.0 mm
d:Ge/MonitorChamber1/Layer1/TransY   = 0.0 mm
d:Ge/MonitorChamber1/Layer1/TransZ   = 10.0  mm
b:Ge/MonitorChamber1/Layer1/Include  = "TRUE"

s:Ge/MonitorChamber1/Layer2/Parent   = "MonitorChamber1"
s:Ge/MonitorChamber1/Layer2/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Layer2/Material = "Aluminum"
d:Ge/MonitorChamber1/Layer2/RMin     = 0.0   mm
d:Ge/MonitorChamber1/Layer2/RMax     = 90.0 mm
d:Ge/MonitorChamber1/Layer2/HL       = 0.003  mm
d:Ge/MonitorChamber1/Layer2/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/Layer2/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/Layer2/RotX     = 0.0 deg
d:Ge/MonitorChamber1/Layer2/RotY     = 0.0 deg
d:Ge/MonitorChamber1/Layer2/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/Layer2/TransX   = 0.0 mm
d:Ge/MonitorChamber1/Layer2/TransY   = 0.0 mm
d:Ge/MonitorChamber1/Layer2/TransZ   = 0.0  mm
b:Ge/MonitorChamber1/Layer2/Include  = "TRUE"

s:Ge/MonitorChamber1/Layer3/Parent   = "MonitorChamber1"
s:Ge/MonitorChamber1/Layer3/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Layer3/Material = "Gold"
d:Ge/MonitorChamber1/Layer3/RMin     = 0.0   mm
d:Ge/MonitorChamber1/Layer3/RMax     = 90.0 mm
d:Ge/MonitorChamber1/Layer3/HL       = 0.003  mm
d:Ge/MonitorChamber1/Layer3/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/Layer3/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/Layer3/RotX     = 0.0 deg
d:Ge/MonitorChamber1/Layer3/RotY     = 0.0 deg
d:Ge/MonitorChamber1/Layer3/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/Layer3/TransX   = 0.0 mm
d:Ge/MonitorChamber1/Layer3/TransY   = 0.0 mm
d:Ge/MonitorChamber1/Layer3/TransZ   = -10.0  mm
b:Ge/MonitorChamber1/Layer3/Include  = "TRUE"

#Distance calculation for Pipe
d:Ge/DistanceOf_BottomMon1_To_TopPipe = -20.0 mm
d:Ge/ZMinusOf_Mon1  = Ge/MonitorChamber1/TransZ - Ge/MonitorChamber1/HL mm
d:Ge/ZPlusOf_Pipe   = Ge/ZMinusOf_Mon1 + Ge/DistanceOf_BottomMon1_To_TopPipe mm

############################################
# Quad/Dipole Field specification in length
############################################
#Gap      Quad1   Gap   Quad2  Gap
#2.0 cm + 5.0*2 + 4.0 + 5.0*2 + 2.0 = 28.0 cm
d:Ge/HLOf_PipeInQuads = 14.0 cm
d:Ge/HLOf_Quad1       = 5.0 cm
d:Ge/HLOf_Quad2       = Ge/HLOf_Quad1 cm
d:Ge/Gap_Top_Quad1    = 2.0 cm
d:Ge/Gap_Quad1_Quad2  = 4.0 cm
d:Ge/Gap_Quad2_Bottom = 2.0 cm

d:Ge/HLxyOf_Quads         = 47.0 mm
d:Ge/HLxyOf_Dipoles       = 77.0 mm
d:Ge/ThicknessOf_Pipe     =  3.0 mm
s:Ge/MaterialOf_PipeWall  = "Aluminum"
s:Ge/MaterialOf_PipeGas   = "HeGas"
#s:Ge/MaterialOf_PipeGas   = "Vacuum"

d:Ge/FLOf_PipeConnector   = 10.0 cm

d:Ge/HLOf_Dipole1                                   = 10.5 cm
d:Ge/HLOf_Dipole2                                   = 13.0 cm
d:Ge/DistanceOf_Coil1_Dipole1                       = 6.0 cm
d:Ge/DistanceOf_Coil2_Dipole2                       = 8.0 cm
d:Ge/DistanceOf_BottomDipoleCoil1_To_TopDipoleCoil2 = 1.0 cm
d:Ge/DistanceOf_BottomPipe_To_TopBPM1               = -1.0 mm
d:Ge/DistanceOf_BottomBPM1_To_PipeExtension         = -0.0 mm
d:Ge/DistanceOf_BottomPipeExtension_To_BPM2         = -0.0 mm

#########################################################
#Calculated parameters from input
#Don't modify following calculations

d:Ge/HLOf_DipoleCoil1             = Ge/HLOf_Dipole1 + Ge/DistanceOf_Coil1_Dipole1 cm
d:Ge/HLOf_DipoleCoil2             = Ge/HLOf_Dipole2 + Ge/DistanceOf_Coil2_Dipole2 cm

d:Ge/FLOf_DipoleCoil1             = Ge/HLOf_DipoleCoil1 cm * 2.0
d:Ge/FLOf_DipoleCoil2             = Ge/HLOf_DipoleCoil2 cm * 2.0
d:Ge/FLOf_DipoleCoil1_DipoleCoil2 = Ge/FLOf_DipoleCoil1 + Ge/FLOf_DipoleCoil2  cm

d:Ge/FLOf_PipeInQuads             = 2.0 * Ge/HLOf_PipeInQuads cm

d:Ge/HLOf_PipeConnector           = Ge/FLOf_PipeConnector cm * 0.5

d:Ge/FLOf_PipeInDipoles           = Ge/FLOf_DipoleCoil1_DipoleCoil2 + Ge/DistanceOf_BottomDipoleCoil1_To_TopDipoleCoil2 cm
d:Ge/HLOf_PipeInDipoles           = Ge/FLOf_PipeInDipoles cm * 0.5

d:Ge/FLOf_QuadsDipoles            = Ge/FLOf_PipeInDipoles + Ge/FLOf_PipeInQuads cm

d:Ge/FLOf_Pipe                    = Ge/FLOf_QuadsDipoles  + Ge/FLOf_PipeConnector cm
d:Ge/HLOf_Pipe                    = Ge/FLOf_Pipe cm * 0.5
########################################################

########################################
# Pipe through Quads/Dipoles/
########################################
s:Ge/BeamPipeInQuadsDipoles/Parent = "Gantry"
s:Ge/BeamPipeInQuadsDipoles/Type   = "Group"
d:Ge/BeamPipeInQuadsDipoles/TransX = 0. m
d:Ge/BeamPipeInQuadsDipoles/TransY = 0. m
d:Ge/BeamPipeInQuadsDipoles/TransZ = Ge/ZPlusOf_Pipe - Ge/HLOf_Pipe mm
d:Ge/BeamPipeInQuadsDipoles/RotX   = 0. deg
d:Ge/BeamPipeInQuadsDipoles/RotY   = 0. deg
d:Ge/BeamPipeInQuadsDipoles/RotZ   = 0. deg

s:Ge/PipeInQuads/Parent   = "BeamPipeInQuadsDipoles"
s:Ge/PipeInQuads/Type     = "TsBox"
s:Ge/PipeInQuads/Material = Ge/MaterialOf_PipeWall
d:Ge/PipeInQuads/HLX      = Ge/HLxyOf_Quads + Ge/ThicknessOf_Pipe mm
d:Ge/PipeInQuads/HLY      = Ge/HLxyOf_Quads + Ge/ThicknessOf_Pipe mm
d:Ge/PipeInQuads/HLZ      = Ge/HLOf_PipeInQuads cm
d:Ge/PipeInQuads/TransX   = 0.0 mm
d:Ge/PipeInQuads/TransY   = 0.0 mm
d:Ge/PipeInQuads/TransZ   = Ge/HLOf_Pipe -  Ge/HLOf_PipeInQuads  cm
d:Ge/PipeInQuads/RotX     = 0.0 deg
d:Ge/PipeInQuads/RotY     = 0.0 deg
d:Ge/PipeInQuads/RotZ     = 0.0 deg

s:Ge/PipeInQuads/Gas/Parent   = "PipeInQuads"
s:Ge/PipeInQuads/Gas/Type     = "TsBox"
s:Ge/PipeInQuads/Gas/Material = Ge/MaterialOf_PipeGas
d:Ge/PipeInQuads/Gas/HLX      = Ge/HLxyOf_Quads   mm
d:Ge/PipeInQuads/Gas/HLY      = Ge/HLxyOf_Quads  mm
d:Ge/PipeInQuads/Gas/HLZ      = Ge/PipeInQuads/HLZ cm
d:Ge/PipeInQuads/Gas/TransX   = 0.0 mm
d:Ge/PipeInQuads/Gas/TransY   = 0.0 mm
d:Ge/PipeInQuads/Gas/TransZ   = 0.0 mm
d:Ge/PipeInQuads/Gas/RotX     = 0.0 deg
d:Ge/PipeInQuads/Gas/RotY     = 0.0 deg
d:Ge/PipeInQuads/Gas/RotZ     = 0.0 deg

########################################
#3. Quadrupole 1 and Quadrupole 2 in pipe
########################################
s:Ge/Quad1/Type          = "TsBox"
s:Ge/Quad1/Parent        = "PipeInQuads/Gas"
s:Ge/Quad1/Material      = "parent"
d:Ge/Quad1/HLX           = Ge/PipeInQuads/Gas/HLX cm
d:Ge/Quad1/HLY           = Ge/PipeInQuads/Gas/HLX cm
d:Ge/Quad1/HLZ           = Ge/HLOf_Quad1  cm
d:Ge/Quad1/TransX        = 0.0 cm
d:Ge/Quad1/TransY        = 0.0 cm
d:Ge/Quad1/Upstream      = Ge/PipeInQuads/Gas/HLZ - Ge/Gap_Top_Quad1 cm
d:Ge/Quad1/TransZ        = Ge/Quad1/Upstream - Ge/Quad1/HLZ cm
d:Ge/Quad1/Downstream    = Ge/Quad1/TransZ - Ge/Quad1/HLZ cm
d:Ge/Quad1/RotX          = 0.0 deg
d:Ge/Quad1/RotY          = 0.0 deg
d:Ge/Quad1/RotZ          = 0.0 deg
s:Ge/Quad1/Field = "QuadrupoleMagnet"
u:Ge/Quad1/MagneticFieldDirectionX    = -1
u:Ge/Quad1/MagneticFieldDirectionY    = 2.0
u:Ge/Quad1/MagneticFieldDirectionZ    = 3.0
d:Ge/Quad1/MagneticFieldGradientX     = 0.0 tesla/cm
d:Ge/Quad1/MagneticFieldGradientY     = 0.0 tesla/cm

s:Ge/Quad2/Type          = "TsBox"
s:Ge/Quad2/Parent        = "PipeInQuads/Gas"
s:Ge/Quad2/Material      = "parent"
d:Ge/Quad2/HLX           = Ge/PipeInQuads/Gas/HLX cm
d:Ge/Quad2/HLY           = Ge/PipeInQuads/Gas/HLX cm
d:Ge/Quad2/HLZ           = Ge/HLOf_Quad2  cm
d:Ge/Quad2/TransX        = 0.0 cm
d:Ge/Quad2/TransY        = 0.0 cm
d:Ge/Quad2/Upstream      = Ge/Quad1/Downstream - Ge/Gap_Quad1_Quad2 cm
d:Ge/Quad2/TransZ        = Ge/Quad2/Upstream - Ge/Quad2/HLZ cm
d:Ge/Quad2/RotX          = 0.0 deg
d:Ge/Quad2/RotY          = 0.0 deg
d:Ge/Quad2/RotZ          = 0.0 deg
s:Ge/Quad2/Field = "QuadrupoleMagnet"
u:Ge/Quad2/MagneticFieldDirectionX    = -1
u:Ge/Quad2/MagneticFieldDirectionY    = 2.0
u:Ge/Quad2/MagneticFieldDirectionZ    = 3.0
d:Ge/Quad2/MagneticFieldGradientX     = 0.0 tesla/cm
d:Ge/Quad2/MagneticFieldGradientY     = 0.0 tesla/cm

d:Ge/ZPlusPipeConnector = Ge/PipeInQuads/TransZ - Ge/HLOf_PipeInQuads cm

s:Ge/PipeConnector/Parent   = "BeamPipeInQuadsDipoles"
s:Ge/PipeConnector/Type     = "G4Trd"
s:Ge/PipeConnector/Material = Ge/MaterialOf_PipeWall
d:Ge/PipeConnector/HLX2     = Ge/HLxyOf_Quads + Ge/ThicknessOf_Pipe mm
d:Ge/PipeConnector/HLY2     = Ge/HLxyOf_Quads + Ge/ThicknessOf_Pipe mm
d:Ge/PipeConnector/HLX1     = Ge/HLxyOf_Dipoles + Ge/ThicknessOf_Pipe mm
d:Ge/PipeConnector/HLY1     = Ge/HLxyOf_Dipoles + Ge/ThicknessOf_Pipe mm
d:Ge/PipeConnector/HLZ      = Ge/HLOf_PipeConnector  mm
d:Ge/PipeConnector/TransX   = 0.0 mm
d:Ge/PipeConnector/TransY   = 0.0 mm
d:Ge/PipeConnector/TransZ   = Ge/ZPlusPipeConnector - Ge/HLOf_PipeConnector mm
d:Ge/PipeConnector/RotX     = 0.0 deg
d:Ge/PipeConnector/RotY     = 0.0 deg
d:Ge/PipeConnector/RotZ     = 0.0 deg
b:Ge/PipeConnector/Include  = "TRUE"

s:Ge/PipeConnector/Gas/Parent   = "PipeConnector"
s:Ge/PipeConnector/Gas/Type     = "G4Trd"
s:Ge/PipeConnector/Gas/Material = Ge/MaterialOf_PipeGas
d:Ge/PipeConnector/Gas/HLX2     = Ge/HLxyOf_Quads mm
d:Ge/PipeConnector/Gas/HLY2     = Ge/HLxyOf_Quads mm
d:Ge/PipeConnector/Gas/HLX1     = Ge/HLxyOf_Dipoles mm
d:Ge/PipeConnector/Gas/HLY1     = Ge/HLxyOf_Dipoles mm
d:Ge/PipeConnector/Gas/HLZ      = Ge/PipeConnector/HLZ mm
d:Ge/PipeConnector/Gas/TransX   = 0.0 mm
d:Ge/PipeConnector/Gas/TransY   = 0.0 mm
d:Ge/PipeConnector/Gas/TransZ   = 0.0 mm
d:Ge/PipeConnector/Gas/RotX     = 0.0 deg
d:Ge/PipeConnector/Gas/RotY     = 0.0 deg
d:Ge/PipeConnector/Gas/RotZ     = 0.0 deg
b:Ge/PipeConnector/Gas/Include  = "TRUE"

d:Ge/ZPlusPipeInDipoles = Ge/PipeConnector/TransZ - Ge/HLOf_PipeConnector cm

s:Ge/PipeInDipoles/Parent   = "BeamPipeInQuadsDipoles"
s:Ge/PipeInDipoles/Type     = "TsBox"
s:Ge/PipeInDipoles/Material = Ge/MaterialOf_PipeWall
d:Ge/PipeInDipoles/HLX      = Ge/HLxyOf_Dipoles + Ge/ThicknessOf_Pipe mm
d:Ge/PipeInDipoles/HLY      = Ge/HLxyOf_Dipoles + Ge/ThicknessOf_Pipe mm
d:Ge/PipeInDipoles/HLZ      = Ge/HLOf_PipeInDipoles cm
d:Ge/PipeInDipoles/TransX   = 0.0 mm
d:Ge/PipeInDipoles/TransY   = 0.0 mm
d:Ge/PipeInDipoles/TransZ   = Ge/ZPlusPipeInDipoles - Ge/HLOf_PipeInDipoles cm
d:Ge/PipeInDipoles/RotX     = 0.0 deg
d:Ge/PipeInDipoles/RotY     = 0.0 deg
d:Ge/PipeInDipoles/RotZ     = 0.0 deg
b:Ge/PipeInDipoles/Include  = "TRUE"

s:Ge/PipeInDipoles/Gas/Parent   = "PipeInDipoles"
s:Ge/PipeInDipoles/Gas/Type     = "TsBox"
s:Ge/PipeInDipoles/Gas/Material = Ge/MaterialOf_PipeGas
d:Ge/PipeInDipoles/Gas/HLX      = Ge/HLxyOf_Dipoles  mm
d:Ge/PipeInDipoles/Gas/HLY      = Ge/HLxyOf_Dipoles  mm
d:Ge/PipeInDipoles/Gas/HLZ      = Ge/HLOf_PipeInDipoles cm
d:Ge/PipeInDipoles/Gas/TransX   = 0.0 mm
d:Ge/PipeInDipoles/Gas/TransY   = 0.0 mm
d:Ge/PipeInDipoles/Gas/TransZ   = 0.0 mm
d:Ge/PipeInDipoles/Gas/RotX     = 0.0 deg
d:Ge/PipeInDipoles/Gas/RotY     = 0.0 deg
d:Ge/PipeInDipoles/Gas/RotZ     = 0.0 deg
b:Ge/PipeInDipoles/Gas/Include  = "TRUE"

########################################
#5. Dipole 1 and 2. in Pipe
########################################
s:Ge/Dipole1/Type          = "TsBox"
s:Ge/Dipole1/Parent        = "PipeInDipoles/Gas"
s:Ge/Dipole1/Material      = "parent"
d:Ge/Dipole1/HLX           = Ge/PipeInDipoles/Gas/HLX mm
d:Ge/Dipole1/HLY           = Ge/PipeInDipoles/Gas/HLY mm
d:Ge/Dipole1/HLZ           = Ge/HLOf_Dipole1 mm
d:Ge/Dipole1/TransX        = 0.0 cm
d:Ge/Dipole1/TransY        = 0.0 cm
d:Ge/Dipole1/TransZ        = Ge/HLOf_PipeInDipoles - Ge/HLOf_DipoleCoil1  mm
d:Ge/Dipole1/RotX          = 0.0 deg
d:Ge/Dipole1/RotY          = 0.0 deg
d:Ge/Dipole1/RotZ          = 0.0 deg
s:Ge/Dipole1/Field = "DipoleMagnet"
u:Ge/Dipole1/MagneticFieldDirectionX    = 1.0
u:Ge/Dipole1/MagneticFieldDirectionY    = 0.0
u:Ge/Dipole1/MagneticFieldDirectionZ    = 0.0
d:Ge/Dipole1/MagneticFieldStrength      = 0.0 tesla

d:Ge/ZMinusOf_Dipole1 = Ge/Dipole1/TransZ - Ge/HLOf_DipoleCoil1 mm
d:Ge/ZPlusOf_Dipole2  = Ge/ZMinusOf_Dipole1 + Ge/DistanceOf_BottomDipoleCoil1_To_TopDipoleCoil2 cm

s:Ge/Dipole2/Type          = "TsBox"
s:Ge/Dipole2/Parent        = "PipeInDipoles/Gas"
s:Ge/Dipole2/Material      = "parent"
d:Ge/Dipole2/HLX           = Ge/PipeInDipoles/Gas/HLX mm
d:Ge/Dipole2/HLY           = Ge/PipeInDipoles/Gas/HLY mm
d:Ge/Dipole2/HLZ           = Ge/HLOf_Dipole2 mm
d:Ge/Dipole2/TransX        = 0.0 cm
d:Ge/Dipole2/TransY        = 0.0 cm
d:Ge/Dipole2/TransZ        = Ge/ZPlusOf_Dipole2 - Ge/HLOf_DipoleCoil2  mm
d:Ge/Dipole2/RotX          = 0.0 deg
d:Ge/Dipole2/RotY          = 0.0 deg
d:Ge/Dipole2/RotZ          = 0.0 deg
s:Ge/Dipole2/Field = "DipoleMagnet"
u:Ge/Dipole2/MagneticFieldDirectionX    = 0.0
u:Ge/Dipole2/MagneticFieldDirectionY    = 1.0
u:Ge/Dipole2/MagneticFieldDirectionZ    = 0.0
d:Ge/Dipole2/MagneticFieldStrength      = 0.0 tesla

d:Ge/ZMinusOf_Pipe = Ge/BeamPipeInQuadsDipoles/TransZ - Ge/HLOf_Pipe mm
d:Ge/ZPlusOf_BPM1  = Ge/ZMinusOf_Pipe + Ge/DistanceOf_BottomPipe_To_TopBPM1  mm

########################################
#5. Beam profile Monitor chamber at the end of pipe
#HLx, HLy, HLz (9.2, 9.2, 1.8)
# 2 Mylar windows
# 2 sets of Multi-wire chamber
########################################
s:Ge/BeamProfileMonitor1/Parent   = "Gantry"
s:Ge/BeamProfileMonitor1/Type     = "TsBox"
s:Ge/BeamProfileMonitor1/Material = "NiGas"
d:Ge/BeamProfileMonitor1/HLX      = 92.0 mm
d:Ge/BeamProfileMonitor1/HLY      = 92.0 mm
d:Ge/BeamProfileMonitor1/HLZ      = 22.0 mm
d:Ge/BeamProfileMonitor1/TransX   = 0.0   mm
d:Ge/BeamProfileMonitor1/TransY   = 0.0   mm
d:Ge/BeamProfileMonitor1/TransZ   = Ge/ZPlusOf_BPM1 - Ge/BeamProfileMonitor1/HLZ cm
d:Ge/BeamProfileMonitor1/RotX     = 0.0 deg
d:Ge/BeamProfileMonitor1/RotY     = 0.0 deg
d:Ge/BeamProfileMonitor1/RotZ     = 0.0 deg
b:Ge/BeamProfileMonitor1/Include  = "TRUE"

s:Ge/BeamProfileMonitor1/Window1/Parent   = "BeamProfileMonitor1"
s:Ge/BeamProfileMonitor1/Window1/Type     = "TsBox"
s:Ge/BeamProfileMonitor1/Window1/Material = "Mylar"
d:Ge/BeamProfileMonitor1/Window1/HLX      = 90.0  mm
d:Ge/BeamProfileMonitor1/Window1/HLY      = 90.0  mm
d:Ge/BeamProfileMonitor1/Window1/HLZ      = 0.02  mm
d:Ge/BeamProfileMonitor1/Window1/TransX   = 0.0 mm
d:Ge/BeamProfileMonitor1/Window1/TransY   = 0.0 mm
d:Ge/BeamProfileMonitor1/Window1/TransZ   = 18.123 mm
d:Ge/BeamProfileMonitor1/Window1/RotX     = 0.0 deg
d:Ge/BeamProfileMonitor1/Window1/RotY     = 0.0 deg
d:Ge/BeamProfileMonitor1/Window1/RotZ     = 0.0 deg

s:Ge/BeamProfileMonitor1/Window2/Parent   = "BeamProfileMonitor1"
s:Ge/BeamProfileMonitor1/Window2/Type     = "TsBox"
s:Ge/BeamProfileMonitor1/Window2/Material = "Mylar"
d:Ge/BeamProfileMonitor1/Window2/HLX      = 90.0  mm
d:Ge/BeamProfileMonitor1/Window2/HLY      = 90.0  mm
d:Ge/BeamProfileMonitor1/Window2/HLZ      = 0.02  mm
d:Ge/BeamProfileMonitor1/Window2/TransX   = 0.0 mm
d:Ge/BeamProfileMonitor1/Window2/TransY   = 0.0 mm
d:Ge/BeamProfileMonitor1/Window2/TransZ   = -18.123 mm
d:Ge/BeamProfileMonitor1/Window2/RotX     = 0.0 deg
d:Ge/BeamProfileMonitor1/Window2/RotY     = 0.0 deg
d:Ge/BeamProfileMonitor1/Window2/RotZ     = 0.0 deg

s:Ge/MWC_In_BPM1/Parent     = "BeamProfileMonitor1"
s:Ge/MWC_In_BPM1/Type       = "TsMultiWireChamber"
s:Ge/MWC_In_BPM1/Material   = "parent"
d:Ge/MWC_In_BPM1/HLX        = 88.0 mm
d:Ge/MWC_In_BPM1/HLY        = 88.0 mm
d:Ge/MWC_In_BPM1/HLZ        = 13.0 mm
d:Ge/MWC_In_BPM1/TransX     = 0.0 mm
d:Ge/MWC_In_BPM1/TransY     = 0.0 mm
d:Ge/MWC_In_BPM1/TransZ     = 0.0 mm
d:Ge/MWC_In_BPM1/RotX       = 0.0 deg
d:Ge/MWC_In_BPM1/RotY       = 0.0 deg
d:Ge/MWC_In_BPM1/RotZ       = 0.0 deg
i:Ge/MWC_In_BPM1/NbOfLayers = 2

d:Ge/MWC_In_BPM1/Layer1/RMin          = 0.0 mm
d:Ge/MWC_In_BPM1/Layer1/RMax          = 0.02 mm
s:Ge/MWC_In_BPM1/Layer1/Material      = "Brass"
d:Ge/MWC_In_BPM1/Layer1/HL            = 85.0 mm
s:Ge/MWC_In_BPM1/Layer1/Align         = "X"
d:Ge/MWC_In_BPM1/Layer1/PosZ          = 5.0 mm
s:Ge/MWC_In_BPM1/Layer1/DrawingStyle  = "FullWireFrame"
dv:Ge/MWC_In_BPM1/Layer1/Displacement = 72
-71.9855 -69.9855 -67.9855 -65.9855 -63.9855 -61.9855 -59.9855 -57.9855 -55.9855 -53.9855
-51.9855 -49.9855 -47.9855 -45.9855 -43.9855 -41.9855 -39.9855 -37.9855 -35.9855 -33.9855
-31.9855 -29.9855 -27.9855 -25.9855 -23.9855 -21.9855 -19.9855 -17.9855 -15.9855 -13.9855
-11.9855  -9.9855  -7.9855  -5.9855  -3.9855 -1.9855   0.0145   2.0145   4.0145   6.0145
  8.0145  10.0145  12.0145  14.0145  16.0145 18.0145  20.0145  22.0145  24.0145  26.0145
 28.0145  30.0145  32.0145  34.0145  36.0145 38.0145  40.0145  42.0145  44.0145  46.0145
 48.0145  50.0145  52.0145  54.0145  56.0145 58.0145  60.0145  62.0145  64.0145  66.0145
 68.0145  70.0145 mm

d:Ge/MWC_In_BPM1/Layer2/RMin          = 0.0 mm
d:Ge/MWC_In_BPM1/Layer2/RMax          = 0.02 mm
s:Ge/MWC_In_BPM1/Layer2/Material      = "Brass"
d:Ge/MWC_In_BPM1/Layer2/HL            = 85.0 mm
s:Ge/MWC_In_BPM1/Layer2/Align         = "Y"
d:Ge/MWC_In_BPM1/Layer2/PosZ          = -5.0 mm
s:Ge/MWC_In_BPM1/Layer2/DrawingStyle  =  "FullWireFrame"
s:Ge/MWC_In_BPM1/Layer2/Color         = "red"
dv:Ge/MWC_In_BPM1/Layer2/Displacement = 72
-71.9855 -69.9855 -67.9855 -65.9855 -63.9855 -61.9855 -59.9855 -57.9855 -55.9855 -53.9855
-51.9855 -49.9855 -47.9855 -45.9855 -43.9855 -41.9855 -39.9855 -37.9855 -35.9855 -33.9855
-31.9855 -29.9855 -27.9855 -25.9855 -23.9855 -21.9855 -19.9855 -17.9855 -15.9855 -13.9855
-11.9855  -9.9855  -7.9855  -5.9855  -3.9855 -1.9855   0.0145   2.0145   4.0145   6.0145
  8.0145  10.0145  12.0145  14.0145  16.0145 18.0145  20.0145  22.0145  24.0145  26.0145
 28.0145  30.0145  32.0145  34.0145  36.0145 38.0145  40.0145  42.0145  44.0145  46.0145
 48.0145  50.0145  52.0145  54.0145  56.0145 58.0145  60.0145  62.0145  64.0145  66.0145
 68.0145  70.0145 mm

d:Ge/ZMinusOf_BPM1         = Ge/BeamProfileMonitor1/TransZ - Ge/BeamProfileMonitor1/HLZ mm
d:Ge/ZPlusOf_PipeExtension =  Ge/ZMinusOf_BPM1  + Ge/DistanceOf_BottomBPM1_To_PipeExtension mm

d:Ge/FLOf_PipeExtension      = 80.0 cm
d:Ge/HLOf_PipeExtension      = Ge/FLOf_PipeExtension cm * 0.5


########################################
#6. Beam pipe extension
#HLx, HLy, (9.2, 9.2)
#HLx, HLy, HLz (1
# 2 Mylar windows
# 2 sets of Multi-wire chamber
########################################
s:Ge/PipeExtension/Parent   = "Gantry"
s:Ge/PipeExtension/Type     = "G4Trd"
s:Ge/PipeExtension/Material = "Aluminum"
d:Ge/PipeExtension/HLX2     = 92.0   mm
d:Ge/PipeExtension/HLY2     = 92.0   mm
d:Ge/PipeExtension/HLX1     = 122.0   mm
d:Ge/PipeExtension/HLY1     = 122.0   mm
d:Ge/PipeExtension/HLZ      = Ge/HLOf_PipeExtension  mm
d:Ge/PipeExtension/TransX   = 0.0 mm
d:Ge/PipeExtension/TransY   = 0.0 mm
d:Ge/PipeExtension/TransZ   = Ge/ZPlusOf_PipeExtension - Ge/HLOf_PipeExtension mm
d:Ge/PipeExtension/RotX     = 0.0 deg
d:Ge/PipeExtension/RotY     = 0.0 deg
d:Ge/PipeExtension/RotZ     = 0.0 deg
b:Ge/PipeExtension/Include  = "TRUE"

s:Ge/PipeExtension/Gas/Parent   = "PipeExtension"
s:Ge/PipeExtension/Gas/Type     = "G4Trd"
s:Ge/PipeExtension/Gas/Material = Ge/PipeInQuads/Gas/Material
d:Ge/PipeExtension/Gas/HLX2     = 90.0  mm
d:Ge/PipeExtension/Gas/HLY2     = 90.0  mm
d:Ge/PipeExtension/Gas/HLX1     = 120.0  mm
d:Ge/PipeExtension/Gas/HLY1     = 120.0  mm
d:Ge/PipeExtension/Gas/HLZ      = Ge/PipeExtension/HLZ mm
d:Ge/PipeExtension/Gas/TransX   = 0.0 mm
d:Ge/PipeExtension/Gas/TransY   = 0.0 mm
d:Ge/PipeExtension/Gas/TransZ   = 0.0 mm
d:Ge/PipeExtension/Gas/RotX     = 0.0 deg
d:Ge/PipeExtension/Gas/RotY     = 0.0 deg
d:Ge/PipeExtension/Gas/RotZ     = 0.0 deg
b:Ge/PipeExtension/Gas/Include  = "TRUE"

d:Ge/ZMinusOf_PipeExtension = Ge/PipeExtension/TransZ - Ge/HLOf_PipeExtension mm
d:Ge/ZPlusOf_BPM2 = Ge/ZMinusOf_PipeExtension  + Ge/DistanceOf_BottomPipeExtension_To_BPM2 mm

########################################
#6. Beam profile monitor 2
# 2 Mylar windows
# 2 sets of Multi-wire chamber
########################################
s:Ge/BeamProfileMonitor2/Parent   = "Gantry"
s:Ge/BeamProfileMonitor2/Type     = "TsBox"
s:Ge/BeamProfileMonitor2/Material = "NiGas"
d:Ge/BeamProfileMonitor2/HLX      = 152.0 mm
d:Ge/BeamProfileMonitor2/HLY      = 152.0 mm
d:Ge/BeamProfileMonitor2/HLZ      = 25.0 mm
d:Ge/BeamProfileMonitor2/TransX   = 0.0   mm
d:Ge/BeamProfileMonitor2/TransY   = 0.0   mm
d:Ge/BeamProfileMonitor2/TransZ   = Ge/ZPlusOf_BPM2 - Ge/BeamProfileMonitor2/HLZ mm
d:Ge/BeamProfileMonitor2/RotX     = 0.0 deg
d:Ge/BeamProfileMonitor2/RotY     = 0.0 deg
d:Ge/BeamProfileMonitor2/RotZ     = 0.0 deg
b:Ge/BeamProfileMonitor2/Include  = "TRUE"

s:Ge/BeamProfileMonitor2/Window1/Parent   = "BeamProfileMonitor2"
s:Ge/BeamProfileMonitor2/Window1/Type     = "TsBox"
s:Ge/BeamProfileMonitor2/Window1/Material = "Mylar"
d:Ge/BeamProfileMonitor2/Window1/HLX      = 150.0  mm
d:Ge/BeamProfileMonitor2/Window1/HLY      = 150.0  mm
d:Ge/BeamProfileMonitor2/Window1/HLZ      = 0.01  mm
d:Ge/BeamProfileMonitor2/Window1/TransX   = 0.0 mm
d:Ge/BeamProfileMonitor2/Window1/TransY   = 0.0 mm
d:Ge/BeamProfileMonitor2/Window1/TransZ   = 18.123 mm
d:Ge/BeamProfileMonitor2/Window1/RotX     = 0.0 deg
d:Ge/BeamProfileMonitor2/Window1/RotY     = 0.0 deg
d:Ge/BeamProfileMonitor2/Window1/RotZ     = 0.0 deg

s:Ge/BeamProfileMonitor2/Window2/Parent   = "BeamProfileMonitor2"
s:Ge/BeamProfileMonitor2/Window2/Type     = "TsBox"
s:Ge/BeamProfileMonitor2/Window2/Material = "Mylar"
d:Ge/BeamProfileMonitor2/Window2/HLX      = 150.0  mm
d:Ge/BeamProfileMonitor2/Window2/HLY      = 150.0  mm
d:Ge/BeamProfileMonitor2/Window2/HLZ      = 0.01  mm
d:Ge/BeamProfileMonitor2/Window2/TransX   = 0.0 mm
d:Ge/BeamProfileMonitor2/Window2/TransY   = 0.0 mm
d:Ge/BeamProfileMonitor2/Window2/TransZ   = -18.123 mm
d:Ge/BeamProfileMonitor2/Window2/RotX     = 0.0 deg
d:Ge/BeamProfileMonitor2/Window2/RotY     = 0.0 deg
d:Ge/BeamProfileMonitor2/Window2/RotZ     = 0.0 deg

s:Ge/MWC_In_BPM2/Parent     = "BeamProfileMonitor2"
s:Ge/MWC_In_BPM2/Type       = "TsMultiWireChamber"
s:Ge/MWC_In_BPM2/Material   = "parent"
d:Ge/MWC_In_BPM2/HLX        = 148.0  mm
d:Ge/MWC_In_BPM2/HLY        = 148.0  mm
d:Ge/MWC_In_BPM2/HLZ        = 13.0   mm
d:Ge/MWC_In_BPM2/TransX     = 0.0 mm
d:Ge/MWC_In_BPM2/TransY     = 0.0 mm
d:Ge/MWC_In_BPM2/TransZ     = 0.0 mm
d:Ge/MWC_In_BPM2/RotX       = 0.0   deg
d:Ge/MWC_In_BPM2/RotY       = 0.0   deg
d:Ge/MWC_In_BPM2/RotZ       = 0.0   deg
i:Ge/MWC_In_BPM2/NbOfLayers = 2

d:Ge/MWC_In_BPM2/Layer1/RMin          = 0.0 mm
d:Ge/MWC_In_BPM2/Layer1/RMax          = 0.02 mm
s:Ge/MWC_In_BPM2/Layer1/Material      = "Brass"
d:Ge/MWC_In_BPM2/Layer1/HL            = 147.0 mm
s:Ge/MWC_In_BPM2/Layer1/Align         = "X"
d:Ge/MWC_In_BPM2/Layer1/PosZ          = 5.0 mm
s:Ge/MWC_In_BPM2/Layer1/DrawingStyle  = "Solid"
dv:Ge/MWC_In_BPM2/Layer1/Displacement = 81
-140. -136.5 -133.  -129.5 -126.  -122.5 -119.  -115.5
-112. -108.5 -105.  -101.5  -98.   -94.5  -91.   -87.5
-84.  -80.5   -77.   -73.5  -70.   -66.5  -63.   -59.5
-56.  -52.5   -49.   -45.5  -42.   -38.5  -35.   -31.5
-28.  -24.5   -21.   -17.5  -14.   -10.5   -7.    -3.5
  0.    3.5     7.    10.5   14.    17.5   21.    24.5
 28.   31.5    35.    38.5   42.    45.5   49.    52.5
 56.   59.5    63.    66.5   70.    73.5   77.    80.5
 84.   87.5    91.    94.5   98.   101.5  105.   108.5
112.  115.5   119.   122.5  126.   129.5  133.   136.5
140.  mm

d:Ge/MWC_In_BPM2/Layer2/RMin          = 0.0 mm
d:Ge/MWC_In_BPM2/Layer2/RMax          = 0.02 mm
s:Ge/MWC_In_BPM2/Layer2/Material      = "Brass"
d:Ge/MWC_In_BPM2/Layer2/HL            = 147.0 mm
s:Ge/MWC_In_BPM2/Layer2/Align         = "Y"
d:Ge/MWC_In_BPM2/Layer2/PosZ          = -5.0 mm
s:Ge/MWC_In_BPM2/Layer2/DrawingStyle  =  "Solid"
s:Ge/MWC_In_BPM2/Layer2/Color         = "red"
dv:Ge/MWC_In_BPM2/Layer2/Displacement = 81
-140. -136.5 -133.  -129.5 -126.  -122.5 -119.  -115.5
-112. -108.5 -105.  -101.5  -98.   -94.5  -91.   -87.5
-84.  -80.5   -77.   -73.5  -70.   -66.5  -63.   -59.5
-56.  -52.5   -49.   -45.5  -42.   -38.5  -35.   -31.5
-28.  -24.5   -21.   -17.5  -14.   -10.5   -7.    -3.5
  0.    3.5     7.    10.5   14.    17.5   21.    24.5
 28.   31.5    35.    38.5   42.    45.5   49.    52.5
 56.   59.5    63.    66.5   70.    73.5   77.    80.5
 84.   87.5    91.    94.5   98.   101.5  105.   108.5
112.  115.5   119.   122.5  126.   129.5  133.   136.5
140.  mm

ScanningStationaryTarget.txt

# Use scanning nozzle to paint stationary target

includeFile = RasterScanningPattern.txt TargetInWaterPhantom.txt Viewer.txt

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

b:Ts/PauseBeforeQuit = "False"

i:So/Example/NumberOfHistoriesInRun = 5
d:So/Example/BeamEnergy             = 145.00 MeV

d:Tf/TimelineEnd               = 1 s
i:Tf/NumberOfSequentialTimes   = 100

ScanningTargetMovingHorizontal.txt

# Use scanning nozzle to paint target that is moving horizontally

includeFile = RasterScanningPattern.txt TargetInWaterPhantom.txt Viewer.txt

i:Tf/Verbosity = 1

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

d:Ge/X_max   =  1.5 cm
d:Ge/X_min   = Ge/X_max cm * -1.0
d:Ge/X_range = Ge/X_max cm * 2.0

# 1. Motion for Target
s:Tf/HorizontalMoveSine/Function           = "Sine"
d:Tf/HorizontalMoveSine/RepetitionInterval = 1.0 s
d:Tf/HorizontalMoveSine/Rate               = 0.36  deg/ms
d:Tf/HorizontalMoveSine/StartValue         = 0.0 deg

d:Tf/HorizontalMove/Value = 2.0 cm * Tf/HorizontalMoveSine/Value
d:Tf/HorizontalScan/Value = 0.15 tesla * Tf/HorizontalMoveSine/Value

# 2. Compensated BField
d:Tf/BField2ndTrackingField/Value = Tf/HorizontalScan/Value + Tf/BField2nd/Value tesla

i:Tf/NumberOfSequentialTimes = 100
d:Tf/TimelineEnd = 1 s

d:Ge/PlaneAtR80/TransX = Tf/HorizontalMove/Value cm
d:Ge/Dipole2/MagneticFieldStrength  = Tf/BField2ndTrackingField/Value tesla

Ts/UseQt = "True"

ScanningTargetMovingInDepth.txt

# Use scanning nozzle to paint target this is moving in depth

includeFile = RasterScanningPattern.txt TargetInWaterPhantom.txt Viewer.txt

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

b:Ts/PauseBeforeQuit = "False"

i:So/Example/NumberOfHistoriesInRun = 10
d:Tf/TimelineEnd                    = 1 s
i:Tf/NumberOfSequentialTimes        = 100

#1. Target position and Energy varies as a sinusoidal
s:Tf/VerticalMoveCosine/Function           = "Cosine"
d:Tf/VerticalMoveCosine/RepetitionInterval = 1.0 s
d:Tf/VerticalMoveCosine/Rate               = 0.36 deg/ms
d:Tf/VerticalMoveCosine/StartValue         = 0.0 deg

#2. Tracking target
d:Tf/VerticalMoveD_Cosine/Value = 18.6 mm  * Tf/VerticalMoveCosine/Value
d:Tf/VerticalMoveR80/Value      = -166.142 mm + Tf/VerticalMoveD_Cosine/Value

#3. Beam energy changing for tracking target
d:Tf/VerticalMoveE_Cosine/Value = -10.0 MeV * Tf/VerticalMoveCosine/Value
d:Tf/VerticalMoveEnergy/Value   = 155.0 MeV + Tf/VerticalMoveE_Cosine/Value
d:So/Example/BeamEnergy         = Tf/VerticalMoveEnergy/Value MeV

d:Ge/R80 = Tf/VerticalMoveR80/Value cm

#Fixed target for visual guidance
d:Ge/R80Fix                 = -140.50 mm
s:Ge/PlaneAtR80Fix/Parent   = "WaterPhantom"
s:Ge/PlaneAtR80Fix/Type     = "TsBox"
s:Ge/PlaneAtR80Fix/Material = "G4_WATER"
d:Ge/PlaneAtR80Fix/HLX      = 5.0 cm
d:Ge/PlaneAtR80Fix/HLY      = 5.0 cm
d:Ge/PlaneAtR80Fix/HLZ      = 0.01 cm
d:Ge/PlaneAtR80Fix/TransX   = 0. cm
d:Ge/PlaneAtR80Fix/TransY   = 0. cm
d:Ge/PlaneAtR80Fix/TransZ   = Ge/WaterPhantom/HLZ + Ge/R80Fix cm
d:Ge/PlaneAtR80Fix/RotX     = 0.0 deg
d:Ge/PlaneAtR80Fix/RotY     = 0.0 deg
d:Ge/PlaneAtR80Fix/RotZ     = 0.0 deg
s:Ge/PlaneAtR80Fix/Color    = "green"
i:Ge/PlaneAtR80Fix/XBins    = 1
i:Ge/PlaneAtR80Fix/YBins    = 1
i:Ge/PlaneAtR80Fix/ZBins    = 1

d:Gr/ViewA/Theta            = 90 deg
d:Gr/ViewA/Phi              = 0 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 20 deg
u:Gr/ViewA/Zoom             = 10

ScatteringNozzle.txt

# Scattering nozzle used in some demonstrations.

includeFile = ConstantsForNozzles.txt

########################################
#1. Beam Exit Window
#100 um thickness Mylar window
########################################
s:Ge/ExitWindow/Parent       = "Gantry"
s:Ge/ExitWindow/Type         = "TsCylinder"
s:Ge/ExitWindow/Material     = "Mylar"
d:Ge/ExitWindow/RMin         = 0.0  mm
d:Ge/ExitWindow/RMax         = 50.0 mm
d:Ge/ExitWindow/HL           = 0.05 mm
d:Ge/ExitWindow/SPhi         = 0.0   deg
d:Ge/ExitWindow/DPhi         = 360.0 deg
d:Ge/ExitWindow/TransX       = 0.0 mm
d:Ge/ExitWindow/TransY       = 0.0 mm
d:Ge/ExitWindow/TransZ       = 299.8 cm
d:Ge/ExitWindow/RotX         = 0.0 deg
d:Ge/ExitWindow/RotY         = 0.0 deg
d:Ge/ExitWindow/RotZ         = 0.0 deg
b:Ge/ExitWindow/Include      = "TRUE"
s:Ge/ExitWindow/DrawingStyle = "Solid"

d:Ge/DistanceOf_CenterExitWindow_To_TopMon1 = -30.0 mm
d:Ge/ZPlusOf_Mon1 = Ge/ExitWindow/TransZ + Ge/DistanceOf_CenterExitWindow_To_TopMon1 cm

########################################
#2. Monitor chamber 1.
# Filled with Nitrogen Gas, 3 layers
# Thickness, position, Material
#            1.0       Gold
#            0.0 	   Aluminum
#           -1.0       Gold
########################################
s:Ge/MonitorChamber1/Parent   = "Gantry"
s:Ge/MonitorChamber1/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Material = "NiGas"
d:Ge/MonitorChamber1/RMin     = 0.0   mm
d:Ge/MonitorChamber1/RMax     = 100.0 mm
d:Ge/MonitorChamber1/HL       = 15.0  mm
d:Ge/MonitorChamber1/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/RotX     = 0.0 deg
d:Ge/MonitorChamber1/RotY     = 0.0 deg
d:Ge/MonitorChamber1/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/TransX   = 0.0 mm
d:Ge/MonitorChamber1/TransY   = 0.0 mm
d:Ge/MonitorChamber1/TransZ   = Ge/ZPlusOf_Mon1 - Ge/MonitorChamber1/HL mm
b:Ge/MonitorChamber1/Include  = "TRUE"

s:Ge/MonitorChamber1/Layer1/Parent   = "MonitorChamber1"
s:Ge/MonitorChamber1/Layer1/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Layer1/Material = "Gold"
d:Ge/MonitorChamber1/Layer1/RMin     = 0.0   mm
d:Ge/MonitorChamber1/Layer1/RMax     = 90.0 mm
d:Ge/MonitorChamber1/Layer1/HL       = 0.002  mm
d:Ge/MonitorChamber1/Layer1/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/Layer1/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/Layer1/RotX     = 0.0 deg
d:Ge/MonitorChamber1/Layer1/RotY     = 0.0 deg
d:Ge/MonitorChamber1/Layer1/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/Layer1/TransX   = 0.0 mm
d:Ge/MonitorChamber1/Layer1/TransY   = 0.0 mm
d:Ge/MonitorChamber1/Layer1/TransZ   = 10.0  mm
b:Ge/MonitorChamber1/Layer1/Include  = "TRUE"

s:Ge/MonitorChamber1/Layer2/Parent   = "MonitorChamber1"
s:Ge/MonitorChamber1/Layer2/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Layer2/Material = "Aluminum"
d:Ge/MonitorChamber1/Layer2/RMin     = 0.0   mm
d:Ge/MonitorChamber1/Layer2/RMax     = 90.0 mm
d:Ge/MonitorChamber1/Layer2/HL       = 0.003  mm
d:Ge/MonitorChamber1/Layer2/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/Layer2/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/Layer2/RotX     = 0.0 deg
d:Ge/MonitorChamber1/Layer2/RotY     = 0.0 deg
d:Ge/MonitorChamber1/Layer2/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/Layer2/TransX   = 0.0 mm
d:Ge/MonitorChamber1/Layer2/TransY   = 0.0 mm
d:Ge/MonitorChamber1/Layer2/TransZ   = 0.0  mm
b:Ge/MonitorChamber1/Layer2/Include  = "TRUE"

s:Ge/MonitorChamber1/Layer3/Parent   = "MonitorChamber1"
s:Ge/MonitorChamber1/Layer3/Type     = "TsCylinder"
s:Ge/MonitorChamber1/Layer3/Material = "Gold"
d:Ge/MonitorChamber1/Layer3/RMin     = 0.0   mm
d:Ge/MonitorChamber1/Layer3/RMax     = 90.0 mm
d:Ge/MonitorChamber1/Layer3/HL       = 0.003  mm
d:Ge/MonitorChamber1/Layer3/SPhi     = 0.0   deg
d:Ge/MonitorChamber1/Layer3/DPhi     = 360.0 deg
d:Ge/MonitorChamber1/Layer3/RotX     = 0.0 deg
d:Ge/MonitorChamber1/Layer3/RotY     = 0.0 deg
d:Ge/MonitorChamber1/Layer3/RotZ     = 0.0 deg
d:Ge/MonitorChamber1/Layer3/TransX   = 0.0 mm
d:Ge/MonitorChamber1/Layer3/TransY   = 0.0 mm
d:Ge/MonitorChamber1/Layer3/TransZ   = -10.0  mm
b:Ge/MonitorChamber1/Layer3/Include  = "TRUE"

##################################################
# First Scatterer:
##################################################
s:Ge/Scatterer1/Type    = "Group"
s:Ge/Scatterer1/Parent  = "Gantry"
d:Ge/Scatterer1/TransX  =  0.0 cm
d:Ge/Scatterer1/TransY  =  0.0 cm
d:Ge/Scatterer1/TransZ  = 280. cm
d:Ge/Scatterer1/RotX    = 0. deg
d:Ge/Scatterer1/RotY    = 0. deg
d:Ge/Scatterer1/RotZ    = 0. deg
s:Ge/Scatterer1/Message = "Constructing IBA TsScatterer1"

# Center for rotation of scatterers:
d:Ge/Scatterer1/RotationCenterY = 5.0 cm
# Defining the in and out of beam rotation angle
d:Ge/Scatterer1/RotZ_InBeam    	= 180.0 deg
d:Ge/Scatterer1/RotZ_OutOfBeam 	=   0.0 deg

d:Ge/Scatterer1/Lollipop1 = Ge/Scatterer1/RotZ_OutOfBeam deg
d:Ge/Scatterer1/Lollipop2 = Ge/Scatterer1/RotZ_OutOfBeam deg
d:Ge/Scatterer1/Lollipop3 = Ge/Scatterer1/RotZ_OutOfBeam deg

# Lollipop 1:
s:Ge/Scatterer1/L1/Type   = "Group"
s:Ge/Scatterer1/L1/Parent = "Scatterer1"
d:Ge/Scatterer1/L1/TransX = 0.0 cm
d:Ge/Scatterer1/L1/TransY = Ge/Scatterer1/RotationCenterY cm
d:Ge/Scatterer1/L1/TransZ = 0.0 cm
d:Ge/Scatterer1/L1/RotX   = 0. deg
d:Ge/Scatterer1/L1/RotY   = 0. deg
d:Ge/Scatterer1/L1/RotZ   = Ge/Scatterer1/Lollipop1 deg

# L1 Lead Foil:
s:Ge/Scatterer1/L1/LeadFoil/Parent   = "Scatterer1/L1"
s:Ge/Scatterer1/L1/LeadFoil/Type     = "TsBox"
s:Ge/Scatterer1/L1/LeadFoil/Material = "Lead"
d:Ge/Scatterer1/L1/LeadFoil/HLX      = 2.15 cm
d:Ge/Scatterer1/L1/LeadFoil/HLY      = 2.15 cm
d:Ge/Scatterer1/L1/LeadFoil/HLZ      = 0.01 cm
d:Ge/Scatterer1/L1/LeadFoil/TransX   = 0.0 cm
d:Ge/Scatterer1/L1/LeadFoil/TransY   = Ge/Scatterer1/RotationCenterY cm
d:Ge/Scatterer1/L1/LeadFoil/TransZ   = 1.0 cm
d:Ge/Scatterer1/L1/LeadFoil/RotX     = 0. deg
d:Ge/Scatterer1/L1/LeadFoil/RotY     = 0. deg
d:Ge/Scatterer1/L1/LeadFoil/RotZ     = 0. deg


# Lollipop 2:
s:Ge/Scatterer1/L2/Type   = "Group"
s:Ge/Scatterer1/L2/Parent = "Scatterer1"
d:Ge/Scatterer1/L2/TransX = 0.0 cm
d:Ge/Scatterer1/L2/TransY = Ge/Scatterer1/RotationCenterY cm
d:Ge/Scatterer1/L2/TransZ = 0.0 cm
d:Ge/Scatterer1/L2/RotX   = 0. deg
d:Ge/Scatterer1/L2/RotY   = 0. deg
d:Ge/Scatterer1/L2/RotZ   = Ge/Scatterer1/Lollipop2 deg

# L2 Lead Foil:
s:Ge/Scatterer1/L2/LexanFoil/Parent   = "Scatterer1/L2"
s:Ge/Scatterer1/L2/LexanFoil/Type     = "TsBox"
s:Ge/Scatterer1/L2/LexanFoil/Material = "Lexan"
d:Ge/Scatterer1/L2/LexanFoil/HLX      = 2.5 cm
d:Ge/Scatterer1/L2/LexanFoil/HLY      = 2.5 cm
d:Ge/Scatterer1/L2/LexanFoil/HLZ      = 0.2 cm
d:Ge/Scatterer1/L2/LexanFoil/TransX   = 0.0 cm
d:Ge/Scatterer1/L2/LexanFoil/TransY   = Ge/Scatterer1/RotationCenterY cm
d:Ge/Scatterer1/L2/LexanFoil/TransZ   = 0.0 cm
d:Ge/Scatterer1/L2/LexanFoil/RotX     = 0. deg
d:Ge/Scatterer1/L2/LexanFoil/RotY     = 0. deg
d:Ge/Scatterer1/L2/LexanFoil/RotZ     = 0. deg


# Lollipop 3:
s:Ge/Scatterer1/L3/Type   = "Group"
s:Ge/Scatterer1/L3/Parent = "Scatterer1"
d:Ge/Scatterer1/L3/TransX =  0.0 cm
d:Ge/Scatterer1/L3/TransY =  Ge/Scatterer1/RotationCenterY cm
d:Ge/Scatterer1/L3/TransZ =  0.0 cm
d:Ge/Scatterer1/L3/RotX   = 0. deg
d:Ge/Scatterer1/L3/RotY   = 0. deg
d:Ge/Scatterer1/L3/RotZ   = Ge/Scatterer1/Lollipop2 deg

# L2 Lead Foil:
s:Ge/Scatterer1/L3/LeadFoil/Parent   = "Scatterer1/L3"
s:Ge/Scatterer1/L3/LeadFoil/Type     = "TsBox"
s:Ge/Scatterer1/L3/LeadFoil/Material = "Lead"
d:Ge/Scatterer1/L3/LeadFoil/HLX      = 2.5 cm
d:Ge/Scatterer1/L3/LeadFoil/HLY      = 2.5 cm
d:Ge/Scatterer1/L3/LeadFoil/HLZ      = 0.02 cm
d:Ge/Scatterer1/L3/LeadFoil/TransX   = 0.0 cm
d:Ge/Scatterer1/L3/LeadFoil/TransY   = Ge/Scatterer1/RotationCenterY cm
d:Ge/Scatterer1/L3/LeadFoil/TransZ   =-1.0 cm
d:Ge/Scatterer1/L3/LeadFoil/RotX     = 0. deg
d:Ge/Scatterer1/L3/LeadFoil/RotY     = 0. deg
d:Ge/Scatterer1/L3/LeadFoil/RotZ     = 0. deg


########################################
#. Range modulator
#(Copied from SpecialComponents/RangeModulator.txt
########################################
s:Ge/RMW_1/Type             = "TsRangeModulator"
s:Ge/RMW_1/Material         = "Parent"
s:Ge/RMW_1/Parent           = "Gantry"
d:Ge/RMW_1/TransX           = 10.0 cm
d:Ge/RMW_1/TransY           = 0.0  cm
d:Ge/RMW_1/TransZ           = 250.0  cm
d:Ge/RMW_1/RotX             = 0.0 deg
d:Ge/RMW_1/RotY             = 0.0 deg
d:Ge/RMW_1/RotZ             = 0.0 deg
b:Ge/RMW_1/Invisible        = "TRUE"
b:Ge/RMW_1/PrintInformation = "True"

d:Ge/RMW_1/HeightOfUpper  = 150 mm
d:Ge/RMW_1/HeightOfMiddle = 1.0 mm
d:Ge/RMW_1/HeightOfLower  = 9.0 mm

d:Ge/RMW_1/Shell/Rin              = 15.0 cm
d:Ge/RMW_1/Shell/Rout             = 15.5 cm
s:Ge/RMW_1/Shell/Material         = "Aluminum"
s:Ge/RMW_1/Shell/Color            = "grey"
s:Ge/RMW_1/Shell/DrawingStyle     = "Solid"
i:Ge/RMW_1/Shell/VisSegsPerCircle = 360

d:Ge/RMW_1/Hub/Rin              = 6.0 cm
d:Ge/RMW_1/Hub/Rout             = 7.0 cm
s:Ge/RMW_1/Hub/Material         = "Aluminum"
s:Ge/RMW_1/Hub/Color            = "grey"
s:Ge/RMW_1/Hub/DrawingStyle     = "Solid"
i:Ge/RMW_1/Hub/VisSegsPerCircle = 360

#Upper tracks
dv:Ge/RMW_1/Upper/RadialDivisions  = 1 11.0 cm
s:Ge/RMW_1/Upper/Track1/Pattern    = "LexanBlockT1"
s:Ge/RMW_1/Upper/Track2/Pattern    = "NULL"
#Middle tracks
dv:Ge/RMW_1/Middle/RadialDivisions = 1 11.0 cm
s:Ge/RMW_1/Middle/Track1/Pattern   = "InterfaceDisk"
s:Ge/RMW_1/Middle/Track2/Pattern   = "HoleTrackDisk"
#Lower tracks
dv:Ge/RMW_1/Lower/RadialDivisions  = 1 11.0 cm
s:Ge/RMW_1/Lower/Track1/Pattern    = "LeadBlockT1"
s:Ge/RMW_1/Lower/Track2/Pattern    = "NULL"

#A track pattern: 14 blocks of Lexan
d:Ge/LexanBlockT1/Offset  = 0.0 deg
dv:Ge/LexanBlockT1/Angles = 14
  5.00 115.00 146.50 173.2 195.07
216.15 230.14 243.00 255.5 270.60
282.20 294.60 306.20 324.00 deg
dv:Ge/LexanBlockT1/Heights = 14
 77.0  82.0  87.0  92.15 95.0
100.4 106.0 110.2 115.3 119.5
124.0 128.8 132.00 60.0 mm
sv:Ge/LexanBlockT1/Materials = 14
"Lexan" "Lexan" "Lexan" "Lexan" "Lexan"
"Lexan" "Lexan" "Lexan" "Lexan" "Lexan"
"Lexan" "Lexan" "Lexan" "Brass"

#A track pattern of single block
dv:Ge/InterfaceDisk/Angles    = 1 0.0 deg
dv:Ge/InterfaceDisk/Heights   = 1 1.0 mm
sv:Ge/InterfaceDisk/Materials = 1 "Aluminum"

#A track pattern of two blocks but one block is a hole
dv:Ge/HoleTrackDisk/Angles    = 2 90.0 110.0 deg
dv:Ge/HoleTrackDisk/Heights   = 2  0.0  1.0 mm
sv:Ge/HoleTrackDisk/Materials = 2 "NULL" "Aluminum"

#A track pattern of 8 Lead blocks
dv:Ge/LeadBlockT1/Angles = 9
  5.00 115.00 146.50 173.2 195.07
216.15 230.14 243.00 255.5 deg
dv:Ge/LeadBlockT1/Heights = 9
 0.890 0.75 0.60 0.52 0.40
 0.30 0.16 0.070 0.0 mm
sv:Ge/LeadBlockT1/Materials = 9
"Lead" "Lead" "Lead" "Lead" "Lead"
"Lead" "Lead" "Lead" "NULL"


##################################################
# Second Scatterer:
##################################################
s:Ge/Scatterer2/Type   		= "Group"
s:Ge/Scatterer2/Parent 		= "World"
d:Ge/Scatterer2/TransX 		=  0.0 cm
d:Ge/Scatterer2/TransY 		=  0.0 cm
d:Ge/Scatterer2/TransZ 		= 170. cm
d:Ge/Scatterer2/RotX 		= 0. deg
d:Ge/Scatterer2/RotY 		= 0. deg
d:Ge/Scatterer2/RotZ 		= 0. deg
s:Ge/Scatterer2/Message 	= "Constructing IBA TsScatterer2"

# Scatterer 2 Brass Box (Mother Volume)
s:Ge/Scatterer2/BrassBox/Parent		= "Scatterer2"
s:Ge/Scatterer2/BrassBox/Type  		= "TsBox"
s:Ge/Scatterer2/BrassBox/Material	= "Brass"
d:Ge/Scatterer2/BrassBox/HLX 		= 30.0 cm
d:Ge/Scatterer2/BrassBox/HLY 		= 30.0 cm
d:Ge/Scatterer2/BrassBox/HLZ 		=  3.0 cm
d:Ge/Scatterer2/BrassBox/TransX		=  0.0 cm
d:Ge/Scatterer2/BrassBox/TransY		=  0.0 cm
d:Ge/Scatterer2/BrassBox/TransZ		=  0.0 cm
d:Ge/Scatterer2/BrassBox/RotX 		=  0. deg
d:Ge/Scatterer2/BrassBox/RotY 		=  0. deg
d:Ge/Scatterer2/BrassBox/RotZ 		=  0. deg

# Scatter Holder Group:
s:Ge/Scatterer2/Holder/Type   		= "Group"
s:Ge/Scatterer2/Holder/Parent 		= "Scatterer2/BrassBox"
d:Ge/Scatterer2/Holder/TransX 		= 10.0 cm
d:Ge/Scatterer2/Holder/TransY 		= 10.0 cm
d:Ge/Scatterer2/Holder/TransZ 		=  0.0 cm
d:Ge/Scatterer2/Holder/RotX 		= 0. deg
d:Ge/Scatterer2/Holder/RotY 		= 0. deg
d:Ge/Scatterer2/Holder/RotZ 		= 0. deg

# Setting up the rotations for selecting a scatterer, this can be made Gantry specific:
d:Ge/Scatterer2/RotZForS1 		= 180. deg
d:Ge/Scatterer2/RotZForS2 		=   0. deg

# Scatter Hole 1
s:Ge/Scatterer2/Hole1/Type   = "Group"
s:Ge/Scatterer2/Hole1/Parent = "Scatterer2/Holder"
d:Ge/Scatterer2/Hole1/TransX = 10.0 cm
d:Ge/Scatterer2/Hole1/TransY = 10.0 cm
d:Ge/Scatterer2/Hole1/TransZ = 0.0 cm
d:Ge/Scatterer2/Hole1/RotX   = 0. deg
d:Ge/Scatterer2/Hole1/RotY   = 0. deg
d:Ge/Scatterer2/Hole1/RotZ   = 0. deg

# Scatter Hole 2
s:Ge/Scatterer2/Hole2/Type   = "Group"
s:Ge/Scatterer2/Hole2/Parent = "Scatterer2/Holder"
d:Ge/Scatterer2/Hole2/TransX = -10.0 cm
d:Ge/Scatterer2/Hole2/TransY = -10.0 cm
d:Ge/Scatterer2/Hole2/TransZ = 0.0 cm
d:Ge/Scatterer2/Hole2/RotX   = 0. deg
d:Ge/Scatterer2/Hole2/RotY   = 0. deg
d:Ge/Scatterer2/Hole2/RotZ   = 0. deg

# Scatterer 1 (no scattering)
# Air Tube:  (no scattering, for pencil beam etc)
s:Ge/Scatterer2/S1/Parent 		= "Scatterer2/Hole1"
s:Ge/Scatterer2/S1/Type 		= "TsCylinder"
s:Ge/Scatterer2/S1/Material     = "World"
d:Ge/Scatterer2/S1/RMin 		=  0.0 cm
d:Ge/Scatterer2/S1/RMax 		=  5.0 cm
d:Ge/Scatterer2/S1/HL   		=  3.0 cm
d:Ge/Scatterer2/S1/TransX 		=  0.0 cm
d:Ge/Scatterer2/S1/TransY 		=  0.0 cm
d:Ge/Scatterer2/S1/TransZ 		=  0.0 cm
d:Ge/Scatterer2/S1/RotX 		=  0.0 deg
d:Ge/Scatterer2/S1/RotY 		=  0.0 deg
d:Ge/Scatterer2/S1/RotZ 		=  0.0 deg
d:Ge/Scatterer2/S1/SPhi 		=  0.0 deg
d:Ge/Scatterer2/S1/DPhi 		=  360.0 deg

# Scatterer 2 (example second scatterer)
# Air Hole for Scatterer 2:
s:Ge/Scatterer2/S2/Parent 		= "Scatterer2/Hole2"
s:Ge/Scatterer2/S2/Type 		= "TsCylinder"
s:Ge/Scatterer2/S2/Material 	= "World"
d:Ge/Scatterer2/S2/RMin 		=  0.0 cm
d:Ge/Scatterer2/S2/RMax 		=  5.0 cm
d:Ge/Scatterer2/S2/HL   		=  3.0 cm
d:Ge/Scatterer2/S2/TransX 		=  0.0 cm
d:Ge/Scatterer2/S2/TransY 		=  0.0 cm
d:Ge/Scatterer2/S2/TransZ 		=  0.0 cm
d:Ge/Scatterer2/S2/RotX 		=  0.0 deg
d:Ge/Scatterer2/S2/RotY 		=  0.0 deg
d:Ge/Scatterer2/S2/RotZ 		=  0.0 deg
d:Ge/Scatterer2/S2/SPhi 		=  0.0 deg
d:Ge/Scatterer2/S2/DPhi 		=  360.0 deg

# Lead Polycone Scatterer2:
s:Ge/Scatterer2/S2/LeadPolycone/Parent 		= "Scatterer2/S2"
s:Ge/Scatterer2/S2/LeadPolycone/Type 		= "G4HPolycone"
s:Ge/Scatterer2/S2/LeadPolycone/Material 	= "Lead"
dv:Ge/Scatterer2/S2/LeadPolycone/RInner 	= 31 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 cm
dv:Ge/Scatterer2/S2/LeadPolycone/ROuter 	= 31 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0  cm
dv:Ge/Scatterer2/S2/LeadPolycone/Z      	= 31 -0.1 -0.097 -0.094 -0.09 -0.086 -0.082 -0.078 -0.074 -0.07 -0.065 -0.06 -0.055 -0.05 -0.045 -0.04 -0.036 -0.033 -0.03 -0.027 -0.024 -0.021 -0.018 -0.015 -0.013 -0.011 -0.009 -0.007 -0.006 -0.005 -0.004 -0.003 cm
d:Ge/Scatterer2/S2/LeadPolycone/TransX 		=  0.0 cm
d:Ge/Scatterer2/S2/LeadPolycone/TransY 		=  0.0 cm
d:Ge/Scatterer2/S2/LeadPolycone/TransZ 		=  0.0 cm
d:Ge/Scatterer2/S2/LeadPolycone/RotX 		=  0.0 deg
d:Ge/Scatterer2/S2/LeadPolycone/RotY 		=  0.0 deg
d:Ge/Scatterer2/S2/LeadPolycone/RotZ 		=  0.0 deg
d:Ge/Scatterer2/S2/LeadPolycone/PhiStart 	=  0.0 deg
d:Ge/Scatterer2/S2/LeadPolycone/PhiTotal 	=  360.0 deg

# Lexan Polycone Scatterer2:
s:Ge/Scatterer2/S2/LexanPolycone/Parent 	= "Scatterer2/S2"
s:Ge/Scatterer2/S2/LexanPolycone/Type 		= "G4HPolycone"
s:Ge/Scatterer2/S2/LexanPolycone/Material 	= "Lexan"
dv:Ge/Scatterer2/S2/LexanPolycone/RInner 	= 41 4.0 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.9 2.8 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.9 1.8 1.7 1.6 1.5 1.4 1.3 1.2 1.1 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 cm
dv:Ge/Scatterer2/S2/LexanPolycone/ROuter 	= 41 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 cm
dv:Ge/Scatterer2/S2/LexanPolycone/Z      	= 41 1.0 1.0 1.0 1.0 1.0 1.0 0.98 0.96 0.94 0.9 0.86 0.82 0.78 0.75 0.72 0.69 0.66 0.63 0.6 0.57 0.54 0.51 0.48 0.46 0.44 0.42 0.39 0.37 0.35 0.33 0.31 0.29 0.27 0.25 0.23 0.21 0.2 0.19 0.18 0.17 0.16 cm
d:Ge/Scatterer2/S2/LexanPolycone/TransX 	=  0.0 cm
d:Ge/Scatterer2/S2/LexanPolycone/TransY 	=  0.0 cm
d:Ge/Scatterer2/S2/LexanPolycone/TransZ 	=  0.0 cm
d:Ge/Scatterer2/S2/LexanPolycone/RotX 		=  0.0 deg
d:Ge/Scatterer2/S2/LexanPolycone/RotY 		=  0.0 deg
d:Ge/Scatterer2/S2/LexanPolycone/RotZ 		=  0.0 deg
d:Ge/Scatterer2/S2/LexanPolycone/PhiStart 	=  0.0 deg
d:Ge/Scatterer2/S2/LexanPolycone/PhiTotal 	= 360.0 deg

##################################################
# Snout:
##################################################
s:Ge/Snout/Type		= "Group"
s:Ge/Snout/Parent	= "Gantry"
d:Ge/Snout/TransX	= 0. m
d:Ge/Snout/TransY	= 0. m
d:Ge/Snout/TransZ	= 50. cm
d:Ge/Snout/RotX		= 0. deg
d:Ge/Snout/RotY		= 0. deg
d:Ge/Snout/RotZ		= 0. deg
s:Ge/Snout/Message 	= "Constructing Snout"

# Snout:
s:Ge/Snout/Block/Parent 	= "Snout"
s:Ge/Snout/Block/Type   	= "TsBox"
s:Ge/Snout/Block/Material 	= "Brass"
d:Ge/Snout/Block/HLX 		= 20.0 cm
d:Ge/Snout/Block/HLY 		= 20.0 cm
d:Ge/Snout/Block/HLZ 		= 3.5 cm
d:Ge/Snout/Block/TransX		= 0. cm
d:Ge/Snout/Block/TransY		= 0. cm
d:Ge/Snout/Block/TransZ		= 0. cm
d:Ge/Snout/Block/RotX		= 0. deg
d:Ge/Snout/Block/RotY		= 0. deg
d:Ge/Snout/Block/RotZ		= 0. deg

# Snout: Hole in Brass Block
s:Ge/Snout/Hole/Parent 		= "Snout/Block"
s:Ge/Snout/Hole/Type   		= "TsCylinder"
s:Ge/Snout/Hole/Material	= "Brass"
d:Ge/Snout/Hole/RMin 		=  0.0 cm
d:Ge/Snout/Hole/RMax 		=  4.5 cm
d:Ge/Snout/Hole/HL		    =  3.5 cm
d:Ge/Snout/Hole/TransX 		=  0.0 cm
d:Ge/Snout/Hole/TransY 		=  0.0 cm
d:Ge/Snout/Hole/TransZ 		=  0.0 cm
d:Ge/Snout/Hole/RotX 		=  0.0 deg
d:Ge/Snout/Hole/RotY 		=  0.0 deg
d:Ge/Snout/Hole/RotZ 		=  0.0 deg
d:Ge/Snout/Hole/SPhi 		=  0.0 deg
d:Ge/Snout/Hole/DPhi 		=  360.0 deg

# Snout: Brass Cone
s:Ge/Snout/BrassCone/Parent   = "Snout"
s:Ge/Snout/BrassCone/Type     = "G4Cons"
s:Ge/Snout/BrassCone/Material = "Brass"
d:Ge/Snout/BrassCone/RMin1    =  3.5 cm
d:Ge/Snout/BrassCone/RMax1    =  6.0 cm
d:Ge/Snout/BrassCone/RMin2    =  3.8  cm
d:Ge/Snout/BrassCone/RMax2    =  6.0 cm
d:Ge/Snout/BrassCone/HL       =  3.5 cm
d:Ge/Snout/BrassCone/TransX   =  0.0 cm
d:Ge/Snout/BrassCone/TransY   =  0.0 cm
d:Ge/Snout/BrassCone/TransZ   = -7.0 cm
d:Ge/Snout/BrassCone/RotX     =  0.0 deg
d:Ge/Snout/BrassCone/RotY     =  0.0 deg
d:Ge/Snout/BrassCone/RotZ     =  0.0 deg
d:Ge/Snout/BrassCone/SPhi     =  0.0 deg
d:Ge/Snout/BrassCone/DPhi     =  360.0 deg

##################################################
# Aperture
##################################################
s:Ge/Aperture/Type        = "TsAperture"
s:Ge/Aperture/Parent      = "Snout"
s:Ge/Aperture/InputFile   = "ApertureFileIn.ap"
s:Ge/Aperture/FileFormat  = "XYCoordinates"
b:Ge/Aperture/PrintPoints = "True"
s:Ge/Aperture/Material    = "Brass"
d:Ge/Aperture/RMax        = 4.5 cm
d:Ge/Aperture/HL          = 2.5 cm
d:Ge/Aperture/TransX      = 0.0 cm
d:Ge/Aperture/TransY      = 0.0 cm
d:Ge/Aperture/TransZ      =-13.0 cm
d:Ge/Aperture/RotX        = 0.0 deg
d:Ge/Aperture/RotY        = 0.0 deg
d:Ge/Aperture/RotZ        = 0.0 deg
d:Ge/Aperture/LowerEdge   = Ge/Aperture/TransZ - Ge/Aperture/HL cm
s:Ge/Aperture/Message     = "Constructing Aperture"

##################################################
# Compensator
##################################################
s:Ge/Compensator/Type        = "TsCompensator"
s:Ge/Compensator/Parent      = "Snout"
s:Ge/Compensator/Material    = "CompensatorLucite"
d:Ge/Compensator/RMax        = 5.5 cm
d:Ge/Compensator/TransX      = 0. cm
d:Ge/Compensator/TransY      = 0. cm
dc:Ge/Compensator/Thickness  = 0. cm # will be reset to actual thickness when compensator is read in
d:Ge/Compensator/HL          = 0.5 * Ge/Compensator/Thickness cm
d:Ge/Compensator/TransZ      = Ge/Aperture/LowerEdge - Ge/Compensator/HL cm
d:Ge/Compensator/LowerEdge   = Ge/Compensator/TransZ - Ge/Compensator/HL cm
d:Ge/Compensator/RotX        = 0. deg
d:Ge/Compensator/RotY        = 0. deg
d:Ge/Compensator/RotZ        = 0. deg
s:Ge/Compensator/InputFile   = "CompensatorFileInRowsDepths.rc"
s:Ge/Compensator/FileFormat  = "RowsAndDepths"
s:Ge/Compensator/Method      = "ExtrudedSolid" # Polyhedra, ExtrudedSolid, SubtractionCylinders or UnionCylinders
d:Ge/Compensator/XTolerance  = 1. mm
d:Ge/Compensator/YTolerance  = 1. mm
b:Ge/Compensator/PrintPoints = "True"
s:Ge/Compensator/Message     = "Constructing Compensator"

#########################
# Phase space volume
#########################
s:Ge/ZPhaseSpaceVol/Type		= "TsBox"
s:Ge/ZPhaseSpaceVol/Parent  	= "Snout"
s:Ge/ZPhaseSpaceVol/Material	= "Parent"
d:Ge/ZPhaseSpaceVol/HLX 		= 20. cm
d:Ge/ZPhaseSpaceVol/HLY 		= 20. cm
d:Ge/ZPhaseSpaceVol/HLZ 		=  0.05 mm
d:Ge/ZPhaseSpaceVol/TransX 		= 0. m
d:Ge/ZPhaseSpaceVol/TransY 		= 0. m
d:Ge/ZPhaseSpaceVol/TransZ 		= -0.015 cm + Ge/Compensator/LowerEdge
d:Ge/ZPhaseSpaceVol/RotX 		= 0. deg
d:Ge/ZPhaseSpaceVol/RotY 		= 0. deg
d:Ge/ZPhaseSpaceVol/RotZ 		= 0. deg

##################################################
# Graphics:
##################################################
s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 30 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 4.
u:Gr/ViewA/TransX                           = -.8
u:Gr/ViewA/TransY                           = -.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
b:Gr/ViewA/IncludeAxes                      = "true"
s:Gr/ViewA/AxesComponent                    = "Gantry"
d:Gr/ViewA/AxesSize                         = 0.5 m

i:Ts/ShowHistoryCountAtInterval = 0

ScanningNozzle_QtTest.txt

ScatteringNozzle_run.txt

# Use scattering nozzle to generate spread out Bragg peak

includeFile = ScatteringNozzle.txt TsAnalysisWaterPhantom.txt

d:Ge/RMW_1/RotZ = Tf/RMW_Rotation/Value deg

i:So/Example/NumberOfHistoriesInRun = 3

b:Ge/CheckForOverlaps = "t"

d:Tf/TimelineEnd             = 100.0 ms
i:Tf/NumberOfSequentialTimes = 100

s:Tf/RMW_Rotation/Function           = "Linear deg"
d:Tf/RMW_Rotation/Rate               = 3.6 deg/ms
d:Tf/RMW_Rotation/StartValue         = 0.0 deg
d:Tf/RMW_Rotation/RepetitionInterval = 100. ms

b:Ts/PauseBeforeQuit            = "False"
i:Ts/ShowHistoryCountAtInterval = 0

# Setting first scatterers:
s:Tf/Scatterer1/L1/Function = "Step"
dv:Tf/Scatterer1/L1/Times   = 5 20 40 60 80 100 ms
dv:Tf/Scatterer1/L1/Values  = 5 Ge/Scatterer1/RotZ_OutOfBeam Ge/Scatterer1/RotZ_InBeam Ge/Scatterer1/RotZ_OutOfBeam Ge/Scatterer1/RotZ_InBeam Ge/Scatterer1/RotZ_OutOfBeam deg

s:Tf/Scatterer1/L2/Function = "Step"
dv:Tf/Scatterer1/L2/Times   = 2 30 100 ms
dv:Tf/Scatterer1/L2/Values  = 2 Ge/Scatterer1/RotZ_InBeam Ge/Scatterer1/RotZ_OutOfBeam deg

s:Tf/Scatterer1/L3/Function = "Step"
dv:Tf/Scatterer1/L3/Times   = 4 20 40 80 100 ms
dv:Tf/Scatterer1/L3/Values  = 4 Ge/Scatterer1/RotZ_InBeam Ge/Scatterer1/RotZ_OutOfBeam Ge/Scatterer1/RotZ_InBeam Ge/Scatterer1/RotZ_OutOfBeam deg

Ge/Scatterer1/Lollipop1 = Tf/Scatterer1/L1/Value deg
Ge/Scatterer1/Lollipop2 = Tf/Scatterer1/L2/Value deg
Ge/Scatterer1/Lollipop3 = Tf/Scatterer1/L3/Value deg

# Setting second scatterer:
s:Tf/Scatterer2/Function = "Step"
dv:Tf/Scatterer2/Times   = 2 50 100 ms
dv:Tf/Scatterer2/Values  = 2 Ge/Scatterer2/RotZForS2 Ge/Scatterer2/RotZForS1 deg

d:Ge/Scatterer2/Holder/RotZ = Tf/Scatterer2/Value deg

# Show time feature steps on console
i:Tf/Verbosity = 1

ScanningNozzle_run_QtTest.txt

TargetInWaterPhantom.txt

# Target used in some demonstrations.

includeFile = ConstantsForNozzles.txt

s:Ge/WaterPhantom/Type     = "TsBox"
s:Ge/WaterPhantom/Parent   = "World"
s:Ge/WaterPhantom/Material = "G4_WATER"
d:Ge/WaterPhantom/HLX      = 8.0 cm
d:Ge/WaterPhantom/HLY      = 8.0 cm
d:Ge/WaterPhantom/HLZ      = 10.0 cm
d:Ge/WaterPhantom/MinusHLZ = Ge/WaterPhantom/HLZ cm * -1.0
d:Ge/WaterPhantom/TransX   = 0. cm
d:Ge/WaterPhantom/TransY   = 0. cm
d:Ge/WaterPhantom/TransZ   = Ge/WaterPhantom/MinusHLZ cm
d:Ge/WaterPhantom/RotX     = 0. deg
d:Ge/WaterPhantom/RotY     = 0. deg
d:Ge/WaterPhantom/RotZ     = 0. deg
s:Ge/WaterPhantom/Color    = "white"

#Value for placing a target.
#146.25 mm is the R80 for about 141 MeV proton
d:Ge/R80 = -146.25 mm

s:Ge/PlaneAtR80/Type       = "TsBox"
s:Ge/PlaneAtR80/Parent     = "WaterPhantom"
s:Ge/PlaneAtR80/Material   = "G4_WATER"
d:Ge/PlaneAtR80/HLX        = 5.0 cm
d:Ge/PlaneAtR80/HLY        = 5.0 cm
d:Ge/PlaneAtR80/HLZ        = 0.5 cm
d:Ge/PlaneAtR80/TransX     = 0. cm
d:Ge/PlaneAtR80/TransY     = 0. cm
d:Ge/PlaneAtR80/TransZ     = Ge/WaterPhantom/HLZ + Ge/R80 cm
d:Ge/PlaneAtR80/RotX       = 0.0 deg
d:Ge/PlaneAtR80/RotY       = 0.0 deg
d:Ge/PlaneAtR80/RotZ       = 0.0 deg
s:Ge/PlaneAtR80/Color      = "red"
i:Ge/PlaneAtR80/XBins      = 1
i:Ge/PlaneAtR80/YBins      = 1
i:Ge/PlaneAtR80/ZBins      = 1

TsAnalysisWaterPhantom.txt

# WaterPhantom used in some demonstrations.
# 40cm long, 20 cm in x, 20 cm in y

includeFile = ConstantsForNozzles.txt

# Water Tank / Phantom
s:Ge/WaterPhantom/Parent 		= "Gantry"
s:Ge/WaterPhantom/Type   		= "TsBox"
s:Ge/WaterPhantom/Material		= "G4_WATER"
d:Ge/WaterPhantom/HLX 			= 10.0 cm
d:Ge/WaterPhantom/HLY 			= 10.0 cm
d:Ge/WaterPhantom/HLZ 			= 20.0 cm
d:Ge/WaterPhantom/TransX		= 0.0 cm
d:Ge/WaterPhantom/TransY		= 0.0 cm
d:Ge/WaterPhantom/TransZ		= 0.0 cm
d:Ge/WaterPhantom/RotX			= 0. deg
d:Ge/WaterPhantom/RotY			= 0. deg
d:Ge/WaterPhantom/RotZ			= 0. deg
d:Ge/WaterPhantom/MaxStepSize 	= 0.5 mm

s:Ge/ScoringCylinder3cm/Parent		= "WaterPhantom"
s:Ge/ScoringCylinder3cm/Type		= "TsCylinder"
s:Ge/ScoringCylinder3cm/Material	= "G4_WATER"
d:Ge/ScoringCylinder3cm/RMin		= 0.0 cm
d:Ge/ScoringCylinder3cm/RMax		= 3.0 cm
d:Ge/ScoringCylinder3cm/HL		    = Ge/WaterPhantom/HLZ cm
d:Ge/ScoringCylinder3cm/SPhi		= 0. deg
d:Ge/ScoringCylinder3cm/DPhi		= 360. deg
d:Ge/ScoringCylinder3cm/TransX		= 0. cm
d:Ge/ScoringCylinder3cm/TransY		= 0. cm
d:Ge/ScoringCylinder3cm/TransZ		= 0. cm
d:Ge/ScoringCylinder3cm/RotX		= 0. deg
d:Ge/ScoringCylinder3cm/RotY		= 0.0 deg
d:Ge/ScoringCylinder3cm/RotZ		= 180. deg
s:Ge/ScoringCylinder3cm/Color		= "blue"
i:Ge/ScoringCylinder3cm/RBins		= 1
i:Ge/ScoringCylinder3cm/PhiBins		= 1
i:Ge/ScoringCylinder3cm/ZBins		= 200

s:Sc/ScoringCylinder3cm/Quantity                  = "DoseToMedium"
s:Sc/ScoringCylinder3cm/Component                 = "ScoringCylinder3cm"
b:Sc/ScoringCylinder3cm/OutputToConsole           = "False"
s:Sc/ScoringCylinder3cm/IfOutputFileAlreadyExists = "Overwrite"

Viewer.txt

# Graphics settings used in some demonstrations.

includeFile = ConstantsForNozzles.txt

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 768
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 25 deg
d:Gr/ViewA/Phi                              = 14 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 20 deg
u:Gr/ViewA/Zoom                             = 10
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "False"
b:Gr/ViewA/IncludeAxes                      = "True"
s:Gr/ViewA/AxesComponent                    = "World"
d:Gr/ViewA/AxesSize                         = 0.1 m

#b:Gr/ViewA/CopyOpenGLToEPS     = "True"
b:Gr/ViewA/IncludeTrajectories = "True"

s:Gr/ViewA/ColorBy      = "Charge"
s:Gr/ViewA/ChargeColors = "red green cyan"

Optical

OpticalMaterialSample.txt

# Materials used by Optical examples

# Materials
dv:Ma/Air/RefractiveIndex/Energies = 3 2.0 3.5 7.14 eV
uv:Ma/Air/RefractiveIndex/Values = 3 1.0 1.0 1.0

# 
sv:Ma/PMMA/Components = 3 "Carbon" "Hydrogen" "Oxygen"
uv:Ma/PMMA/Fractions = 3  0.599848  0.080538  0.319614
d:Ma/PMMA/Density = 1.190 g/cm3
d:Ma/PMMA/MeanExcitationEnergy=85.7 eV
s:Ma/PMMA/DefaultColor = "lightblue"
dv:Ma/PMMA/RefractiveIndex/Energies = 2 2.0 3.35 eV
uv:Ma/PMMA/RefractiveIndex/Values = 2 1.49 1.49

#
sv:Ma/Buapfcfm/Components = 2 "Hydrogen" "Carbon"
uv:Ma/Buapfcfm/Fractions  = 2  0.5 0.5
d:Ma/Buapfcfm/Density     = 1.032 g/cm3
s:Ma/Buapfcfm/DefaultColor= "yellow"
u:Ma/Buapfcfm/ScintillationYield      = 50
u:Ma/Buapfcfm/ResolutionScale         = 1.0
d:Ma/Buapfcfm/FastTimeConstant        = 2.1 ns 
u:Ma/Buapfcfm/YieldRatio              = 1.0
dv:Ma/Buapfcfm/RefractiveIndex/Energies    = 4 2.11501 2.3509 2.85803 3.10177 eV
uv:Ma/Buapfcfm/RefractiveIndex/Values    = 4 1.58  1.58  1.58  1.58 
dv:Ma/Buapfcfm/AbsLength/Energies = 4 2.11501 2.3509 2.85803 3.10177 eV
dv:Ma/Buapfcfm/AbsLength/Values = 4 50  50  50  50 cm 
dv:Ma/Buapfcfm/FastComponent/Energies = 300
2.06785  2.07016  2.07247  2.07479  2.07711  2.07944  2.08177  2.08411  2.08646  2.08881  
2.09116  2.09352  2.09589  2.09826  2.10064  2.10302  2.1054  2.1078  2.11019  2.1126  
2.11501  2.11742  2.11984  2.12227  2.1247  2.12713  2.12958  2.13202  2.13448  2.13694  
2.1394  2.14187  2.14435  2.14683  2.14932  2.15181  2.15431  2.15682  2.15933  2.16184  
2.16437  2.1669  2.16943  2.17197  2.17451  2.17707  2.17962  2.18219  2.18476  2.18734  
2.18992  2.19251  2.1951  2.19771  2.20031  2.20292  2.20554  2.20817  2.2108  2.21344  
2.21608  2.21873  2.22139  2.22405  2.22672  2.2294  2.23208  2.23477  2.23747  2.24017  
2.24288  2.2456  2.24832  2.25104  2.25378  2.25652  2.25927  2.26203  2.26479  2.26756  
2.27033  2.27312  2.2759  2.2787  2.2815  2.28431  2.28713  2.28995  2.29278  2.29562  
2.29847  2.30132  2.30417  2.30704  2.30991  2.31279  2.31568  2.31858  2.32148  2.32439  
2.32731  2.33023  2.33316  2.3361  2.33904  2.342  2.34496  2.34793  2.3509  2.35389 
2.35688  2.35987  2.36288  2.36589  2.36892  2.37195  2.37498  2.37803  2.38108  2.38414  
2.38721  2.39028  2.39337  2.39646  2.39956  2.40267  2.40579  2.40891  2.41204  2.41519  
2.41834  2.42149  2.42465  2.42783  2.43101  2.4342  2.4374  2.44061  2.44382  2.44705  
2.45028  2.45352  2.45677  2.46003  2.4633  2.46657  2.46986  2.47315  2.47645  2.47976  
2.48308  2.48641  2.48975  2.49309  2.49645  2.49981  2.50319  2.50657  2.50996  2.51337  
2.51677  2.52019  2.52362  2.52706  2.53051  2.53396  2.53743  2.54091  2.54439  2.54788  
2.55139  2.5549  2.55843  2.56196  2.56551  2.56906  2.57262  2.5762  2.57978  2.58337  
2.58697  2.59059  2.59421  2.59785  2.60149  2.60514  2.60881  2.61248  2.61617  2.61986  
2.62356  2.62728  2.63101  2.63475  2.63849  2.64225  2.64602  2.6498  2.65359  2.65739  
2.66121  2.66503  2.66887  2.67271  2.67657  2.68044  2.68432  2.68821  2.6921  2.69602  
2.69994  2.70388  2.70783  2.71179  2.71576  2.71974  2.72373  2.72774  2.73175  2.73578  
2.73982  2.74388  2.74794  2.75202  2.75611  2.76021  2.76433  2.76845  2.77259  2.77674  
2.7809  2.78508  2.78927  2.79347  2.79768  2.80191  2.80615  2.81039  2.81466  2.81894  
2.82323  2.82753  2.83185  2.83618  2.84052  2.84488  2.84925  2.85363  2.85803  2.86244  
2.86686  2.8713  2.87576  2.88022  2.8847  2.8892  2.8937  2.89822  2.90276  2.90731  
2.91187  2.91645  2.92104  2.92565  2.93027  2.93491  2.93956  2.94422  2.9489  2.9536  
2.95831  2.96304  2.96778  2.97254  2.97731  2.98209  2.98689  2.99171  2.99654  3.00139  
3.00626  3.01114  3.01604  3.02095  3.02588  3.03082  3.03578  3.04075  3.04575  3.05076  
3.05579  3.06083  3.06589  3.07097  3.07606  3.08116  3.08629  3.09143  3.0966  3.10177   eV
uv:Ma/Buapfcfm/FastComponent/Values = 300
2.53707e-09  0.000969057  0.00219543  0.00343101  0.00448992  0.00406717  0.00212089  
0.00189828  0.0034739  0.00463901  0.00349636  0.00220565  0.00175737  0.00296129  
0.00380065  0.00368119  0.00409474  0.00472785  0.0048657  0.00466862  0.00530172  
0.005315  0.00629325  0.00749818  0.00654444  0.00603592  0.00653117  0.00754618  
0.008069  0.00776368  0.00707135  0.00696311  0.00715202  0.00650564  0.00602775  
0.00659958  0.00726128  0.00799548  0.00871537  0.00873375  0.00831917  0.00788008  
0.00862041  0.00989887  0.0104472  0.0106055  0.0109608  0.0116215  0.0108495  
0.00959865  0.00941076  0.0104288  0.0124027  0.012899  0.0126437  0.0145103  
0.0155641  0.0146206  0.0129929  0.0128979  0.0138261  0.0160961  0.0175686  
0.0179913  0.0182762  0.0192045  0.0196721  0.0188471  0.0178269  0.0188705  
0.0201327  0.0206014  0.0217052  0.0230357  0.0232155  0.0231389  0.0232696  
0.0244664  0.0250239  0.0264045  0.0274848  0.027927  0.0291013  0.0298528  
0.0303409  0.0309005  0.0306902  0.0303001  0.0314928  0.0332348  0.035756  
0.0381802  0.0389613  0.0390594  0.0394403  0.0405829  0.0417868  0.0431204  
0.044548  0.0462808  0.0479912  0.0492891  0.0500682  0.0519726  0.0544111  
0.0558611  0.0579667  0.0595688  0.0598027  0.0606798  0.063392  0.0665656  
0.0670456  0.0669813  0.0689469  0.0711097  0.072769  0.0742732  0.0746877  
0.0753168  0.077166  0.0802386  0.0824984  0.0829599  0.0822237  0.0833326  
0.0862817  0.0884291  0.09171  0.0954229  0.0989172  0.100978  0.103933  
0.108923  0.113152  0.117175  0.120361  0.124456  0.129869  0.135552  
0.141064  0.145967  0.151178  0.15674  0.164827  0.172542  0.177745  
0.182116  0.187929  0.194925  0.201241  0.208795  0.216055  0.222254  
0.228368  0.235244  0.242736  0.249196  0.255093  0.261023  0.26667  
0.273616  0.280392  0.286072  0.290522  0.294205  0.298384  0.30374  
0.30793  0.313362  0.319508  0.324279  0.328948  0.335092  0.341312  
0.345841  0.350326  0.355925  0.362182  0.369145  0.377476  0.385885  
0.394869  0.404849  0.415726  0.427795  0.440715  0.453566  0.468143  
0.48397  0.499906  0.516324  0.535005  0.553831  0.571448  0.589444  
0.607162  0.62493  0.643692  0.661074  0.678412  0.694858  0.711383  
0.72796  0.742975  0.754724  0.76482  0.774458  0.784008  0.791667  
0.797605  0.802749  0.804437  0.804963  0.806107  0.806766  0.804071  
0.799845  0.798582  0.799343  0.79763  0.793356  0.788948  0.784289  
0.782514  0.783498  0.785583  0.791562  0.799319  0.807515  0.817578  
0.829744  0.843536  0.85967  0.879576  0.901532  0.921301  0.938109  
0.954733  0.971245  0.985684  0.9937  0.998387  1  0.994588  0.982845  
0.965506  0.943082  0.915695  0.883038  0.844113  0.798443  0.749678  
0.69914  0.645699  0.592066  0.540742  0.493092  0.444413  0.397385  
0.353534  0.309104  0.266364  0.229146  0.195239  0.166194  0.139671  
0.115177  0.0956812  0.0815875  0.0709453  0.0619685  0.0553199  0.0496077  
0.0453853  0.0420237  0.0373051  0.0330806  0.0319349  0.0313999  0.0296261  
0.0282793  0.0273684  0.0262166  0.0257111  0.0254037  0.0241733  0.0225476  
0.0212947  0.0200285  0.0194209  0.0188899  0.0198386  0.0202113  0.019085  
0.0186091  0.0188777  0.0201643  0.0233094  0.026576

#
sv:Ma/Polystyrene/Components = 2 "Carbon" "Hydrogen"
uv:Ma/Polystyrene/Fractions = 2 0.9226 0.0774
d:Ma/Polystyrene/Density = 1.06 g/cm3
d:Ma/Polystyrene/MeanExcitationEnergy = 68 eV
s:Ma/Polystyrene/DefaultColor = "blue"
d:Ma/Polystyrene/WLSTimeConstant = 2.7 ns
dv:Ma/Polystyrene/RefractiveIndex/Energies = 67
2.08871  2.09688  2.1067  2.11901  2.13227  2.14775  2.16097  2.17225  2.18364  2.19859
2.21026  2.22648  2.23891  2.25375  2.26738  2.27888  2.29049  2.30364  2.3179  2.33282
2.34843  2.36028  2.37327  2.39096  2.40429  2.41311  2.42304  2.43043  2.43947  2.44483
2.45021  2.4551  2.46054  2.46818  2.47584  2.48463  2.49182  2.50069  2.50792  2.51687
2.52494  2.52869  2.53548  2.54  2.5476  2.55294  2.55983  2.56443  2.57218  2.57919
2.58782  2.59887  2.60524  2.61001  2.61641  2.61961  2.62441  2.6317  2.63573  2.64143
2.648  2.65211  2.6554  2.66204  2.66787  2.67712  2.68643   eV
uv:Ma/Polystyrene/RefractiveIndex/Values = 67
1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6
1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6
1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6
1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6
1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6
1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6  1.6
1.6  1.6  1.6  1.6  1.6  1.6  1.6
dv:Ma/Polystyrene/WLSAbsLength/Energies = 117
2.62543  2.63692  2.65308  2.66523  2.67411  2.68221  2.68692
2.69251  2.69684  2.70162  2.70685  2.7108  2.71696  2.72228
2.72455  2.72906  2.73495  2.73962  2.74511  2.74695  2.74879
2.75152  2.75336  2.75521  2.75615  2.75934  2.76207  2.76843
2.77616  2.78071  2.78573  2.79076  2.79767  2.80321  2.81018
2.81718  2.82422  2.83177  2.84031  2.84554  2.84982  2.85702
2.86575  2.87161  2.87457  2.87851  2.88297  2.88596  2.88847
2.89199  2.89452  2.89854  2.90109  2.90463  2.90768  2.91073
2.91481  2.91737  2.92147  2.92302  2.92609  2.93373  2.94037
2.94495  2.94954  2.95467  2.9598  2.96392  2.96804  2.97585
2.98159  2.98682  2.9926  2.99681  3.00102  3.00792  3.01605
3.02206  3.02972  3.03703  3.04481  3.05846  3.06638  3.07268
3.07858  3.08366  3.09129  3.0968  3.10104  3.10785  3.11469
3.12328  3.13192  3.14061  3.14846  3.15458  3.16339  3.1678
3.17489  3.18651  3.20186  3.21461  3.23025  3.24885  3.26483
3.28095  3.29435  3.30881  3.32635  3.34805  3.37005  3.40055
3.42847  3.45475  3.48037  3.50747  3.54278   eV
dv:Ma/Polystyrene/WLSAbsLength/Values =117
0.298184  0.298199  0.297833  0.297076  0.294001  0.28996  
0.287072  0.283028  0.278404  0.27378  0.268193  0.261253  
0.251423  0.241592  0.229636  0.211509  0.188755  0.149411  
0.126657  0.1174  0.109108  0.101974  0.0950325  0.0873191  
0.0805691  0.0742074  0.0701598  0.0668879  0.0690183  
0.0721096  0.0771303  0.0817652  0.086595  0.0916162  
0.0960602  0.10089  0.106106  0.109972  0.116346  
0.121945  0.127929  0.132759  0.133154  0.130846  
0.126991  0.123909  0.119284  0.113694  0.108488  
0.100005  0.0924847  0.085352  0.0766746  0.0705058  
0.0629863  0.0560454  0.0487198  0.0415855  0.0334883  
0.0284748  0.0234628  0.0213487  0.0228984  0.0271465  
0.0329377  0.0383437  0.0449069  0.0501189  0.0559096  
0.061511  0.067689  0.0732878  0.0800445  0.0856423  
0.0918188  0.0991551  0.107602  0.116287  0.125987  
0.131491  0.135115  0.135417  0.134412  0.132248  
0.130083  0.126905  0.126478  0.128363  0.131839  
0.136764  0.142267  0.148062  0.155013  0.161097  
0.167758  0.174997  0.181949  0.18745  0.19411  
0.201643  0.209179  0.215844  0.221065  0.226577  
0.23093  0.237309  0.242238  0.249772  0.25673  
0.264269  0.269783 0.275014  0.279375  0.282287  
0.284331  0.286086  0.287847   m
dv:Ma/Polystyrene/WLSComponent/Energies = 67
2.08871  2.09688  2.1067  2.11901  2.13227  2.14775  2.16097  2.17225
2.18364  2.19859  2.21026  2.22648  2.23891  2.25375  2.26738  2.27888
2.29049  2.30364  2.3179  2.33282  2.34843  2.36028  2.37327  2.39096
2.40429  2.41311  2.42304  2.43043  2.43947  2.44483  2.45021  2.4551
2.46054  2.46818  2.47584  2.48463  2.49182  2.50069  2.50792  2.51687
2.52494  2.52869  2.53548  2.54  2.5476  2.55294  2.55983  2.56443  2.57218
2.57919  2.58782  2.59887  2.60524  2.61001  2.61641  2.61961  2.62441
2.6317  2.63573  2.64143  2.648  2.65211  2.6554  2.66204  2.66787  2.67712  2.68643   eV
uv:Ma/Polystyrene/WLSComponent/Values = 67
0.00571321  0.00979897  0.0200973  0.0283023  0.0406511  0.0581719
0.0767485  0.092228  0.108745  0.121088  0.136567  0.165503  0.191354
0.226526  0.23681  0.252295  0.265706  0.288444  0.304952  0.323532
0.354558  0.377308  0.406278  0.43937  0.477676  0.514972  0.555375
0.604093  0.659026  0.699456  0.739886  0.791731  0.839424  0.892291
0.932709  0.963784  0.984493  0.995856  0.989592  0.972944  0.955609
0.936223  0.908521  0.873915  0.835143  0.800533  0.754848  0.718859
0.675937  0.641318  0.601159  0.541621  0.51254  0.475167  0.432254
0.404572  0.356133  0.315982  0.267547  0.224637  0.191406  0.166487
0.138805  0.106957  0.0737305  0.0404873  0.0100106

sv:Ma/Borosilicate/Components = 6 "Boron" "Oxygen" "Sodium" "Aluminum" "Silicon" "Potassium"
uv:Ma/Borosilicate/Fractions  = 6 0.040064 0.539562 0.028191 0.011644 0.377220 0.003321
d:Ma/Borosilicate/Density     = 2.23 g/cm3
s:Ma/Borosilicate/DefaultColor = "red"
dv:Ma/Borosilicate/RefractiveIndex/Energies = 2 2.297 2.298 eV
uv:Ma/Borosilicate/RefractiveIndex/Values = 2 1.5   1.5

OpticalPhotonCount.txt

# Demonstrates optical behavior in a plastic scintillator

includeFile = OpticalMaterialSample.txt

i:Ts/SequenceVerbosity = 1

# SEQUENCE
b:Ts/PauseBeforeQuit            = "True"
b:Ts/ShowCPUTime                = "True"
i:Ts/ShowHistoryCountAtInterval = 1

# SCORER
s:Sc/PhSp/Quantity                  = "PhaseSpace"
s:Sc/PhSp/Surface                   = "Plastic/OuterCurvedSurface"
s:Sc/PhSp/OutputType                = "ASCII"
s:Sc/PhSp/OutputFile                = "PHSP"
s:Sc/PhSp/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/PhSp/IncludeTimeOfFlight       = "true"
b:Sc/PhSp/UsePDGEncoding            = "True"

# VISUALIZATION
s:Gr/view/Type        = "OpenGl"
i:Gr/view/WindowSizeX = 600
i:Gr/view/WindowSizeY = 600
d:Gr/view/Theta       = 45. deg
d:Gr/view/Phi         = 45. deg

# PHYSICS LIST
s:Ph/ListName         = "Optical"
s:Ph/Optical/Type     = "Geant4_Modular"
sv:Ph/Optical/Modules = 2 "g4em-standard_opt3" "g4optical"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 100 MeV
u:So/Example/BeamEnergySpread         = 0.5
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 0.5 mm
d:So/Example/BeamPositionCutoffY      = 0.5 mm
s:So/Example/BeamAngularDistribution  = "Flat"
d:So/Example/BeamAngularCutoffX       = 0.2 rad
d:So/Example/BeamAngularCutoffY       = 0.2 rad
i:So/Example/NumberOfHistoriesInRun   = 100

# GEOMETRY
d:Ge/World/HLX      = 1 cm
d:Ge/World/HLY      = 1 cm
d:Ge/World/HLZ      = 1 cm
s:Ge/World/Material = "Air"

# Plastic
s:Ge/Plastic/Parent   = "World"
s:Ge/Plastic/Type     = "TsCylinder"
s:Ge/Plastic/Material = "Buapfcfm"
d:Ge/Plastic/HL       = 0.5 cm
d:Ge/Plastic/RMin     = 0.0 cm
d:Ge/Plastic/RMax     =	0.5 cm
d:Ge/Plastic/SPhi     = 0 deg
d:Ge/Plastic/DPhi     = 360 deg
d:Ge/Plastic/TransX   = 0 mm
d:Ge/Plastic/TransY   = 0 mm
d:Ge/Plastic/TransZ   = 0 mm
d:Ge/Plastic/RotX     = 0 deg
d:Ge/Plastic/RotY     = 0 deg
d:Ge/Plastic/RotZ     = 0 deg

s:Ge/PMT/Parent = "World"
s:Ge/PMT/Type = "TsBox"
s:Ge/PMT/Material = "Buapfcfm"
d:Ge/PMT/HLX = 0.5 cm
d:Ge/PMT/HLY = 0.5 cm
d:Ge/PMT/HLZ   = 0.1 mm
d:Ge/PMT/TransZ1 = Ge/Plastic/TransZ - Ge/Plastic/HL cm
d:Ge/PMT/TransZ  = Ge/PMT/TransZ1 - Ge/PMT/HLZ cm

s:Ge/FOT/Parent = "PMT"
s:Ge/FOT/Type = "TsBox"
s:Ge/FOT/Material = "Buapfcfm"
d:Ge/FOT/HLX = 0.45 cm
d:Ge/FOT/HLY = 0.45 cm
d:Ge/FOT/HLZ   = 0.05 mm
s:Ge/FOT/OpticalBehavior = "SurfaceDetector"

# Surface used to detect optical photons
s:Su/SurfaceDetector/Type                = "dielectric_metal"
s:Su/SurfaceDetector/Finish              = "polished"
s:Su/SurfaceDetector/Model               = "unified"
dv:Su/SurfaceDetector/Efficiency/Energies   = 2 1.6 7.2 eV
uv:Su/SurfaceDetector/Efficiency/Values     = 2 1.0 1.0
dv:Su/SurfaceDetector/Reflectivity/Energies = 2 1.6 4.2 eV
uv:Su/SurfaceDetector/Reflectivity/Values   = 2 0.0 0.0

# The scorer is attached to the PMT, but only those
# photons that arrives to the surface of the photocathode
# are collected (with 20% probability, see surface setup)
s:Sc/Scorer/Quantity = "OpticalPhotonCount"
s:Sc/Scorer/Component = "PMT"
s:Sc/Scorer/OutputFile = "PhotocathodeSurface"
s:Sc/Scorer/OutputType = "root"
s:Sc/Scorer/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/Scorer/BounceLimit = 1000000

PixelatedDetector.txt

# Optical material properties for scintillation
includeFile = OpticalMaterialSample.txt

# Re-set world dimension
d:Ge/World/HLX = 10 cm
d:Ge/World/HLY = 10 cm
d:Ge/World/HLZ = 5 cm
b:Ge/World/Invisible = "True"
s:Ge/World/Material = "Air"

# Create new component
s:Ge/Detector/Parent = "World"
s:Ge/Detector/Type   = "TsPixelatedBox"
s:Ge/Detector/Material = "PMMA"
s:Ge/Detector/Pixel/Material = "Buapfcfm"
s:Ge/Detector/Pixel/Color    = "yellow"
d:Ge/Detector/PixelSizeX = 2 mm
d:Ge/Detector/PixelSizeY = 2 mm
d:Ge/Detector/PixelSizeZ = 15 mm
d:Ge/Detector/PitchX     = 2.1 mm
d:Ge/Detector/PitchY     = 2.1 mm
i:Ge/Detector/NumberOfPixelsX     = 21
i:Ge/Detector/NumberOfPixelsY     = 21

# A plane to score phase space information
iv:Gr/Color/TransparentRed    = 4 255 0   0 100
s:Ge/PhaseSpace/Parent = "World"
s:Ge/PhaseSpace/Type   = "TsBox"
s:Ge/PhaseSpace/Material = "Borosilicate"
s:Ge/PhaseSpace/Color    = "TransparentRed"
s:Ge/PhaseSpace/DrawingStyle = "Solid"
d:Ge/PhaseSpace/HLX      = 35 mm
d:Ge/PhaseSpace/HLY      = 35 mm
d:Ge/PhaseSpace/HLZ      = 0.5 mm
d:Ge/PhaseSpace/TransZ   = 7.5 mm + Ge/PhaseSpace/HLZ 

# Scorer for phase space 
s:Sc/PhaseSpace/Quantity = "PhaseSpace"
s:Sc/PhaseSpace/Surface  = "PhaseSpace/ZMinusSurface"
s:Sc/PhaseSpace/OutputType = "binary" 
s:Sc/PhaseSpace/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/PhaseSpace/OnlyIncludeParticlesGoing = "In"
b:Sc/PhaseSpace/IncludeTimeOfFlight = "True"
b:Sc/PhaseSpace/KillAfterPhaseSpace = "True"

# Physics list (only electromagnetic and optical transport)
Ph/Default/Modules = 2 "g4em-standard_opt4" "g4optical"

# Particle source
s:So/gammaSource/Type = "Beam"
s:So/gammaSource/BeamParticle = "gamma"
d:So/gammaSource/BeamEnergy   = 120 keV 
s:So/gammaSource/Component    = "BeamPosition"
u:So/gammaSource/BeamEnergySpread = 0.0
s:So/gammaSource/BeamPositionCutoffShape = "Ellipse"
s:So/gammaSource/BeamPositionDistribution = "Flat"
d:So/gammaSource/BeamPositionCutOffX      = 20 mm
d:So/gammaSource/BeamPositionCutOffY      = 20 mm
s:So/gammaSource/BeamAngularDistribution  = "None"
i:So/gammaSource/NumberOfHistoriesInRun   = 10 * Ts/ShowHistoryCountAtInterval 
i:Ts/ShowHistoryCountAtInterval    = 100

d:Ge/BeamPosition/TransX = 1 mm 
d:Ge/BeamPosition/TransY = 1 mm 
d:Ge/BeamPosition/TransZ = -20 mm
d:Ge/BeamPosition/RotX   = 0 deg

# Visualization
b:Ts/UseQt = "True"
b:Gr/enable = "True" 
s:Gr/view1/Type = "OpenGl"
d:Gr/view1/Theta = 45 deg
d:Gr/view1/Phi   = 45 deg
i:Gr/view1/WindowSizeX = 300
i:Gr/view1/WindowSizeY = 300

i:Ts/NumberOfThreads = 1
i:Ts/Seed = 1354
b:Ts/PauseBeforeQuit = Gr/Enable 
b:Ts/ShowCPUTime = "True"

PlasticScintillator.txt

# Demonstrates optical behavior in a plastic scintillator

includeFile = OpticalMaterialSample.txt

i:Ts/SequenceVerbosity = 1

# SEQUENCE
b:Ts/PauseBeforeQuit            = "True"
b:Ts/ShowCPUTime                = "True"
i:Ts/ShowHistoryCountAtInterval = 1

# SCORER
s:Sc/PhSp/Quantity                  = "PhaseSpace"
s:Sc/PhSp/Surface                   = "Plastic/OuterCurvedSurface"
s:Sc/PhSp/OutputType                = "ASCII"
s:Sc/PhSp/OutputFile                = "PHSP"
s:Sc/PhSp/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/PhSp/IncludeTimeOfFlight       = "true"
b:Sc/PhSp/UsePDGEncoding            = "True"

# VISUALIZATION
s:Gr/view/Type        = "OpenGl"
i:Gr/view/WindowSizeX = 600
i:Gr/view/WindowSizeY = 600
d:Gr/view/Theta       = 45. deg
d:Gr/view/Phi         = 45. deg

# PHYSICS LIST
s:Ph/ListName         = "Optical"
s:Ph/Optical/Type     = "Geant4_Modular"
sv:Ph/Optical/Modules = 2 "g4em-standard_opt3" "g4optical"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 100 MeV
u:So/Example/BeamEnergySpread         = 0.5
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 0.5 mm
d:So/Example/BeamPositionCutoffY      = 0.5 mm
s:So/Example/BeamAngularDistribution  = "Flat"
d:So/Example/BeamAngularCutoffX       = 0.2 rad
d:So/Example/BeamAngularCutoffY       = 0.2 rad
i:So/Example/NumberOfHistoriesInRun   = 1

# GEOMETRY
d:Ge/World/HLX      = 1 cm
d:Ge/World/HLY      = 1 cm
d:Ge/World/HLZ      = 1 cm
s:Ge/World/Material = "Air"

# Plastic
s:Ge/Plastic/Parent   = "World"
s:Ge/Plastic/Type     = "TsCylinder"
s:Ge/Plastic/Material = "Buapfcfm"
d:Ge/Plastic/HL       = 0.5 cm
d:Ge/Plastic/RMin     = 0.0 cm
d:Ge/Plastic/RMax     =	0.5 cm
d:Ge/Plastic/SPhi     = 0 deg
d:Ge/Plastic/DPhi     = 360 deg
d:Ge/Plastic/TransX   = 0 mm
d:Ge/Plastic/TransY   = 0 mm
d:Ge/Plastic/TransZ   = 0 mm
d:Ge/Plastic/RotX     = 0 deg
d:Ge/Plastic/RotY     = 0 deg
d:Ge/Plastic/RotZ     = 0 deg

Rotating_Surfaces.txt

# Demonstrates optical behavior on rotating surfaces

includeFile = Surfaces.txt

i:Ts/SequenceVerbosity = 0

i:Tf/Verbosity               = 0
d:Tf/TimelineEnd             = 60.0 ms
i:Tf/NumberOfSequentialTimes = 40

i:So/Example/NumberOfHistoriesInRun = 20

d:Ge/Splitter/RotX = Tf/SplitterRot/Value deg

s:Tf/SplitterRot/Function           = "Linear deg"
d:Tf/SplitterRot/Rate               = 1. deg/ms
d:Tf/SplitterRot/StartValue         = -57.0 deg
d:Tf/SplitterRot/RepetitionInterval = 60. ms

d:Ge/Mirror/RotX =  Tf/MirrorRot/Value deg

s:Tf/MirrorRot/Function           = "Linear deg"
d:Tf/MirrorRot/Rate               = -1. deg/ms
d:Tf/MirrorRot/StartValue         = 100.0 deg
d:Tf/MirrorRot/RepetitionInterval = 60. ms

Surfaces.txt

# Demonstrate use of optical surfaces

includeFile = OpticalMaterialSample.txt

i:Ts/SequenceVerbosity = 1

# SEQUENCE
b:Ts/PauseBeforeQuit                = "True"
b:Ts/ShowCPUTime                    = "True"
i:Ts/ShowHistoryCountAtInterval     = 10

# VISUALIZATION
s:Gr/view/Type         = "OpenGl"
#b:Gr/view/IncludeAxes  = "true"
d:Gr/view/AxesSize     = 10 cm

# PHYSICS LIST
s:Ph/ListName         = "Optical"
s:Ph/Optical/Type     = "Geant4_Modular"
sv:Ph/Optical/Modules = 2 "g4optical" "g4em-standard_opt3"

# SCORER
s:Sc/PhSp/Quantity                  = "PhaseSpace"
s:Sc/PhSp/Surface                   = "Screen/YMinusSurface"
s:Sc/PhSp/OutputType                = "ASCII"
s:Sc/PhSp/OutputFile                = "PhSp"
s:Sc/PhSp/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/PhSp/UsePDGEncoding            = "True"
b:Sc/PhSp/KillAfterPhaseSpace       = "True"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "opticalphoton"
u:So/Example/BeamPolarizationX        = 1
u:So/Example/BeamPolarizationY        = 0
u:So/Example/BeamPolarizationZ        = 0
d:So/Example/BeamEnergy               = 1.9593 eV
u:So/Example/BeamEnergySpread         = 0.04898
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 0.405 mm
d:So/Example/BeamPositionCutoffY      = 0.405 mm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 1. mrad
d:So/Example/BeamAngularSpreadY       = 1. mrad
i:So/Example/NumberOfHistoriesInRun   = 100
d:Ge/BeamPosition/TransZ         = -1.0 * Ge/World/HLZ cm
d:Ge/BeamPosition/RotY           = 180 deg

d:Ge/World/HLX = 15 cm
d:Ge/World/HLY = 15 cm
d:Ge/World/HLZ = 15 cm

# Splitter
s:Ge/Splitter/Parent = "World"
s:Ge/Splitter/Type   = "Group"
d:Ge/Splitter/TransX = 0 mm
d:Ge/Splitter/TransY = 0 mm
d:Ge/Splitter/TransZ = 0 mm
d:Ge/Splitter/RotX   = -45 deg
d:Ge/Splitter/RotY   = 0 deg
d:Ge/Splitter/RotZ   = 0 deg

s:Ge/Split/Parent   = "Splitter"
s:Ge/Split/Type     = "TsBox"
s:Ge/Split/Material = "Borosilicate"
d:Ge/Split/HLX      = 2 cm
d:Ge/Split/HLY      = 2 cm
d:Ge/Split/HLZ      = 0.75 mm
d:Ge/Split/TransX   = 0 mm
d:Ge/Split/TransY   = 0 mm
d:Ge/Split/TransZ   = 0 mm
d:Ge/Split/RotX     = 0 deg
d:Ge/Split/RotY     = 0 deg
d:Ge/Split/RotZ     = 0 deg
s:Ge/Split/OpticalBehaviorTo/SilverSurface   = "SurfaceSplitter"

s:Ge/SilverSurface/Parent   = "Splitter"
s:Ge/SilverSurface/Type     = "TsBox"
s:Ge/SilverSurface/Material = "Borosilicate"
d:Ge/SilverSurface/HLX      = 1.9 cm
d:Ge/SilverSurface/HLY      = 1.9 cm
d:Ge/SilverSurface/HLZ      = 0.5 nm
d:Ge/SilverSurface/TransX   = 0 mm
d:Ge/SilverSurface/TransY   = 0 mm
d:Ge/SilverSurface/TransZ   = Ge/Split/HLZ + Ge/SilverSurface/HLZ cm
d:Ge/SilverSurface/RotX     = 0 deg
d:Ge/SilverSurface/RotY     = 0 deg
d:Ge/SilverSurface/RotZ     = 0 deg
s:Ge/SilverSurface/OpticalBehaviorTo/Split  = "SurfaceSplitter"

# Mirrors
s:Ge/Mirror/Parent          = "World"
s:Ge/Mirror/Type            = "TsBox"
s:Ge/Mirror/Material        = "Borosilicate"
d:Ge/Mirror/HLX             = 2 cm
d:Ge/Mirror/HLY             = 2 cm
d:Ge/Mirror/HLZ             = 0.75 mm
d:Ge/Mirror/TransX          = 0 mm
d:Ge/Mirror/TransY          = 10 cm
d:Ge/Mirror/TransZ          = 0 mm
d:Ge/Mirror/RotX            = 89.7 deg
d:Ge/Mirror/RotY            = 0 deg
d:Ge/Mirror/RotZ            = 0 deg
s:Ge/Mirror/OpticalBehavior = "surfaceMirror"

s:Ge/screen/Parent   = "World"
s:Ge/screen/Type     = "TsBox"
s:Ge/screen/Material = "Air"
d:Ge/screen/HLX      = 2 cm
d:Ge/screen/HLY      = 1 mm
d:Ge/screen/HLZ      = 2 cm
d:Ge/screen/TransX   = 0 mm
d:Ge/screen/TransY   = -10 cm
d:Ge/screen/TransZ   = 0 cm
d:Ge/screen/RotX     = 0 deg
d:Ge/screen/RotY     = 0 deg
d:Ge/screen/RotZ     = 0 deg

# Optical properties of the surfaces needed
s:Su/SurfaceSplitter/Type                   = "dielectric_dielectric"
s:Su/SurfaceSplitter/Finish                 = "polished"
s:Su/SurfaceSplitter/Model                  = "unified"
dv:Su/SurfaceSplitter/Efficiency/Energies   = 2 1.6 4.2 eV
uv:Su/SurfaceSplitter/Efficiency/Values     = 2 1.0 1.0
dv:Su/SurfaceSplitTer/Reflectivity/Energies = 2 1.6 4.2 eV
uv:Su/SurfaceSplitter/Reflectivity/Values   = 2 0.5 0.5

s:Su/SurfaceMirror/Type                   = "dielectric_metal"
s:Su/SurfaceMirror/Finish                 = "polished"
s:Su/SurfaceMirror/Model                  = "unified"
dv:Su/SurfaceMirror/Reflectivity/Energies = 2 1.6 4.2 eV
uv:Su/SurfaceMirror/Reflectivity/Values   = 2 1.0 1.0

WavelengthShifter.txt

# Demonstrates optical behavior in a wavelength shifter

includeFile = OpticalMaterialSample.txt

i:Ts/SequenceVerbosity = 0

# SEQUENCE
b:Ts/PauseBeforeQuit = "False"
b:Ts/ShowCPUTime = "True"
i:Ts/ShowHistoryCountAtInterval= 10000

# SCORER
s:Sc/PhSp1/Quantity                        = "PhaseSpace"
s:Sc/PhSp1/Surface                         = "WLS/OuterCurvedSurface"
s:Sc/PhSp1/OutputType                      = "ASCII"
s:Sc/PhSp1/OutputFile                      = "In"
s:Sc/PhSp1/IfOutputFileAlreadyExists       = "Overwrite"
b:Sc/PhSp1/IncludeTimeOfFlight             = "true"
b:Sc/PhSp1/UsePDGEncoding                  = "True"
sv:Sc/PhSp1/OnlyIncludeParticlesFromVolume = 1 "Plastic"
s:Sc/PhSp1/OnlyIncludeParticlesGoing       = "in"

s:Sc/PhSp2/Quantity                  = "PhaseSpace"
s:Sc/PhSp2/Surface                   = "WLS/Core/ZPlusSurface"
s:Sc/PhSp2/OutputType                = "ASCII"
s:Sc/PhSp2/OutputFile                = "Out"
s:Sc/PhSp2/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/PhSp2/IncludeTimeOfFlight       = "true"
b:Sc/PhSp2/UsePDGEncoding            = "True"

# VISUALIZATION
#s:Gr/view/Type       = "OpenGl"
b:Gr/view/IncludeAxes = "True"
i:Gr/view/WindowSizeX = 600
i:Gr/view/WindowSizeY = 600
d:Gr/view/Theta       = 45. deg
d:Gr/view/Phi         = 45. deg

# PHYSICS LIST
s:Ph/ListName         = "Optical"
s:Ph/Optical/Type     = "Geant4_Modular"
sv:Ph/Optical/Modules = 7 "g4optical" "g4em-standard_opt3" "g4h-phy_QGSP_BIC_HP" "g4decay"
"g4ion-binarycascade" "g4h-elastic_HP" "g4stopping"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 200 MeV
u:So/Example/BeamEnergySpread         = 0.5
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 0.5 mm
d:So/Example/BeamPositionCutoffY      = 0.5 mm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.2 rad
d:So/Example/BeamAngularSpreadY       = 0.2 rad
i:So/Example/NumberOfHistoriesInRun   = 100000
d:Ge/BeamPosition/TransY            = -3.0 cm

# GEOMETRY
d:Ge/World/HLX      =6 cm
d:Ge/World/HLY      =6 cm
d:Ge/World/HLZ      =20 cm
s:Ge/World/Material = "Air"

# Plastic
s:Ge/WaterBox/Parent   = "World"
s:Ge/WaterBox/Type     = "TsBox"
s:Ge/WaterBox/Material = "G4_WATER"
d:Ge/WaterBox/HLX      = 2.5 cm
d:Ge/WaterBox/HLY      = 2.5 cm
d:Ge/WaterBox/HLZ      = 5.0 cm
d:Ge/WaterBox/TransX   = 0 mm
d:Ge/WaterBox/TransY   = -3.0 cm
d:Ge/WaterBox/TransZ   = 0 mm
d:Ge/WaterBox/RotX     = 0 deg
d:Ge/WaterBox/RotY     = 0 deg
d:Ge/WaterBox/RotZ     = 0 deg

# Plastic
s:Ge/Plastic/Parent   = "World"
s:Ge/Plastic/Type     = "TsBox"
s:Ge/Plastic/Material = "BUAPFCFM"
d:Ge/Plastic/HLX      = 0.5 cm
d:Ge/Plastic/HLY      = 0.5 cm
d:Ge/Plastic/HLZ      =	2.5 cm
d:Ge/Plastic/TransX   = 0 mm
d:Ge/Plastic/TransY   = 0 mm
d:Ge/Plastic/TransZ   = 0 mm
d:Ge/Plastic/RotX     = 0 deg
d:Ge/Plastic/RotY     = 0 deg
d:Ge/Plastic/RotZ     = 0 deg

# WLS
d:Ge/WLS/Diameter = 1.03 mm
s:Ge/WLS/Parent   = "World"
s:Ge/WLS/Type     = "TsCylinder"
s:Ge/WLS/Material = "PMMA"
d:Ge/WLS/HL       = 10 cm
d:Ge/WLS/RMin     = 0.50 mm
d:Ge/WLS/RMax     = 0.515 mm
d:Ge/WLS/SPhi     = 0 deg
d:Ge/WLS/DPhi     = 360 deg
d:Ge/WLS/TransX   = 0 mm
d:Ge/WLS/TransY   = Ge/Plastic/HLY + Ge/WLS/RMax mm
d:Ge/WLS/TransZ   = Ge/WLS/HL - Ge/Plastic/HLZ cm
d:Ge/WLS/RotX     = 0 deg
d:Ge/WLS/RotY     = 0 deg
d:Ge/WLS/RotZ     = 0 deg

s:Ge/WLS/Core/Parent   = "World"
s:Ge/WLS/Core/Type     = "TsCylinder"
s:Ge/WLS/Core/Material = "Polystyrene"
d:Ge/WLS/Core/HL       = Ge/WLS/HL cm
d:Ge/WLS/Core/RMin     = 0.0 mm
d:Ge/WLS/Core/RMax     = 0.5 mm
d:Ge/WLS/Core/SPhi     = 0 deg
d:Ge/WLS/Core/DPhi     = 360 deg
d:Ge/WLS/Core/TransX   = 0 mm
d:Ge/WLS/Core/TransY   = Ge/Plastic/HLY + Ge/WLS/RMax mm
d:Ge/WLS/Core/TransZ   = Ge/WLS/HL - Ge/Plastic/HLZ cm
d:Ge/WLS/Core/RotX     = 0 deg
d:Ge/WLS/Core/RotY     = 0 deg
d:Ge/WLS/Core/RotZ     = 0 deg

Outcome

CEModelBurman.txt

CVModelStavrev.txt

#Parameter obtained from Stavrev et. al. Physica Medica, Vol 17(2) (2001).
# Table 1.
#          Organ                                mu_cr   std     sigma   std    D50_FSU  std     Gamma50_FSU   std
uv:Sc/CriticalVolumeValues/Lung	          = 8	0.08	0.02	0.02	0.01	220	51	0.3	0.02	# Pneumonitis
uv:Sc/CriticalVolumeValues/Liver	  = 8	0.04	0.01	0.01	0.003	181	20	0.5	0.02	# Liver failure
uv:Sc/CriticalVolumeValues/Brain	  = 8	0.08	0.02	0.05	0.02	104	7.9	1	0.1	# Necrosis
uv:Sc/CriticalVolumeValues/Heart	  = 8	0.14	0.07	0.05	0.02	83	22	0.8	0.2	# Pericarditis
uv:Sc/CriticalVolumeValues/Kidney	  = 8	0.22	0.06	0.05	0.01	59	14	0.4	0.06	# Clinical nephritis
uv:Sc/CriticalVolumeValues/Esophagus	  = 8	0.01	0.02	0.02	0.03	97	14	2.4	0.8	# Clincial stricture, perforation
uv:Sc/CriticalVolumeValues/Stomach	  = 8	0.02	0.01	0.03	0.01	94	7.1	2.2	0.5	# Ulceration, perforation
uv:Sc/CriticalVolumeValues/BrachialPlexus = 8	0.01	0.03	0.05	0.1	86	9.9	6	4	# Clinically apparent nerve damage
uv:Sc/CriticalVolumeValues/Bladder	  = 8	0.26	0.11	0.11	0.02	108	24	0.8	0.2	# Symptomatic bladder contraction and volume loss
uv:Sc/CriticalVolumeValues/TMJointMandible= 8	0.07	0.06	0.09	0.07	86	7.4	3.1	1	# Marked limitation of joint function
uv:Sc/CriticalVolumeValues/BrainStem	  = 8	0.12	0.06	0.08	0.04	97	12	1.2	0.2	# Necrosis
uv:Sc/CriticalVolumeValues/Larynx 	  = 8	0.07	0.08	0.08	0.05	108	22	1.9	0.5	# Cartilage necrosis perforation
uv:Sc/CriticalVolumeValues/SmallIntestine = 8	0.04	0.05	0.04	0.04	97	28	1.2	0.3	# Obstruction, perforation
uv:Sc/CriticalVolumeValues/Colon	  = 8	0.03	0.02	0.02	0.01	108	16	1.1	0.1	# Obstruction, perforation
uv:Sc/CriticalVolumeValues/SpinalCord	  = 8	0.08	0.09	0.16	0.15	81	12	2.6	1	# Myelitis necrosis
uv:Sc/CriticalVolumeValues/Skin	          = 8	0.11	0.05	0.09	0.05	93	8.5	1.7	0.3	# Necrosis, ulceration

Phantom.txt

# The body
s:Ge/WaterPhantom/Parent = "World"
s:Ge/WaterPhantom/Type   = "TsBox"
s:Ge/WaterPhantom/Material = "G4_WATER"
d:Ge/WaterPhantom/HLX = 40 mm
d:Ge/WaterPhantom/HLY = 40 mm
d:Ge/WaterPhantom/HLZ = 100 mm
d:Ge/WaterPhantom/TransX =  0.0 cm
d:Ge/WaterPhantom/TransY =  0.0 cm
d:Ge/WaterPhantom/TransZ =  0.0 cm
d:Ge/WaterPhantom/RotX= 0. deg
d:Ge/WaterPhantom/RotY= 0. deg
d:Ge/WaterPhantom/RotZ= 0. deg

# The target/tumor
d:Ge/InitPosZ = -1.0 * Ge/WaterPhantom/HLZ mm
s:Ge/WaterPhantom/Target/Parent = "WaterPhantom"
s:Ge/WaterPhantom/Target/Type   = "TsBox"
s:Ge/WaterPhantom/Target/Material = "G4_WATER"
d:Ge/WaterPhantom/Target/HLX = 10 mm
d:Ge/WaterPhantom/Target/HLY = 10 mm
d:Ge/WaterPhantom/Target/HLZ = 22 mm
d:Ge/WaterPhantom/Target/TransX =  0.0 cm
d:Ge/WaterPhantom/Target/TransY =  0.0 cm
d:Ge/WaterPhantom/Target/TransZTmp = 24 mm + Ge/InitPosZ
d:Ge/WaterPhantom/Target/TransZ =  Ge/WaterPhantom/Target/TransZTmp + Ge/WaterPhantom/Target/HLZ  mm
d:Ge/WaterPhantom/Target/RotX= 0. deg
d:Ge/WaterPhantom/Target/RotY= 0. deg
d:Ge/WaterPhantom/Target/RotZ= 0. deg
i:Ge/WaterPhantom/Target/XBins = 20
i:Ge/WaterPhantom/Target/YBins = 20
i:Ge/WaterPhantom/Target/ZBins = 44

# An organ at risk at the entrance of the beam
s:Ge/WaterPhantom/OAR1/Parent = "WaterPhantom"
s:Ge/WaterPhantom/OAR1/Type   = "TsBox"
s:Ge/WaterPhantom/OAR1/Material = "G4_WATER"
d:Ge/WaterPhantom/OAR1/HLX = 10 mm
d:Ge/WaterPhantom/OAR1/HLY = 10 mm
d:Ge/WaterPhantom/OAR1/HLZ = 22 mm
d:Ge/WaterPhantom/OAR1/TransX =  0.0 cm
d:Ge/WaterPhantom/OAR1/TransY =  0.0 cm
d:Ge/WaterPhantom/OAR1/TransZTmp = Ge/WaterPhantom/Target/TransZ + Ge/WaterPhantom/Target/HLZ mm
d:Ge/WaterPhantom/OAR1/TransZ = Ge/WaterPhantom/OAR1/TransZTmp + Ge/WaterPhantom/OAR1/HLZ mm
d:Ge/WaterPhantom/OAR1/RotX= 0. deg
d:Ge/WaterPhantom/OAR1/RotY= 0. deg
d:Ge/WaterPhantom/OAR1/RotZ= 0. deg
i:Ge/WaterPhantom/OAR1/XBins = 20
i:Ge/WaterPhantom/OAR1/YBins = 20
i:Ge/WaterPhantom/OAR1/ZBins = 44

# An organ at risk at distal position
s:Ge/WaterPhantom/OAR2/Parent = "WaterPhantom"
s:Ge/WaterPhantom/OAR2/Type   = "TsBox"
s:Ge/WaterPhantom/OAR2/Material = "G4_WATER"
d:Ge/WaterPhantom/OAR2/HLX = 12 mm
d:Ge/WaterPhantom/OAR2/HLY = 12 mm
d:Ge/WaterPhantom/OAR2/HLZ = 12 mm
d:Ge/WaterPhantom/OAR2/TransX =  0.0 cm
d:Ge/WaterPhantom/OAR2/TransY =  0.0 cm
d:Ge/WaterPhantom/OAR2/TransZ = Ge/InitPosZ + Ge/WaterPhantom/OAR2/HLZ mm
d:Ge/WaterPhantom/OAR2/RotX= 0. deg
d:Ge/WaterPhantom/OAR2/RotY= 0. deg
d:Ge/WaterPhantom/OAR2/RotZ= 0. deg
i:Ge/WaterPhantom/OAR2/XBins = 24
i:Ge/WaterPhantom/OAR2/YBins = 24
i:Ge/WaterPhantom/OAR2/ZBins = 24

PoissonModelOkuneff.txt

#Parameter obtained from Okunieff  et. al. Int. J. Radiation Oncology Biol. Phys. Vol 32  pp 1227-1237. (1995)
# Table No. 2. Single institution macroscopic tumor
#       Tumor site                     TD50    Gamma50  Slope50   Comments 
uv:Sc/PoissonValues/MFungoides 	   = 3	10.49	 0.33	 3.1	
uv:Sc/PoissonValues/MFungoides 	   = 3	10.53	 0.31	 2.97	# Recurrent
uv:Sc/PoissonValues/Hodgkin   	   = 3	14.65	 0.41	 2.8	# Stage I + II
uv:Sc/PoissonValues/Hodgkin    	   = 3	15.3	 1.39	 9.09	# > 3.0 cm
uv:Sc/PoissonValues/Hodgkin   	   = 3	15.31	 1.51	 9.84	# 0.5-3.0 cm
uv:Sc/PoissonValues/Hodgkin   	   = 3	21.42	 1.62	 7.58	# All 
uv:Sc/PoissonValues/Breast	   = 3	21.71	 0.04	 0.17	# 4-6 cm 
uv:Sc/PoissonValues/UterineCervix  = 3	24.27	 0.67	 2.77	# Stage IA 
uv:Sc/PoissonValues/UterineCervix  = 3	25.51	 0.64	 2.52	# Stage IIA 
uv:Sc/PoissonValues/UterineCervix  = 3	26.35	 0.71	 2.7	# All
uv:Sc/PoissonValues/UterineCervix  = 3	34.15	 20.93	 61.27	# Stage IIB 
uv:Sc/PoissonValues/Breast	   = 3	36.24	 0.88	 2.42	# Recurrent 
uv:Sc/PoissonValues/UterineCervix  = 3	45.45	 0.69	 1.52	# Stage IIB 
uv:Sc/PoissonValues/Breast	   = 3	46.94	 0.28	 0.6	# All T3 + 4
uv:Sc/PoissonValues/NSCLC	   = 3	48.51	 0.57	 1.18	# CR + PR 
uv:Sc/PoissonValues/Lung	   = 3	49.12	 1.25	 2.54	# Large Cell
uv:Sc/PoissonValues/Melanoma 	   = 3	49.84	 0.99	 1.98	# --
uv:Sc/PoissonValues/Nasophatynx	   = 3	50.01	 17.54	 35.06	# Node < 3 cm 
uv:Sc/PoissonValues/Nasopharynx	   = 3	50.27	 32.22	 64.1	# All Node +
uv:Sc/PoissonValues/Supraglottic   = 3	50.44	 1.83	 3.62	# Tl 
uv:Sc/PoissonValues/Lung	   = 3	51.87	 2.17	 4.18	# Adenocarcinoma 
uv:Sc/PoissonValues/Lung	   = 3	51.97	 1.81	 3.48	# All NSCLC
uv:Sc/PoissonValues/Tonsil	   = 3	54.02	 1.03	 1.92	# Nl-3
uv:Sc/PoissonValues/Lung 	   = 3	54.92	 2.04	 3.72	# Squamous Cell 
uv:Sc/PoissonValues/Nasopharynx    = 3	55.12	 1.82	 3.31	# Node 3-6 cm 
uv:Sc/PoissonValues/Tonsil	   = 3	57.27	 1.29	 3.25	# Tl-4
uv:Sc/PoissonValues/Breast 	   = 3	57.37	 0.93	 1.61	# Stage III
uv:Sc/PoissonValues/Nasopharynx    = 3	58.79	 47.26	 80.39	# Tl +T2
uv:Sc/PoissonValues/Breast 	   = 3	59.08	 1.33	 2.25	# Stage III
uv:Sc/PoissonValues/Nasopharynx    = 3	60.15	 4.41	 7.33	# T3 
uv:Sc/PoissonValues/PyriformSinus  = 3	60.76	 3.8	 6.25	# Nodes<3cm 
uv:Sc/PoissonValues/Nasopharynx    = 3	61.59	 3.38	 5.49	# Tl-4
uv:Sc/PoissonValues/Supraglottic   = 3	61.97	 2.69	 4.33	# Squamous Cell 
uv:Sc/PoissonValues/Breast 	   = 3	62.59	 1.24	 1.98	# > 6 cm
uv:Sc/PoissonValues/Breast 	   = 3	62.83	 1.55	 2.46	# Stage II + III
uv:Sc/PoissonValues/Supraglottic   = 3	62.92	 0.63	 1	# T4
uv:Sc/PoissonValues/Supraglottic   = 3	63.28	 4.01	 6.33	# T2+T3
uv:Sc/PoissonValues/PyriformSinus  = 3	63.4	 2.85	 4.49	# All Nodes 
uv:Sc/PoissonValues/Supraglottic   = 3	63.43	 2.66	 4.19	# Stage I, II, IIIA 
uv:Sc/PoissonValues/PharyngealWall = 3	63.66	 1.67	 2.62	# Tl-4
uv:Sc/PoissonValues/UterineCervix  = 3	64.38	 0.69	 1.08	# Stage III 
uv:Sc/PoissonValues/PyriformSinus  = 3	65.89	 1.61	 2.45	# Tl+2
uv:Sc/PoissonValues/Nasopharynx    = 3	67.23	 3.25	 4.84	# T4 
uv:Sc/PoissonValues/Nasopharynx    = 3	68.81	 1.67	 2.43	# Node>6cm 
uv:Sc/PoissonValues/PyriformSinus  = 3	69.72	 2.81	 4.03	# Nodes>3cm 
uv:Sc/PoissonValues/PharyngealWall = 3	72.19	 0.8	 1.11	# T3 + 4
uv:Sc/PoissonValues/PyriformSinus  = 3	77.15	 0.75	 0.97	# T1+2+3
uv:Sc/PoissonValues/PyriformSinus  = 3	81.75	 0.69	 0.85	# T3
uv:Sc/PoissonValues/Supraglottic   = 3	83.35	 0.97	 1.16	# Stage IIIB, IV 
uv:Sc/PoissonValues/Breast	   = 3	90.31	 0.41	 0.45	# T4

TestOutcomeModel.txt

# The geometry
includeFile = LKMModelBurman.txt Phantom.txt

Ge/World/HLX = 101 mm
Ge/World/HLY = 101 mm
Ge/World/HLZ = 101 mm

# To reach ~60 Gy at maximum dose in the target
u:Sc/ScaleFactor = 5779493.074240799

# Calculates outcome from DVH
s:Sc/OAR1/Quantity = "DoseToMedium"
s:Sc/OAR1/Component = "WaterPhantom/OAR1"
s:Sc/OAR1/OutputFile = "DoseAtOAR1"
s:Sc/OAR1/OutputType = "Binary"
s:Sc/OAR1/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OAR1/Report = 2 "sum" "cumulativevolumehistogram"
i:Sc/OAR1/HistogramBins = 100
d:Sc/OAR1/HistogramMin = 0 Gy
d:Sc/OAR1/HistogramMax = 1.42E-5 Gy

# Here cDVH is activated, then the outcome will be calculate from DVH.
# For that, cDVH is internally converted to dDVH
# Models to be calulated
sv:Sc/OAR1/OutcomeModelName = 3 "lkb" "CriticalElement" "CriticalVolume"
# User may wants to scale the dose distribution
u:Sc/OAR1/OutcomeOutputScaleFactor = Sc/ScaleFactor
# Correct for dose fractionation. Set number of fractions:
i:Sc/OAR1/NumberOfFractions = 20
# Optionally  set the dose per fraction and alpha/beta. Othewise
# The values 2.0 Gy and 3.0 Gy are set by default respectively
d:Sc/OAR1/DosePerFraction = 2.0 Gy
d:Sc/OAR1/AlphaOverBeta = 3.0 Gy

# There is an internal data base for LKB only.
# If the organ name is not found in data base, TOPAS is stopped and
# a list with the organs is displayed. Otherwise user can set
# the parameters by hand: n, m and TD50
s:Sc/OAR1/lkb/UsePresetParametersFromOrganNamed = "Kidney"

# Parameters for the rest of the models are set by hand
u:Sc/OAR1/CriticalElement/Gamma               = 2.8
u:Sc/OAR1/CriticalElement/td50                = 28.0
u:Sc/OAR1/CriticalVolume/mu_cr                = 0.22
u:Sc/OAR1/CriticalVolume/sigma_mu_cr          = 0.05
u:Sc/OAR1/CriticalVolume/d50fsu               = 59
u:Sc/OAR1/CriticalVolume/gamma50fsu           = 0.4

# From full dose distribution
s:Sc/OAR2/Quantity = "DoseToMedium"
s:Sc/OAR2/Component = "WaterPhantom/OAR2"
s:Sc/OAR2/OutputFile = "DoseAtOAR2"
s:Sc/OAR2/OutputType = "Binary"
s:Sc/OAR2/IfOutputFileAlreadyExists = "Overwrite"

# If DVH is not reported, then the outcome is calculated
# from full dose distribution. In that case, all voxels
# must to have the same volume.
sv:Sc/OAR2/OutcomeModelName = 1 "lkb"
u:Sc/OAR2/OutcomeOutputScaleFactor = Sc/ScaleFactor
s:Sc/OAR2/lkb/UsePresetParametersFromOrganNamed = "colon"
# Correct for dose fractionation
i:Sc/OAR2/NumberOfFractions = 20

s:Sc/Target/Quantity = "DoseToMedium"
s:Sc/Target/Component = "WaterPhantom/Target"
s:Sc/Target/OutputFile = "DoseAtTarget"
s:Sc/Target/OutputType = "Binary"
s:Sc/Target/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/Target/Report = 2 "sum" "cumulativevolumehistogram"
i:Sc/Target/HistogramBins = 100
d:Sc/Target/HistogramMin  = 0 Gy
d:Sc/Target/HistogramMax  = 1.56e-5 Gy
sv:Sc/Target/OutcomeModelName = 1 "poisson"
u:Sc/Target/OutcomeOutputScaleFactor = Sc/ScaleFactor
u:Sc/Target/Poisson/Gamma50 = 0.60
u:Sc/Target/Poisson/TCD50 = 41.78
# Correct for dose fractionation
i:Sc/Target/NumberOfFractions = 20

# Set a raw SOBP
s:Tf/Energy/Function = "Step"
dv:Tf/Energy/Times = 5 20 40 60 80 100 ms
dv:Tf/Energy/Values = 5 160 155 150 145 140 MeV
s:Tf/Histories/Function = "Step"
dv:Tf/Histories/Times = 5 20 40 60 80 100 ms
iv:Tf/Histories/Values = 5 6600 2500 1750 1400 1200

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = Tf/Energy/Value MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. mm
d:So/Example/BeamPositionCutoffY      = 10. mm
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10 * Tf/Histories/Value

# Start
Ts/PauseBeforeQuit = "False"
i:Tf/NumberOfSequentialTimes = 5
d:Tf/TimelineEnd = 100 ms
Ts/ShowHistoryCountAtInterval = 10000
Tf/Verbosity = 1
b:Ts/ShowCPUTime = "True"

TestRestoreModel.txt

# The geometry
includeFile = LKMModelBurman.txt Phantom.txt

Ge/World/HLX = 101 mm
Ge/World/HLY = 101 mm
Ge/World/HLZ = 101 mm

# To reach ~60 Gy at maximum dose in the target
u:Sc/ScaleFactor = 5779493.074240799

# Calculates outcome from DVH
s:Sc/OAR1/Quantity = "DoseToMedium"
s:Sc/OAR1/Component = "WaterPhantom/OAR1"
s:Sc/OAR1/OutputFile = "DoseAtOAR1"
s:Sc/OAR1/OutputType = "Binary"
s:Sc/OAR1/InputFile = "DoseAtOAR1Saved"
s:Sc/OAR1/InputType = "Binary"
s:Sc/OAR1/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OAR1/Report = 2 "sum" "cumulativevolumehistogram"
i:Sc/OAR1/HistogramBins = 100
d:Sc/OAR1/HistogramMin = 0 Gy
d:Sc/OAR1/HistogramMax = 1.42E-5 Gy

# Here cDVH is activated, then the outcome will be calculate from DVH.
# For that, cDVH is internally converted to dDVH
# Models to be calulated
sv:Sc/OAR1/OutcomeModelName = 3 "lkb" "CriticalElement" "CriticalVolume"
# User may wants to scale the dose distribution
u:Sc/OAR1/OutcomeOutputScaleFactor = Sc/ScaleFactor
# Correct for dose fractionation. Set number of fractions:
i:Sc/OAR1/NumberOfFractions = 20
# Optionally  set the dose per fraction and alpha/beta. Othewise
# The values 2.0 Gy and 3.0 Gy are set by default respectively
d:Sc/OAR1/DosePerFraction = 2.0 Gy
d:Sc/OAR1/AlphaOverBeta = 3.0 Gy

# There is an internal data base for LKB only.
# If the organ name is not found in data base, TOPAS is stopped and
# a list with the organs is displayed. Otherwise user can set
# the parameters by hand: n, m and TD50
s:Sc/OAR1/lkb/UsePresetParametersFromOrganNamed = "Kidney"

# Parameters for the rest of the models are set by hand
u:Sc/OAR1/CriticalElement/Gamma               = 2.8
u:Sc/OAR1/CriticalElement/td50                = 28.0
u:Sc/OAR1/CriticalVolume/mu_cr                = 0.22
u:Sc/OAR1/CriticalVolume/sigma_mu_cr          = 0.05
u:Sc/OAR1/CriticalVolume/d50fsu               = 59
u:Sc/OAR1/CriticalVolume/gamma50fsu           = 0.4

# From full dose distribution
s:Sc/OAR2/Quantity = "DoseToMedium"
s:Sc/OAR2/Component = "WaterPhantom/OAR2"
s:Sc/OAR2/OutputFile = "DoseAtOAR2"
s:Sc/OAR2/OutputType = "Binary"
s:Sc/OAR2/InputFile = "DoseAtOAR2Saved"
s:Sc/OAR2/InputType = "Binary"
s:Sc/OAR2/IfOutputFileAlreadyExists = "Overwrite"

# If DVH is not reported, then the outcome is calculated
# from full dose distribution. In that case, all voxels
# must to have the same volume.
sv:Sc/OAR2/OutcomeModelName = 1 "lkb"
u:Sc/OAR2/OutcomeOutputScaleFactor = Sc/ScaleFactor
s:Sc/OAR2/lkb/UsePresetParametersFromOrganNamed = "colon"
# Correct for dose fractionation
i:Sc/OAR2/NumberOfFractions = 20

s:Sc/Target/Quantity = "DoseToMedium"
s:Sc/Target/Component = "WaterPhantom/Target"
s:Sc/Target/OutputFile = "DoseAtTarget"
s:Sc/Target/OutputType = "Binary"
s:Sc/Target/InputFile = "DoseAtTargetSaved"
s:Sc/Target/InputType = "Binary"
s:Sc/Target/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/Target/Report = 2 "sum" "cumulativevolumehistogram"
i:Sc/Target/HistogramBins = 100
d:Sc/Target/HistogramMin  = 0 Gy
d:Sc/Target/HistogramMax  = 1.56e-5 Gy
sv:Sc/Target/OutcomeModelName = 1 "poisson"
u:Sc/Target/OutcomeOutputScaleFactor = Sc/ScaleFactor
u:Sc/Target/Poisson/Gamma50 = 0.40
u:Sc/Target/Poisson/TCD50 = 11.78
# Correct for dose fractionation
i:Sc/Target/NumberOfFractions = 20

# Set a raw SOBP
s:Tf/Energy/Function = "Step"
dv:Tf/Energy/Times = 5 20 40 60 80 100 ms
dv:Tf/Energy/Values = 5 160 155 150 145 140 MeV
s:Tf/Histories/Function = "Step"
dv:Tf/Histories/Times = 5 20 40 60 80 100 ms
iv:Tf/Histories/Values = 5 6600 2500 1750 1400 1200

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = Tf/Energy/Value MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10 mm
d:So/Example/BeamPositionCutoffY      = 10 mm
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10 * Tf/Histories/Value

# Start
Ts/PauseBeforeQuit = "False"
i:Tf/NumberOfSequentialTimes = 5
d:Tf/TimelineEnd = 100 ms
Ts/ShowHistoryCountAtInterval = 10000
Tf/Verbosity = 1
b:Ts/ShowCPUTime = "True"

Ts/RestoreResultsFromFile = "True"

Patient

Applicator.txt

# Set world material to lead so that test particles
# stop right away, making it easy to just see all the
# starting positions of the particles.

Ge/World/HLX = 50. cm
Ge/World/HLY = 50. cm
Ge/World/HLZ = 50. cm
Ge/World/Material = "G4_WATER"
b:Ge/World/Invisible = "True"

# If using water phantom
s:Ge/Patient/Type = "TsBox"
s:Ge/Patient/Parent = "World"
s:Ge/Patient/Material = "G4_WATER"
d:Ge/Patient/HLX = 4. cm
d:Ge/Patient/HLY = 4. cm
d:Ge/Patient/HLZ = 4. cm
#i:Ge/Patient/XBins = 10
#i:Ge/Patient/YBins = 10
#i:Ge/Patient/ZBins = 5

# If using real DICOM
#s:Ge/Patient/Type = "TsDicomPatient"
#s:Ge/Patient/Parent = "World"
d:Ge/Patient/TransX = 0. cm
d:Ge/Patient/TransY = 0. cm
d:Ge/Patient/TransZ = 0. cm
d:Ge/Patient/RotX               = 0. deg
d:Ge/Patient/RotY               = 0. deg
d:Ge/Patient/RotZ               = 0. deg
s:Ge/Patient/DicomDirectory     = "Abdomen"
sv:Ge/Patient/DicomModalityTags = 1 "CT"
includeFile = HUtoMaterialSchneider.txt

# Scoring
s:Sc/Dose/Quantity                  = "DoseToMedium"
s:Sc/Dose/Component                 = "Patient"
s:Sc/Dose/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/Dose/OutputType                = "DICOM"
b:Sc/Dose/DICOMOutput32BitsPerPixel = "True"

# Applicator Geometry
s:Ge/Applicator/Type = "TsBrachyApplicator"
s:Ge/Applicator/Parent = "Patient"
b:Ge/Applicator/IsParallel = "True"
s:Ge/Applicator/Material = "G4_WATER"
d:Ge/Applicator/CylinderLength = 40. mm
d:Ge/Applicator/Radius = 12.5 mm
i:Ge/Applicator/NumberOfRadialHoles = 6
d:Ge/Applicator/HoleOffset = 6 mm
d:Ge/Applicator/HoleRadius = 1.2 mm
s:Ge/Applicator/DrawingStyle = "Solid"
s:Ge/Applicator/Color = "transparentgrey"
iv:Gr/Color/transparentgrey = 4 255 255 255 90

# The following parameters are updated automatically
# by the applicator component to show true hole centers.
# They need to be defined here, but these initial values
# are not important
dc:Ge/Applicator/Hole0/TransX = 0. mm
dc:Ge/Applicator/Hole0/TransY = 0. mm
dc:Ge/Applicator/Hole1/TransX = 0. mm
dc:Ge/Applicator/Hole1/TransY = 0. mm
dc:Ge/Applicator/Hole2/TransX = 0. mm
dc:Ge/Applicator/Hole2/TransY = 0. mm
dc:Ge/Applicator/Hole3/TransX = 0. mm
dc:Ge/Applicator/Hole3/TransY = 0. mm
dc:Ge/Applicator/Hole4/TransX = 0. mm
dc:Ge/Applicator/Hole4/TransY = 0. mm
dc:Ge/Applicator/Hole5/TransX = 0. mm
dc:Ge/Applicator/Hole5/TransY = 0. mm
dc:Ge/Applicator/Hole6/TransX = 0. mm
dc:Ge/Applicator/Hole6/TransY = 0. mm


# Varian Source wire model VS2000 Geometry
s:Ge/Wire/Type                 = "TsCylinder"
s:Ge/Wire/Parent               = "Patient"
b:Ge/Wire/IsParallel = Ge/Applicator/IsParallel
s:Ge/Wire/ParallelWorldName = "Applicator"

# These for fixed position
#d:Ge/Wire/TransX              = Ge/Applicator/Hole1/TransX mm
#d:Ge/Wire/TransY              = Ge/Applicator/Hole1/TransY mm
#d:Ge/Wire/TransZ              = 0. mm - Ge/SourcePellets/TransZ # Offset wire so SourcePellets is centered in Patient

# These to have wire move under time feature
d:Ge/Wire/TransX              = Tf/WireX/Value mm
d:Ge/Wire/TransY              = Tf/WireY/Value mm
d:Ge/Wire/TransZ              = Tf/WireZ/Value  - Ge/SourcePellets/TransZ mm # Offset wire so SourcePellets is centered in Patient

s:Ge/Wire/Material             = "G4_AIR"
d:Ge/Wire/RMax                = .295 mm
d:Ge/Wire/HalfRMax		= 0.5 * Ge/Wire/RMax mm
d:Ge/Wire/HL			= Ge/WireCylinder/HL + Ge/Wire/HalfRMax mm
b:Ge/Wire/Invisible = "True"

s:Ge/WireCylinder/Type         = "TsCylinder"
s:Ge/WireCylinder/Parent       = "Wire"
b:Ge/WireCylinder/IsParallel = Ge/Applicator/IsParallel
s:Ge/WireCylinder/ParallelWorldName = "Applicator"
s:Ge/WireCylinder/Material    = "TitaniumNickel"
d:Ge/WireCylinder/RMax        = Ge/Wire/RMax mm
d:Ge/WireCylinder/HL         = 10.0 mm
d:Ge/WireCylinder/TransZ      = Ge/Wire/HalfRMax mm
d:Ge/WireCylinder/DistanceFromEndOfActiveSourceToEndOfCylinder = 1. mm - Ge/Wire/RMax
s:Ge/WireCylinder/Color         = "blue"

s:Ge/WireTip/Type              = "TsSphere"
s:Ge/WireTip/Parent            = "Wire"
b:Ge/WireTip/IsParallel = Ge/Applicator/IsParallel
s:Ge/WireTip/ParallelWorldName = "Applicator"
s:Ge/WireTip/Material         = "TitaniumNickel"
d:Ge/WireTip/RMax             = Ge/Wire/RMax mm
d:Ge/WireTip/STheta           = 90 deg
d:Ge/WireTip/DTheta           = 90 deg
d:Ge/WireTip/NegTransZ           = Ge/WireCylinder/HL - Ge/Wire/HalfRMax mm
d:Ge/WireTip/TransZ           = -1. * Ge/WireTip/NegTransZ mm
s:Ge/WireTip/Color = "blue"

s:Ge/SourcePellets/Type         = "TsCylinder"
s:Ge/SourcePellets/Parent       = "WireCylinder"
b:Ge/SourcePellets/IsParallel = Ge/Applicator/IsParallel
s:Ge/SourcePellets/ParallelWorldName = "Applicator"
s:Ge/SourcePellets/Material    = Ge/Wire/Material
d:Ge/SourcePellets/RMax        = .17 mm
d:Ge/SourcePellets/HL          = 2.5 mm
d:Ge/SourcePellets/OnePelletHL = 0.5 * Ge/SourcePellets/HL mm
d:Ge/SourcePellets/CylinderHL   = Ge/SourcePellets/OnePelletHL - Ge/SourcePellets/RMax mm
d:Ge/SourcePellets/Temp1       = Ge/WireCylinder/HL - Ge/SourcePellets/HL mm
d:Ge/SourcePellets/Temp2       = Ge/SourcePellets/Temp1 - Ge/WireCylinder/DistanceFromEndOfActiveSourceToEndOfCylinder mm
d:Ge/SourcePellets/TransZ       = -1. * Ge/SourcePellets/Temp2 mm
b:Ge/SourcePellets/Invisible = "True"
s:Ge/SourcePellets/Color = "white"

s:Ge/Source1Pellet/Type         = "TsCylinder"
s:Ge/Source1Pellet/Parent       = "SourcePellets"
b:Ge/Source1Pellet/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source1Pellet/ParallelWorldName = "Applicator"
s:Ge/Source1Pellet/Material    = Ge/Wire/Material
d:Ge/Source1Pellet/RMax        = Ge/SourcePellets/RMax mm
d:Ge/Source1Pellet/HL           = Ge/SourcePellets/OnePelletHL mm
d:Ge/Source1Pellet/TransZ       = Ge/SourcePellets/OnePelletHL mm
b:Ge/Source1Pellet/Invisible = "True"

s:Ge/Source1Cylinder/Type       = "TsCylinder"
s:Ge/Source1Cylinder/Parent     = "Source1Pellet"
b:Ge/Source1Cylinder/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source1Cylinder/ParallelWorldName = "Applicator"
s:Ge/Source1Cylinder/Material  = "G4_Ir"
d:Ge/Source1Cylinder/RMax      = Ge/SourcePellets/RMax mm
d:Ge/Source1Cylinder/HL        = Ge/SourcePellets/CylinderHL mm

s:Ge/Source1CapPlusZ/Type       = "TsSphere"
s:Ge/Source1CapPlusZ/Parent     = "Source1Pellet"
b:Ge/Source1CapPlusZ/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source1CapPlusZ/ParallelWorldName = "Applicator"
s:Ge/Source1CapPlusZ/Material  = "G4_Ir"
d:Ge/Source1CapPlusZ/RMax      = Ge/SourcePellets/RMax mm
d:Ge/Source1CapPlusZ/STheta    = 0 deg
d:Ge/Source1CapPlusZ/DTheta	  = 90 deg
d:Ge/Source1CapPlusZ/TransZ    = Ge/SourcePellets/CylinderHL mm

s:Ge/Source1CapMinusZ/Type      = "TsSphere"
s:Ge/Source1CapMinusZ/Parent    = "Source1Pellet"
b:Ge/Source1CapMinusZ/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source1CapMinusZ/ParallelWorldName = "Applicator"
s:Ge/Source1CapMinusZ/Material = "G4_Ir"
d:Ge/Source1CapMinusZ/RMax     = Ge/SourcePellets/RMax mm
d:Ge/Source1CapMinusZ/STheta   = 90 deg
d:Ge/Source1CapMinusZ/DTheta	  = 90 deg
d:Ge/Source1CapMinusZ/TransZ   = -1. * Ge/SourcePellets/CylinderHL mm

s:Ge/Source2Pellet/Type         = "TsCylinder"
s:Ge/Source2Pellet/Parent       = "SourcePellets"
b:Ge/Source2Pellet/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source2Pellet/ParallelWorldName = "Applicator"
s:Ge/Source2Pellet/Material    = Ge/Wire/Material
d:Ge/Source2Pellet/RMax        = Ge/SourcePellets/RMax mm
d:Ge/Source2Pellet/HL           = Ge/SourcePellets/OnePelletHL mm
d:Ge/Source2Pellet/TransZ      = -1. * Ge/SourcePellets/OnePelletHL mm
b:Ge/Source2Pellet/Invisible = "True"

s:Ge/Source2Cylinder/Type       = "TsCylinder"
s:Ge/Source2Cylinder/Parent     = "Source2Pellet"
b:Ge/Source2Cylinder/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source2Cylinder/ParallelWorldName = "Applicator"
s:Ge/Source2Cylinder/Material  = "G4_Ir"
d:Ge/Source2Cylinder/RMax      = Ge/SourcePellets/RMax mm
d:Ge/Source2Cylinder/HL        = Ge/SourcePellets/CylinderHL mm

s:Ge/Source2CapPlusZ/Type       = "TsSphere"
s:Ge/Source2CapPlusZ/Parent     = "Source2Pellet"
b:Ge/Source2CapPlusZ/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source2CapPlusZ/ParallelWorldName = "Applicator"
s:Ge/Source2CapPlusZ/Material  = "G4_Ir"
d:Ge/Source2CapPlusZ/RMax      = Ge/SourcePellets/RMax mm
d:Ge/Source2CapPlusZ/STheta    = 0 deg
d:Ge/Source2CapPlusZ/DTheta	  = 90 deg
d:Ge/Source2CapPlusZ/TransZ    = Ge/SourcePellets/CylinderHL mm

s:Ge/Source2CapMinusZ/Type      = "TsSphere"
s:Ge/Source2CapMinusZ/Parent    = "Source2Pellet"
b:Ge/Source2CapMinusZ/IsParallel = Ge/Applicator/IsParallel
s:Ge/Source2CapMinusZ/ParallelWorldName = "Applicator"
s:Ge/Source2CapMinusZ/Material = "G4_Ir"
d:Ge/Source2CapMinusZ/RMax     = Ge/SourcePellets/RMax mm
d:Ge/Source2CapMinusZ/STheta   = 90 deg
d:Ge/Source2CapMinusZ/DTheta	  = 90 deg
d:Ge/Source2CapMinusZ/TransZ   = -1. * Ge/SourcePellets/CylinderHL mm

sv:Ma/TitaniumNickel/Components  = 2 "Titanium" "Nickel"
uv:Ma/TitaniumNickel/Fractions   = 2 0.444 0.556
d:Ma/TitaniumNickel/Density      = 6.5 g/cm3
s:Ma/TitaniumNickel/DefaultColor ="grass"


# Radioactivity
s:So/Example/Type                     = "Volumetric"
s:So/Example/Component                = "SourcePellets"
s:So/Example/ActiveMaterial		= "G4_Ir"
s:So/Example/BeamParticle             = "gamma"
i:So/Example/NumberOfHistoriesInRun   = Tf/NumberOfHistoriesInRun/Value
b:So/Example/RecursivelyIncludeChildren = "True"
i:So/Example/MaxNumberOfPointsToSample = 1000000000

s:So/Example/BeamEnergySpectrumType       = "Continuous"
dv:So/Example/BeamEnergySpectrumValues    = 117 0.0614 0.0615 0.0616 0.0629 0.063 0.0631 0.065 0.0651 0.0652 0.0667 0.0668 0.0669 0.071 0.0711 0.0712 0.0713 0.0714 0.0715 0.0733 0.0734 0.0735 0.0753 0.0754 0.0755 0.0756 0.0757 0.0758 0.0777 0.0778 0.0779 0.1103 0.1104 0.1105 0.1362 0.1363 0.1364 0.1769 0.177 0.1771 0.2012 0.2013 0.2014 0.2057 0.2058 0.2059 0.2802 0.2803 0.2804 0.2832 0.2833 0.2834 0.2959 0.296 0.2961 0.3084 0.3085 0.3086 0.3164 0.3165 0.3166 0.3291 0.3292 0.3293 0.3744 0.3745 0.3746 0.4164 0.4165 0.4166 0.4204 0.4205 0.4206 0.468 0.4681 0.4682 0.4845 0.4846 0.4847 0.4852 0.4853 0.4854 0.489 0.4891 0.4892 0.5885 0.5886 0.5887 0.5934 0.5935 0.5936 0.5993 0.5994 0.5995 0.6043 0.6044 0.6045 0.6124 0.6125 0.6126 0.7038 0.7039 0.704 0.7657 0.7658 0.7659 0.8844 0.8845 0.8846 1.0614 1.0615 1.0616 1.0898 1.0899 1.089 1.3781 1.3782 1.3783 MeV

uv:So/Example/BeamEnergySpectrumWeightsUnscaled   = 117
1e-08 0.412 1e-08 1e-08 0.7039 1e-08 1e-08 1.1309 1e-08 1e-08 1.9178 1e-08 1e-08 0.0827 1e-08 1e-08 0.16 1e-08 1e-08 0.056 1e-08 1e-08 0.2292 1e-08 1e-08 0.4408 1e-08 1e-08 0.157 1e-08 1e-08 0.0042 1e-08 1e-08 0.086 1e-08 1e-08 0.0018 1e-08 1e-08 0.1624 1e-08 1e-08 1.1468 1e-08 1e-08 0.0039 1e-08 1e-08 0.0913 1e-08 1e-08 12.3498 1e-08 1e-08 12.7626 1e-08 1e-08 35.566 1e-08 1e-08 0.006 1e-08 1e-08 0.2493 1e-08 1e-08 0.2877 1e-08 1e-08 0.0237 1e-08 1e-08 20.5587 1e-08 1e-08 1.0942 1e-08 1e-08 0.001 1e-08 1e-08 0.1504 1e-08 1e-08 1.9423 1e-08 1e-08 0.0181 1e-08 1e-08 0.0017 1e-08 1e-08 3.5361 1e-08 1e-08 2.2962 1e-08 1e-08 0.0018 1e-08 1e-08 0.0006 1e-08 1e-08 0.1251 1e-08 1e-08 0.0228 1e-08 1e-08 0.0005 1e-08 1e-08 0.0005 1e-8

# Scale these values to give total weight of 1.
uv:So/Example/BeamEnergySpectrumWeights   = .0102269 * So/Example/BeamEnergySpectrumWeightsUnscaled


# Graphics
s:Gr/ViewA/Type              = "OpenGL"
b:Gr/ViewA/IncludeStepPoints = "True"
d:Gr/ViewA/Phi = 0 deg
d:Gr/ViewA/Theta = 65 deg
u:Gr/ViewA/Zoom = 2.


# Simplify physics to only require electromagnetics
# (don't need hadronic physics which is otherwise in default setup)
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
sv:Ph/Default/LayeredMassGeometryWorlds = 1 "Applicator"


# Overall run parameters
i:Ts/ShowHistoryCountAtInterval = 100
Ts/NumberOfThreads = 1


i:Tf/Verbosity               = 2
d:Tf/TimelineEnd             = 70.0 s
i:Tf/NumberOfSequentialTimes = 70

s:Tf/WireX/Function           = "Step"
dv:Tf/WireX/Times             = 7 10. 20. 30. 40. 50. 60. 70. s
dv:Tf/WireX/Values            = 7 Ge/Applicator/Hole0/TransX Ge/Applicator/Hole1/TransX Ge/Applicator/Hole2/TransX Ge/Applicator/Hole3/TransX Ge/Applicator/Hole4/TransX Ge/Applicator/Hole5/TransX Ge/Applicator/Hole6/TransX mm
d:Tf/WireX/RepetitionInterval = 70. s

s:Tf/WireY/Function           = "Step"
dv:Tf/WireY/Times             = 7 10. 20. 30. 40. 50. 60. 70. s
dv:Tf/WireY/Values            = 7 Ge/Applicator/Hole0/TransY Ge/Applicator/Hole1/TransY Ge/Applicator/Hole2/TransY Ge/Applicator/Hole3/TransY Ge/Applicator/Hole4/TransY Ge/Applicator/Hole5/TransY Ge/Applicator/Hole6/TransY mm
d:Tf/WireY/RepetitionInterval = 70. s

s:Tf/WireZ/Function           = "Step"
dv:Tf/WireZ/Times             = 10 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. s
dv:Tf/WireZ/Values            = 10 -18. -14. -10. -6. -2. 2. 6. 10. 14. 18. mm
d:Tf/WireZ/RepetitionInterval = 10. s

s:Tf/NumberOfHistoriesInRun/Function           = "Step"
dv:Tf/NumberOfHistoriesInRun/Times             = 7 10. 20. 30. 40. 50. 60. 70. s
iv:Tf/NumberOfHistoriesInRun/Values            = 7 70 30 10 10 40 60 70
d:Tf/NumberOfHistoriesInRun/RepetitionInterval = 70. s

DoseTo4DCT.txt

# Demonstrates use of a DICOM file.
# You must unzip synthetic_lung.tar.bz2 before you run this example.
# Reads in and displays a simple test DICOM that represents
# three different time phases of a simplified lung phantom.
# This phantom consists of a tumor in a cylinder of water in a tube of air.

includeFile = HUtoMaterialSchneider.txt

# Geometry
s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Patient/Parent               = "World"
s:Ge/Patient/Material             = "G4_WATER"
d:Ge/Patient/TransX               = 0. cm # -8. cm
d:Ge/Patient/TransY               = 0. cm # -8. cm
d:Ge/Patient/TransZ               = 0. m
d:Ge/Patient/RotX                 = 90. deg
d:Ge/Patient/RotY                 = 0. deg
d:Ge/Patient/RotZ                 = 0. deg
s:Ge/Patient/Type                 = "TsDicomPatient"
s:Ge/Patient/DicomDirectory       = Tf/ImageName/Value
#b:Ge/Patient/PreLoadAllMaterials  = "True"

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
iv:Ge/Patient/ShowSpecificSlicesY = 1 -1
#iv:Ge/Patient/ShowSpecificSlicesZ = 1 -2

# Time feature, load different CTs at different times
s:Tf/ImageName/Function = "Step"
dv:Tf/ImageName/Times   = 3 10 20 30 ms
sv:Tf/ImageName/Values  = 3 "synthetic_lung/lung-1" "synthetic_lung/lung-2" "synthetic_lung/lung-3"

d:Tf/TimelineEnd = 120.0 ms
i:Tf/NumberOfSequentialTimes = 12
i:Tf/Verbosity = 1

s:Tf/Zoom/Function           = "Step"
dv:Tf/Zoom/Times             = 3 30 60 180 ms
uv:Tf/Zoom/Values            = 3 1.4 3. 9.
d:Tf/Zoom/RepetitionInterval = 360. ms

s:Tf/Pan/Function            = "Step"
dv:Tf/Pan/Times              = 3 30 60 180 ms
uv:Tf/Pan/Values             = 3 0. .1 .1
d:Tf/Pan/RepetitionInterval  = 360. ms

s:Tf/PanY/Function           = "Step"
dv:Tf/PanY/Times             = 3 30 60 180 ms
uv:Tf/PanY/Values            = 3 0. -.05 -.05
d:Tf/PanY/RepetitionInterval = 360. ms

# Uncomment to enable scoring
s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Patient"
b:Sc/DoseAtPhantom/OutputToConsole           = "False"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom/OutputType                = "DICOM"
b:Sc/DoseAtPhantom/DICOMOutput32BitsPerPixel = "False"

# Uncomment to split scoring by ImageName
#s:Sc/DoseAtPhantom/SplitByTimeFeature = "ImageName"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 120. MeV
u:So/Example/BeamEnergySpread         = 0.757504
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  = "None"
i:So/Example/NumberOfHistoriesInRun   = 100

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

# Graphics
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
s:Gr/ViewA/Type        = "OpenGL"
i:Gr/ViewA/WindowSizeX = 900
i:Gr/ViewA/WindowSizeY = 900
d:Gr/ViewA/Theta       = 45 deg
d:Gr/ViewA/Phi         = 45 deg
u:Gr/ViewA/Zoom        = Tf/Zoom/Value
u:Gr/ViewA/TransX      = Tf/Pan/Value
u:Gr/ViewA/TransY      = Tf/PanY/Value

# Extra graphics options to handle complex voxel geometries
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 2100000

i:Ts/ShowHistoryCountAtInterval = 5000

b:Ts/PauseBeforeQuit = "False"

DoseToCT.txt

# Demonstrates scoring in a DICOM file.
# You must unzip DICOM_Box.zip before you run this example.
# Reads in and displays a simple test DICOM that represents
# a box of water in air.
# Can optionally display patient from XiO input file.
# If Graphics is enabled, the display writes very slowly to the screen.
# This will be improved in an upcoming new release.
# Until then, one useful trick is that if you iconize the graphics window,
# then un-inconize it when drawing is done, the drawing will go much faster.

includeFile = HUtoMaterialSchneider.txt

s:Ge/World/Material    = "Vacuum"
d:Ge/World/HLX         = 2.0 m
d:Ge/World/HLY         = 2.0 m
d:Ge/World/HLZ         = 2.0 m
b:Ge/World/Invisible   = "TRUE"

s:Ge/Patient/Parent   = "World"
s:Ge/Patient/Material = "G4_WATER"
d:Ge/Patient/TransX   = 0. m
d:Ge/Patient/TransY   = 0. m
d:Ge/Patient/TransZ   = 0. m
d:Ge/Patient/RotX     = 0. deg
d:Ge/Patient/RotY     = 0. deg
d:Ge/Patient/RotZ     = 0. deg

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
#iv:Ge/Patient/ShowSpecificSlicesY = 1 -2
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -2

# Can read either DICOM or XiO input files.
# To change input format, change which
# Ge/Patient/Type file is commented out below.

# Additional needed for DICOM input
s:Ge/Patient/Type           = "TsDicomPatient"
s:Ge/Patient/DicomDirectory = "DICOM_Box"

# Additional needed for XiO input
#s:Ge/Patient/Type             = "TsXiOPatient"
s:Ge/Patient/InputDirectory   = "./"
s:Ge/Patient/InputFile        = "XIO_Example.dat"
i:Ge/Patient/NumberOfVoxelsX  = 25
i:Ge/Patient/NumberOfVoxelsY  = 25
iv:Ge/Patient/NumberOfVoxelsZ = 2 3 7
d:Ge/Patient/VoxelSizeX       = 2.0 mm
d:Ge/Patient/VoxelSizeY       = 2.0 mm
dv:Ge/Patient/VoxelSizeZ      = 2 5. 2.5 mm

s:Sc/DoseOnCTGrid/Quantity                  = "DoseToMedium"
s:Sc/DoseOnCTGrid/Component                 = "Patient"
b:Sc/DoseOnCTGrid/OutputToConsole           = "True"
s:Sc/DoseOnCTGrid/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseOnCTGrid/OutputType                = "DICOM"
b:Sc/DoseOnCTGrid/DICOMOutput32BitsPerPixel = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 30. MeV
u:So/Example/BeamEnergySpread         = 0.757504
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  = "None"
i:So/Example/NumberOfHistoriesInRun   = 500

# Uncomment to activate graphics
s:Gr/ViewA/Type           = "OpenGL"
sv:Gr/ViewA/VisibleWorlds = 1 "All"
i:Gr/ViewA/WindowSizeX    = 900
i:Gr/ViewA/WindowSizeY    = 900
d:Gr/ViewA/Theta          = 70 deg
d:Gr/ViewA/Phi            = 10 deg

# Extra graphics options to handle complex voxel geometries
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 210000000

i:Ts/ShowHistoryCountAtInterval = 100

b:Ts/PauseBeforeQuit = "True"

HUtoMaterialSchneiber.txt

# Topas parameter settings for conversion of Hounsfield Units to materials using the Schneider paper

s:Ge/Patient/ImagingToMaterialConverter = "Schneider"

# Correction Factor for the relative stopping power of Geant4 and the XiO planning system:
dv:Ge/Patient/DensityCorrection = 3996 9.35212 5.55269 4.14652 3.41395 2.9645 2.66061 2.44144 2.27588 2.1464 2.04239 1.95698 1.8856 1.82506 1.77307 1.72791 1.68835 1.6534 1.62229 1.59442 1.56932 1.54659 1.52591 1.50701 1.48968 1.47373 1.45899 1.44534 1.43265 1.42084 1.40981 1.39949 1.3898 1.38071 1.37214 1.36406 1.35643 1.34921 1.34237 1.33587 1.3297 1.32383 1.31824 1.31291 1.30781 1.30295 1.29829 1.29383 1.28956 1.28546 1.28152 1.1284 1.12519 1.12209 1.11912 1.11625 1.11348 1.11081 1.10823 1.10574 1.10333 1.101 1.09875 1.09657 1.09445 1.0924 1.09041 1.08848 1.08661 1.08479 1.08303 1.08131 1.07964 1.07801 1.07643 1.0749 1.0734 1.07194 1.07052 1.06913 1.06778 1.06646 1.06518 1.06392 1.0627 1.0615 1.06033 1.05919 1.05808 1.05698 1.05592 1.05487 1.05386 1.05286 1.05188 1.05092 1.04999 1.04907 1.04817 1.04728 1.04643 1.04558 1.04475 1.04394 1.04314 1.04235 1.04158 1.04084 1.04009 1.03936 1.03866 1.03796 1.03726 1.0366 1.03593 1.03527 1.03463 1.03401 1.03339 1.03277 1.03218 1.03159 1.03101 1.03044 1.02988 1.02933 1.02878 1.02825 1.02772 1.0272 1.0267 1.02619 1.0257 1.02522 1.02473 1.02426 1.02379 1.02334 1.02288 1.02243 1.022 1.02156 1.02113 1.02072 1.02029 1.01988 1.01948 1.01909 1.01869 1.0183 1.01793 1.01754 1.01717 1.0168 1.01644 1.01608 1.01572 1.01538 1.01503 1.01469 1.01436 1.01403 1.01369 1.01337 1.01306 1.01273 1.01242 1.01212 1.01181 1.0115 1.01121 1.01092 1.01062 1.01033 1.01006 1.00977 1.00949 1.00922 1.00895 1.00867 1.00842 1.00815 1.00789 1.00763 1.00738 1.00713 1.00687 1.00663 1.00639 1.00614 1.00591 1.00568 1.00544 1.0052 1.00498 1.00476 1.00453 1.00431 1.00409 1.00387 1.00366 1.00345 1.00323 1.00302 1.00282 1.00261 1.00241 1.00221 1.00201 1.00181 1.00162 1.00143 1.00123 1.00104 1.00086 1.00067 1.00049 1.0003 1.00012 0.99994 0.99977 0.99959 0.99941 0.99924 0.99907 0.9989 0.99873 0.99856 0.9984 0.99824 0.99807 0.99791 0.99775 0.99759 0.99744 0.99728 0.99713 0.99697 0.99682 0.99667 0.99652 0.99637 0.99623 0.99608 0.99594 0.99579 0.99565 0.99551 0.99537 0.99523 0.99509 0.99496 0.99482 0.99469 0.99455 0.99442 0.99429 0.99416 0.99403 0.9939 0.99378 0.99365 0.99352 0.9934 0.99328 0.99315 0.99303 0.99292 0.99279 0.99267 0.99256 0.99244 0.99232 0.99221 0.99209 0.99198 0.99187 0.99176 0.99164 0.99153 0.99143 0.99131 0.9912 0.9911 0.991 0.99088 0.99078 0.99068 0.99057 0.99047 0.99037 0.99027 0.99016 0.99006 0.98997 0.98987 0.98977 0.98967 0.98958 0.98948 0.98939 0.98929 0.98919 0.9891 0.98901 0.98892 0.98882 0.98873 0.98864 0.98855 0.98846 0.98838 0.98828 0.9882 0.98811 0.98803 0.98794 0.98785 0.98777 0.98768 0.9876 0.98752 0.98743 0.98735 0.98727 0.98719 0.9871 0.98703 0.98695 0.98687 0.98679 0.98671 0.98663 0.98655 0.98648 0.9864 0.98633 0.98625 0.98617 0.9861 0.98602 0.98595 0.98588 0.9858 0.98573 0.98566 0.98559 0.98552 0.98545 0.98538 0.9853 0.98524 0.98517 0.9851 0.98503 0.98496 0.98489 0.98482 0.98476 0.98469 0.98462 0.98456 0.98449 0.98443 0.98436 0.9843 0.98423 0.98417 0.98411 0.98404 0.98398 0.98392 0.98386 0.98379 0.98373 0.98367 0.98361 0.98355 0.98349 0.98343 0.98337 0.98331 0.98325 0.98319 0.98314 0.98308 0.98302 0.98296 0.98291 0.98285 0.98279 0.98274 0.98268 0.98263 0.98257 0.98251 0.98246 0.98241 0.98235 0.9823 0.98224 0.98219 0.98214 0.98208 0.98203 0.98198 0.98193 0.98188 0.98182 0.98177 0.98172 0.98167 0.98162 0.98157 0.98152 0.98147 0.98142 0.98137 0.98132 0.98127 0.98122 0.98118 0.98113 0.98108 0.98103 0.98098 0.98094 0.98089 0.98084 0.98079 0.98075 0.98071 0.98066 0.98061 0.98057 0.98052 0.98047 0.98043 0.98039 0.98034 0.9803 0.98025 0.98021 0.98016 0.98012 0.98008 0.98003 0.97999 0.97995 0.9799 0.97986 0.97982 0.97978 0.97974 0.9797 0.97966 0.97961 0.97957 0.97953 0.97949 0.97945 0.97941 0.97937 0.97933 0.97929 0.97925 0.97921 0.97917 0.97913 0.97909 0.97905 0.97902 0.97898 0.97894 0.9789 0.97886 0.97882 0.97878 0.97875 0.97871 0.97867 0.97864 0.9786 0.97856 0.97853 0.97849 0.97845 0.97841 0.97838 0.97835 0.97831 0.97827 0.97824 0.9782 0.97817 0.97813 0.9781 0.97806 0.97803 0.97799 0.97796 0.97793 0.97789 0.97786 0.97782 0.97779 0.97776 0.97772 0.97769 0.97766 0.97762 0.97759 0.97756 0.97753 0.97749 0.97746 0.97743 0.9774 0.97736 0.97733 0.9773 0.97727 0.97724 0.97721 0.97717 0.97714 0.97711 0.97708 0.97705 0.97702 0.97699 0.97696 0.97693 0.9769 0.97687 0.97684 0.97681 0.97678 0.97675 0.97672 0.97669 0.97666 0.97663 0.9766 0.97658 0.97654 0.97651 0.97649 0.97646 0.97643 0.9764 0.97637 0.97634 0.97632 0.97629 0.97626 0.97623 0.9762 0.97618 0.97615 0.97612 0.9761 0.97607 0.97604 0.97602 0.97599 0.97596 0.97593 0.97591 0.97588 0.97585 0.97583 0.9758 0.97577 0.97575 0.97573 0.9757 0.97567 0.97565 0.97562 0.97559 0.97557 0.97555 0.97552 0.9755 0.97547 0.97544 0.97542 0.9754 0.97537 0.97534 0.97532 0.9753 0.97527 0.97525 0.97522 0.9752 0.97517 0.97515 0.97513 0.9751 0.97508 0.97506 0.97503 0.97501 0.97499 0.97496 0.97494 0.97492 0.97489 0.97487 0.97485 0.97482 0.9748 0.97478 0.97475 0.97473 0.97471 0.97469 0.97466 0.97464 0.97462 0.9746 0.97458 0.97455 0.97453 0.97451 0.97449 0.97447 0.97444 0.97442 0.9744 0.97438 0.97436 0.97433 0.97432 0.97429 0.97427 0.97425 0.97423 0.97421 0.97419 0.97417 0.97415 0.97413 0.97411 0.97409 0.97407 0.97404 0.97402 0.974 0.97398 0.97396 0.97394 0.97392 0.9739 0.97388 0.97386 0.97384 0.97382 0.9738 0.97378 0.97376 0.97375 0.97373 0.97371 0.97369 0.97367 0.97365 0.97363 0.97361 0.97359 0.97357 0.97355 0.97353 0.97352 0.9735 0.97348 0.97346 0.97344 0.97342 0.97341 0.97338 0.97337 0.97335 0.97333 0.97331 0.97329 0.97328 0.97326 0.97324 0.97322 0.9732 0.97319 0.97317 0.97315 0.97313 0.97311 0.9731 0.97308 0.97306 0.97305 0.97303 0.97301 0.97299 0.97298 0.97296 0.97294 0.97292 0.97291 0.97289 0.97287 0.97286 0.97284 0.97282 0.97281 0.97279 0.97277 0.97276 0.97274 0.97272 0.97271 0.97269 0.97267 0.97266 0.97264 0.97262 0.97261 0.97259 0.97258 0.97256 0.97254 0.97253 0.97251 0.97249 0.97248 0.97246 0.97245 0.97243 0.97242 0.9724 0.97239 0.97237 0.97235 0.97234 0.97232 0.97231 0.97229 0.97228 0.97226 0.97225 0.97223 0.97222 0.9722 0.97218 0.97217 0.97216 0.97214 0.97213 0.97211 0.9721 0.97208 0.97207 0.97205 0.97203 0.97202 0.97201 0.97199 0.97198 0.97196 0.97195 0.97193 0.97192 0.97191 0.97189 0.97188 0.97186 0.97185 0.97183 0.97182 0.97181 0.97179 0.97178 0.97176 0.97175 0.97174 0.97172 0.97171 0.97169 0.97168 0.97167 0.97165 0.97164 0.97163 0.97161 0.9716 0.97158 0.97157 0.97156 0.97154 0.97153 0.97152 0.9715 0.97149 0.97148 0.97146 0.97145 0.97144 0.97142 0.97141 0.9714 0.97139 0.97137 0.97136 0.97135 0.97133 0.97132 0.97131 0.9713 0.97128 0.97127 0.97126 0.97124 0.97123 0.97122 0.97121 0.97119 0.97118 0.97117 0.97116 0.97114 0.97113 0.97112 0.97111 0.97109 0.97108 0.97107 0.97106 0.97105 0.97103 0.97102 0.97101 0.971 0.97098 0.97097 0.97096 0.97095 0.97094 0.97093 0.97091 0.9709 0.97089 0.97088 0.97086 0.97085 0.97084 0.97083 0.97082 0.97081 0.9708 0.97078 0.97077 0.97076 0.97075 0.97074 0.97073 0.97072 0.9707 0.97069 0.97068 0.97067 0.97066 0.97065 0.97064 0.97062 0.97061 0.9706 0.97059 0.97058 0.97057 0.97056 0.94514 0.94512 0.94511 0.9451 0.94509 0.94508 0.94507 0.94506 0.94505 0.94504 0.94503 0.94502 0.94501 0.945 0.94499 0.94498 0.94497 0.94496 0.94495 0.94494 0.94492 0.94492 0.9449 0.94489 0.94488 0.94487 0.94486 0.94485 0.94484 0.94483 0.94482 0.94481 0.94569 0.94582 0.94594 0.94607 0.94619 0.95156 0.95168 0.95181 0.95194 0.95206 0.95219 0.95231 0.95244 0.95256 0.95268 0.95281 0.95293 0.95306 0.95318 0.9533 0.95342 0.95355 0.95367 0.95379 0.95391 0.95403 0.95416 0.95428 0.9544 0.95452 0.95464 0.95476 0.95488 0.955 0.95512 0.96074 0.96086 0.96098 0.9611 0.96122 0.96134 0.96146 0.96158 0.9617 0.96181 0.96193 0.96205 0.96217 0.96229 0.9624 0.96252 0.96264 0.96275 0.96287 0.96298 0.9631 0.96322 0.96333 0.96345 0.96356 0.96367 0.96379 0.9639 0.96402 0.96413 0.96818 0.96829 0.96841 0.96852 0.96864 0.96874 0.96886 0.96897 0.96909 0.96919 0.96931 0.96943 0.96953 0.96964 0.96976 0.96986 0.96998 0.97009 0.9702 0.97031 0.97042 0.97053 0.97064 0.97075 0.97087 0.97098 0.9711 0.97123 0.97135 0.97146 0.97526 0.97538 0.97549 0.97561 0.97573 0.97584 0.97596 0.97608 0.97752 0.97848 0.97944 0.98701 0.98798 0.98895 0.98992 0.99089 0.99197 0.99181 0.99166 0.99151 0.99135 0.99119 0.99104 0.99088 0.99073 0.99057 0.99042 0.99027 0.99012 0.98997 0.98982 0.98967 0.98951 0.98936 0.98874 0.98811 0.98749 0.98687 0.98625 0.98563 0.98502 0.9844 0.98378 0.98317 0.98256 0.98195 0.98134 0.98073 0.98013 0.97952 0.97892 0.97832 0.97771 0.97711 0.97651 0.97592 0.97532 0.97472 0.97414 0.97355 0.97295 0.97236 0.97178 0.97119 0.9706 0.97002 0.96943 0.96885 0.96828 0.9677 0.96712 0.96654 0.96596 0.97464 0.97406 0.97348 0.97291 0.97233 0.97176 0.97119 0.97062 0.97005 0.96948 0.96891 0.96834 0.96777 0.96721 0.96665 0.96609 0.96553 0.96497 0.96441 0.96385 0.9633 1.00233 1.00225 1.00216 1.00208 1.002 1.00192 1.00184 1.00175 1.00167 1.00159 1.00151 1.00143 1.00134 1.00126 1.00118 1.0011 1.00102 1.00093 1.00085 1.00035 1.00027 1.00019 1.0001 1.00002 0.99994 0.99987 0.99979 0.9997 0.99962 0.99954 0.99946 0.99938 0.9993 0.99922 0.99914 0.99906 0.99899 0.9989 0.99882 0.99874 0.99867 0.99859 0.9985 0.99842 0.99835 0.99827 0.99819 0.99811 0.99803 0.99795 0.99788 0.9978 0.99771 0.99764 0.99756 0.99749 0.99741 0.99732 0.99725 0.99717 0.9971 0.99702 0.99694 0.99686 0.99678 0.99671 0.99663 0.99655 0.99647 0.9964 0.99632 0.99625 0.99616 0.99609 0.99601 0.99594 0.99586 0.99578 0.99571 0.99563 0.99556 0.99548 0.9954 0.99533 0.99525 0.99518 0.99511 0.99502 0.99495 0.99488 0.9948 0.99473 0.99465 0.99457 0.9945 0.99443 0.99435 0.99427 0.9942 1.00458 1.0045 1.00443 1.00435 1.00428 1.0042 1.00413 1.00406 1.00397 1.0039 1.00383 1.00376 1.00368 1.0036 1.00353 1.00346 1.00339 1.00331 1.00323 1.00316 1.00309 1.00301 1.00294 1.00286 1.00279 1.00272 1.00265 1.00258 1.0025 1.00243 1.00235 1.00228 1.00221 1.00213 1.00206 1.00199 1.00192 1.00185 1.00177 1.0017 1.00163 1.00156 1.00149 1.00141 1.00134 1.00127 1.0012 1.00113 1.00105 1.00098 1.00091 1.00084 1.00077 1.00069 1.00062 1.00055 1.00048 1.00041 1.00033 1.00027 1.0002 1.00013 1.00006 0.99998 0.99991 0.99984 0.99977 0.99971 0.99963 0.99956 0.99949 0.99942 0.99935 0.99928 0.99921 0.99914 0.99907 0.99901 0.99893 0.99886 0.99879 0.99873 0.99866 0.99858 0.99852 0.99845 0.99838 0.99831 0.99824 0.99817 0.9981 0.99804 0.99797 0.99789 0.99783 0.99776 0.99769 0.99763 0.99755 0.99749 1.00929 1.00922 1.00916 1.00908 1.00901 1.00895 1.00888 1.00881 1.00874 1.00867 1.00861 1.00854 1.00847 1.0084 1.00833 1.00827 1.0082 1.00813 1.00806 1.00799 1.00793 1.00786 1.0078 1.00772 1.00766 1.00759 1.00753 1.00746 1.00739 1.00732 1.00726 1.00719 1.00713 1.00705 1.00699 1.00692 1.00686 1.00679 1.00672 1.00666 1.00659 1.00653 1.00646 1.00639 1.00633 1.00626 1.0062 1.00613 1.00606 1.006 1.00593 1.00587 1.0058 1.00573 1.00567 1.00561 1.00554 1.00548 1.00541 1.00534 1.00528 1.00522 1.00515 1.00508 1.00502 1.00496 1.00489 1.00483 1.00476 1.0047 1.00463 1.00457 1.00451 1.00444 1.00438 1.00431 1.00425 1.00419 1.00412 1.00406 1.00399 1.00393 1.00387 1.0038 1.00374 1.00368 1.00361 1.00355 1.00348 1.00342 1.00336 1.0033 1.00324 1.00317 1.00311 1.00305 1.00298 1.00292 1.00285 1.00279 1.01335 1.01329 1.01323 1.01316 1.0131 1.01304 1.01298 1.01292 1.01285 1.01278 1.01272 1.01266 1.0126 1.01253 1.01247 1.01241 1.01235 1.01229 1.01222 1.01216 1.0121 1.01204 1.01198 1.01191 1.01185 1.01179 1.01173 1.01167 1.0116 1.01154 1.01148 1.01142 1.01136 1.0113 1.01124 1.01118 1.01112 1.01106 1.01099 1.01093 1.01087 1.01081 1.01075 1.01069 1.01063 1.01057 1.01051 1.01045 1.01038 1.01033 1.01027 1.01021 1.01015 1.01008 1.01003 1.00997 1.00991 1.00985 1.00978 1.00972 1.00967 1.00961 1.00955 1.00948 1.00943 1.00937 1.00931 1.00925 1.00919 1.00913 1.00907 1.00902 1.00896 1.00889 1.00883 1.00878 1.00872 1.00866 1.0086 1.00854 1.00848 1.00843 1.00837 1.0083 1.00825 1.00819 1.00813 1.00808 1.00801 1.00796 1.0079 1.00784 1.00779 1.00772 1.00767 1.00761 1.00755 1.0075 1.00743 1.00738 1.01627 1.01621 1.01615 1.01609 1.01603 1.01598 1.01592 1.01587 1.0158 1.01575 1.01569 1.01563 1.01558 1.01551 1.01546 1.0154 1.01535 1.01529 1.01523 1.01517 1.01512 1.01506 1.015 1.01494 1.01489 1.01483 1.01478 1.01472 1.01466 1.0146 1.01455 1.01449 1.01444 1.01438 1.01432 1.01427 1.01421 1.01416 1.01409 1.01404 1.01398 1.01393 1.01388 1.01381 1.01376 1.01371 1.01365 1.0136 1.01353 1.01348 1.01343 1.01337 1.01332 1.01326 1.0132 1.01315 1.0131 1.01304 1.01298 1.01293 1.01287 1.01282 1.01277 1.01271 1.01265 1.0126 1.01255 1.01249 1.01243 1.01238 1.01232 1.01227 1.01222 1.01216 1.01211 1.01205 1.012 1.01195 1.01189 1.01183 1.01178 1.01173 1.01168 1.01162 1.01156 1.01151 1.01146 1.01141 1.01135 1.01129 1.01124 1.01119 1.01114 1.01108 1.01103 1.01097 1.01092 1.01087 1.01081 1.01076 1.01979 1.01974 1.01968 1.01962 1.01957 1.01952 1.01947 1.01942 1.01936 1.0193 1.01925 1.0192 1.01915 1.01909 1.01904 1.01899 1.01894 1.01888 1.01883 1.01877 1.01872 1.01867 1.01862 1.01856 1.01851 1.01846 1.01841 1.01836 1.0183 1.01825 1.0182 1.01815 1.0181 1.01804 1.01799 1.01794 1.01789 1.01783 1.01778 1.01773 1.01768 1.01763 1.01758 1.01752 1.01747 1.01742 1.01737 1.01732 1.01726 1.01721 1.01716 1.01711 1.01706 1.017 1.01695 1.0169 1.01685 1.0168 1.01675 1.0167 1.01665 1.0166 1.01655 1.01649 1.01644 1.01639 1.01634 1.0163 1.01624 1.01619 1.01614 1.01609 1.01604 1.01599 1.01594 1.01589 1.01584 1.01579 1.01573 1.01569 1.01564 1.01559 1.01554 1.01548 1.01543 1.01539 1.01534 1.01529 1.01523 1.01518 1.01514 1.01509 1.01504 1.01499 1.01494 1.01489 1.01484 1.01479 1.01474 1.01469 1.02359 1.02354 1.02349 1.02344 1.02339 1.02334 1.02329 1.02324 1.02319 1.02314 1.02309 1.02304 1.023 1.02294 1.02289 1.02285 1.0228 1.02275 1.0227 1.02265 1.0226 1.02255 1.02251 1.02245 1.0224 1.02236 1.02231 1.02226 1.02221 1.02216 1.02211 1.02207 1.02202 1.02196 1.02192 1.02187 1.02182 1.02178 1.02172 1.02168 1.02163 1.02158 1.02154 1.02148 1.02144 1.02139 1.02134 1.0213 1.02124 1.0212 1.02115 1.0211 1.02106 1.021 1.02096 1.02091 1.02087 1.02082 1.02077 1.02072 1.02067 1.02063 1.02058 1.02053 1.02049 1.02043 1.02039 1.02035 1.02029 1.02025 1.0202 1.02016 1.02011 1.02006 1.02002 1.01996 1.01992 1.01988 1.01983 1.01978 1.01973 1.01969 1.01964 1.01959 1.01955 1.0195 1.01945 1.01941 1.01936 1.01932 1.01927 1.01922 1.01918 1.01913 1.01909 1.01903 1.01899 1.01895 1.0189 1.01886 1.02794 1.02789 1.02785 1.0278 1.02776 1.02771 1.02767 1.02762 1.02756 1.02752 1.02748 1.02744 1.02739 1.02734 1.02729 1.02725 1.0272 1.02717 1.02711 1.02706 1.02702 1.02697 1.02693 1.02688 1.02684 1.02679 1.02675 1.0267 1.02666 1.02661 1.02657 1.02652 1.02648 1.02643 1.02638 1.02635 1.0263 1.02626 1.0262 1.02616 1.02611 1.02607 1.02603 1.02598 1.02594 1.02589 1.02585 1.0258 1.02576 1.02571 1.02567 1.02563 1.02558 1.02554 1.02549 1.02545 1.02541 1.02536 1.02531 1.02526 1.02523 1.02519 1.02514 1.02509 1.02505 1.025 1.02496 1.02493 1.02487 1.02483 1.02479 1.02474 1.0247 1.02465 1.02461 1.02457 1.02453 1.02448 1.02444 1.0244 1.02435 1.02431 1.02427 1.02421 1.02417 1.02414 1.02409 1.02405 1.024 1.02396 1.02391 1.02387 1.02384 1.02379 1.02374 1.0237 1.02366 1.02361 1.02357 1.02353 1.03085 1.03081 1.03077 1.03073 1.03068 1.03064 1.0306 1.03055 1.03051 1.03046 1.03042 1.03038 1.03034 1.03029 1.03025 1.03021 1.03017 1.03012 1.03008 1.03004 1.03 1.02995 1.02992 1.02986 1.02983 1.02978 1.02975 1.0297 1.02966 1.02961 1.02957 1.02954 1.02949 1.02945 1.0294 1.02937 1.02932 1.02928 1.02923 1.02919 1.02916 1.02911 1.02908 1.02902 1.02899 1.02894 1.0289 1.02887 1.02882 1.02878 1.02873 1.0287 1.02866 1.02861 1.02857 1.02853 1.02849 1.02845 1.0284 1.02836 1.02833 1.02828 1.02825 1.02819 1.02816 1.02812 1.02807 1.02804 1.02799 1.02795 1.02791 1.02788 1.02783 1.02779 1.02775 1.0277 1.02767 1.02763 1.02758 1.02754 1.02751 1.02746 1.02742 1.02738 1.02735 1.0273 1.02726 1.02723 1.02717 1.02714 1.0271 1.02707 1.02702 1.02698 1.02694 1.0269 1.02686 1.02682 1.02678 1.02673 1.03276 1.03272 1.03268 1.03264 1.03259 1.03256 1.03252 1.03248 1.03243 1.0324 1.03235 1.03232 1.03228 1.03224 1.03219 1.03216 1.03212 1.03208 1.03204 1.032 1.03196 1.03192 1.03188 1.03183 1.0318 1.03176 1.03172 1.03169 1.03164 1.0316 1.03156 1.03153 1.03149 1.03144 1.03141 1.03136 1.03133 1.03129 1.03124 1.03121 1.03117 1.03113 1.0311 1.03105 1.03101 1.03097 1.03094 1.0309 1.03085 1.03082 1.03078 1.03074 1.03071 1.03067 1.03062 1.03059 1.03055 1.03051 1.03047 1.03043 1.03039 1.03036 1.03032 1.03027 1.03024 1.0302 1.03016 1.03013 1.03009 1.03004 1.03001 1.02998 1.02993 1.02989 1.02986 1.02981 1.02978 1.02975 1.02971 1.02966 1.02963 1.02959 1.02955 1.02951 1.02948 1.02944 1.0294 1.02936 1.02932 1.02929 1.02925 1.02921 1.02918 1.02914 1.02909 1.02906 1.02903 1.02899 1.02894 1.02891 1.03634 1.03631 1.03626 1.03623 1.03619 1.03615 1.03611 1.03608 1.03603 1.036 1.03596 1.03593 1.03589 1.03585 1.03581 1.03578 1.03574 1.03571 1.03566 1.03563 1.03559 1.03556 1.03552 1.03548 1.03544 1.03541 1.03537 1.03534 1.03529 1.03526 1.03522 1.03518 1.03515 1.03511 1.03507 1.03503 1.035 1.03496 1.03492 1.03488 1.03485 1.03482 1.03478 1.03474 1.0347 1.03467 1.03463 1.0346 1.03456 1.03452 1.03449 1.03445 1.03442 1.03438 1.03434 1.03431 1.03427 1.03423 1.0342 1.03416 1.03412 1.03408 1.03405 1.03402 1.03397 1.03394 1.03391 1.03387 1.03383 1.0338 1.03376 1.03373 1.03369 1.03365 1.03362 1.03358 1.03355 1.03352 1.03347 1.03344 1.03341 1.03337 1.03334 1.0333 1.03326 1.03323 1.03319 1.03316 1.03312 1.03308 1.03305 1.03301 1.03298 1.03294 1.0329 1.03287 1.03284 1.0328 1.03276 1.03273 1.03851 1.03848 1.03844 1.03841 1.03837 1.03833 1.0383 1.03826 1.03823 1.03819 1.03816 1.03812 1.03809 1.03805 1.03802 1.03798 1.03795 1.03792 1.03788 1.03785 1.03781 1.03778 1.03774 1.03771 1.03767 1.03764 1.0376 1.03757 1.03752 1.0375 1.03746 1.03743 1.0374 1.03735 1.03732 1.03729 1.03726 1.03722 1.03718 1.03715 1.03711 1.03709 1.03705 1.03701 1.03697 1.03694 1.03692 1.03688 1.03684 1.0368 1.03677 1.03674 1.03671 1.03667 1.03663 1.0366 1.03657 1.03653 1.0365 1.03646 1.03643 1.0364 1.03636 1.03633 1.0363 1.03626 1.03623 1.03619 1.03616 1.03613 1.03609 1.03606 1.03603 1.03599 1.03596 1.03593 1.03589 1.03586 1.03583 1.03579 1.03576 1.03573 1.03569 1.03566 1.03563 1.03559 1.03556 1.03553 1.03548 1.03546 1.03543 1.03539 1.03536 1.03532 1.03528 1.03526 1.03523 1.03519 1.03515 1.03512 1.04093 1.0409 1.04087 1.04083 1.0408 1.04076 1.04074 1.0407 1.04067 1.04063 1.0406 1.04057 1.04054 1.0405 1.04047 1.04043 1.04041 1.04037 1.04034 1.0403 1.04027 1.04024 1.04021 1.04017 1.04014 1.04011 1.04008 1.04004 1.04001 1.03998 1.03994 1.03992 1.03988 1.03985 1.03981 1.03978 1.03975 1.03972 1.03968 1.03965 1.03962 1.03959 1.03956 1.03952 1.03949 1.03945 1.03943 1.0394 1.03936 1.03933 1.03929 1.03927 1.03923 1.0392 1.03917 1.03913 1.03911 1.03907 1.03904 1.03901 1.03898 1.03895 1.03891 1.03888 1.03885 1.03882 1.03879 1.03875 1.03872 1.03869 1.03866 1.03863 1.03859 1.03856 1.03853 1.0385 1.03847 1.03844 1.0384 1.03837 1.03835 1.03831 1.03828 1.03825 1.03821 1.03819 1.03815 1.03812 1.03809 1.03805 1.03803 1.038 1.03796 1.03793 1.0379 1.03787 1.03784 1.03781 1.03777 1.03774 1.04358 1.04356 1.04352 1.04349 1.04346 1.04343 1.0434 1.04337 1.04333 1.0433 1.04327 1.04324 1.04321 1.04317 1.04315 1.04311 1.04309 1.04305 1.04302 1.04299 1.04296 1.04293 1.04291 1.04286 1.04284 1.04281 1.04278 1.04275 1.04272 1.04268 1.04266 1.04262 1.0426 1.04256 1.04253 1.0425 1.04247 1.04244 1.04241 1.04237 1.04235 1.04231 1.04229 1.04225 1.04222 1.04219 1.04217 1.04213 1.0421 1.04208 1.04204 1.04202 1.04198 1.04195 1.04192 1.04189 1.04186 1.04183 1.0418 1.04177 1.04174 1.04171 1.04168 1.04164 1.04162 1.04159 1.04156 1.04154 1.04149 1.04147 1.04144 1.04141 1.04138 1.04135 1.04132 1.04129 1.04126 1.04123 1.0412 1.04117 1.04114 1.04111 1.04108 1.04105 1.04102 1.04099 1.04096 1.04093 1.0409 1.04087 1.04084 1.04081 1.04079 1.04075 1.04072 1.04069 1.04067 1.04064 1.0406 1.04058 1.04455 1.04453 1.0445 1.04447 1.04443 1.04441 1.04438 1.04435 1.04431 1.04429 1.04426 1.04423 1.0442 1.04417 1.04414 1.04411 1.04408 1.04406 1.04402 1.044 1.04397 1.04394 1.04391 1.04388 1.04385 1.04382 1.04379 1.04377 1.04373 1.0437 1.04367 1.04365 1.04362 1.04359 1.04356 1.04353 1.0435 1.04347 1.04344 1.04341 1.04339 1.04336 1.04333 1.04329 1.04327 1.04324 1.04321 1.04319 1.04315 1.04313 1.0431 1.04307 1.04304 1.04301 1.04299 1.04295 1.04293 1.0429 1.04287 1.04284 1.04281 1.04279 1.04276 1.04273 1.0427 1.04267 1.04265 1.04261 1.04259 1.04255 1.04253 1.04251 1.04247 1.04244 1.04241 1.04239 1.04236 1.04233 1.0423 1.04228 1.04225 1.04222 1.04219 1.04216 1.04214 1.0421 1.04208 1.04205 1.04202 1.042 1.04196 1.04194 1.04192 1.04188 1.04185 1.04183 1.0418 1.04178 1.04175 1.04171 1.04169 1.04166 1.04163 1.0416 1.04158 1.04155 1.04153 1.04149 1.04146 1.04144 1.04141 1.04138 1.04136 1.04133 1.0413 1.04128 1.04125 1.04122 1.04119 1.04117 1.04113 1.04111 1.04109 1.04105 1.04103 1.041 1.04097 1.04095 1.04092 1.04089 1.04086 1.04084 1.04081 1.04077 1.04075 1.04073 1.0407 1.04067 1.04064 1.04062 1.04059 1.04056 1.04054 1.04051 1.04048 1.04046 1.04043 1.0404 1.04037 1.04035 1.04032 1.04029 1.04027 1.04024 1.04021 1.04018 1.04016 1.04014 1.04011 1.04007 1.04005 1.04003 1.04 1.03997 1.03994 1.03992 1.03989 1.03986 1.03983 1.03981 1.03979 1.03975 1.03973 1.0397 1.03968 1.03965 1.03962 1.0396 1.03957 1.03955 1.03951 1.03949 1.03947 1.03944 1.03941 1.03938 1.03936 1.03934 1.03931 1.03928 1.03925 1.03923 1.03921 1.03918 1.03915 1.03912 1.0391 1.03907 1.03904 1.03902 1.03899 1.03897 1.03894 1.03891 1.03889 1.03886 1.03883 1.03881 1.03878 1.03876 1.03873 1.0387 1.03868 1.03865 1.03863 1.0386 1.03858 1.03855 1.03852 1.0385 1.03847 1.03845 1.03842 1.03839 1.03836 1.03834 1.03832 1.03829 1.03826 1.03824 1.03821 1.03819 1.03816 1.03813 1.03811 1.03809 1.03806 1.03803 1.038 1.03798 1.03796 1.03793 1.03791 1.03788 1.03786 1.03783 1.0378 1.03778 1.03775 1.03773 1.0377 1.03768 1.03766 1.03763 1.0376 1.03757 1.03755 1.03753 1.0375 1.03747 1.03745 1.03743 1.0374 1.03737 1.03735 1.03732 1.03729 1.03727 1.03724 1.03722 1.0372 1.03717 1.03715 1.03712 1.0371 1.03707 1.03704 1.03702 1.03699 1.03697 1.03694 1.03692 1.0369 1.03687 1.03684 1.03682 1.0368 1.03678 1.03675 1.03672 1.0367 1.03667 1.03665 1.03662 1.03659 1.03657 1.03655 1.03652 1.03649 1.03647 1.03645 1.03642 1.0364 1.03637 1.03635 1.03633 1.0363 1.03628 1.03625 1.03623 1.0362 1.03618 1.03616 1.03613 1.03611 1.03608 1.03606 1.03603 1.03601 1.03598 1.03596 1.03593 1.03591 1.03589 1.03586 1.03584 1.03581 1.03579 1.03576 1.03574 1.03571 1.03569 1.03567 1.03564 1.03562 1.03559 1.03557 1.03555 1.03552 1.0355 1.03547 1.03545 1.03543 1.0354 1.03538 1.03535 1.03533 1.03531 1.03528 1.03525 1.03523 1.03521 1.03519 1.03516 1.03513 1.03511 1.03509 1.03506 1.03503 1.03501 1.03499 1.03497 1.03494 1.03491 1.03489 1.03487 1.03485 1.03482 1.0348 1.03478 1.03475 1.03473 1.03471 1.03468 1.03466 1.03463 1.03461 1.03459 1.03456 1.03453 1.03451 1.03449 1.03447 1.03445 1.03442 1.0344 1.03438 1.03435 1.03432 1.0343 1.03428 1.03426 1.03423 1.0342 1.03418 1.03416 1.03414 1.03412 1.03409 1.03407 1.03405 1.03402 1.034 1.03397 1.03395 1.03393 1.03391 1.03389 1.03386 1.03384 1.03381 1.03379 1.03377 1.03374 1.03372 1.0337 1.03368 1.03365 1.03363 1.0336 1.03358 1.03356 1.03353 1.03351 1.03349 1.03347 1.03344 1.03342 1.03339 1.03337 1.03335 1.03333 1.03331 1.03328 1.03326 1.03323 1.03321 1.03319 1.03317 1.03315 1.03312 1.0331 1.03308 1.03305 1.03303 1.03301 1.03299 1.03297 1.03294 1.03291 1.03289 1.03287 1.03285 1.03282 1.0328 1.03278 1.03276 1.03273 1.03271 1.03269 1.03267 1.03264 1.03262 1.0326 1.03258 1.03255 1.03253 1.03251 1.03248 1.03246 1.03244 1.03242 1.0324 1.03237 1.03235 1.03233 1.03231 1.03229 1.03226 1.03224 1.03222 1.0322 1.03217 1.03214 1.03212 1.03211 1.03209 1.03206 1.03203 1.03201 1.032 1.03197 1.03195 1.03192 1.0319 1.03189 1.03186 1.03184 1.03181 1.03179 1.03177 1.03181 1.03185 1.03189 1.03193 1.03197 1.03201 1.03204 1.03209 1.03212 1.03216 1.0322 1.03224 1.03227 1.03232 1.03236 1.03239 1.03244 1.03247 1.03251 1.03255 1.03259 1.03262 1.03267 1.0327 1.03274 1.03278 1.03282 1.03286 1.0329 1.03294 1.03297 1.03301 1.03305 1.03309 1.03313 1.03317 1.0332 1.03324 1.03328 1.03332 1.03336 1.0334 1.03344 1.03347 1.03351 1.03355 1.03359 1.03362 1.03366 1.0337 1.03374 1.03378 1.03382 1.03386 1.03389 1.03393 1.03397 1.03401 1.03404 1.03408 1.03412 1.03416 1.03419 1.03424 1.03428 1.03431 1.03435 1.03439 1.03443 1.03446 1.0345 1.03454 1.03458 1.03461 1.03465 1.03469 1.03473 1.03477 1.0348 1.03484 1.03488 1.03492 1.03495 1.03499 1.03503 1.03507 1.0351 1.03514 1.03518 1.03522 1.03526 1.03529 1.03533 1.03536 1.03541 1.03544 1.03548 1.03551 1.03555 1.03559 1.03563 1.03567 1.0357 1.03574 1.03578 1.03582 1.03585 1.03589 1.03592 1.03596 1.036 1.03604 1.03608 1.03611 1.03615 1.03618 1.03623 1.03626 1.0363 1.03633 1.03637 1.03641 1.03645 1.03648 1.03652 1.03656 1.03659 1.03663 1.03667 1.03671 1.03674 1.03678 1.03681 1.03685 1.03688 1.03692 1.03696 1.037 1.03704 1.03707 1.03711 1.03714 1.03718 1.03722 1.03726 1.03729 1.03733 1.03736 1.0374 1.03744 1.03747 1.03751 1.03755 1.03759 1.03762 1.03766 1.03769 1.03773 1.03776 1.0378 1.03783 1.03787 1.03791 1.03795 1.03799 1.03802 1.03806 1.03809 1.03813 1.03816 1.0382 1.03823 1.03827 1.03831 1.03835 1.03838 1.03842 1.03846 1.03849 1.03853 1.03856 1.0386 1.03863 1.03867 1.0387 1.03874 1.03878 1.03881 1.03885 1.03888 1.03892 1.03896 1.03899 1.03903 1.03907 1.0391 1.03914 1.03918 1.03921 1.03925 1.03928 1.03932 1.03935 1.03939 1.03942 1.03946 1.03949 1.03953 1.03956 1.0396 1.03964 1.03967 1.03971 1.03974 1.03978 1.03981 1.03985 1.03988 1.03992 1.03995 1.03999 1.04002 1.04006 1.0401 1.04013 1.04017 1.0402 1.04024 1.04027 1.04031 1.04034 1.04038 1.04041 1.04045 1.04049 1.04052 1.04056 1.04059 1.04063 1.04066 1.0407 1.04073 1.04077 1.0408 1.04084 1.04087 1.04091 1.04094 1.04098 1.04101 1.04105 1.04108 1.04111 1.04115 1.04118 1.04122 1.04125 1.04129 1.04133 1.04136 1.0414 1.04143 1.04147 1.0415 1.04154 1.04157 1.04161 1.04164 1.04167 1.0417 1.04174 1.04178 1.04181 1.04185 1.04188 1.04192 1.04195 1.04199 1.04202 1.04205 1.04209 1.04212 1.04215 1.04219 1.04223 1.04226 1.0423 1.04233 1.04237 1.0424 1.04243 1.04246 1.0425 1.04253 1.04257 1.04261 1.04264 1.04268 1.04271 1.04274 1.04277 1.04281 1.04284 1.04288 1.04291 1.04295 1.04298 1.04301 1.04305 1.04308 1.04312 1.04315 1.04319 1.04322 1.04325 1.04329 1.04332 1.04335 1.04339 1.04343 1.04346 1.04349 1.04352 1.04356 1.04359 1.04363 1.04366 1.0437 1.04373 1.04376 1.04379 1.04383 1.04387 1.0439 1.04393 1.04396 1.044 1.04403 1.04407 1.0441 1.04413 1.04416 1.0442 1.04423 1.04427 1.0443 1.04433 1.04437 1.0444 1.04444 1.04447 1.0445 1.04453 1.04457 1.0446 1.04464 1.04467 1.0447 1.04474 1.04477 1.04481 1.04484 1.04487 1.0449 1.04494 1.04497 1.045 1.04503 1.04507 1.04511 1.04514 1.04517 1.0452 1.04524 1.04527 1.0453 1.04533 1.04537 1.0454 1.04543 1.04547 1.0455 1.04554 1.04557 1.0456 1.04563 1.04567 1.0457 1.04573 1.04576 1.0458 1.04583 1.04586 1.0459 1.04593 1.04596 1.04599 1.04603 1.04606 1.0461 1.04612 1.04616 1.04619 1.04623 1.04625 1.04629 1.04633 1.04636 1.04639 1.04642 1.04646 1.04648 1.04652 1.04655 1.04659 1.04661 1.04665 1.04669 1.04671 1.04675 1.04678 1.04681 1.04684 1.04688 1.04691 1.04694 1.04697 1.04701 1.04704 1.04707 1.04711 1.04714 1.04717 1.0472 1.04724 1.04726 1.0473 1.04733 1.04736 1.04739 1.04743 1.04746 1.04749 1.04753 1.04756 1.04759 1.04762 1.04766 1.04768 1.04772 1.04775 1.04778 1.04781 1.04785 1.04788 1.04791 1.04795 1.04797 1.04801 1.04804 1.04807 1.0481 1.04814 1.04816 1.0482 1.04823 1.04826 1.0483 1.04833 1.04836 1.04839 1.04842 1.04845 1.04849 1.04852 1.04855 1.04858 1.04861 1.04865 1.04868 1.04871 1.04874 1.04877 1.0488 1.04884 1.04886 1.0489 1.04893 1.04896 1.04899 1.04903 1.04906 1.04909 1.04912 1.04915 1.04918 1.04921 1.04925 1.04928 1.04931 1.04934 1.04937 1.04941 1.04943 1.04947 1.0495 1.04953 1.04956 1.04959 1.04962 1.04966 1.04968 1.04972 1.04975 1.04978 1.04981 1.04984 1.04988 1.0499 1.04994 1.04997 1.05 1.05003 1.05006 1.05009 1.05012 1.05015 1.05019 1.05022 1.05025 1.05028 1.05031 1.05034 1.05037 1.05041 1.05043 1.05047 1.05049 1.05053 1.05056 1.05059 1.05062 1.05065 1.05068 1.05071 1.05075 1.05077 1.05081 1.05083 1.05087 1.0509 1.05093 1.05096 1.05099 1.05102 1.05105 1.05109 1.05111 1.05115 1.05117 1.05121 1.05123 1.05127 1.0513 1.05133 1.05136 1.05139 1.05142 1.05145 1.05148 1.05151 1.05155 1.05157 1.05161 1.05163 1.05167 1.0517 1.05173 1.05176 1.05179 1.05182 1.05185 1.05188 1.05191 1.05194 1.05197 1.052 1.05203 1.05206 1.0521 1.05212 1.05216 1.05218 1.05222 1.05224 1.05228 1.0523 1.05234 1.05236 1.0524 1.05243 1.05246 1.05249 1.05252 1.05255 1.05258 1.05261 1.05264 1.05267 1.0527 1.05273 1.05276 1.05279 1.05282 1.05285 1.05288 1.05291 1.05294 1.05297 1.053 1.05303 1.05306 1.05309 1.05312 1.05315 1.05318 1.05321 1.05324 1.05327 1.0533 1.05333 1.05336 1.05339 1.05342 1.05345 1.05347 1.05351 1.05354 1.05357 1.0536 1.05363 1.05366 1.05368 1.05372 1.05374 1.05378 1.0538 1.05383 1.05386 1.05389 1.05393 1.05395 1.05398 1.05401 1.05404 1.05407 1.0541 1.05413 1.05416 1.05419 1.05422 1.05425 1.05428 1.05431 1.05434 1.05437 1.05439 1.05443 1.05445 1.05449 1.05451 1.05454 1.05457 1.0546 1.05463 1.05466 1.05469 1.05472 1.05475 1.05478 1.05481 1.05483 1.05487 1.05489 1.05492 1.05496 1.05498 1.05501 1.05504 1.05507 1.0551 1.05513 1.05516 1.05519 1.05521 1.05525 1.05527 1.0553 1.05534 1.05536 1.05539 1.05542 1.05545 1.05548 1.05551 1.05553 1.05557 1.05559 1.05562 1.05565 1.05568 1.05571 1.05574 1.05577 1.0558 1.05583 1.05585 1.05588 1.05591 1.05594 1.05597 1.056 1.05603 1.05606 1.05609 1.05611 1.05614 1.05617 1.0562 1.05623 1.05626 1.05628 1.05632 1.05634 1.05637 1.0564 1.05643 1.05646 1.05649 1.05652 1.05654 1.05657 1.0566 1.05663 1.05666 1.05669 1.05672 1.05674 1.05678 1.0568 1.05683 1.05686 1.05689 1.05691 1.05695 1.05697 1.057 1.05703 1.05706 1.05709 1.05711 1.05715 1.05717 1.0572 1.05723 1.05726 1.05728 1.05731 1.05734 1.05737 1.05739 1.05743 1.05746 1.05748 1.05751 1.05754 1.05757 1.05759 1.05763 1.05765 1.05768 1.05771 1.05774 1.05777 1.05779 1.05782 1.05785 1.05788 1.0579 1.05793 1.05796 1.05799 1.05802 1.05805 1.05807 1.0581 1.05813 1.05816 1.05819 1.05821 1.05824 1.05827 1.0583 1.05832 1.05835 1.05838 1.05841 1.05844 1.05846 1.0585 1.05852 1.05855 1.05858 1.05861 1.05863 1.05866 1.05869 1.05872 1.05874 1.05877 1.0588 1.05883 1.05886 1.05888 1.05891 1.05894 1.05897 1.05899 1.05902 1.05905 1.05908 1.0591 1.05913 1.05916 1.05919 1.05922 1.05924 1.05927 1.05929 1.05933 1.05935 1.05938 1.0594 1.05943 1.05946 1.05949 1.05952 1.05954 1.05957 1.0596 1.05963 1.05965 1.05968 1.05971 1.05974 1.05976 1.05979 1.05982 1.05984 1.05988 1.0599 1.05993 1.05995 1.05998 1.06001 1.06004 1.06006 1.06009 1.06012 1.06015 1.06018 1.0602 1.06023 1.06025 1.06028 1.06031 1.06034 1.06036 1.06039 1.06041 1.06044 1.06047 1.0605 1.06053 1.06055 1.06058 1.06061 1.06064 1.06066 1.06069 1.06071 1.06074 1.06077 1.0608 1.06083 1.06085 1.06088 1.0609 1.06093 1.06096 1.06099 1.06101 1.06104 1.06106 1.06109 1.06112 1.06115 1.06118 1.0612 1.06123 1.06125 1.06128 1.06131 1.06133 1.06136 1.06139 1.06141 1.06144 1.06147 1.06149 1.06152 1.06155 1.06158 1.0616 1.06163 1.06165 1.06168 1.06171 1.06173 1.06176 1.06179 1.06182 1.06184 1.06187 1.06189 1.06192 1.06195 1.06197 1.062 1.06203 1.06205 1.06208 1.06211 1.06213 1.06216 1.06218 1.06221 1.06224 1.06227 1.06229 1.06232 1.06234 1.06237 1.06239 1.06242 1.06245 1.06248 1.0625 1.06253 1.06256 1.06258 1.06261 1.06263 1.06266 1.06268 1.06271 1.06274 1.06277 1.06279 1.06282 1.06285 1.06287 1.0629 1.06292 1.06295 1.06297 1.063 1.06302 1.06305 1.06308 1.06311 1.06313 1.06316 1.06319 1.06321 1.06324 1.06326 1.06329 1.06331 1.06334 1.06315 1.06295 1.06275 1.06255 1.00275 g/cm3

# Formula: Density = (Offset + (Factor*(FactorOffset + HU[-1000,2995] ))) * DensityCorrection
iv:Ge/Patient/SchneiderHounsfieldUnitSections = 8 -1000 -98 15 23 101 2001 2995 2996
uv:Ge/Patient/SchneiderDensityOffset = 7 0.00121 1.018 1.03 1.003 1.017 2.201 4.54
uv:Ge/Patient/SchneiderDensityFactor = 7 0.001029700665188 0.000893 0.0 0.001169 0.000592 0.0005 0.0
uv:Ge/Patient/SchneiderDensityFactorOffset = 7 1000. 0. 1000. 0. 0. -2000. 0.

# Define Materials used for HU
sv:Ge/Patient/SchneiderElements = 13 "Hydrogen" "Carbon" "Nitrogen" "Oxygen" "Magnesium" "Phosphorus" "Sulfur" "Chlorine" "Argon" "Calcium" "Sodium" "Potassium" "Titanium"
iv:Ge/Patient/SchneiderHUToMaterialSections = 26 -1000 -950 -120 -83 -53 -23 7 18 80 120 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 2995 2996
uv:Ge/Patient/SchneiderMaterialsWeight1  = 13 0.0      0.0    0.755    0.232  0.0       0.0       0.0    0.0      0.013  0.0	 0.0    0.0	  0.0
uv:Ge/Patient/SchneiderMaterialsWeight2  = 13 0.103    0.105  0.031    0.749  0.0       0.002     0.003  0.003    0.0    0.0	 0.002  0.002	  0.0
uv:Ge/Patient/SchneiderMaterialsWeight3  = 13 0.116    0.681  0.002    0.198  0.0       0.0       0.001  0.001    0.0    0.0	 0.001  0.0	  0.0
uv:Ge/Patient/SchneiderMaterialsWeight4  = 13 0.113    0.567  0.009    0.308  0.0       0.0       0.001  0.001    0.0    0.0	 0.001  0.0	  0.0
uv:Ge/Patient/SchneiderMaterialsWeight5  = 13 0.110    0.458  0.015    0.411  0.0       0.001     0.002  0.002    0.0    0.0     0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight6  = 13 0.108    0.356  0.022    0.509  0.0       0.001     0.002  0.002    0.0    0.0     0.0    0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight7  = 13 0.106    0.284  0.026    0.578  0.0       0.001     0.002  0.002    0.0    0.0     0.0    0.001     0.0
uv:Ge/Patient/SchneiderMaterialsWeight8  = 13 0.103    0.134  0.030    0.723  0.0       0.002     0.002  0.002    0.0    0.0     0.002  0.002     0.0
uv:Ge/Patient/SchneiderMaterialsWeight9  = 13 0.094    0.207  0.062    0.622  0.0       0.0       0.006  0.003    0.0    0.0     0.006  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight10 = 13 0.095    0.455  0.025    0.355  0.0       0.021     0.001	 0.001	  0.0    0.045   0.001  0.001     0.0
uv:Ge/Patient/SchneiderMaterialsWeight11 = 13 0.089    0.423  0.027    0.363  0.0       0.030	  0.001	 0.001	  0.0    0.064   0.001  0.001     0.0
uv:Ge/Patient/SchneiderMaterialsWeight12 = 13 0.082    0.391  0.029    0.372  0.0       0.039	  0.001	 0.001	  0.0    0.083   0.001  0.001     0.0
uv:Ge/Patient/SchneiderMaterialsWeight13 = 13 0.076    0.361  0.030    0.380  0.001     0.047	  0.002	 0.001	  0.0    0.101   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight14 = 13 0.071    0.335  0.032    0.387  0.001     0.054	  0.002	 0.0	  0.0    0.117   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight15 = 13 0.066    0.310  0.033    0.394  0.001     0.061	  0.002	 0.0	  0.0    0.132   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight16 = 13 0.061    0.287  0.035    0.400  0.001     0.067	  0.002	 0.0	  0.0    0.146   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight17 = 13 0.056    0.265  0.036    0.405  0.002     0.073	  0.003	 0.0	  0.0    0.159   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight18 = 13 0.052    0.246  0.037    0.411  0.002     0.078	  0.003	 0.0	  0.0    0.170   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight19 = 13 0.049    0.227  0.038    0.416  0.002     0.083	  0.003	 0.0	  0.0    0.181   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight20 = 13 0.045    0.210  0.039    0.420  0.002     0.088	  0.003	 0.0	  0.0    0.192   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight21 = 13 0.042    0.194  0.040    0.425  0.002     0.092	  0.003	 0.0	  0.0    0.201   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight22 = 13 0.039    0.179  0.041    0.429  0.002     0.096	  0.003	 0.0	  0.0    0.210   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight23 = 13 0.036    0.165  0.042    0.432  0.002     0.100	  0.003	 0.0	  0.0    0.219   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight24 = 13 0.034    0.155  0.042    0.435  0.002     0.103	  0.003	 0.0	  0.0    0.225   0.001  0.0       0.0
uv:Ge/Patient/SchneiderMaterialsWeight25 = 13 0.0      0.0    0.0      0.0    0.0       0.0	  0.0	 0.0	  0.0    0.0     0.0    0.0       1.0

iv:Gr/Color/PatientTissue1 = 3  63  63  63
iv:Gr/Color/PatientTissue2 = 3 100   0   0
iv:Gr/Color/PatientTissue3 = 3 100  30   0
iv:Gr/Color/PatientTissue4 = 3 100  60   0
iv:Gr/Color/PatientTissue5 = 3 100  90   0
iv:Gr/Color/PatientTissue6 = 3 100 120   0
iv:Gr/Color/PatientTissue7 = 3 100 150   0
iv:Gr/Color/PatientTissue8 = 3 100 180   0
iv:Gr/Color/PatientTissue9 = 3 100 210   0
iv:Gr/Color/PatientTissue10= 3 100 240   0
iv:Gr/Color/PatientTissue11= 3 200 200   0
iv:Gr/Color/PatientTissue12= 3 200 200  30
iv:Gr/Color/PatientTissue13= 3 200 200  60
iv:Gr/Color/PatientTissue14= 3 200 200  90
iv:Gr/Color/PatientTissue15= 3 200 200 120
iv:Gr/Color/PatientTissue16= 3 200 200 150
iv:Gr/Color/PatientTissue17= 3 200 200 180
iv:Gr/Color/PatientTissue18= 3 200 200 210
iv:Gr/Color/PatientTissue19= 3 200 200 240
iv:Gr/Color/PatientTissue20= 3 230 200 240
iv:Gr/Color/PatientTissue21= 3 230 230 240
iv:Gr/Color/PatientTissue22= 3 230 230 240
iv:Gr/Color/PatientTissue23= 3 240 240 240
iv:Gr/Color/PatientTissue24= 3 255 255 255
iv:Gr/Color/PatientTissue25= 3 100 100 100

HUtoMaterialSchneider2.txt

# Topas parameter settings for conversion of Hounsfield Units to materials using the Schneider paper

s:Ge/Patient2/ImagingToMaterialConverter = "Schneider"

# Correction Factor for the relative stopping power of Geant4 and the XiO planning system:
dv:Ge/Patient2/DensityCorrection = 3996 9.35212 5.55269 4.14652 3.41395 2.9645 2.66061 2.44144 2.27588 2.1464 2.04239 1.95698 1.8856 1.82506 1.77307 1.72791 1.68835 1.6534 1.62229 1.59442 1.56932 1.54659 1.52591 1.50701 1.48968 1.47373 1.45899 1.44534 1.43265 1.42084 1.40981 1.39949 1.3898 1.38071 1.37214 1.36406 1.35643 1.34921 1.34237 1.33587 1.3297 1.32383 1.31824 1.31291 1.30781 1.30295 1.29829 1.29383 1.28956 1.28546 1.28152 1.1284 1.12519 1.12209 1.11912 1.11625 1.11348 1.11081 1.10823 1.10574 1.10333 1.101 1.09875 1.09657 1.09445 1.0924 1.09041 1.08848 1.08661 1.08479 1.08303 1.08131 1.07964 1.07801 1.07643 1.0749 1.0734 1.07194 1.07052 1.06913 1.06778 1.06646 1.06518 1.06392 1.0627 1.0615 1.06033 1.05919 1.05808 1.05698 1.05592 1.05487 1.05386 1.05286 1.05188 1.05092 1.04999 1.04907 1.04817 1.04728 1.04643 1.04558 1.04475 1.04394 1.04314 1.04235 1.04158 1.04084 1.04009 1.03936 1.03866 1.03796 1.03726 1.0366 1.03593 1.03527 1.03463 1.03401 1.03339 1.03277 1.03218 1.03159 1.03101 1.03044 1.02988 1.02933 1.02878 1.02825 1.02772 1.0272 1.0267 1.02619 1.0257 1.02522 1.02473 1.02426 1.02379 1.02334 1.02288 1.02243 1.022 1.02156 1.02113 1.02072 1.02029 1.01988 1.01948 1.01909 1.01869 1.0183 1.01793 1.01754 1.01717 1.0168 1.01644 1.01608 1.01572 1.01538 1.01503 1.01469 1.01436 1.01403 1.01369 1.01337 1.01306 1.01273 1.01242 1.01212 1.01181 1.0115 1.01121 1.01092 1.01062 1.01033 1.01006 1.00977 1.00949 1.00922 1.00895 1.00867 1.00842 1.00815 1.00789 1.00763 1.00738 1.00713 1.00687 1.00663 1.00639 1.00614 1.00591 1.00568 1.00544 1.0052 1.00498 1.00476 1.00453 1.00431 1.00409 1.00387 1.00366 1.00345 1.00323 1.00302 1.00282 1.00261 1.00241 1.00221 1.00201 1.00181 1.00162 1.00143 1.00123 1.00104 1.00086 1.00067 1.00049 1.0003 1.00012 0.99994 0.99977 0.99959 0.99941 0.99924 0.99907 0.9989 0.99873 0.99856 0.9984 0.99824 0.99807 0.99791 0.99775 0.99759 0.99744 0.99728 0.99713 0.99697 0.99682 0.99667 0.99652 0.99637 0.99623 0.99608 0.99594 0.99579 0.99565 0.99551 0.99537 0.99523 0.99509 0.99496 0.99482 0.99469 0.99455 0.99442 0.99429 0.99416 0.99403 0.9939 0.99378 0.99365 0.99352 0.9934 0.99328 0.99315 0.99303 0.99292 0.99279 0.99267 0.99256 0.99244 0.99232 0.99221 0.99209 0.99198 0.99187 0.99176 0.99164 0.99153 0.99143 0.99131 0.9912 0.9911 0.991 0.99088 0.99078 0.99068 0.99057 0.99047 0.99037 0.99027 0.99016 0.99006 0.98997 0.98987 0.98977 0.98967 0.98958 0.98948 0.98939 0.98929 0.98919 0.9891 0.98901 0.98892 0.98882 0.98873 0.98864 0.98855 0.98846 0.98838 0.98828 0.9882 0.98811 0.98803 0.98794 0.98785 0.98777 0.98768 0.9876 0.98752 0.98743 0.98735 0.98727 0.98719 0.9871 0.98703 0.98695 0.98687 0.98679 0.98671 0.98663 0.98655 0.98648 0.9864 0.98633 0.98625 0.98617 0.9861 0.98602 0.98595 0.98588 0.9858 0.98573 0.98566 0.98559 0.98552 0.98545 0.98538 0.9853 0.98524 0.98517 0.9851 0.98503 0.98496 0.98489 0.98482 0.98476 0.98469 0.98462 0.98456 0.98449 0.98443 0.98436 0.9843 0.98423 0.98417 0.98411 0.98404 0.98398 0.98392 0.98386 0.98379 0.98373 0.98367 0.98361 0.98355 0.98349 0.98343 0.98337 0.98331 0.98325 0.98319 0.98314 0.98308 0.98302 0.98296 0.98291 0.98285 0.98279 0.98274 0.98268 0.98263 0.98257 0.98251 0.98246 0.98241 0.98235 0.9823 0.98224 0.98219 0.98214 0.98208 0.98203 0.98198 0.98193 0.98188 0.98182 0.98177 0.98172 0.98167 0.98162 0.98157 0.98152 0.98147 0.98142 0.98137 0.98132 0.98127 0.98122 0.98118 0.98113 0.98108 0.98103 0.98098 0.98094 0.98089 0.98084 0.98079 0.98075 0.98071 0.98066 0.98061 0.98057 0.98052 0.98047 0.98043 0.98039 0.98034 0.9803 0.98025 0.98021 0.98016 0.98012 0.98008 0.98003 0.97999 0.97995 0.9799 0.97986 0.97982 0.97978 0.97974 0.9797 0.97966 0.97961 0.97957 0.97953 0.97949 0.97945 0.97941 0.97937 0.97933 0.97929 0.97925 0.97921 0.97917 0.97913 0.97909 0.97905 0.97902 0.97898 0.97894 0.9789 0.97886 0.97882 0.97878 0.97875 0.97871 0.97867 0.97864 0.9786 0.97856 0.97853 0.97849 0.97845 0.97841 0.97838 0.97835 0.97831 0.97827 0.97824 0.9782 0.97817 0.97813 0.9781 0.97806 0.97803 0.97799 0.97796 0.97793 0.97789 0.97786 0.97782 0.97779 0.97776 0.97772 0.97769 0.97766 0.97762 0.97759 0.97756 0.97753 0.97749 0.97746 0.97743 0.9774 0.97736 0.97733 0.9773 0.97727 0.97724 0.97721 0.97717 0.97714 0.97711 0.97708 0.97705 0.97702 0.97699 0.97696 0.97693 0.9769 0.97687 0.97684 0.97681 0.97678 0.97675 0.97672 0.97669 0.97666 0.97663 0.9766 0.97658 0.97654 0.97651 0.97649 0.97646 0.97643 0.9764 0.97637 0.97634 0.97632 0.97629 0.97626 0.97623 0.9762 0.97618 0.97615 0.97612 0.9761 0.97607 0.97604 0.97602 0.97599 0.97596 0.97593 0.97591 0.97588 0.97585 0.97583 0.9758 0.97577 0.97575 0.97573 0.9757 0.97567 0.97565 0.97562 0.97559 0.97557 0.97555 0.97552 0.9755 0.97547 0.97544 0.97542 0.9754 0.97537 0.97534 0.97532 0.9753 0.97527 0.97525 0.97522 0.9752 0.97517 0.97515 0.97513 0.9751 0.97508 0.97506 0.97503 0.97501 0.97499 0.97496 0.97494 0.97492 0.97489 0.97487 0.97485 0.97482 0.9748 0.97478 0.97475 0.97473 0.97471 0.97469 0.97466 0.97464 0.97462 0.9746 0.97458 0.97455 0.97453 0.97451 0.97449 0.97447 0.97444 0.97442 0.9744 0.97438 0.97436 0.97433 0.97432 0.97429 0.97427 0.97425 0.97423 0.97421 0.97419 0.97417 0.97415 0.97413 0.97411 0.97409 0.97407 0.97404 0.97402 0.974 0.97398 0.97396 0.97394 0.97392 0.9739 0.97388 0.97386 0.97384 0.97382 0.9738 0.97378 0.97376 0.97375 0.97373 0.97371 0.97369 0.97367 0.97365 0.97363 0.97361 0.97359 0.97357 0.97355 0.97353 0.97352 0.9735 0.97348 0.97346 0.97344 0.97342 0.97341 0.97338 0.97337 0.97335 0.97333 0.97331 0.97329 0.97328 0.97326 0.97324 0.97322 0.9732 0.97319 0.97317 0.97315 0.97313 0.97311 0.9731 0.97308 0.97306 0.97305 0.97303 0.97301 0.97299 0.97298 0.97296 0.97294 0.97292 0.97291 0.97289 0.97287 0.97286 0.97284 0.97282 0.97281 0.97279 0.97277 0.97276 0.97274 0.97272 0.97271 0.97269 0.97267 0.97266 0.97264 0.97262 0.97261 0.97259 0.97258 0.97256 0.97254 0.97253 0.97251 0.97249 0.97248 0.97246 0.97245 0.97243 0.97242 0.9724 0.97239 0.97237 0.97235 0.97234 0.97232 0.97231 0.97229 0.97228 0.97226 0.97225 0.97223 0.97222 0.9722 0.97218 0.97217 0.97216 0.97214 0.97213 0.97211 0.9721 0.97208 0.97207 0.97205 0.97203 0.97202 0.97201 0.97199 0.97198 0.97196 0.97195 0.97193 0.97192 0.97191 0.97189 0.97188 0.97186 0.97185 0.97183 0.97182 0.97181 0.97179 0.97178 0.97176 0.97175 0.97174 0.97172 0.97171 0.97169 0.97168 0.97167 0.97165 0.97164 0.97163 0.97161 0.9716 0.97158 0.97157 0.97156 0.97154 0.97153 0.97152 0.9715 0.97149 0.97148 0.97146 0.97145 0.97144 0.97142 0.97141 0.9714 0.97139 0.97137 0.97136 0.97135 0.97133 0.97132 0.97131 0.9713 0.97128 0.97127 0.97126 0.97124 0.97123 0.97122 0.97121 0.97119 0.97118 0.97117 0.97116 0.97114 0.97113 0.97112 0.97111 0.97109 0.97108 0.97107 0.97106 0.97105 0.97103 0.97102 0.97101 0.971 0.97098 0.97097 0.97096 0.97095 0.97094 0.97093 0.97091 0.9709 0.97089 0.97088 0.97086 0.97085 0.97084 0.97083 0.97082 0.97081 0.9708 0.97078 0.97077 0.97076 0.97075 0.97074 0.97073 0.97072 0.9707 0.97069 0.97068 0.97067 0.97066 0.97065 0.97064 0.97062 0.97061 0.9706 0.97059 0.97058 0.97057 0.97056 0.94514 0.94512 0.94511 0.9451 0.94509 0.94508 0.94507 0.94506 0.94505 0.94504 0.94503 0.94502 0.94501 0.945 0.94499 0.94498 0.94497 0.94496 0.94495 0.94494 0.94492 0.94492 0.9449 0.94489 0.94488 0.94487 0.94486 0.94485 0.94484 0.94483 0.94482 0.94481 0.94569 0.94582 0.94594 0.94607 0.94619 0.95156 0.95168 0.95181 0.95194 0.95206 0.95219 0.95231 0.95244 0.95256 0.95268 0.95281 0.95293 0.95306 0.95318 0.9533 0.95342 0.95355 0.95367 0.95379 0.95391 0.95403 0.95416 0.95428 0.9544 0.95452 0.95464 0.95476 0.95488 0.955 0.95512 0.96074 0.96086 0.96098 0.9611 0.96122 0.96134 0.96146 0.96158 0.9617 0.96181 0.96193 0.96205 0.96217 0.96229 0.9624 0.96252 0.96264 0.96275 0.96287 0.96298 0.9631 0.96322 0.96333 0.96345 0.96356 0.96367 0.96379 0.9639 0.96402 0.96413 0.96818 0.96829 0.96841 0.96852 0.96864 0.96874 0.96886 0.96897 0.96909 0.96919 0.96931 0.96943 0.96953 0.96964 0.96976 0.96986 0.96998 0.97009 0.9702 0.97031 0.97042 0.97053 0.97064 0.97075 0.97087 0.97098 0.9711 0.97123 0.97135 0.97146 0.97526 0.97538 0.97549 0.97561 0.97573 0.97584 0.97596 0.97608 0.97752 0.97848 0.97944 0.98701 0.98798 0.98895 0.98992 0.99089 0.99197 0.99181 0.99166 0.99151 0.99135 0.99119 0.99104 0.99088 0.99073 0.99057 0.99042 0.99027 0.99012 0.98997 0.98982 0.98967 0.98951 0.98936 0.98874 0.98811 0.98749 0.98687 0.98625 0.98563 0.98502 0.9844 0.98378 0.98317 0.98256 0.98195 0.98134 0.98073 0.98013 0.97952 0.97892 0.97832 0.97771 0.97711 0.97651 0.97592 0.97532 0.97472 0.97414 0.97355 0.97295 0.97236 0.97178 0.97119 0.9706 0.97002 0.96943 0.96885 0.96828 0.9677 0.96712 0.96654 0.96596 0.97464 0.97406 0.97348 0.97291 0.97233 0.97176 0.97119 0.97062 0.97005 0.96948 0.96891 0.96834 0.96777 0.96721 0.96665 0.96609 0.96553 0.96497 0.96441 0.96385 0.9633 1.00233 1.00225 1.00216 1.00208 1.002 1.00192 1.00184 1.00175 1.00167 1.00159 1.00151 1.00143 1.00134 1.00126 1.00118 1.0011 1.00102 1.00093 1.00085 1.00035 1.00027 1.00019 1.0001 1.00002 0.99994 0.99987 0.99979 0.9997 0.99962 0.99954 0.99946 0.99938 0.9993 0.99922 0.99914 0.99906 0.99899 0.9989 0.99882 0.99874 0.99867 0.99859 0.9985 0.99842 0.99835 0.99827 0.99819 0.99811 0.99803 0.99795 0.99788 0.9978 0.99771 0.99764 0.99756 0.99749 0.99741 0.99732 0.99725 0.99717 0.9971 0.99702 0.99694 0.99686 0.99678 0.99671 0.99663 0.99655 0.99647 0.9964 0.99632 0.99625 0.99616 0.99609 0.99601 0.99594 0.99586 0.99578 0.99571 0.99563 0.99556 0.99548 0.9954 0.99533 0.99525 0.99518 0.99511 0.99502 0.99495 0.99488 0.9948 0.99473 0.99465 0.99457 0.9945 0.99443 0.99435 0.99427 0.9942 1.00458 1.0045 1.00443 1.00435 1.00428 1.0042 1.00413 1.00406 1.00397 1.0039 1.00383 1.00376 1.00368 1.0036 1.00353 1.00346 1.00339 1.00331 1.00323 1.00316 1.00309 1.00301 1.00294 1.00286 1.00279 1.00272 1.00265 1.00258 1.0025 1.00243 1.00235 1.00228 1.00221 1.00213 1.00206 1.00199 1.00192 1.00185 1.00177 1.0017 1.00163 1.00156 1.00149 1.00141 1.00134 1.00127 1.0012 1.00113 1.00105 1.00098 1.00091 1.00084 1.00077 1.00069 1.00062 1.00055 1.00048 1.00041 1.00033 1.00027 1.0002 1.00013 1.00006 0.99998 0.99991 0.99984 0.99977 0.99971 0.99963 0.99956 0.99949 0.99942 0.99935 0.99928 0.99921 0.99914 0.99907 0.99901 0.99893 0.99886 0.99879 0.99873 0.99866 0.99858 0.99852 0.99845 0.99838 0.99831 0.99824 0.99817 0.9981 0.99804 0.99797 0.99789 0.99783 0.99776 0.99769 0.99763 0.99755 0.99749 1.00929 1.00922 1.00916 1.00908 1.00901 1.00895 1.00888 1.00881 1.00874 1.00867 1.00861 1.00854 1.00847 1.0084 1.00833 1.00827 1.0082 1.00813 1.00806 1.00799 1.00793 1.00786 1.0078 1.00772 1.00766 1.00759 1.00753 1.00746 1.00739 1.00732 1.00726 1.00719 1.00713 1.00705 1.00699 1.00692 1.00686 1.00679 1.00672 1.00666 1.00659 1.00653 1.00646 1.00639 1.00633 1.00626 1.0062 1.00613 1.00606 1.006 1.00593 1.00587 1.0058 1.00573 1.00567 1.00561 1.00554 1.00548 1.00541 1.00534 1.00528 1.00522 1.00515 1.00508 1.00502 1.00496 1.00489 1.00483 1.00476 1.0047 1.00463 1.00457 1.00451 1.00444 1.00438 1.00431 1.00425 1.00419 1.00412 1.00406 1.00399 1.00393 1.00387 1.0038 1.00374 1.00368 1.00361 1.00355 1.00348 1.00342 1.00336 1.0033 1.00324 1.00317 1.00311 1.00305 1.00298 1.00292 1.00285 1.00279 1.01335 1.01329 1.01323 1.01316 1.0131 1.01304 1.01298 1.01292 1.01285 1.01278 1.01272 1.01266 1.0126 1.01253 1.01247 1.01241 1.01235 1.01229 1.01222 1.01216 1.0121 1.01204 1.01198 1.01191 1.01185 1.01179 1.01173 1.01167 1.0116 1.01154 1.01148 1.01142 1.01136 1.0113 1.01124 1.01118 1.01112 1.01106 1.01099 1.01093 1.01087 1.01081 1.01075 1.01069 1.01063 1.01057 1.01051 1.01045 1.01038 1.01033 1.01027 1.01021 1.01015 1.01008 1.01003 1.00997 1.00991 1.00985 1.00978 1.00972 1.00967 1.00961 1.00955 1.00948 1.00943 1.00937 1.00931 1.00925 1.00919 1.00913 1.00907 1.00902 1.00896 1.00889 1.00883 1.00878 1.00872 1.00866 1.0086 1.00854 1.00848 1.00843 1.00837 1.0083 1.00825 1.00819 1.00813 1.00808 1.00801 1.00796 1.0079 1.00784 1.00779 1.00772 1.00767 1.00761 1.00755 1.0075 1.00743 1.00738 1.01627 1.01621 1.01615 1.01609 1.01603 1.01598 1.01592 1.01587 1.0158 1.01575 1.01569 1.01563 1.01558 1.01551 1.01546 1.0154 1.01535 1.01529 1.01523 1.01517 1.01512 1.01506 1.015 1.01494 1.01489 1.01483 1.01478 1.01472 1.01466 1.0146 1.01455 1.01449 1.01444 1.01438 1.01432 1.01427 1.01421 1.01416 1.01409 1.01404 1.01398 1.01393 1.01388 1.01381 1.01376 1.01371 1.01365 1.0136 1.01353 1.01348 1.01343 1.01337 1.01332 1.01326 1.0132 1.01315 1.0131 1.01304 1.01298 1.01293 1.01287 1.01282 1.01277 1.01271 1.01265 1.0126 1.01255 1.01249 1.01243 1.01238 1.01232 1.01227 1.01222 1.01216 1.01211 1.01205 1.012 1.01195 1.01189 1.01183 1.01178 1.01173 1.01168 1.01162 1.01156 1.01151 1.01146 1.01141 1.01135 1.01129 1.01124 1.01119 1.01114 1.01108 1.01103 1.01097 1.01092 1.01087 1.01081 1.01076 1.01979 1.01974 1.01968 1.01962 1.01957 1.01952 1.01947 1.01942 1.01936 1.0193 1.01925 1.0192 1.01915 1.01909 1.01904 1.01899 1.01894 1.01888 1.01883 1.01877 1.01872 1.01867 1.01862 1.01856 1.01851 1.01846 1.01841 1.01836 1.0183 1.01825 1.0182 1.01815 1.0181 1.01804 1.01799 1.01794 1.01789 1.01783 1.01778 1.01773 1.01768 1.01763 1.01758 1.01752 1.01747 1.01742 1.01737 1.01732 1.01726 1.01721 1.01716 1.01711 1.01706 1.017 1.01695 1.0169 1.01685 1.0168 1.01675 1.0167 1.01665 1.0166 1.01655 1.01649 1.01644 1.01639 1.01634 1.0163 1.01624 1.01619 1.01614 1.01609 1.01604 1.01599 1.01594 1.01589 1.01584 1.01579 1.01573 1.01569 1.01564 1.01559 1.01554 1.01548 1.01543 1.01539 1.01534 1.01529 1.01523 1.01518 1.01514 1.01509 1.01504 1.01499 1.01494 1.01489 1.01484 1.01479 1.01474 1.01469 1.02359 1.02354 1.02349 1.02344 1.02339 1.02334 1.02329 1.02324 1.02319 1.02314 1.02309 1.02304 1.023 1.02294 1.02289 1.02285 1.0228 1.02275 1.0227 1.02265 1.0226 1.02255 1.02251 1.02245 1.0224 1.02236 1.02231 1.02226 1.02221 1.02216 1.02211 1.02207 1.02202 1.02196 1.02192 1.02187 1.02182 1.02178 1.02172 1.02168 1.02163 1.02158 1.02154 1.02148 1.02144 1.02139 1.02134 1.0213 1.02124 1.0212 1.02115 1.0211 1.02106 1.021 1.02096 1.02091 1.02087 1.02082 1.02077 1.02072 1.02067 1.02063 1.02058 1.02053 1.02049 1.02043 1.02039 1.02035 1.02029 1.02025 1.0202 1.02016 1.02011 1.02006 1.02002 1.01996 1.01992 1.01988 1.01983 1.01978 1.01973 1.01969 1.01964 1.01959 1.01955 1.0195 1.01945 1.01941 1.01936 1.01932 1.01927 1.01922 1.01918 1.01913 1.01909 1.01903 1.01899 1.01895 1.0189 1.01886 1.02794 1.02789 1.02785 1.0278 1.02776 1.02771 1.02767 1.02762 1.02756 1.02752 1.02748 1.02744 1.02739 1.02734 1.02729 1.02725 1.0272 1.02717 1.02711 1.02706 1.02702 1.02697 1.02693 1.02688 1.02684 1.02679 1.02675 1.0267 1.02666 1.02661 1.02657 1.02652 1.02648 1.02643 1.02638 1.02635 1.0263 1.02626 1.0262 1.02616 1.02611 1.02607 1.02603 1.02598 1.02594 1.02589 1.02585 1.0258 1.02576 1.02571 1.02567 1.02563 1.02558 1.02554 1.02549 1.02545 1.02541 1.02536 1.02531 1.02526 1.02523 1.02519 1.02514 1.02509 1.02505 1.025 1.02496 1.02493 1.02487 1.02483 1.02479 1.02474 1.0247 1.02465 1.02461 1.02457 1.02453 1.02448 1.02444 1.0244 1.02435 1.02431 1.02427 1.02421 1.02417 1.02414 1.02409 1.02405 1.024 1.02396 1.02391 1.02387 1.02384 1.02379 1.02374 1.0237 1.02366 1.02361 1.02357 1.02353 1.03085 1.03081 1.03077 1.03073 1.03068 1.03064 1.0306 1.03055 1.03051 1.03046 1.03042 1.03038 1.03034 1.03029 1.03025 1.03021 1.03017 1.03012 1.03008 1.03004 1.03 1.02995 1.02992 1.02986 1.02983 1.02978 1.02975 1.0297 1.02966 1.02961 1.02957 1.02954 1.02949 1.02945 1.0294 1.02937 1.02932 1.02928 1.02923 1.02919 1.02916 1.02911 1.02908 1.02902 1.02899 1.02894 1.0289 1.02887 1.02882 1.02878 1.02873 1.0287 1.02866 1.02861 1.02857 1.02853 1.02849 1.02845 1.0284 1.02836 1.02833 1.02828 1.02825 1.02819 1.02816 1.02812 1.02807 1.02804 1.02799 1.02795 1.02791 1.02788 1.02783 1.02779 1.02775 1.0277 1.02767 1.02763 1.02758 1.02754 1.02751 1.02746 1.02742 1.02738 1.02735 1.0273 1.02726 1.02723 1.02717 1.02714 1.0271 1.02707 1.02702 1.02698 1.02694 1.0269 1.02686 1.02682 1.02678 1.02673 1.03276 1.03272 1.03268 1.03264 1.03259 1.03256 1.03252 1.03248 1.03243 1.0324 1.03235 1.03232 1.03228 1.03224 1.03219 1.03216 1.03212 1.03208 1.03204 1.032 1.03196 1.03192 1.03188 1.03183 1.0318 1.03176 1.03172 1.03169 1.03164 1.0316 1.03156 1.03153 1.03149 1.03144 1.03141 1.03136 1.03133 1.03129 1.03124 1.03121 1.03117 1.03113 1.0311 1.03105 1.03101 1.03097 1.03094 1.0309 1.03085 1.03082 1.03078 1.03074 1.03071 1.03067 1.03062 1.03059 1.03055 1.03051 1.03047 1.03043 1.03039 1.03036 1.03032 1.03027 1.03024 1.0302 1.03016 1.03013 1.03009 1.03004 1.03001 1.02998 1.02993 1.02989 1.02986 1.02981 1.02978 1.02975 1.02971 1.02966 1.02963 1.02959 1.02955 1.02951 1.02948 1.02944 1.0294 1.02936 1.02932 1.02929 1.02925 1.02921 1.02918 1.02914 1.02909 1.02906 1.02903 1.02899 1.02894 1.02891 1.03634 1.03631 1.03626 1.03623 1.03619 1.03615 1.03611 1.03608 1.03603 1.036 1.03596 1.03593 1.03589 1.03585 1.03581 1.03578 1.03574 1.03571 1.03566 1.03563 1.03559 1.03556 1.03552 1.03548 1.03544 1.03541 1.03537 1.03534 1.03529 1.03526 1.03522 1.03518 1.03515 1.03511 1.03507 1.03503 1.035 1.03496 1.03492 1.03488 1.03485 1.03482 1.03478 1.03474 1.0347 1.03467 1.03463 1.0346 1.03456 1.03452 1.03449 1.03445 1.03442 1.03438 1.03434 1.03431 1.03427 1.03423 1.0342 1.03416 1.03412 1.03408 1.03405 1.03402 1.03397 1.03394 1.03391 1.03387 1.03383 1.0338 1.03376 1.03373 1.03369 1.03365 1.03362 1.03358 1.03355 1.03352 1.03347 1.03344 1.03341 1.03337 1.03334 1.0333 1.03326 1.03323 1.03319 1.03316 1.03312 1.03308 1.03305 1.03301 1.03298 1.03294 1.0329 1.03287 1.03284 1.0328 1.03276 1.03273 1.03851 1.03848 1.03844 1.03841 1.03837 1.03833 1.0383 1.03826 1.03823 1.03819 1.03816 1.03812 1.03809 1.03805 1.03802 1.03798 1.03795 1.03792 1.03788 1.03785 1.03781 1.03778 1.03774 1.03771 1.03767 1.03764 1.0376 1.03757 1.03752 1.0375 1.03746 1.03743 1.0374 1.03735 1.03732 1.03729 1.03726 1.03722 1.03718 1.03715 1.03711 1.03709 1.03705 1.03701 1.03697 1.03694 1.03692 1.03688 1.03684 1.0368 1.03677 1.03674 1.03671 1.03667 1.03663 1.0366 1.03657 1.03653 1.0365 1.03646 1.03643 1.0364 1.03636 1.03633 1.0363 1.03626 1.03623 1.03619 1.03616 1.03613 1.03609 1.03606 1.03603 1.03599 1.03596 1.03593 1.03589 1.03586 1.03583 1.03579 1.03576 1.03573 1.03569 1.03566 1.03563 1.03559 1.03556 1.03553 1.03548 1.03546 1.03543 1.03539 1.03536 1.03532 1.03528 1.03526 1.03523 1.03519 1.03515 1.03512 1.04093 1.0409 1.04087 1.04083 1.0408 1.04076 1.04074 1.0407 1.04067 1.04063 1.0406 1.04057 1.04054 1.0405 1.04047 1.04043 1.04041 1.04037 1.04034 1.0403 1.04027 1.04024 1.04021 1.04017 1.04014 1.04011 1.04008 1.04004 1.04001 1.03998 1.03994 1.03992 1.03988 1.03985 1.03981 1.03978 1.03975 1.03972 1.03968 1.03965 1.03962 1.03959 1.03956 1.03952 1.03949 1.03945 1.03943 1.0394 1.03936 1.03933 1.03929 1.03927 1.03923 1.0392 1.03917 1.03913 1.03911 1.03907 1.03904 1.03901 1.03898 1.03895 1.03891 1.03888 1.03885 1.03882 1.03879 1.03875 1.03872 1.03869 1.03866 1.03863 1.03859 1.03856 1.03853 1.0385 1.03847 1.03844 1.0384 1.03837 1.03835 1.03831 1.03828 1.03825 1.03821 1.03819 1.03815 1.03812 1.03809 1.03805 1.03803 1.038 1.03796 1.03793 1.0379 1.03787 1.03784 1.03781 1.03777 1.03774 1.04358 1.04356 1.04352 1.04349 1.04346 1.04343 1.0434 1.04337 1.04333 1.0433 1.04327 1.04324 1.04321 1.04317 1.04315 1.04311 1.04309 1.04305 1.04302 1.04299 1.04296 1.04293 1.04291 1.04286 1.04284 1.04281 1.04278 1.04275 1.04272 1.04268 1.04266 1.04262 1.0426 1.04256 1.04253 1.0425 1.04247 1.04244 1.04241 1.04237 1.04235 1.04231 1.04229 1.04225 1.04222 1.04219 1.04217 1.04213 1.0421 1.04208 1.04204 1.04202 1.04198 1.04195 1.04192 1.04189 1.04186 1.04183 1.0418 1.04177 1.04174 1.04171 1.04168 1.04164 1.04162 1.04159 1.04156 1.04154 1.04149 1.04147 1.04144 1.04141 1.04138 1.04135 1.04132 1.04129 1.04126 1.04123 1.0412 1.04117 1.04114 1.04111 1.04108 1.04105 1.04102 1.04099 1.04096 1.04093 1.0409 1.04087 1.04084 1.04081 1.04079 1.04075 1.04072 1.04069 1.04067 1.04064 1.0406 1.04058 1.04455 1.04453 1.0445 1.04447 1.04443 1.04441 1.04438 1.04435 1.04431 1.04429 1.04426 1.04423 1.0442 1.04417 1.04414 1.04411 1.04408 1.04406 1.04402 1.044 1.04397 1.04394 1.04391 1.04388 1.04385 1.04382 1.04379 1.04377 1.04373 1.0437 1.04367 1.04365 1.04362 1.04359 1.04356 1.04353 1.0435 1.04347 1.04344 1.04341 1.04339 1.04336 1.04333 1.04329 1.04327 1.04324 1.04321 1.04319 1.04315 1.04313 1.0431 1.04307 1.04304 1.04301 1.04299 1.04295 1.04293 1.0429 1.04287 1.04284 1.04281 1.04279 1.04276 1.04273 1.0427 1.04267 1.04265 1.04261 1.04259 1.04255 1.04253 1.04251 1.04247 1.04244 1.04241 1.04239 1.04236 1.04233 1.0423 1.04228 1.04225 1.04222 1.04219 1.04216 1.04214 1.0421 1.04208 1.04205 1.04202 1.042 1.04196 1.04194 1.04192 1.04188 1.04185 1.04183 1.0418 1.04178 1.04175 1.04171 1.04169 1.04166 1.04163 1.0416 1.04158 1.04155 1.04153 1.04149 1.04146 1.04144 1.04141 1.04138 1.04136 1.04133 1.0413 1.04128 1.04125 1.04122 1.04119 1.04117 1.04113 1.04111 1.04109 1.04105 1.04103 1.041 1.04097 1.04095 1.04092 1.04089 1.04086 1.04084 1.04081 1.04077 1.04075 1.04073 1.0407 1.04067 1.04064 1.04062 1.04059 1.04056 1.04054 1.04051 1.04048 1.04046 1.04043 1.0404 1.04037 1.04035 1.04032 1.04029 1.04027 1.04024 1.04021 1.04018 1.04016 1.04014 1.04011 1.04007 1.04005 1.04003 1.04 1.03997 1.03994 1.03992 1.03989 1.03986 1.03983 1.03981 1.03979 1.03975 1.03973 1.0397 1.03968 1.03965 1.03962 1.0396 1.03957 1.03955 1.03951 1.03949 1.03947 1.03944 1.03941 1.03938 1.03936 1.03934 1.03931 1.03928 1.03925 1.03923 1.03921 1.03918 1.03915 1.03912 1.0391 1.03907 1.03904 1.03902 1.03899 1.03897 1.03894 1.03891 1.03889 1.03886 1.03883 1.03881 1.03878 1.03876 1.03873 1.0387 1.03868 1.03865 1.03863 1.0386 1.03858 1.03855 1.03852 1.0385 1.03847 1.03845 1.03842 1.03839 1.03836 1.03834 1.03832 1.03829 1.03826 1.03824 1.03821 1.03819 1.03816 1.03813 1.03811 1.03809 1.03806 1.03803 1.038 1.03798 1.03796 1.03793 1.03791 1.03788 1.03786 1.03783 1.0378 1.03778 1.03775 1.03773 1.0377 1.03768 1.03766 1.03763 1.0376 1.03757 1.03755 1.03753 1.0375 1.03747 1.03745 1.03743 1.0374 1.03737 1.03735 1.03732 1.03729 1.03727 1.03724 1.03722 1.0372 1.03717 1.03715 1.03712 1.0371 1.03707 1.03704 1.03702 1.03699 1.03697 1.03694 1.03692 1.0369 1.03687 1.03684 1.03682 1.0368 1.03678 1.03675 1.03672 1.0367 1.03667 1.03665 1.03662 1.03659 1.03657 1.03655 1.03652 1.03649 1.03647 1.03645 1.03642 1.0364 1.03637 1.03635 1.03633 1.0363 1.03628 1.03625 1.03623 1.0362 1.03618 1.03616 1.03613 1.03611 1.03608 1.03606 1.03603 1.03601 1.03598 1.03596 1.03593 1.03591 1.03589 1.03586 1.03584 1.03581 1.03579 1.03576 1.03574 1.03571 1.03569 1.03567 1.03564 1.03562 1.03559 1.03557 1.03555 1.03552 1.0355 1.03547 1.03545 1.03543 1.0354 1.03538 1.03535 1.03533 1.03531 1.03528 1.03525 1.03523 1.03521 1.03519 1.03516 1.03513 1.03511 1.03509 1.03506 1.03503 1.03501 1.03499 1.03497 1.03494 1.03491 1.03489 1.03487 1.03485 1.03482 1.0348 1.03478 1.03475 1.03473 1.03471 1.03468 1.03466 1.03463 1.03461 1.03459 1.03456 1.03453 1.03451 1.03449 1.03447 1.03445 1.03442 1.0344 1.03438 1.03435 1.03432 1.0343 1.03428 1.03426 1.03423 1.0342 1.03418 1.03416 1.03414 1.03412 1.03409 1.03407 1.03405 1.03402 1.034 1.03397 1.03395 1.03393 1.03391 1.03389 1.03386 1.03384 1.03381 1.03379 1.03377 1.03374 1.03372 1.0337 1.03368 1.03365 1.03363 1.0336 1.03358 1.03356 1.03353 1.03351 1.03349 1.03347 1.03344 1.03342 1.03339 1.03337 1.03335 1.03333 1.03331 1.03328 1.03326 1.03323 1.03321 1.03319 1.03317 1.03315 1.03312 1.0331 1.03308 1.03305 1.03303 1.03301 1.03299 1.03297 1.03294 1.03291 1.03289 1.03287 1.03285 1.03282 1.0328 1.03278 1.03276 1.03273 1.03271 1.03269 1.03267 1.03264 1.03262 1.0326 1.03258 1.03255 1.03253 1.03251 1.03248 1.03246 1.03244 1.03242 1.0324 1.03237 1.03235 1.03233 1.03231 1.03229 1.03226 1.03224 1.03222 1.0322 1.03217 1.03214 1.03212 1.03211 1.03209 1.03206 1.03203 1.03201 1.032 1.03197 1.03195 1.03192 1.0319 1.03189 1.03186 1.03184 1.03181 1.03179 1.03177 1.03181 1.03185 1.03189 1.03193 1.03197 1.03201 1.03204 1.03209 1.03212 1.03216 1.0322 1.03224 1.03227 1.03232 1.03236 1.03239 1.03244 1.03247 1.03251 1.03255 1.03259 1.03262 1.03267 1.0327 1.03274 1.03278 1.03282 1.03286 1.0329 1.03294 1.03297 1.03301 1.03305 1.03309 1.03313 1.03317 1.0332 1.03324 1.03328 1.03332 1.03336 1.0334 1.03344 1.03347 1.03351 1.03355 1.03359 1.03362 1.03366 1.0337 1.03374 1.03378 1.03382 1.03386 1.03389 1.03393 1.03397 1.03401 1.03404 1.03408 1.03412 1.03416 1.03419 1.03424 1.03428 1.03431 1.03435 1.03439 1.03443 1.03446 1.0345 1.03454 1.03458 1.03461 1.03465 1.03469 1.03473 1.03477 1.0348 1.03484 1.03488 1.03492 1.03495 1.03499 1.03503 1.03507 1.0351 1.03514 1.03518 1.03522 1.03526 1.03529 1.03533 1.03536 1.03541 1.03544 1.03548 1.03551 1.03555 1.03559 1.03563 1.03567 1.0357 1.03574 1.03578 1.03582 1.03585 1.03589 1.03592 1.03596 1.036 1.03604 1.03608 1.03611 1.03615 1.03618 1.03623 1.03626 1.0363 1.03633 1.03637 1.03641 1.03645 1.03648 1.03652 1.03656 1.03659 1.03663 1.03667 1.03671 1.03674 1.03678 1.03681 1.03685 1.03688 1.03692 1.03696 1.037 1.03704 1.03707 1.03711 1.03714 1.03718 1.03722 1.03726 1.03729 1.03733 1.03736 1.0374 1.03744 1.03747 1.03751 1.03755 1.03759 1.03762 1.03766 1.03769 1.03773 1.03776 1.0378 1.03783 1.03787 1.03791 1.03795 1.03799 1.03802 1.03806 1.03809 1.03813 1.03816 1.0382 1.03823 1.03827 1.03831 1.03835 1.03838 1.03842 1.03846 1.03849 1.03853 1.03856 1.0386 1.03863 1.03867 1.0387 1.03874 1.03878 1.03881 1.03885 1.03888 1.03892 1.03896 1.03899 1.03903 1.03907 1.0391 1.03914 1.03918 1.03921 1.03925 1.03928 1.03932 1.03935 1.03939 1.03942 1.03946 1.03949 1.03953 1.03956 1.0396 1.03964 1.03967 1.03971 1.03974 1.03978 1.03981 1.03985 1.03988 1.03992 1.03995 1.03999 1.04002 1.04006 1.0401 1.04013 1.04017 1.0402 1.04024 1.04027 1.04031 1.04034 1.04038 1.04041 1.04045 1.04049 1.04052 1.04056 1.04059 1.04063 1.04066 1.0407 1.04073 1.04077 1.0408 1.04084 1.04087 1.04091 1.04094 1.04098 1.04101 1.04105 1.04108 1.04111 1.04115 1.04118 1.04122 1.04125 1.04129 1.04133 1.04136 1.0414 1.04143 1.04147 1.0415 1.04154 1.04157 1.04161 1.04164 1.04167 1.0417 1.04174 1.04178 1.04181 1.04185 1.04188 1.04192 1.04195 1.04199 1.04202 1.04205 1.04209 1.04212 1.04215 1.04219 1.04223 1.04226 1.0423 1.04233 1.04237 1.0424 1.04243 1.04246 1.0425 1.04253 1.04257 1.04261 1.04264 1.04268 1.04271 1.04274 1.04277 1.04281 1.04284 1.04288 1.04291 1.04295 1.04298 1.04301 1.04305 1.04308 1.04312 1.04315 1.04319 1.04322 1.04325 1.04329 1.04332 1.04335 1.04339 1.04343 1.04346 1.04349 1.04352 1.04356 1.04359 1.04363 1.04366 1.0437 1.04373 1.04376 1.04379 1.04383 1.04387 1.0439 1.04393 1.04396 1.044 1.04403 1.04407 1.0441 1.04413 1.04416 1.0442 1.04423 1.04427 1.0443 1.04433 1.04437 1.0444 1.04444 1.04447 1.0445 1.04453 1.04457 1.0446 1.04464 1.04467 1.0447 1.04474 1.04477 1.04481 1.04484 1.04487 1.0449 1.04494 1.04497 1.045 1.04503 1.04507 1.04511 1.04514 1.04517 1.0452 1.04524 1.04527 1.0453 1.04533 1.04537 1.0454 1.04543 1.04547 1.0455 1.04554 1.04557 1.0456 1.04563 1.04567 1.0457 1.04573 1.04576 1.0458 1.04583 1.04586 1.0459 1.04593 1.04596 1.04599 1.04603 1.04606 1.0461 1.04612 1.04616 1.04619 1.04623 1.04625 1.04629 1.04633 1.04636 1.04639 1.04642 1.04646 1.04648 1.04652 1.04655 1.04659 1.04661 1.04665 1.04669 1.04671 1.04675 1.04678 1.04681 1.04684 1.04688 1.04691 1.04694 1.04697 1.04701 1.04704 1.04707 1.04711 1.04714 1.04717 1.0472 1.04724 1.04726 1.0473 1.04733 1.04736 1.04739 1.04743 1.04746 1.04749 1.04753 1.04756 1.04759 1.04762 1.04766 1.04768 1.04772 1.04775 1.04778 1.04781 1.04785 1.04788 1.04791 1.04795 1.04797 1.04801 1.04804 1.04807 1.0481 1.04814 1.04816 1.0482 1.04823 1.04826 1.0483 1.04833 1.04836 1.04839 1.04842 1.04845 1.04849 1.04852 1.04855 1.04858 1.04861 1.04865 1.04868 1.04871 1.04874 1.04877 1.0488 1.04884 1.04886 1.0489 1.04893 1.04896 1.04899 1.04903 1.04906 1.04909 1.04912 1.04915 1.04918 1.04921 1.04925 1.04928 1.04931 1.04934 1.04937 1.04941 1.04943 1.04947 1.0495 1.04953 1.04956 1.04959 1.04962 1.04966 1.04968 1.04972 1.04975 1.04978 1.04981 1.04984 1.04988 1.0499 1.04994 1.04997 1.05 1.05003 1.05006 1.05009 1.05012 1.05015 1.05019 1.05022 1.05025 1.05028 1.05031 1.05034 1.05037 1.05041 1.05043 1.05047 1.05049 1.05053 1.05056 1.05059 1.05062 1.05065 1.05068 1.05071 1.05075 1.05077 1.05081 1.05083 1.05087 1.0509 1.05093 1.05096 1.05099 1.05102 1.05105 1.05109 1.05111 1.05115 1.05117 1.05121 1.05123 1.05127 1.0513 1.05133 1.05136 1.05139 1.05142 1.05145 1.05148 1.05151 1.05155 1.05157 1.05161 1.05163 1.05167 1.0517 1.05173 1.05176 1.05179 1.05182 1.05185 1.05188 1.05191 1.05194 1.05197 1.052 1.05203 1.05206 1.0521 1.05212 1.05216 1.05218 1.05222 1.05224 1.05228 1.0523 1.05234 1.05236 1.0524 1.05243 1.05246 1.05249 1.05252 1.05255 1.05258 1.05261 1.05264 1.05267 1.0527 1.05273 1.05276 1.05279 1.05282 1.05285 1.05288 1.05291 1.05294 1.05297 1.053 1.05303 1.05306 1.05309 1.05312 1.05315 1.05318 1.05321 1.05324 1.05327 1.0533 1.05333 1.05336 1.05339 1.05342 1.05345 1.05347 1.05351 1.05354 1.05357 1.0536 1.05363 1.05366 1.05368 1.05372 1.05374 1.05378 1.0538 1.05383 1.05386 1.05389 1.05393 1.05395 1.05398 1.05401 1.05404 1.05407 1.0541 1.05413 1.05416 1.05419 1.05422 1.05425 1.05428 1.05431 1.05434 1.05437 1.05439 1.05443 1.05445 1.05449 1.05451 1.05454 1.05457 1.0546 1.05463 1.05466 1.05469 1.05472 1.05475 1.05478 1.05481 1.05483 1.05487 1.05489 1.05492 1.05496 1.05498 1.05501 1.05504 1.05507 1.0551 1.05513 1.05516 1.05519 1.05521 1.05525 1.05527 1.0553 1.05534 1.05536 1.05539 1.05542 1.05545 1.05548 1.05551 1.05553 1.05557 1.05559 1.05562 1.05565 1.05568 1.05571 1.05574 1.05577 1.0558 1.05583 1.05585 1.05588 1.05591 1.05594 1.05597 1.056 1.05603 1.05606 1.05609 1.05611 1.05614 1.05617 1.0562 1.05623 1.05626 1.05628 1.05632 1.05634 1.05637 1.0564 1.05643 1.05646 1.05649 1.05652 1.05654 1.05657 1.0566 1.05663 1.05666 1.05669 1.05672 1.05674 1.05678 1.0568 1.05683 1.05686 1.05689 1.05691 1.05695 1.05697 1.057 1.05703 1.05706 1.05709 1.05711 1.05715 1.05717 1.0572 1.05723 1.05726 1.05728 1.05731 1.05734 1.05737 1.05739 1.05743 1.05746 1.05748 1.05751 1.05754 1.05757 1.05759 1.05763 1.05765 1.05768 1.05771 1.05774 1.05777 1.05779 1.05782 1.05785 1.05788 1.0579 1.05793 1.05796 1.05799 1.05802 1.05805 1.05807 1.0581 1.05813 1.05816 1.05819 1.05821 1.05824 1.05827 1.0583 1.05832 1.05835 1.05838 1.05841 1.05844 1.05846 1.0585 1.05852 1.05855 1.05858 1.05861 1.05863 1.05866 1.05869 1.05872 1.05874 1.05877 1.0588 1.05883 1.05886 1.05888 1.05891 1.05894 1.05897 1.05899 1.05902 1.05905 1.05908 1.0591 1.05913 1.05916 1.05919 1.05922 1.05924 1.05927 1.05929 1.05933 1.05935 1.05938 1.0594 1.05943 1.05946 1.05949 1.05952 1.05954 1.05957 1.0596 1.05963 1.05965 1.05968 1.05971 1.05974 1.05976 1.05979 1.05982 1.05984 1.05988 1.0599 1.05993 1.05995 1.05998 1.06001 1.06004 1.06006 1.06009 1.06012 1.06015 1.06018 1.0602 1.06023 1.06025 1.06028 1.06031 1.06034 1.06036 1.06039 1.06041 1.06044 1.06047 1.0605 1.06053 1.06055 1.06058 1.06061 1.06064 1.06066 1.06069 1.06071 1.06074 1.06077 1.0608 1.06083 1.06085 1.06088 1.0609 1.06093 1.06096 1.06099 1.06101 1.06104 1.06106 1.06109 1.06112 1.06115 1.06118 1.0612 1.06123 1.06125 1.06128 1.06131 1.06133 1.06136 1.06139 1.06141 1.06144 1.06147 1.06149 1.06152 1.06155 1.06158 1.0616 1.06163 1.06165 1.06168 1.06171 1.06173 1.06176 1.06179 1.06182 1.06184 1.06187 1.06189 1.06192 1.06195 1.06197 1.062 1.06203 1.06205 1.06208 1.06211 1.06213 1.06216 1.06218 1.06221 1.06224 1.06227 1.06229 1.06232 1.06234 1.06237 1.06239 1.06242 1.06245 1.06248 1.0625 1.06253 1.06256 1.06258 1.06261 1.06263 1.06266 1.06268 1.06271 1.06274 1.06277 1.06279 1.06282 1.06285 1.06287 1.0629 1.06292 1.06295 1.06297 1.063 1.06302 1.06305 1.06308 1.06311 1.06313 1.06316 1.06319 1.06321 1.06324 1.06326 1.06329 1.06331 1.06334 1.06315 1.06295 1.06275 1.06255 1.00275 g/cm3

# Formula: Density = (Offset + (Factor*(FactorOffset + HU[-1000,2995] ))) * DensityCorrection
iv:Ge/Patient2/SchneiderHounsfieldUnitSections = 8 -1000 -98 15 23 101 2001 2995 2996
uv:Ge/Patient2/SchneiderDensityOffset = 7 0.00121 1.018 1.03 1.003 1.017 2.201 4.54
uv:Ge/Patient2/SchneiderDensityFactor = 7 0.001029700665188 0.000893 0.0 0.001169 0.000592 0.0005 0.0
uv:Ge/Patient2/SchneiderDensityFactorOffset = 7 1000. 0. 1000. 0. 0. -2000. 0.

# Define Materials used for HU
sv:Ge/Patient2/SchneiderElements = 13 "Hydrogen" "Carbon" "Nitrogen" "Oxygen" "Magnesium" "Phosphorus" "Sulfur" "Chlorine" "Argon" "Calcium" "Sodium" "Potassium" "Titanium"
iv:Ge/Patient2/SchneiderHUToMaterialSections = 26 -1000 -950 -120 -83 -53 -23 7 18 80 120 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 2995 2996
uv:Ge/Patient2/SchneiderMaterialsWeight1  = 13 0.0      0.0    0.755    0.232  0.0       0.0       0.0    0.0      0.013  0.0	 0.0    0.0	  0.0
uv:Ge/Patient2/SchneiderMaterialsWeight2  = 13 0.103    0.105  0.031    0.749  0.0       0.002     0.003  0.003    0.0    0.0	 0.002  0.002	  0.0
uv:Ge/Patient2/SchneiderMaterialsWeight3  = 13 0.116    0.681  0.002    0.198  0.0       0.0       0.001  0.001    0.0    0.0	 0.001  0.0	  0.0
uv:Ge/Patient2/SchneiderMaterialsWeight4  = 13 0.113    0.567  0.009    0.308  0.0       0.0       0.001  0.001    0.0    0.0	 0.001  0.0	  0.0
uv:Ge/Patient2/SchneiderMaterialsWeight5  = 13 0.110    0.458  0.015    0.411  0.0       0.001     0.002  0.002    0.0    0.0     0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight6  = 13 0.108    0.356  0.022    0.509  0.0       0.001     0.002  0.002    0.0    0.0     0.0    0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight7  = 13 0.106    0.284  0.026    0.578  0.0       0.001     0.002  0.002    0.0    0.0     0.0    0.001     0.0
uv:Ge/Patient2/SchneiderMaterialsWeight8  = 13 0.103    0.134  0.030    0.723  0.0       0.002     0.002  0.002    0.0    0.0     0.002  0.002     0.0
uv:Ge/Patient2/SchneiderMaterialsWeight9  = 13 0.094    0.207  0.062    0.622  0.0       0.0       0.006  0.003    0.0    0.0     0.006  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight10 = 13 0.095    0.455  0.025    0.355  0.0       0.021     0.001	 0.001	  0.0    0.045   0.001  0.001     0.0
uv:Ge/Patient2/SchneiderMaterialsWeight11 = 13 0.089    0.423  0.027    0.363  0.0       0.030	  0.001	 0.001	  0.0    0.064   0.001  0.001     0.0
uv:Ge/Patient2/SchneiderMaterialsWeight12 = 13 0.082    0.391  0.029    0.372  0.0       0.039	  0.001	 0.001	  0.0    0.083   0.001  0.001     0.0
uv:Ge/Patient2/SchneiderMaterialsWeight13 = 13 0.076    0.361  0.030    0.380  0.001     0.047	  0.002	 0.001	  0.0    0.101   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight14 = 13 0.071    0.335  0.032    0.387  0.001     0.054	  0.002	 0.0	  0.0    0.117   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight15 = 13 0.066    0.310  0.033    0.394  0.001     0.061	  0.002	 0.0	  0.0    0.132   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight16 = 13 0.061    0.287  0.035    0.400  0.001     0.067	  0.002	 0.0	  0.0    0.146   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight17 = 13 0.056    0.265  0.036    0.405  0.002     0.073	  0.003	 0.0	  0.0    0.159   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight18 = 13 0.052    0.246  0.037    0.411  0.002     0.078	  0.003	 0.0	  0.0    0.170   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight19 = 13 0.049    0.227  0.038    0.416  0.002     0.083	  0.003	 0.0	  0.0    0.181   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight20 = 13 0.045    0.210  0.039    0.420  0.002     0.088	  0.003	 0.0	  0.0    0.192   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight21 = 13 0.042    0.194  0.040    0.425  0.002     0.092	  0.003	 0.0	  0.0    0.201   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight22 = 13 0.039    0.179  0.041    0.429  0.002     0.096	  0.003	 0.0	  0.0    0.210   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight23 = 13 0.036    0.165  0.042    0.432  0.002     0.100	  0.003	 0.0	  0.0    0.219   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight24 = 13 0.034    0.155  0.042    0.435  0.002     0.103	  0.003	 0.0	  0.0    0.225   0.001  0.0       0.0
uv:Ge/Patient2/SchneiderMaterialsWeight25 = 13 0.0      0.0    0.0      0.0    0.0       0.0	  0.0	 0.0	  0.0    0.0     0.0    0.0       1.0

iv:Gr/Color/Patient2Tissue1 = 3  63  63  63
iv:Gr/Color/Patient2Tissue2 = 3 100   0   0
iv:Gr/Color/Patient2Tissue3 = 3 100  30   0
iv:Gr/Color/Patient2Tissue4 = 3 100  60   0
iv:Gr/Color/Patient2Tissue5 = 3 100  90   0
iv:Gr/Color/Patient2Tissue6 = 3 100 120   0
iv:Gr/Color/Patient2Tissue7 = 3 100 150   0
iv:Gr/Color/Patient2Tissue8 = 3 100 180   0
iv:Gr/Color/Patient2Tissue9 = 3 100 210   0
iv:Gr/Color/Patient2Tissue10= 3 100 240   0
iv:Gr/Color/Patient2Tissue11= 3 200 200   0
iv:Gr/Color/Patient2Tissue12= 3 200 200  30
iv:Gr/Color/Patient2Tissue13= 3 200 200  60
iv:Gr/Color/Patient2Tissue14= 3 200 200  90
iv:Gr/Color/Patient2Tissue15= 3 200 200 120
iv:Gr/Color/Patient2Tissue16= 3 200 200 150
iv:Gr/Color/Patient2Tissue17= 3 200 200 180
iv:Gr/Color/Patient2Tissue18= 3 200 200 210
iv:Gr/Color/Patient2Tissue19= 3 200 200 240
iv:Gr/Color/Patient2Tissue20= 3 230 200 240
iv:Gr/Color/Patient2Tissue21= 3 230 230 240
iv:Gr/Color/Patient2Tissue22= 3 230 230 240
iv:Gr/Color/Patient2Tissue23= 3 240 240 240
iv:Gr/Color/Patient2Tissue24= 3 255 255 255
iv:Gr/Color/Patient2Tissue25= 3 100 100 100

Implant.txt

# Demonstrates use of a DICOM file.
# You must unzip DICOM_Box.zip before you run this example.
# Reads in and displays a simple test DICOM that represents
# a box of water in air
# and uses Layered Mass Geometry to overlay a titanium sphere "implant"
# onto this DICOM geomtry.
# The display writes very slowly to the screen.
# This will be improved in an upcoming new release.
# Until then, one useful trick is that if you iconize the graphics window,
# then un-inconize it when drawing is done, the drawing will go much faster.

includeFile = HUtoMaterialSchneider.txt

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Patient/Parent         = "World"
s:Ge/Patient/Material       = "G4_WATER"
d:Ge/Patient/TransX         = 0. m
d:Ge/Patient/TransY         = 0. m
d:Ge/Patient/TransZ         = 0. m
d:Ge/Patient/RotX           = 0. deg
d:Ge/Patient/RotY           = 0. deg
d:Ge/Patient/RotZ           = 0. deg
s:Ge/Patient/Type           = "TsDicomPatient"
s:Ge/Patient/DicomDirectory = "DICOM_Box"

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
#iv:Ge/Patient/ShowSpecificSlicesY = 1 -2
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -2

# Overlay implant in a parallel world using Layered Mass Geometry.
s:Ge/Implant/Type       = "TsSphere"
s:Ge/Implant/Parent     = "Patient"
b:Ge/Implant/IsParallel = "True"
s:Ge/Implant/Material   = "Titanium"
d:Ge/Implant/RMin       = 0. cm
d:Ge/Implant/RMax       = 5.0 cm
d:Ge/Implant/SPhi       = 0.0 deg
d:Ge/Implant/DPhi       = 360. deg
d:Ge/Implant/STheta     = 0 deg
d:Ge/Implant/DTheta     = 180 deg
d:Ge/Implant/TransX     = 0. cm
d:Ge/Implant/TransY     = 0. cm
d:Ge/Implant/TransZ     = 15. cm
d:Ge/Implant/RotX       = 0. deg
d:Ge/Implant/RotY       = 0.0 deg
d:Ge/Implant/RotZ       = 0. deg
s:Ge/Implant/Color      = "yellow"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
sv:Ph/Default/LayeredMassGeometryWorlds = 1 "Implant"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 30. MeV
u:So/Example/BeamEnergySpread         = 0.757504
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  = "None"
i:So/Example/NumberOfHistoriesInRun   = 300

# Graphics
s:Gr/ViewA/Type           = "OpenGL"
sv:Gr/ViewA/VisibleWorlds = 1 "All"

# Graphics options to handle complex voxel geometries
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 2100000
i:Gr/SwitchOGLtoOGLIifVoxelCountExceeds = 210

i:Ts/ShowHistoryCountAtInterval = 5000

b:Ts/PauseBeforeQuit = "False"

PatientInIEC_1.txt

####################################################
# Geometry parameters from plan
####################################################
#for plan
d:Ge/Gantry_Angle = 0.0 deg
d:Ge/Couch_Angle  = 0.0 deg

###################################################
# Coordination
###################################################o
# World: Fixed coordination in IEC
s:Ge/World/Material  = "G4_AIR"
d:Ge/World/HLX       = 0.6 m
d:Ge/World/HLY       = 0.6 m
d:Ge/World/HLZ       = 0.6 m

# IEC_G: Gantry
s:Ge/IEC_G/Parent  = "World"
s:Ge/IEC_G/Type    = "Group"
d:Ge/IEC_G/RotX    = 0. deg
dc:Ge/IEC_G/RotY    = 0. deg  # Here !!!
d:Ge/IEC_G/RotZ    = 0. deg
d:Ge/IEC_G/TransX  = 0. m
d:Ge/IEC_G/TransY  = 0. m
d:Ge/IEC_G/TransZ  = 0. m

# IEC_S: Patient support
s:Ge/IEC_S/Parent  = "World"
s:Ge/IEC_S/Type    = "Group"
d:Ge/IEC_S/RotX    = 0. deg
d:Ge/IEC_S/RotY    = 0. deg
dc:Ge/IEC_S/RotZ    = 0.0 deg # Here !!!
d:Ge/IEC_S/TransX  = 0. m
d:Ge/IEC_S/TransY  = 0. m
d:Ge/IEC_S/TransZ  = 0. m

# DICOM_to_IEC
s:Ge/DICOM_to_IEC/Type   = "Group"
s:Ge/DICOM_to_IEC/Parent = "IEC_S"
d:Ge/DICOM_to_IEC/TransX = 0 mm
d:Ge/DICOM_to_IEC/TransY = 0 mm
d:Ge/DICOM_to_IEC/TransZ = 0 mm
dc:Ge/DICOM_to_IEC/RotX   = 0.0 deg
d:Ge/DICOM_to_IEC/RotY   = 0.0  deg
d:Ge/DICOM_to_IEC/RotZ   = 0.0  deg


###################################################
##----  Beam setup   ----#
####################################################

#Beam is on Gantry coordination
Ge/BeamPosition/Parent = "IEC_G"
Ge/BeamPosition/TransZ = 25.0 cm

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 60.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 1. cm
d:So/Example/BeamPositionCutoffY      = 1. cm
d:So/Example/BeamPositionSpreadX      = 0.2 cm
d:So/Example/BeamPositionSpreadY      = 0.2 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

###################################################
# Visualization
####################################################

s:Gr/ViewA/Type        = "OpenGL"
i:Gr/ViewA/WindowSizeX = 900
i:Gr/ViewA/WindowSizeY = 900
d:Gr/ViewA/Theta       = 265 deg
d:Gr/ViewA/Phi         = -90 deg
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 1000000

s:Gr/ViewA/AxesComponent  = "World"
b:Gr/ViewA/IncludeAxes    = "true"
d:Gr/ViewA/AxesSize       = 30.0 cm
u:Gr/ViewA/Zoom           = 1.5

s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 10 deg

i:Ts/NumberOfThreads = 1

#Ts/UseQT="T"

####################################################
##------ Patient CT  -----
####################################################

# img-center
s:Ge/patient/Type   = "Group"
s:Ge/patient/Parent = "DICOM_to_IEC"
d:Ge/patient/TransX = 0.0 mm
d:Ge/patient/TransY = 0.0 mm
d:Ge/patient/TransZ = 0.0 mm
d:Ge/patient/RotX   = 0.0 deg   
d:Ge/patient/RotY   = 0.0 deg 
d:Ge/patient/RotZ   = 0.0 deg

# Sphere
s:Ge/patient_head/Type                 = "TsSphere"
s:Ge/patient_head/Parent               = "patient"
s:Ge/patient_head/Material             = "Air"
d:Ge/patient_head/TransZ               = 22 cm
d:Ge/patient_head/RMax                 = 5 cm
s:Ge/patient_head/DrawingStyle         = "FullWireFrame"
s:Ge/patient_head/Color                = "grass"

#
s:Ge/patient_body/Type                    = "G4Trd"
s:Ge/patient_body/Parent                  = "patient"
s:Ge/patient_body/Material                = "Air"
d:Ge/patient_body/TransX                  = 0 cm
d:Ge/patient_body/TransY                  = 0 cm
d:Ge/patient_body/TransZ                  = 0 cm
d:Ge/patient_body/RotX                    = 0 deg
d:Ge/patient_body/RotY                    = 0 deg
d:Ge/patient_body/RotZ                    = 0 deg
d:Ge/patient_body/HLX1                    = 6. cm
d:Ge/patient_body/HLX2                    = 10. cm
d:Ge/patient_body/HLY1                    = 2. cm
d:Ge/patient_body/HLY2                    = 2. cm
d:Ge/patient_body/HLZ                     = 15 cm
s:Ge/patient_body/Color                   = "violet"

#prescription-isocenter in body
s:Ge/patient_iso/Type                 = "TsSphere"
s:Ge/patient_iso/Parent               = "patient_body"
s:Ge/patient_iso/Material             = "Air"
d:Ge/patient_iso/RMax                 = 6.6 mm #2-sigma
s:Ge/patient_iso/DrawingStyle         = "solid"
s:Ge/patient_iso/Color                = "grass"
# Isocenter
d:Ge/patient_iso/TransX               = 5.0 cm  # here !!!
d:Ge/patient_iso/TransY               = 0.0 cm  # here !!!
d:Ge/patient_iso/TransZ               = 10.0 cm # here !!!


# Left arm
s:Ge/patient_larm/Type               = "TsCylinder"
s:Ge/patient_larm/Parent             = "patient"
s:Ge/patient_larm/Material           = "Air"
d:Ge/patient_larm/RMax               = 15 mm
d:Ge/patient_larm/HL                 = 7 cm
s:Ge/patient_larm/Color              = "red"
s:Ge/patient_larm/DrawingStyle       = "solid"

d:Ge/patient_larm/TransX             = 17.5 cm 
d:Ge/patient_larm/TransY             = 0 cm    
d:Ge/patient_larm/TransZ             = 12 cm   

d:Ge/patient_larm/RotX             = 0  deg
d:Ge/patient_larm/RotY             = 80 deg
d:Ge/patient_larm/RotZ             = 0 deg

# right arm
s:Ge/patient_rarm/Type               = "TsCylinder"
s:Ge/patient_rarm/Parent             = "patient"
s:Ge/patient_rarm/Material           = "Air"
d:Ge/patient_rarm/RMax               = Ge/patient_larm/RMax mm
d:Ge/patient_rarm/HL                 = Ge/patient_larm/HL cm
s:Ge/patient_rarm/Color              = "lightblue"
s:Ge/patient_rarm/DrawingStyle       = "solid"

d:Ge/patient_rarm/TransX             = -1.0 * Ge/patient_larm/TransX  cm
d:Ge/patient_rarm/TransY             = 0 cm
d:Ge/patient_rarm/TransZ             = Ge/patient_larm/TransZ cm

d:Ge/patient_rarm/RotX             = 0  deg
d:Ge/patient_rarm/RotY             = -1.0 * Ge/patient_larm/RotY deg 
d:Ge/patient_rarm/RotZ             = 0 deg

# Left leg
s:Ge/patient_lleg/Type               = "TsCylinder"
s:Ge/patient_lleg/Parent             = "patient"
s:Ge/patient_lleg/Material           = "Air"
d:Ge/patient_lleg/RMax               = 15 mm
d:Ge/patient_lleg/HL                 = 7 cm
s:Ge/patient_lleg/Color              = "red"
s:Ge/patient_lleg/DrawingStyle       = "solid"

d:Ge/patient_lleg/TransX             = 3 cm
d:Ge/patient_lleg/TransY             = 0 cm
d:Ge/patient_lleg/TransZ             = -23 cm

# right leg
s:Ge/patient_rleg/Type               = "TsCylinder"
s:Ge/patient_rleg/Parent             = "patient"
s:Ge/patient_rleg/Material           = "Air"
d:Ge/patient_rleg/RMax               = Ge/patient_lleg/RMax mm
d:Ge/patient_rleg/HL                 = Ge/patient_lleg/HL cm
s:Ge/patient_rleg/Color              = "lightblue"
s:Ge/patient_rleg/DrawingStyle       = "solid"

d:Ge/patient_rleg/TransX             = -1.0 * Ge/patient_lleg/TransX  cm
d:Ge/patient_rleg/TransY             = 0 cm
d:Ge/patient_rleg/TransZ             = Ge/patient_lleg/TransZ cm

Ts/PauseBeforeQuit = "True"

PatientInIEC_2_time_feature.txt

# PatientInIEC_2_time_feature : we rotate patient and gantry simulatenously using TimeFeature

includeFile = PatientInIEC_2.txt

# Gantry
s:Tf/rotation/Function           = "Linear deg"
d:Tf/rotation/Rate               = 5 deg/ms
d:Tf/rotation/StartValue         = 0.0 deg
d:Tf/rotation/RepetitionInterval = 60. ms

Ge/IEC_G/RotY         = Tf/rotation/Value deg 
Ge/IEC_S/RotZ         = Tf/rotation/Value deg # step3: 60 deg ?

d:Tf/TimelineEnd             = 60.0 ms
i:Tf/NumberOfSequentialTimes = 60

PatientInIEC_2.txt

# PatientInIEC_2 : we place a patient to treatment room.

# Fix for iso-center
# Fix for DICOM to IEC
# Fix for Gantry rotation : 60 deg
# Fix for Couch  rotation : 90 deg

includeFile = PatientInIEC_1.txt

# step 1
Ge/patient/TransX = -1.0 * Ge/patient_iso/TransX mm
Ge/patient/TransY = -1.0 * Ge/patient_iso/TransY mm
Ge/patient/TransZ = -1.0 * Ge/patient_iso/TransZ mm

Ge/DICOM_to_IEC/RotX  = 90.0 deg # step 2: 90.0 deg

Ge/IEC_G/RotY         = 60.0 deg # step3: 60 deg ?

# Couch (patient support)
Ge/IEC_S/RotZ         = 45.0 deg # step4: 90 deg ? 

s:Sc/DoseAtPhantom1/Quantity    = "DoseToWater"
s:Sc/DoseAtPhantom1/Component   = "patient_rleg"
s:Sc/DoseAtPhantom1/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/DoseAtPhantom1/OutputAfterRun = "True"

PatientInIEC_3.txt

# PatientInIEC_3 : we place a beam to DICOM

includeFile = PatientInIEC_1.txt

# step 1 : Fix patient to world

Ge/patient/Parent = "World"

# step 2 : place IEC_G on IEC_S 

Ge/DICOM_to_IEC/Parent = "World"
Ge/IEC_S/Parent        = "DICOM_to_IEC"
Ge/IEC_G/Parent        = "IEC_S"

# step 3 : Gantry  
Ge/IEC_G/RotY         = 60.0 deg # 60 deg ?

# step 4 Couch (patient support)
Ge/IEC_S/RotZ         = -45.0 deg # -90 deg ? 

# step 5 rotation
Ge/DICOM_to_IEC/RotX  = -90 deg

# step 6 translational movement
Ge/DICOM_to_IEC/TransX = Ge/patient_iso/TransX mm
Ge/DICOM_to_IEC/TransY = Ge/patient_iso/TransY mm
Ge/DICOM_to_IEC/TransZ = Ge/patient_iso/TransZ mm

TwoDicoms.txt

# Demonstrates use of a DICOM file.
# You must unzip Abdomen.zip before you run this example.
# Reads in and displays a 3 slice scan of an abdomen.
# The display writes very slowly to the screen.
# This will be improved in an upcoming new release.
# Until then, one useful trick is that if you iconize the graphics window,
# then un-inconize it when drawing is done, the drawing will go much faster.

includeFile = HUtoMaterialSchneider.txt
includeFile = HUtoMaterialSchneider2.txt

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Patient/Parent             = "World"
s:Ge/Patient/Material           = "G4_WATER"
s:Ge/Patient/Type               = "TsDicomPatient"
d:Ge/Patient/TransX             = 0. m
d:Ge/Patient/TransY             = 0. m
d:Ge/Patient/TransZ             = 0. m
d:Ge/Patient/RotX               = 0. deg
d:Ge/Patient/RotY               = 0. deg
d:Ge/Patient/RotZ               = 0. deg
s:Ge/Patient/DicomDirectory     = "Abdomen"
sv:Ge/Patient/DicomModalityTags = 1 "CT"
b:Ge/Patient/SchneiderUseVariableDensityMaterials = "True"

s:Ge/Patient2/Parent             = "World"
s:Ge/Patient2/Material           = "G4_WATER"
s:Ge/Patient2/Type               = "TsDicomPatient"
d:Ge/Patient2/TransX             = 0. m
d:Ge/Patient2/TransY             = 0. m
d:Ge/Patient2/TransZ             = 1. m
d:Ge/Patient2/RotX               = 0. deg
d:Ge/Patient2/RotY               = 0. deg
d:Ge/Patient2/RotZ               = 0. deg
s:Ge/Patient2/DicomDirectory     = "DICOM_Box"
sv:Ge/Patient2/DicomModalityTags = 1 "CT"
b:Ge/Patient2/SchneiderUseVariableDensityMaterials = "True"

Ts/DumpNonDefaultParameters = "True"

# Restrict which voxels are loaded.
# This will speed things up for purposes of this demonstration,
# but also changes simulation results, as only part of the DICOM
# will be loaded. Take care when using this feature in your research.
#i:Ge/Patient/RestrictVoxelsXMin = 200
#i:Ge/Patient/RestrictVoxelsYMin = 200
#i:Ge/Patient/RestrictVoxelsXMax = 400
#i:Ge/Patient/RestrictVoxelsYMax = 400

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
#iv:Ge/Patient/ShowSpecificSlicesY = 1 -2
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -1

# Simplify physics for faster start of this demonstration
#sv:Ph/Default/Modules = 1 "transportation_only"
sv:Ph/Default/Modules = 1 "g4em-standard_opt4"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 0
Ts/ShowHistoryCountAtInterval = 100
#Ts/NumberOfThreads = 4

#s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Patient"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/DoseAtPhantom/Report = 8 "Sum" "Mean" "Count_in_bin" "Second_Moment" "Variance" "Standard_Deviation" "Min" "Max"

s:Gr/ViewA/Type        = "OpenGL"
i:Gr/ViewA/WindowSizeX = 900
i:Gr/ViewA/WindowSizeY = 900
d:Gr/ViewA/Theta       = 70 deg
d:Gr/ViewA/Phi         = 10 deg
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 100000000

Ts/PauseBeforeInit = "F"
Ts/PauseBeforeSequence = "F"
Ts/PauseBeforeQuit = "True"

ViewAbdomen_rtdose.txt

# Demonstrates use of a DICOM file.
# You must unzip Abdomen.zip before you run this example.
# Reads in and displays a 3 slice scan of an abdomen.
# The display writes very slowly to the screen.
# This will be improved in an upcoming new release.
# Until then, one useful trick is that if you iconize the graphics window,
# then un-inconize it when drawing is done, the drawing will go much faster.

# This example has three blocks of component definition to mimic beam delivery to a patient in a treatment room.

# 1. Coordination definition
# 2. Plan information: Gantry angle, couch angle, Plan Isocenter
# 2. DICOM Patient:
# 3. Beam setup
# 4. Dosegrid setup

includeFile = HUtoMaterialSchneider.txt


###################################################
# Coordination
###################################################
# World: Fixed coordination in IEC
s:Ge/World/Material  = "G4_AIR"
d:Ge/World/HLX       = 0.6 m
d:Ge/World/HLY       = 0.6 m
d:Ge/World/HLZ       = 0.6 m
b:Ge/World/Invisible = "T"
# IEC_G: Gantry
s:Ge/IEC_G/Parent  = "World"
s:Ge/IEC_G/Type    = "Group"
d:Ge/IEC_G/RotX    = 0. deg
d:Ge/IEC_G/RotY    = -1.0 * Ge/Gantry_Angle deg
d:Ge/IEC_G/RotZ    = 0. deg
d:Ge/IEC_G/TransX  = 0. m
d:Ge/IEC_G/TransY  = 0. m
d:Ge/IEC_G/TransZ  = 0. m

# IEC_S: Patient support
s:Ge/IEC_S/Parent  = "World"
s:Ge/IEC_S/Type    = "Group"
d:Ge/IEC_S/RotX    = 0. deg
d:Ge/IEC_S/RotY    = 0. deg
d:Ge/IEC_S/RotZ    = Ge/Couch_Angle deg
d:Ge/IEC_S/TransX  = 0. m
d:Ge/IEC_S/TransY  = 0. m
d:Ge/IEC_S/TransZ  = 0. m

# DICOM_to_IEC
s:Ge/DICOM_to_IEC/Type   = "Group"
s:Ge/DICOM_to_IEC/Parent = "IEC_S"
d:Ge/DICOM_to_IEC/TransX = 0 mm
d:Ge/DICOM_to_IEC/TransY = 0 mm
d:Ge/DICOM_to_IEC/TransZ = 0 mm
d:Ge/DICOM_to_IEC/RotX   = 90.0 deg
d:Ge/DICOM_to_IEC/RotY   = 0.0  deg
d:Ge/DICOM_to_IEC/RotZ   = 0.0  deg

####################################################
# Geometry parameters from plan
####################################################
#for plan
d:Ge/Gantry_Angle = 170.0 deg
d:Ge/Couch_Angle  = 0.0 deg

#Geant4: Abdomen CT's isocenter
d:Ge/IsoCenterX   = 15.3125 mm
d:Ge/IsoCenterY   = 206.7656 mm
d:Ge/IsoCenterZ   = -92.5 mm

#Beam is on Gantry coordination
Ge/BeamPosition/Parent = "IEC_G"
Ge/BeamPosition/TransZ = 25.0 cm

###################################################
#  Patient in DICOM
####################################################

s:Ge/Patient/Parent   = "DICOM_to_IEC"
s:Ge/Patient/Type     = "TsDicomPatient"
s:Ge/Patient/Material = "G4_WATER"
d:Ge/Patient/RotX     = 0.0 deg
d:Ge/Patient/RotY     = 0.0 deg
d:Ge/Patient/RotZ     = 0.0 deg
s:Ge/Patient/HUtoMaterialConversionMethod = "Schneider"

# Transient parametes
# DicomOrigin: a vector to CT cube's center
# note: patient positioning is properly done when the simulation starts
dc:Ge/Patient/DicomOriginX  = 0.0 mm
dc:Ge/Patient/DicomOriginY  = 0.0 mm
dc:Ge/Patient/DicomOriginZ  = 0.0 mm

d:Ge/Patient/TransX   = Ge/Patient/DicomOriginX - Ge/IsoCenterX mm
d:Ge/Patient/TransY   = Ge/Patient/DicomOriginY - Ge/IsoCenterY mm
d:Ge/Patient/TransZ   = Ge/Patient/DicomOriginZ - Ge/IsoCenterZ mm

s:Ge/Patient/DicomDirectory      = "Abdomen"

# Create a parallel grid for scroing. "Patient/RTDoseGrid"
# you have three options to create RTDoseGrid
# option 1 : You can create  same size from DICOM-RT Dose
# s:Ge/Patient/CloneRTDoseGridFrom = Ge/Patient/DicomDirectory + "/rtdose.dcm"

# option 2 : You can redefine size from DICOM-RT Dose but keep same position
# s:Ge/Patient/CloneRTDoseGridFrom = Ge/Patient/DicomDirectory + "/rtdose.dcm"
# dv:Ge/Patient/CloneRTDoseGridSize = 3 5 5 8 mm

# option 3 : If you don't have RT-Dose, simply specify the pixel size.
 dv:Ge/Patient/CloneRTDoseGridSize = 3 5 5 5 mm

b:Ge/Patient/IgnoreInconsistentFrameOfReferenceUID = "True"

sv:Ge/Patient/DicomModalityTags = 1 "CT"

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
#iv:Ge/Patient/ShowSpecificSlicesY = 1 -2
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -1


###################################################
##----  Beam setup   ----#
####################################################

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 60.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 1. cm
d:So/Example/BeamPositionCutoffY      = 1. cm
d:So/Example/BeamPositionSpreadX      = 0.2 cm
d:So/Example/BeamPositionSpreadY      = 0.2 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

###################################################
# Dose calculation
####################################################
# scoring dose on DoseGrid from RTDOSE
# "Patient/RTDose"

s:Sc/DoseOnRTGrid/Quantity                  = "DoseToMedium"
s:Sc/DoseOnRTGrid/Component                 = "Patient/RTDoseGrid"
b:Sc/DoseOnRTGrid/OutputToConsole           = "F"
s:Sc/DoseOnRTGrid/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseOnRTGrid/OutputType                = "DICOM"
b:Sc/DoseOnRTGrid/DICOMOutput32BitsPerPixel = "True"

###################################################
# Visualization
####################################################

s:Gr/ViewA/Type        = "OpenGL"
i:Gr/ViewA/WindowSizeX = 900
i:Gr/ViewA/WindowSizeY = 900
d:Gr/ViewA/Theta       = 265 deg
d:Gr/ViewA/Phi         = -90 deg
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 1000000

s:Gr/ViewA/AxesComponent  = "World"
b:Gr/ViewA/IncludeAxes    = "true"
d:Gr/ViewA/AxesSize       = 30.0 cm
u:Gr/ViewA/Zoom           = 1.5

s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 10 deg

i:Ts/NumberOfThreads = 1

ViewAbdomen.txt

# Demonstrates use of a DICOM file.
# You must unzip Abdomen.zip before you run this example.
# Reads in and displays a 3 slice scan of an abdomen.
# The display writes very slowly to the screen.
# This will be improved in an upcoming new release.
# Until then, one useful trick is that if you iconize the graphics window,
# then un-inconize it when drawing is done, the drawing will go much faster.

includeFile = HUtoMaterialSchneider.txt

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Patient/Parent             = "World"
s:Ge/Patient/Material           = "G4_WATER"
s:Ge/Patient/Type               = "TsDicomPatient"
d:Ge/Patient/TransX             = 0. m
d:Ge/Patient/TransY             = 0. m
d:Ge/Patient/TransZ             = 0. m
d:Ge/Patient/RotX               = 0. deg
d:Ge/Patient/RotY               = 0. deg
d:Ge/Patient/RotZ               = 0. deg
s:Ge/Patient/DicomDirectory     = "Abdomen"
sv:Ge/Patient/DicomModalityTags = 1 "CT"

# Restrict which voxels are loaded.
# This will speed things up for purposes of this demonstration,
# but also changes simulation results, as only part of the DICOM
# will be loaded. Take care when using this feature in your research.
i:Ge/Patient/RestrictVoxelsXMin = 200
i:Ge/Patient/RestrictVoxelsYMin = 200
i:Ge/Patient/RestrictVoxelsXMax = 400
i:Ge/Patient/RestrictVoxelsYMax = 400

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
#iv:Ge/Patient/ShowSpecificSlicesY = 1 -2
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -1

# Simplify physics for faster start of this demonstration
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/ViewA/Type        = "OpenGL"
i:Gr/ViewA/WindowSizeX = 900
i:Gr/ViewA/WindowSizeY = 900
d:Gr/ViewA/Theta       = 70 deg
d:Gr/ViewA/Phi         = 10 deg
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 1000000

XCAT_Materials.txt

# XCAT Material Definitions
# (any spaces in material name from XCAT log file are replaced with underscores)

# Temporarily, all are actually water, just with different colors

sv:Ma/XCAT_Air/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Air/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Air/Density 			= 1.0 g/cm3
s:Ma/XCAT_Air/DefaultColor 			= "TransparentBlack"
iv:Gr/Color/TransparentBlack = 4 0 0 0 0

sv:Ma/XCAT_Body_(water)/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Body_(water)/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Body_(water)/Density 		= 1.0 g/cm3
d:Ma/XCAT_Body_(water)/MeanExcitationEnergy 	= 75.0 eV
s:Ma/XCAT_Body_(water)/DefaultColor 		= "blue"

sv:Ma/XCAT_Muscle/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Muscle/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Muscle/Density 			= 1.0 g/cm3
s:Ma/XCAT_Muscle/DefaultColor 			= "orange"

sv:Ma/XCAT_Adipose_(fat)/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Adipose_(fat)/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Adipose_(fat)/Density 		= 1.0 g/cm3
s:Ma/XCAT_Adipose_(fat)/DefaultColor 		= "yellow"

sv:Ma/XCAT_Lung/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Lung/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Lung/Density 			= 1.0 g/cm3
s:Ma/XCAT_Lung/DefaultColor 			= "skyblue"

sv:Ma/XCAT_Spine_Bone/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Spine_Bone/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Spine_Bone/Density 			= 1.0 g/cm3
s:Ma/XCAT_Spine_Bone/DefaultColor 		= "white"

sv:Ma/XCAT_Rib_Bone/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Rib_Bone/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Rib_Bone/Density 			= 1.0 g/cm3
s:Ma/XCAT_Rib_Bone/DefaultColor 		= "grey"

sv:Ma/XCAT_Blood/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Blood/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Blood/Density 			= 1.0 g/cm3
s:Ma/XCAT_Blood/DefaultColor 			= "blue"

sv:Ma/XCAT_Heart/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Heart/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Heart/Density 			= 1.0 g/cm3
s:Ma/XCAT_Heart/DefaultColor 			= "red"

sv:Ma/XCAT_Kidney/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Kidney/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Kidney/Density 			= 1.0 g/cm3
s:Ma/XCAT_Kidney/DefaultColor 			= "red"

sv:Ma/XCAT_Liver/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Liver/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Liver/Density 			= 1.0 g/cm3
s:Ma/XCAT_Liver/DefaultColor 			= "red"

sv:Ma/XCAT_Lymph/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Lymph/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Lymph/Density 			= 1.0 g/cm3
s:Ma/XCAT_Lymph/DefaultColor 			= "green"

sv:Ma/XCAT_Pancreas/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Pancreas/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Pancreas/Density 			= 1.0 g/cm3
s:Ma/XCAT_Pancreas/DefaultColor 		= "red"

sv:Ma/XCAT_Spleen/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Spleen/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Spleen/Density 			= 1.0 g/cm3
s:Ma/XCAT_Spleen/DefaultColor 			= "red"

sv:Ma/XCAT_Intestine/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Intestine/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Intestine/Density 			= 1.0 g/cm3
s:Ma/XCAT_Intestine/DefaultColor 		= "yellow"

sv:Ma/XCAT_Skull/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Skull/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Skull/Density 			= 1.0 g/cm3
s:Ma/XCAT_Skull/DefaultColor 			= "grey"

sv:Ma/XCAT_Cartilage/Components 		= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Cartilage/Fractions  		= 2 0.111894 0.888106
d:Ma/XCAT_Cartilage/Density 			= 1.0 g/cm3
s:Ma/XCAT_Cartilage/DefaultColor 		= "grey"

sv:Ma/XCAT_Brain/Components 			= 2 "Hydrogen" "Oxygen"
uv:Ma/XCAT_Brain/Fractions  			= 2 0.111894 0.888106
d:Ma/XCAT_Brain/Density 			= 1.0 g/cm3
s:Ma/XCAT_Brain/DefaultColor 			= "grey"

XCAT.txt

# Demonstrates scoring in an XCAT file.

s:Ge/Patient/Type		= "TsImageCube"
s:Ge/Patient/InputDirectory	= "./"
s:Ge/Patient/InputFile		= "XCAT_FullMouse_86x86x161_atn_1.bin"
s:Ge/Patient/MetaDataFile	= "XCAT_FullMouse_86x86x161_atn_1.log"
s:Ge/Patient/ImagingToMaterialConverter = "XCAT_Attenuation" # "XCAT_Activity"
includeFile = XCAT_Materials.txt

# These parameters are only used if no MetaDataFile is provided.
i:Ge/Patient/NumberOfVoxelsX	= 86
i:Ge/Patient/NumberOfVoxelsY	= 86
i:Ge/Patient/NumberOfVoxelsZ	= 161
d:Ge/Patient/VoxelSizeX	= .5 mm
d:Ge/Patient/VoxelSizeY	= .5 mm
dv:Ge/Patient/VoxelSizeZ = 1 .5 mm

s:Ge/Patient/DataType = "FLOAT"
u:Ge/Patient/AttenuationForMaterial_XCAT_Air = 0.
u:Ge/Patient/AttenuationForMaterial_XCAT_Body_(water)   =     203.8293
u:Ge/Patient/AttenuationForMaterial_XCAT_Muscle         =     195.2515
u:Ge/Patient/AttenuationForMaterial_XCAT_Adipose_(fat)  =     114.9825
u:Ge/Patient/AttenuationForMaterial_XCAT_Lung           =      57.5347
u:Ge/Patient/AttenuationForMaterial_XCAT_Spine_Bone     =     225.7159
u:Ge/Patient/AttenuationForMaterial_XCAT_Rib_Bone       =     283.3633
u:Ge/Patient/AttenuationForMaterial_XCAT_Blood          =     201.7046
u:Ge/Patient/AttenuationForMaterial_XCAT_Heart          =     195.6546
u:Ge/Patient/AttenuationForMaterial_XCAT_Kidney         =     196.5382
u:Ge/Patient/AttenuationForMaterial_XCAT_Liver          =     197.4710
u:Ge/Patient/AttenuationForMaterial_XCAT_Lymph          =     204.0590
u:Ge/Patient/AttenuationForMaterial_XCAT_Pancreas       =     190.0039
u:Ge/Patient/AttenuationForMaterial_XCAT_Spleen         =     200.6941
u:Ge/Patient/AttenuationForMaterial_XCAT_Intestine      =     195.1612
u:Ge/Patient/AttenuationForMaterial_XCAT_Skull          =     247.5866
u:Ge/Patient/AttenuationForMaterial_XCAT_Cartilage      =     208.0629
u:Ge/Patient/AttenuationForMaterial_XCAT_Brain          =     192.2248

s:Ge/Patient/Parent   = "World"
d:Ge/Patient/TransX   = 0. m
d:Ge/Patient/TransY   = 0. m
d:Ge/Patient/TransZ   = 0. m
d:Ge/Patient/RotX     = 0. deg
d:Ge/Patient/RotY     = 0. deg
d:Ge/Patient/RotZ     = 0. deg

# Specify which slices to show.
# Comment this out or set to zero to show all slices.
# Set to -1 to show only center slice.
# Set to -2 to show first, center and last slice.
#iv:Ge/Patient/ShowSpecificSlicesX = 1 -2
#iv:Ge/Patient/ShowSpecificSlicesY = 1 -2
iv:Ge/Patient/ShowSpecificSlicesZ = 9 1 21 41 61 81 101 121 141 161

s:Ge/World/Material    = "G4_AIR"
d:Ge/World/HLX         = .5 m
d:Ge/World/HLY         = .5 m
d:Ge/World/HLZ         = .5 m
b:Ge/World/Invisible   = "TRUE"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 70. MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 5. mm
d:So/Example/BeamPositionCutoffY      = 5. mm
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/ViewA/Type           = "OpenGL"
i:Gr/ViewA/WindowSizeX    = 900
i:Gr/ViewA/WindowSizeY    = 900
d:Gr/ViewA/Theta          = 60 deg
d:Gr/ViewA/Phi            = 10 deg

# Extra graphics options to handle complex voxel geometries
i:Gr/ShowOnlyOutlineIfVoxelCountExceeds = 210000000

i:Ts/ShowHistoryCountAtInterval = 100

b:Ts/PauseBeforeQuit = "True"

PhaseSpace

MultiRun_Write_ASCII.txt

# Writes phase space separately for several time intervals

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                     = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                  = "ASCII" # ASCII or Binary
s:Sc/PhaseSpaceAtVacFilm/OutputFile                  = "ASCIIOutput"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesGoing  = "In"
b:Sc/PhaseSpaceAtVacFilm/IncludeRunID                = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeEventID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTrackID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTime                 = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeSeed                 = "True"
#sv:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesNamed = 1 "Proton"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists   = "Overwrite" # Exit, Overwrite or Increment
b:Sc/PhaseSpaceAtVacFilm/OutputAfterRun              = "True"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

d:Tf/TimelineEnd             = 100.0 ms
i:Tf/NumberOfSequentialTimes = 4

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

ReadASCII.txt

# Read phase space in TOPAS ASCII form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:So/Example/Type                            = "PhaseSpace"
s:So/Example/PhaseSpaceFileName              = "ASCIIOutput"
s:So/Example/Component                       = "World"
#i:So/Example/PhaseSpaceMultipleUse          = 2
b:So/Example/PhaseSpaceIncludeEmptyHistories = "True"

# Graphics
s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

ReadBinary.txt

# Read phase space in TOPAS Binary form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:So/Example/Type                            = "PhaseSpace"
s:So/Example/PhaseSpaceFileName              = "BinaryOutput"
s:So/Example/Component                       = "World"
#i:So/Example/PhaseSpaceMultipleUse          = 2
b:So/Example/PhaseSpaceIncludeEmptyHistories = "True"

# Graphics
s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

ReadLimited.txt

# Read phase space in Limited form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:So/Example/Type                            = "PhaseSpace"
s:So/Example/PhaseSpaceFileName              = "LimitedOutput"
s:So/Example/Component                       = "World"
#i:So/Example/PhaseSpaceMultipleUse          = 2
b:So/Example/PhaseSpaceIncludeEmptyHistories = "True"

# Graphics
s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

ReadElekta.txt

# Reads an example file from the IAEA phase space database.
# https://www-nds.iaea.org/phsp/phsp.htmlx
#
# To run this example:
# Download the header and phase space files that have the name:
# ELEKTA_PRECISE_10mv_part1
# Rename the .IAEAheader file to be .header
# Rename the .IAEAphsp file to be .phsp
#
# To make this example run faster, it is set to
# turn off the PreCheck function
# and reads only the first 5 histories from the file.

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:So/Example/Type                            = "PhaseSpace"
s:So/Example/PhaseSpaceFileName              = "ELEKTA_PRECISE_10mv_part1"
s:So/Example/Component                       = "World"
#b:So/Example/LimitedAssumeFirstParticleIsNewHistory = "true"
#b:So/Example/LimitedAssumeEveryParticleIsNewHistory = "true"
#b:So/Example/LimitedAssumePhotonIsNewHistory = "true"
i:So/Example/PhaseSpaceMultipleUse = 0
i:So/Example/NumberOfHistoriesInRun = 5
i:So/Example/PreCheckShowParticleCountAtInterval = 100000
b:So/Example/PhaseSpacePreCheck = "False"


# Graphics
s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

ReadVarian.txt

# Reads an example of what we believe to be a malformed file
# from the IAEA phase space database.
# https://www-nds.iaea.org/phsp/phsp.htmlx
#
# We consider this file malformed because, as far as we can tell,
# it is entirely missing the required New History flags,
# and the first particle in the file is a proton,
# even though the header file indicates that there are no protons.
#
# TOPAS is still able to read this file by using the special options:
# b:So/Example/LimitedAssumeFirstParticleIsNewHistory = "true"
# and
# b:So/Example/LimitedAssumePhotonIsNewHistory = "true"
#
# You could also make it run by turning off those two options
# and instead using the special option:
# b:So/Example/LimitedAssumeEveryParticleIsNewHistory = "true"
#
# To run this example:
# Download the header and phase space files that have the name:
# Varian_TrueBeam6MV_01
# Rename the .IAEAheader file to be .header
# Rename the .IAEAphsp file to be .phsp
#
# To make this example run faster, it is set to
# turn off the PreCheck function
# and reads only the first 5 histories from the file.

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:So/Example/Type                            = "PhaseSpace"
s:So/Example/PhaseSpaceFileName              = "Varian_TrueBeam6MV_01"
s:So/Example/Component                       = "World"
b:So/Example/LimitedAssumeFirstParticleIsNewHistory = "true"
#b:So/Example/LimitedAssumeEveryParticleIsNewHistory = "true"
b:So/Example/LimitedAssumePhotonIsNewHistory = "true"
i:So/Example/PhaseSpaceMultipleUse = 0
i:So/Example/NumberOfHistoriesInRun = 5
b:So/Example/PhaseSpacePreCheck = "False"
i:So/Example/PreCheckShowParticleCountAtInterval = 100000


# Graphics
s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

WriteASCII.txt

# Write phase space in TOPAS ASCII form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                     = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                  = "ASCII" # ASCII, Binary, Limited or ROOT
s:Sc/PhaseSpaceAtVacFilm/OutputFile                  = "ASCIIOutput"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesGoing  = "In"
b:Sc/PhaseSpaceAtVacFilm/IncludeTOPASTime            = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTimeOfFlight         = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeRunID                = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeEventID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTrackID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeParentID             = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeCreatorProcess       = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeVertexInfo           = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeSeed                 = "True"
#sv:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesNamed = 1 "Proton"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists   = "Overwrite"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

WriteBinary.txt

# Write phase space in TOPAS Binary form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                     = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                  = "Binary" # ASCII, Binary, Limited or ROOT
s:Sc/PhaseSpaceAtVacFilm/OutputFile                  = "BinaryOutput"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesGoing  = "In"
b:Sc/PhaseSpaceAtVacFilm/IncludeTOPASTime            = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTimeOfFlight         = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeRunID                = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeEventID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTrackID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeParentID             = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeVertexInfo           = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeSeed                 = "True"
#sv:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesNamed = 1 "Proton"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists   = "Overwrite"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

WriteIonsASCII.txt

# Write ASCII phase space with ion beam

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "Vacuum"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                   = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole            = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                    = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                 = "ASCII" # ASCII, Binary, Limited or ROOT
s:Sc/PhaseSpaceAtVacFilm/OutputFile                 = "ASCIIOutput"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize           = 1000
sv:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesNamed = 1 "GenericIon(3,7)"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists  = "Overwrite"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:Ph/Default/Type = "QGSP_BIC_HP"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "GenericIon(3,7)"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 4

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

WriteLimited.txt

# Write phase space in Limited form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                     = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                  = "Limited" # ASCII, Binary, Limited or ROOT
s:Sc/PhaseSpaceAtVacFilm/OutputFile                  = "LimitedOutput"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesGoing  = "In"
b:Sc/PhaseSpaceAtVacFilm/IncludeTOPASTime            = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTimeOfFlight         = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeRunID                = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeEventID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTrackID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeParentID             = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeVertexInfo           = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeSeed                 = "True"
#sv:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesNamed = 1 "Proton"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists   = "Overwrite"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

WriteROOT.txt

# Write phase space in TOPAS ASCII form

b:Ge/World/Invisible = "TRUE"

s:Ge/VacFilm/Type     = "TsBox"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/HLX      = 50.0 cm
d:Ge/VacFilm/HLY      = 50.0 cm
d:Ge/VacFilm/HLZ      = 1.0 cm
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0. deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

s:Sc/PhaseSpaceAtVacFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtVacFilm/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtVacFilm/Surface                     = "VacFilm/ZMinusSurface"
s:Sc/PhaseSpaceAtVacFilm/OutputType                  = "ROOT" # ASCII, Binary, Limited or ROOT
s:Sc/PhaseSpaceAtVacFilm/OutputFile                  = "ROOTOutput"
i:Sc/PhaseSpaceAtVacFilm/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesGoing  = "In"
b:Sc/PhaseSpaceAtVacFilm/IncludeTOPASTime            = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTimeOfFlight         = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeRunID                = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeEventID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeTrackID              = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeParentID             = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeVertexInfo           = "True"
b:Sc/PhaseSpaceAtVacFilm/IncludeSeed                 = "True"
#sv:Sc/PhaseSpaceAtVacFilm/OnlyIncludeParticlesNamed = 1 "Proton"
s:Sc/PhaseSpaceAtVacFilm/IfOutputFileAlreadyExists   = "Overwrite"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

Scoring

ChargeInSphere.txt

# Score charge in a sphere

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Sphere/Type         = "TsSphere"
s:Ge/Sphere/Parent       = "World"
s:Ge/Sphere/Material     = "Air"
d:Ge/Sphere/RMax         = 55.0 cm
s:Ge/Sphere/DrawingStyle = "FullWireFrame"

s:Sc/Charge/Quantity                          = "Charge"
s:Sc/Charge/Component                         = "Sphere"
b:Sc/Charge/OutputToConsole                   = "TRUE"
s:Sc/Charge/IfOutputFileAlreadyExists         = "Overwrite"
sv:Sc/Charge/OnlyIncludeParticlesNamed        = 1 "proton"
#s:Sc/Charge/OnlyIncludeParticlesOfGeneration  = "secondary"

s:Gr/ViewA/Type = "OpenGL"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 500

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

Complex.txt

# A complex example showing lots of different scorers and options.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Film/Type     = "TsBox"
s:Ge/Film/Parent   = "World"
s:Ge/Film/Material = "G4_WATER"
d:Ge/Film/HLX      = 50.0 cm
d:Ge/Film/HLY      = 50.0 cm
d:Ge/Film/HLZ      = 1.0 cm
d:Ge/Film/TransX   = 0. cm
d:Ge/Film/TransY   = 0. cm
d:Ge/Film/TransZ   = 0. cm
d:Ge/Film/RotX     = 0. deg
d:Ge/Film/RotY     = 0. deg
d:Ge/Film/RotZ     = 0. deg
s:Ge/Film/Color    = "skyblue"

s:Ge/Phantom1/Type     = "TsBox"
s:Ge/Phantom1/Parent   = "World"
s:Ge/Phantom1/Material = "G4_WATER"
d:Ge/Phantom1/HLX      = 30.0 cm
d:Ge/Phantom1/HLY      = 30.0 cm
d:Ge/Phantom1/HLZ      = 1.1 cm
d:Ge/Phantom1/TransZ   = -30. cm

s:Ge/Phantom2/Type     = "TsBox"
s:Ge/Phantom2/Parent   = "World"
s:Ge/Phantom2/Material = "G4_WATER"
d:Ge/Phantom2/HLX      = 10.0 cm
d:Ge/Phantom2/HLY      = 10.0 cm
d:Ge/Phantom2/HLZ      = 10.0 cm
d:Ge/Phantom2/TransZ   = -50. cm
s:Ge/Phantom2/Color    = "red"
i:Ge/Phantom2/XBins    = 2
i:Ge/Phantom2/YBins    = 2
i:Ge/Phantom2/ZBins    = 1

s:Sc/PhaseSpaceAtFilm/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtFilm/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtFilm/Surface                     = "Film/ZMinusSurface"
s:Sc/PhaseSpaceAtFilm/OutputType                  = "ASCII" # ASCII or Binary
i:Sc/PhaseSpaceAtFilm/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtFilm/OnlyIncludeParticlesGoing  = "In"
b:Sc/PhaseSpaceAtFilm/IncludeRunID                = "True"
b:Sc/PhaseSpaceAtFilm/IncludeEventID              = "True"
b:Sc/PhaseSpaceAtFilm/IncludeTrackID              = "True"
b:Sc/PhaseSpaceAtFilm/IncludeTime                 = "True"
#sv:Sc/PhaseSpaceAtFilm/OnlyIncludeParticlesNamed = 1 "Proton"
s:Sc/PhaseSpaceAtFilm/IfOutputFileAlreadyExists   = "Increment" # Exit, Overwrite or Increment

s:Sc/PhaseSpaceAtFilmb/Quantity                    = "PhaseSpace"
b:Sc/PhaseSpaceAtFilmb/OutputToConsole             = "True"
s:Sc/PhaseSpaceAtFilmb/Surface                     = "Film/ZMinusSurface"
s:Sc/PhaseSpaceAtFilmb/OutputType                  = "binary" # ASCII or Binary
i:Sc/PhaseSpaceAtFilmb/OutputBufferSize            = 1000
#s:Sc/PhaseSpaceAtFilmb/OnlyIncludeParticlesGoing  = "In"
#sv:Sc/PhaseSpaceAtFilmb/OnlyIncludeParticlesNamed = 1 "Proton"

s:Sc/DoseAtPhantom1/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom1/Component                 = "Phantom1"
s:Sc/DoseAtPhantom1/OutputFile                = "DoseAtPhantom1"
s:Sc/DoseAtPhantom1/OutputType                = "csv"
b:Sc/DoseAtPhantom1/OutputToConsole           = "TRUE"
b:Sc/DoseAtPhantom1/Visualize                 = "TRUE"
s:Sc/DoseAtPhantom1/IfOutputFileAlreadyExists = "Increment" # Exit, Overwrite or Increment
sv:Sc/DoseAtPhantom1/Report = 8 "Sum" "Mean" "Count_in_bin" "Second_Moment" "Variance" "Standard_Deviation" "Min" "Max"
i:Sc/DoseAtPhantom1/ZBins = 10

s:Sc/DoseAtPhantom1b/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom1b/Component                 = "Phantom1"
s:Sc/DoseAtPhantom1b/OutputFile                = "DoseAtPhantom1b"
s:Sc/DoseAtPhantom1b/OutputType                = "binary"
b:Sc/DoseAtPhantom1b/OutputToConsole           = "TRUE"
b:Sc/DoseAtPhantom1b/Visualize                 = "TRUE"
s:Sc/DoseAtPhantom1b/IfOutputFileAlreadyExists = "Increment" # Exit, Overwrite or Increment
sv:Sc/DoseAtPhantom1b/Report = 8 "Sum" "Mean" "Count_in_bin" "Second_Moment" "Variance" "Standard_Deviation" "Min" "Max"

s:Sc/EnergyDepAtPhantom1/Quantity                  = "EnergyDeposit"
s:Sc/EnergyDepAtPhantom1/Component                 = "Phantom1"
s:Sc/EnergyDepAtPhantom1/OutputType                = "csv"
b:Sc/EnergyDepAtPhantom1/OutputToConsole           = "TRUE"
b:Sc/EnergyDepAtPhantom1/Visualize                 = "TRUE"
s:Sc/EnergyDepAtPhantom1/IfOutputFileAlreadyExists = "Increment" # Exit, Overwrite or Increment

s:Sc/FluenceAtPhantom1/Quantity        = "Fluence"
s:Sc/FluenceAtPhantom1/Component       = "Phantom1"
s:Sc/FluenceAtPhantom1/OutputFile      = "FluenceAtPhantom1"
s:Sc/FluenceAtPhantom1/OutputType      = "csv"
b:Sc/FluenceAtPhantom1/OutputToConsole = "TRUE"
b:Sc/FluenceAtPhantom1/Visualize       = "TRUE"

s:Sc/EnergyFluenceAtPhantom1/Quantity                   = "EnergyFluence"
s:Sc/EnergyFluenceAtPhantom1/Component                  = "Phantom1"
s:Sc/EnergyFluenceAtPhantom1/OutputFile                 = "EnergyFluenceAtPhantom1"
s:Sc/EnergyFluenceAtPhantom1/OutputType                 = "csv"
b:Sc/EnergyFluenceAtPhantom1/OutputToConsole            = "TRUE"
b:Sc/EnergyFluenceAtPhantom1/Visualize                  = "TRUE"
sv:Sc/EnergyFluenceAtPhantom1/OnlyIncludeParticlesNamed = 1 "proton"

s:Sc/eDoseAtPhantom1/Quantity                              = "DoseToMedium"
s:Sc/eDoseAtPhantom1/Component                             = "Phantom1"
sv:Sc/eDoseAtPhantom1/OnlyIncludeParticlesNamed            = 1 "e-"
#sv:Sc/eDoseAtPhantom1/OnlyIncludeParticlesCharged         = 1 "negative" # zero or more of positive, negative or neutral
#d:Sc/eDoseAtPhantom1/OnlyIncludeIfIncidentParticleKEAbove = 200. keV # minimum energy
#d:Sc/eDoseAtPhantom1/OnlyIncludeIfIncidentParticleKEBelow = 250. keV # minimum energy
#sv:Sc/eDoseAtPhantom1/OnlyIncludeParticlesFromComponent   = 1 "Phantom1"
#sv:Sc/eDoseAtPhantom1/OnlyIncludeParticlesFromProcess     = 1 "hIoni"
#b:Sc/eDoseAtPhantom1/InvertFilter                         = "TRUE"
s:Sc/eDoseAtPhantom1/OutputFile                            = "eDoseAtPhantom1"
s:Sc/eDoseAtPhantom1/OutputType                            = "csv"
b:Sc/eDoseAtPhantom1/OutputToConsole                       = "FALSE"
b:Sc/eDoseAtPhantom1/Visualize                             = "TRUE"

s:Sc/EDepAtPhantom1/Quantity                   = "DoseToMedium"
s:Sc/EDepAtPhantom1/Component                  = "Phantom2"
b:Sc/EDepAtPhantom1/OutputToConsole            = "TRUE"
sv:Sc/EDepAtPhantom1/OnlyIncludeParticlesNamed = 1 "proton"

s:Sc/DoseAtPhantom2/Quantity        = "DoseToMedium"
s:Sc/DoseAtPhantom2/Component       = "Phantom2"
s:Sc/DoseAtPhantom2/OutputFile      = "DoseAtPhantom2"
s:Sc/DoseAtPhantom2/OutputType      = "csv"
b:Sc/DoseAtPhantom2/OutputToConsole = "TRUE"
b:Sc/DoseAtPhantom2/Visualize       = "TRUE"

s:Sc/EDepAtPhantom2/Quantity  = "EnergyDeposit"
s:Sc/EDepAtPhantom2/Component = "Phantom2"

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

Dose.txt

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "Air"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 10.0 cm
d:Ge/Phantom/TransZ   = -30. cm
s:Ge/Phantom/Color    = "blue"

s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"

#s:Gr/ViewA/Type                            = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100000

i:Ts/ShowHistoryCountAtInterval = 10000
i:Ts/NumberOfThreads = 7

#b:Ts/PauseBeforeQuit = "True"

DoseInVoxelMaterials.txt

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 30.0 cm
d:Ge/Phantom/TransZ   = -30. cm
s:Ge/Phantom/Color    = "blue"
i:Ge/Phantom/XBins    = 10
i:Ge/Phantom/YBins    = 10
i:Ge/Phantom/ZBins    = 10
includeFile           = VoxelMaterials.txt
d:Ge/Phantom/RotY     = 270 deg

s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
#d:Gr/ViewA/Theta                           = 55 deg
#d:Gr/ViewA/Phi                             = 20 deg
#s:Gr/ViewA/Projection                      = "Perspective"
#d:Gr/ViewA/PerspectiveAngle                = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

i:Ts/ShowHistoryCountAtInterval = 10000
i:Ts/NumberOfThreads = 7

b:Ts/PauseBeforeQuit = "True"

DoseToMediumVsWater.txt

# Demonstrates dose to medium versus dose to water.

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/WaterBox/Type     = "TsBox"
s:Ge/WaterBox/Parent   = "World"
s:Ge/WaterBox/Material = "G4_WATER"
d:Ge/WaterBox/HLX      = 10.0 cm
d:Ge/WaterBox/HLY      = 10.0 cm
d:Ge/WaterBox/HLZ      = 2.0 cm
d:Ge/WaterBox/TransX   = 0. cm
d:Ge/WaterBox/TransY   = 0. cm
d:Ge/WaterBox/TransZ   = 10. cm
d:Ge/WaterBox/RotX     = 0. deg
d:Ge/WaterBox/RotY     = 0. deg
d:Ge/WaterBox/RotZ     = 0. deg
s:Ge/WaterBox/Color    = "blue"

s:Ge/LeadBox/Type     = "TsBox"
s:Ge/LeadBox/Parent   = "World"
s:Ge/LeadBox/Material = "Lead"
d:Ge/LeadBox/HLX      = 10.0 cm
d:Ge/LeadBox/HLY      = 10.0 cm
d:Ge/LeadBox/HLZ      = 5.0 cm
d:Ge/LeadBox/TransX   = 0. cm
d:Ge/LeadBox/TransY   = 0. cm
d:Ge/LeadBox/TransZ   = 0. cm
d:Ge/LeadBox/RotX     = 0. deg
d:Ge/LeadBox/RotY     = 0. deg
d:Ge/LeadBox/RotZ     = 0. deg
s:Ge/LeadBox/Color    = "blue"

s:Sc/1WaterBoxDoseToMedium/Quantity                         = "DoseToMedium"
s:Sc/1WaterBoxDoseToMedium/Component                        = "WaterBox"
b:Sc/1WaterBoxDoseToMedium/OutputToConsole                  = "TRUE"
s:Sc/1WaterBoxDoseToMedium/IfOutputFileAlreadyExists        = "Overwrite"

s:Sc/2WaterBoxDoseToWater/Quantity                          = "DoseToWater"
s:Sc/2WaterBoxDoseToWater/Component                         = "WaterBox"
b:Sc/2WaterBoxDoseToWater/OutputToConsole                   = "TRUE"
s:Sc/2WaterBoxDoseToWater/IfOutputFileAlreadyExists         = "Overwrite"

s:Sc/3WaterBoxDoseToMaterialWater/Quantity                  = "DoseToMaterial"
s:Sc/3WaterBoxDoseToMaterialWater/Material                  = "G4_WATER"
s:Sc/3WaterBoxDoseToMaterialWater/Component                 = "WaterBox"
b:Sc/3WaterBoxDoseToMaterialWater/OutputToConsole           = "TRUE"
s:Sc/3WaterBoxDoseToMaterialWater/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/4WaterBoxDoseToMaterialLead/Quantity                   = "DoseToMaterial"
s:Sc/4WaterBoxDoseToMaterialLead/Material                   = "Lead"
s:Sc/4WaterBoxDoseToMaterialLead/Component                  = "WaterBox"
b:Sc/4WaterBoxDoseToMaterialLead/OutputToConsole            = "TRUE"
s:Sc/4WaterBoxDoseToMaterialLead/IfOutputFileAlreadyExists  = "Overwrite"

s:Sc/5LeadBoxDoseToMedium/Quantity                          = "DoseToMedium"
s:Sc/5LeadBoxDoseToMedium/Component                         = "LeadBox"
b:Sc/5LeadBoxDoseToMedium/OutputToConsole                   = "TRUE"
s:Sc/5LeadBoxDoseToMedium/IfOutputFileAlreadyExists         = "Overwrite"

s:Sc/6LeadBoxBoxDoseToWater/Quantity                        = "DoseToWater"
s:Sc/6LeadBoxBoxDoseToWater/Component                       = "LeadBox"
b:Sc/6LeadBoxBoxDoseToWater/OutputToConsole                 = "TRUE"
s:Sc/6LeadBoxBoxDoseToWater/IfOutputFileAlreadyExists       = "Overwrite"

s:Sc/7LeadBoxDoseToMaterialWater/Quantity                   = "DoseToMaterial"
s:Sc/7LeadBoxDoseToMaterialWater/Material                   = "G4_WATER"
s:Sc/7LeadBoxDoseToMaterialWater/Component                  = "LeadBox"
b:Sc/7LeadBoxDoseToMaterialWater/OutputToConsole            = "TRUE"
s:Sc/7LeadBoxDoseToMaterialWater/IfOutputFileAlreadyExists  = "Overwrite"

s:Sc/8LeadBoxDoseToMaterialLead/Quantity                    = "DoseToMaterial"
s:Sc/8LeadBoxDoseToMaterialLead/Material                    = "Lead"
s:Sc/8LeadBoxDoseToMaterialLead/Component                   = "LeadBox"
b:Sc/8LeadBoxDoseToMaterialLead/OutputToConsole             = "TRUE"
s:Sc/8LeadBoxDoseToMaterialLead/IfOutputFileAlreadyExists   = "Overwrite"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/ViewA/Type = "OpenGL"

b:Ts/PauseBeforeQuit = "True"

DoseVolumeHistogram.txt

# Score dose to a cumulative volume histogram

s:Ge/World/Material = "Vacuum"
d:Ge/World/HLX      = 2.0 m
d:Ge/World/HLY      = 2.0 m
d:Ge/World/HLZ      = 2.0 m

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "Lead"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 10.0 cm
d:Ge/Phantom/TransX   = 0. cm
d:Ge/Phantom/TransY   = 0. cm
d:Ge/Phantom/TransZ   = -30. cm
d:Ge/Phantom/RotX     = 0. deg
d:Ge/Phantom/RotY     = 0. deg
d:Ge/Phantom/RotZ     = 0. deg
s:Ge/Phantom/Color    = "blue"
i:Ge/Phantom/XBins    = 10
i:Ge/Phantom/YBins    = 10
i:Ge/Phantom/ZBins    = 10

s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/DoseAtPhantom/Report                   = 2 "Sum" "CumulativeVolumeHistogram"
i:Sc/DoseAtPhantom/HistogramBins             = 100
d:Sc/DoseAtPhantom/HistogramMin              = 0. Gy
d:Sc/DoseAtPhantom/HistogramMax              = .0001 Gy

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

b:Ts/PauseBeforeQuit = "True"

EnergyAndDose.txt

# Demonstrate scoring energy and dose in a simple water phantom

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "Lead"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 10.0 cm
d:Ge/Phantom/TransZ   = -30. cm
s:Ge/Phantom/Color    = "blue"

s:Sc/EnergyDepAtPhantom/Quantity                  = "EnergyDeposit"
s:Sc/EnergyDepAtPhantom/Component                 = "Phantom"
b:Sc/EnergyDepAtPhantom/OutputToConsole           = "TRUE"
s:Sc/EnergyDepAtPhantom/IfOutputFileAlreadyExists = "Overwrite"

s:Sc/DoseAtPhantom/Quantity                       = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                      = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole                = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists      = "Overwrite"

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

EnergyDepositBinnedByEnergy.txt

# This example demonstrates the three different ways one can bin results by energy. Adjust the value of EBinEnergy to see the effect.
#
# IncidentTrack means we bin based on the energy of the track that was initially
# incident on the scoring volume, even though the track that finally delivers the
# scored energy is likely to be not this track but one of its resultng delta rays.
# This is the default setting.
# It is set this way because the original use of energy binning was to study how
# proton therapy dose due to various energy protons incident on the patient.
#
# PreStep means we bin based on the kinetic energy of the track at the time
# that it deposited the dose.
# This is generally used when one wants to score a spectrum.
# So, for example, if you adjust Quantity below to Fluence, then the scored
# value is what is referred to in the literature as a Spectral Fluence.
#
# DepositedInStep means we bin based on the energy that was deposited in the step.
# You can use this setting to see that almost all actual energy deposits occur
# in small amounts spread along the track.

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 20.0 cm
d:Ge/Phantom/HLY      = 20.0 cm
d:Ge/Phantom/HLZ      = 20.0 cm
d:Ge/Phantom/TransZ   = -30. cm

s:Sc/Case1BinnedByIncidentTrackEnergy/Quantity                  = "EnergyDeposit"
s:Sc/Case1BinnedByIncidentTrackEnergy/Component                 = "Phantom"
b:Sc/Case1BinnedByIncidentTrackEnergy/OutputToConsole           = "TRUE"
s:Sc/Case1BinnedByIncidentTrackEnergy/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/Case1BinnedByIncidentTrackEnergy/EBins                     = 4
d:Sc/Case1BinnedByIncidentTrackEnergy/EBinMin                   = 0. MeV
d:Sc/Case1BinnedByIncidentTrackEnergy/EBinMax                   = 200. MeV
sc:Sc/Case1BinnedByIncidentTrackEnergy/EBinEnergy               = "IncidentTrack"

s:Sc/Case2BinnedByIncidentPreStepEnergy/Quantity                  = "EnergyDeposit"
s:Sc/Case2BinnedByIncidentPreStepEnergy/Component                 = "Phantom"
b:Sc/Case2BinnedByIncidentPreStepEnergy/OutputToConsole           = "TRUE"
s:Sc/Case2BinnedByIncidentPreStepEnergy/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/Case2BinnedByIncidentPreStepEnergy/EBins                     = 4
d:Sc/Case2BinnedByIncidentPreStepEnergy/EBinMin                   = 0. MeV
d:Sc/Case2BinnedByIncidentPreStepEnergy/EBinMax                   = 200. MeV
sc:Sc/Case2BinnedByIncidentPreStepEnergy/EBinEnergy               = "PreStep"

s:Sc/Case3BinnedByEnergyDepositedInStep/Quantity                  = "EnergyDeposit"
s:Sc/Case3BinnedByEnergyDepositedInStep/Component                 = "Phantom"
b:Sc/Case3BinnedByEnergyDepositedInStep/OutputToConsole           = "TRUE"
s:Sc/Case3BinnedByEnergyDepositedInStep/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/Case3BinnedByEnergyDepositedInStep/EBins                     = 4
d:Sc/Case3BinnedByEnergyDepositedInStep/EBinMin                   = 0. MeV
d:Sc/Case3BinnedByEnergyDepositedInStep/EBinMax                   = 200. MeV
sc:Sc/Case3BinnedByEnergyDepositedInStep/EBinEnergy               = "DepositedInStep"

#s:Gr/ViewA/Type                            = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 175. MeV
u:So/Example/BeamEnergySpread         = 0.
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1

#b:Ts/PauseBeforeQuit = "True"

EnergyDivisions.txt

# Score surface track count of primary protons
# in energy bins in two phantoms

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/WaterBox/Type     = "TsBox"
s:Ge/WaterBox/Parent   = "World"
s:Ge/WaterBox/Material = "G4_WATER"
d:Ge/WaterBox/HLX      = 30.0 cm
d:Ge/WaterBox/HLY      = 30.0 cm
d:Ge/WaterBox/HLZ      = 2.0 cm
d:Ge/WaterBox/TransZ   = -20. cm

s:Ge/LeadBox/Type     = "TsBox"
s:Ge/LeadBox/Parent   = "World"
s:Ge/LeadBox/Material = "Lead"
d:Ge/LeadBox/HLX      = 30.0 cm
d:Ge/LeadBox/HLY      = 30.0 cm
d:Ge/LeadBox/HLZ      = 10.0 cm
d:Ge/LeadBox/TransZ   = -40. cm
d:Ge/LeadBox/RotX     = 0. deg
d:Ge/LeadBox/RotY     = 0. deg
d:Ge/LeadBox/RotZ     = 0. deg

s:Sc/EnergyDepAtPhantom/Quantity                          = "SurfaceTrackCount"
s:Sc/EnergyDepAtPhantom/Surface                           = "WaterBox/ZPlusSurface"
b:Sc/EnergyDepAtPhantom/OutputToConsole                   = "True"
s:Sc/EnergyDepAtPhantom/OutputType                        = "csv"
s:Sc/EnergyDepAtPhantom/IfOutputFileAlreadyExists         = "Overwrite"
i:Sc/EnergyDepAtPhantom/EBins                             = 10
sv:Sc/EnergyDepAtPhantom/OnlyIncludeParticlesNamed        = 1 "proton"
s:Sc/EnergyDepAtPhantom/OnlyIncludeParticlesOfGeneration  = "primary"
d:Sc/EnergyDepAtPhantom/EBinMin                           = 0. MeV
d:Sc/EnergyDepAtPhantom/EBinMax                           = 100. MeV

s:Sc/EnergyDepAtPhantom2/Quantity                         = "SurfaceTrackCount"
s:Sc/EnergyDepAtPhantom2/Surface                          = "LeadBox/ZPlusSurface"
b:Sc/EnergyDepAtPhantom2/OutputToConsole                  = "True"
s:Sc/EnergyDepAtPhantom2/OutputType                       = "csv"
s:Sc/EnergyDepAtPhantom2/IfOutputFileAlreadyExists        = "Overwrite"
i:Sc/EnergyDepAtPhantom2/EBins                            = 10
sv:Sc/EnergyDepAtPhantom2/OnlyIncludeParticlesNamed       = 1 "proton"
s:Sc/EnergyDepAtPhantom2/OnlyIncludeParticlesOfGeneration = "primary"
d:Sc/EnergyDepAtPhantom2/EBinMin                          = 0. MeV
d:Sc/EnergyDepAtPhantom2/EBinMax                          = 100. MeV

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1000

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

EnergyInBinnedCylinder.txt

# Demonstrates binning by R, Phi and Z in a cylinder

s:Ge/World/Material    = "Vacuum"
d:Ge/World/HLX         = 1.0 m
d:Ge/World/HLY         = 1.0 m
d:Ge/World/HLZ         = 1.0 m
d:Ge/World/MaxStepSize = 1.0 m

s:Ge/ScoringCylinder/Type     = "TsCylinder"
s:Ge/ScoringCylinder/Parent   = "World"
s:Ge/ScoringCylinder/Material = "G4_WATER"
d:Ge/ScoringCylinder/RMin     = 2. cm
d:Ge/ScoringCylinder/RMax     = 40. cm
d:Ge/ScoringCylinder/HL       = 40. cm
d:Ge/ScoringCylinder/SPhi     = 0. deg
d:Ge/ScoringCylinder/DPhi     = 360. deg
i:Ge/ScoringCylinder/RBins    = 6
i:Ge/ScoringCylinder/PhiBins  = 6
i:Ge/ScoringCylinder/ZBins    = 6

s:Sc/MyScorer/Quantity                  = "EnergyDeposit"
s:Sc/MyScorer/Component                 = "ScoringCylinder"
s:Sc/MyScorer/OutputFile                = "Energy_Test"
s:Sc/MyScorer/OutputType                = "csv"
b:Sc/MyScorer/OutputToConsole           = "False"
s:Sc/MyScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 2.
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1000

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

Filters.txt

# Test every kind of scoring filter

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Foil/Type     = "TsBox"
s:Ge/Foil/Parent   = "World"
s:Ge/Foil/Material = "Lead"
d:Ge/Foil/HLX      = 30.0 cm
d:Ge/Foil/HLY      = 30.0 cm
d:Ge/Foil/HLZ      = .5 cm
d:Ge/Foil/TransX   = 0. cm
d:Ge/Foil/TransY   = 0. cm
d:Ge/Foil/TransZ   = 0. cm
d:Ge/Foil/RotX     = 0. deg
d:Ge/Foil/RotY     = 0. deg
d:Ge/Foil/RotZ     = 0. deg

s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Parent   = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX      = 20.0 cm
d:Ge/Box/HLY      = 20.0 cm
d:Ge/Box/HLZ      = 20.0 cm
d:Ge/Box/TransX   = 0. cm
d:Ge/Box/TransY   = 0. cm
d:Ge/Box/TransZ   = -30. cm
d:Ge/Box/RotX     = 0. deg
d:Ge/Box/RotY     = 0. deg
d:Ge/Box/RotZ     = 0. deg

s:Sc/OnlyIncludeParticlesOfGeneration/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesOfGeneration/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesOfGeneration/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesOfGeneration/OutputType = "csv"
s:Sc/OnlyIncludeParticlesOfGeneration/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/OnlyIncludeParticlesOfGeneration/OnlyIncludeParticlesOfGeneration = "Primary"

s:Sc/OnlyIncludeParticlesCharged/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesCharged/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesCharged/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesCharged/OutputType = "csv"
s:Sc/OnlyIncludeParticlesCharged/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesCharged/OnlyIncludeParticlesCharged = 1 "Positive"

s:Sc/OnlyIncludeParticlesNotCharged/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotCharged/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotCharged/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotCharged/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotCharged/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNotCharged/OnlyIncludeParticlesNotCharged = 1 "Positive"

s:Sc/OnlyIncludeParticlesOfAtomicMass/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesOfAtomicMass/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesOfAtomicMass/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesOfAtomicMass/OutputType = "csv"
s:Sc/OnlyIncludeParticlesOfAtomicMass/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/OnlyIncludeParticlesOfAtomicMass/OnlyIncludeParticlesOfAtomicMass = 1

s:Sc/OnlyIncludeParticlesNotOfAtomicMass/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotOfAtomicMass/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotOfAtomicMass/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotOfAtomicMass/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotOfAtomicMass/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/OnlyIncludeParticlesNotOfAtomicMass/OnlyIncludeParticlesNotOfAtomicMass = 1

s:Sc/OnlyIncludeParticlesOfAtomicNumber/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesOfAtomicNumber/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesOfAtomicNumber/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesOfAtomicNumber/OutputType = "csv"
s:Sc/OnlyIncludeParticlesOfAtomicNumber/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/OnlyIncludeParticlesOfAtomicNumber/OnlyIncludeParticlesOfAtomicNumber = 1

s:Sc/OnlyIncludeParticlesNotOfAtomicNumber/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotOfAtomicNumber/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotOfAtomicNumber/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotOfAtomicNumber/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotOfAtomicNumber/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/OnlyIncludeParticlesNotOfAtomicNumber/OnlyIncludeParticlesNotOfAtomicNumber = 1

s:Sc/OnlyIncludeParticlesWithInitialKEBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialKEBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialKEBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialKEBelow/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialKEBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialKEBelow/OnlyIncludeParticlesWithInitialKEBelow = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialKENotBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialKENotBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialKENotBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialKENotBelow/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialKENotBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialKENotBelow/OnlyIncludeParticlesWithInitialKENotBelow = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialKE/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialKE/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialKE/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialKE/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialKE/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialKE/OnlyIncludeParticlesWithInitialKE = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialKENot/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialKENot/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialKENot/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialKENot/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialKENot/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialKENot/OnlyIncludeParticlesWithInitialKENot = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialKEAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialKEAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialKEAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialKEAbove/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialKEAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialKEAbove/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialKENotAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialKENotAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialKENotAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialKENotAbove/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialKENotAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialKENotAbove/OnlyIncludeParticlesWithInitialKENotAbove = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialMomentumBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialMomentumBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialMomentumBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialMomentumBelow/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialMomentumBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialMomentumBelow/OnlyIncludeParticlesWithInitialMomentumBelow = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialMomentumNotBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNotBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialMomentumNotBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNotBelow/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNotBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialMomentumNotBelow/OnlyIncludeParticlesWithInitialMomentumNotBelow = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialMomentum/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialMomentum/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialMomentum/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialMomentum/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialMomentum/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialMomentum/OnlyIncludeParticlesWithInitialMomentum = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialMomentumNot/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNot/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialMomentumNot/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNot/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNot/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialMomentumNot/OnlyIncludeParticlesWithInitialMomentumNot = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialMomentumAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialMomentumAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialMomentumAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialMomentumAbove/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialMomentumAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialMomentumAbove/OnlyIncludeParticlesWithInitialMomentumAbove = 100. MeV

s:Sc/OnlyIncludeParticlesWithInitialMomentumNotAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNotAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesWithInitialMomentumNotAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNotAbove/OutputType = "csv"
s:Sc/OnlyIncludeParticlesWithInitialMomentumNotAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeParticlesWithInitialMomentumNotAbove/OnlyIncludeParticlesWithInitialMomentumNotAbove = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleKEBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleKEBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleKEBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleKEBelow/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleKEBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleKEBelow/OnlyIncludeIfIncidentParticleKEBelow = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleKENotBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleKENotBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleKENotBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleKENotBelow/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleKENotBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleKENotBelow/OnlyIncludeIfIncidentParticleKENotBelow = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleKE/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleKE/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleKE/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleKE/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleKE/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleKE/OnlyIncludeIfIncidentParticleKE = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleKENot/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleKENot/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleKENot/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleKENot/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleKENot/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleKENot/OnlyIncludeIfIncidentParticleKENot = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleKEAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleKEAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleKEAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleKEAbove/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleKEAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleKEAbove/OnlyIncludeIfIncidentParticleKEAbove = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleKENotAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleKENotAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleKENotAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleKENotAbove/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleKENotAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleKENotAbove/OnlyIncludeIfIncidentParticleKENotAbove = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleMomentumBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleMomentumBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleMomentumBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleMomentumBelow/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleMomentumBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleMomentumBelow/OnlyIncludeIfIncidentParticleMomentumBelow = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleMomentumNotBelow/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNotBelow/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleMomentumNotBelow/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNotBelow/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNotBelow/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleMomentumNotBelow/OnlyIncludeIfIncidentParticleMomentumNotBelow = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleMomentum/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleMomentum/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleMomentum/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleMomentum/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleMomentum/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleMomentum/OnlyIncludeIfIncidentParticleMomentum = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleMomentumNot/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNot/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleMomentumNot/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNot/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNot/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleMomentumNot/OnlyIncludeIfIncidentParticleMomentumNot = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleMomentumAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleMomentumAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleMomentumAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleMomentumAbove/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleMomentumAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleMomentumAbove/OnlyIncludeIfIncidentParticleMomentumAbove = 100. MeV

s:Sc/OnlyIncludeIfIncidentParticleMomentumNotAbove/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNotAbove/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfIncidentParticleMomentumNotAbove/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNotAbove/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticleMomentumNotAbove/IfOutputFileAlreadyExists = "Overwrite"
d:Sc/OnlyIncludeIfIncidentParticleMomentumNotAbove/OnlyIncludeIfIncidentParticleMomentumNotAbove = 100. MeV

s:Sc/OnlyIncludeParticlesFromProcess/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesFromProcess/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesFromProcess/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesFromProcess/OutputType = "csv"
s:Sc/OnlyIncludeParticlesFromProcess/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesFromProcess/OnlyIncludeParticlesFromProcess = 1 "hIoni"

s:Sc/OnlyIncludeParticlesNotFromProcess/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotFromProcess/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotFromProcess/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotFromProcess/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotFromProcess/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNotFromProcess/OnlyIncludeParticlesNotFromProcess = 1 "hIoni"

s:Sc/OnlyIncludeIfParticleOrAncestorFromProcess/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorFromProcess/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorFromProcess/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorFromProcess/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorFromProcess/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorFromProcess/OnlyIncludeIfParticleOrAncestorFromProcess = 1 "hIoni"

s:Sc/OnlyIncludeIfParticleOrAncestorNotFromProcess/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromProcess/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotFromProcess/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromProcess/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromProcess/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotFromProcess/OnlyIncludeIfParticleOrAncestorNotFromProcess = 1 "hIoni"

s:Sc/OnlyIncludeParticlesNamed/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNamed/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNamed/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNamed/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNamed/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNamed/OnlyIncludeParticlesNamed = 1 "proton"

s:Sc/OnlyIncludeParticlesNotNamed/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotNamed/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotNamed/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotNamed/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotNamed/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNotNamed/OnlyIncludeParticlesNotNamed = 1 "proton"

s:Sc/OnlyIncludeIfParticleOrAncestorNamed/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNamed/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNamed/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNamed/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNamed/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNamed/OnlyIncludeIfParticleOrAncestorNamed = 1 "proton"

s:Sc/OnlyIncludeIfParticleOrAncestorNotNamed/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotNamed/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotNamed/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotNamed/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotNamed/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotNamed/OnlyIncludeIfParticleOrAncestorNotNamed = 1 "proton"

s:Sc/OnlyIncludeParticlesFromVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesFromVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesFromVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesFromVolume/OutputType = "csv"
s:Sc/OnlyIncludeParticlesFromVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesFromVolume/OnlyIncludeParticlesFromVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeParticlesNotFromVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotFromVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotFromVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotFromVolume/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotFromVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNotFromVolume/OnlyIncludeParticlesNotFromVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeParticlesFromComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesFromComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesFromComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesFromComponent/OutputType = "csv"
s:Sc/OnlyIncludeParticlesFromComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesFromComponent/OnlyIncludeParticlesFromComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeParticlesNotFromComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotFromComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotFromComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotFromComponent/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotFromComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNotFromComponent/OnlyIncludeParticlesNotFromComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeParticlesFromComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesFromComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesFromComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesFromComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeParticlesFromComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesFromComponentOrSubComponentsOf/OnlyIncludeParticlesFromComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf/OnlyIncludeParticlesNotFromComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorFromVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorFromVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorFromVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorFromVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorFromVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorFromVolume/OnlyIncludeIfParticleOrAncestorFromVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotFromVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotFromVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotFromVolume/OnlyIncludeIfParticleOrAncestorNotFromVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorFromComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorFromComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorFromComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorFromComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorFromComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorFromComponent/OnlyIncludeIfParticleOrAncestorFromComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponent/OnlyIncludeIfParticleOrAncestorNotFromComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf/OnlyIncludeIfParticleOrAncestorFromComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf/OnlyIncludeIfParticleOrAncestorNotFromComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleInteractedInVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleInteractedInVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleInteractedInVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleInteractedInVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleInteractedInVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleInteractedInVolume/OnlyIncludeIfParticleInteractedInVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleNotInteractedInVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleNotInteractedInVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleNotInteractedInVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleNotInteractedInVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleNotInteractedInVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleNotInteractedInVolume/OnlyIncludeIfParticleNotInteractedInVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleInteractedInComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleInteractedInComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleInteractedInComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleInteractedInComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleInteractedInComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleInteractedInComponent/OnlyIncludeIfParticleInteractedInComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleNotInteractedInComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleNotInteractedInComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleNotInteractedInComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleNotInteractedInComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleNotInteractedInComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleNotInteractedInComponent/OnlyIncludeIfParticleNotInteractedInComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf/OnlyIncludeIfParticleInteractedInComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf/OnlyIncludeIfParticleNotInteractedInComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorInteractedInVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorInteractedInVolume/OnlyIncludeIfParticleOrAncestorInteractedInVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume/OnlyIncludeIfParticleOrAncestorNotInteractedInVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponent/OnlyIncludeIfParticleOrAncestorInteractedInComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent/OnlyIncludeIfParticleOrAncestorNotInteractedInComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf/OnlyIncludeIfParticleOrAncestorInteractedInComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf/OnlyIncludeIfParticleOrAncestorNotInteractedInComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleTraversedVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleTraversedVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleTraversedVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleTraversedVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleTraversedVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleTraversedVolume/OnlyIncludeIfParticleTraversedVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleNotTraversedVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleNotTraversedVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleNotTraversedVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleNotTraversedVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleNotTraversedVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleNotTraversedVolume/OnlyIncludeIfParticleNotTraversedVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleTraversedComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleTraversedComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleTraversedComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleTraversedComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleTraversedComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleTraversedComponent/OnlyIncludeIfParticleTraversedComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleNotTraversedComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleNotTraversedComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleNotTraversedComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleNotTraversedComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleNotTraversedComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleNotTraversedComponent/OnlyIncludeIfParticleNotTraversedComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf/OnlyIncludeIfParticleTraversedComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf/OnlyIncludeIfParticleNotTraversedComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorTraversedVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorTraversedVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorTraversedVolume/OnlyIncludeIfParticleOrAncestorTraversedVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedVolume/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedVolume/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedVolume/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedVolume/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedVolume/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedVolume/OnlyIncludeIfParticleOrAncestorNotTraversedVolume = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponent/OnlyIncludeIfParticleOrAncestorTraversedComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponent/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponent/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponent/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponent/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponent/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponent/OnlyIncludeIfParticleOrAncestorNotTraversedComponent = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf/OnlyIncludeIfParticleOrAncestorTraversedComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf/OutputType = "csv"
s:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf/OnlyIncludeIfParticleOrAncestorNotTraversedComponentOrSubComponentsOf = 2 "World" "Foil"

s:Sc/OnlyIncludeIfInMaterial/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfInMaterial/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfInMaterial/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfInMaterial/OutputType = "csv"
s:Sc/OnlyIncludeIfInMaterial/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfInMaterial/OnlyIncludeIfInMaterial = 1 "Lead"

s:Sc/OnlyIncludeIfNotInMaterial/Quantity = "SurfaceTrackCount"
s:Sc/OnlyIncludeIfNotInMaterial/Surface = "Box/ZPlusSurface"
b:Sc/OnlyIncludeIfNotInMaterial/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfNotInMaterial/OutputType = "csv"
s:Sc/OnlyIncludeIfNotInMaterial/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfNotInMaterial/OnlyIncludeIfNotInMaterial = 1 "Lead"

s:Sc/OnlyIncludeIfIncidentParticlesNamed/Quantity = "EnergyDeposit"
s:Sc/OnlyIncludeIfIncidentParticlesNamed/Component = "Box"
b:Sc/OnlyIncludeIfIncidentParticlesNamed/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticlesNamed/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticlesNamed/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfIncidentParticlesNamed/OnlyIncludeIfIncidentParticlesNamed = 1 "proton"

s:Sc/OnlyIncludeIfIncidentParticlesNotNamed/Quantity = "EnergyDeposit"
s:Sc/OnlyIncludeIfIncidentParticlesNotNamed/Component = "Box"
b:Sc/OnlyIncludeIfIncidentParticlesNotNamed/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticlesNotNamed/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticlesNotNamed/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfIncidentParticlesNotNamed/OnlyIncludeIfIncidentParticlesNotNamed = 1 "proton"

s:Sc/OnlyIncludeIfIncidentParticlesFromProcess/Quantity = "EnergyDeposit"
s:Sc/OnlyIncludeIfIncidentParticlesFromProcess/Component = "Box"
b:Sc/OnlyIncludeIfIncidentParticlesFromProcess/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticlesFromProcess/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticlesFromProcess/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfIncidentParticlesFromProcess/OnlyIncludeIfIncidentParticlesFromProcess = 1 "hIoni"

s:Sc/OnlyIncludeIfIncidentParticlesNotFromProcess/Quantity = "EnergyDeposit"
s:Sc/OnlyIncludeIfIncidentParticlesNotFromProcess/Component = "Box"
b:Sc/OnlyIncludeIfIncidentParticlesNotFromProcess/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticlesNotFromProcess/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticlesNotFromProcess/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/OnlyIncludeIfIncidentParticlesNotFromProcess/OnlyIncludeIfIncidentParticlesNotFromProcess = 1 "hIoni"

s:Sc/OnlyIncludeIfIncidentParticlesOfGeneration/Quantity = "EnergyDeposit"
s:Sc/OnlyIncludeIfIncidentParticlesOfGeneration/Component = "Box"
b:Sc/OnlyIncludeIfIncidentParticlesOfGeneration/OutputToConsole = "TRUE"
s:Sc/OnlyIncludeIfIncidentParticlesOfGeneration/OutputType = "csv"
s:Sc/OnlyIncludeIfIncidentParticlesOfGeneration/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/OnlyIncludeIfIncidentParticlesOfGeneration/OnlyIncludeIfIncidentParticlesOfGeneration = "Primary"

s:Gr/ViewA/Type = "OpenGL"
i:Gr/ViewA/WindowSizeX = 900
i:Gr/ViewA/WindowSizeY = 900

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1

b:Ts/PauseBeforeQuit = "True"

FilterByInteractionCount.txt

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsSphere"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/RMax      = 1.0 m

s:Sc/InteractionCountAbove0/Quantity = "EnergyDeposit"
s:Sc/InteractionCountAbove0/Component = "Phantom"
b:Sc/InteractionCountAbove0/OutputToConsole = "True"
s:Sc/InteractionCountAbove0/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountAbove0/OnlyIncludeParticlesWithInteractionCountAbove = 0

s:Sc/InteractionCountAbove1/Quantity = "EnergyDeposit"
s:Sc/InteractionCountAbove1/Component = "Phantom"
b:Sc/InteractionCountAbove1/OutputToConsole = "True"
s:Sc/InteractionCountAbove1/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountAbove1/OnlyIncludeParticlesWithInteractionCountAbove = 1

s:Sc/InteractionCountAbove2/Quantity = "EnergyDeposit"
s:Sc/InteractionCountAbove2/Component = "Phantom"
b:Sc/InteractionCountAbove2/OutputToConsole = "True"
s:Sc/InteractionCountAbove2/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountAbove2/OnlyIncludeParticlesWithInteractionCountAbove = 2

s:Sc/InteractionCountAbove20/Quantity = "EnergyDeposit"
s:Sc/InteractionCountAbove20/Component = "Phantom"
b:Sc/InteractionCountAbove20/OutputToConsole = "True"
s:Sc/InteractionCountAbove20/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountAbove20/OnlyIncludeParticlesWithInteractionCountAbove = 20

s:Sc/InteractionCountBelow0/Quantity = "EnergyDeposit"
s:Sc/InteractionCountBelow0/Component = "Phantom"
b:Sc/InteractionCountBelow0/OutputToConsole = "True"
s:Sc/InteractionCountBelow0/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountBelow0/OnlyIncludeParticlesWithInteractionCountBelow = 0

s:Sc/InteractionCountBelow1/Quantity = "EnergyDeposit"
s:Sc/InteractionCountBelow1/Component = "Phantom"
b:Sc/InteractionCountBelow1/OutputToConsole = "True"
s:Sc/InteractionCountBelow1/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountBelow1/OnlyIncludeParticlesWithInteractionCountBelow = 1

s:Sc/InteractionCountBelow2/Quantity = "EnergyDeposit"
s:Sc/InteractionCountBelow2/Component = "Phantom"
b:Sc/InteractionCountBelow2/OutputToConsole = "True"
s:Sc/InteractionCountBelow2/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountBelow2/OnlyIncludeParticlesWithInteractionCountBelow = 2

s:Sc/InteractionCountBelow20/Quantity = "EnergyDeposit"
s:Sc/InteractionCountBelow20/Component = "Phantom"
b:Sc/InteractionCountBelow20/OutputToConsole = "True"
s:Sc/InteractionCountBelow20/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountBelow20/OnlyIncludeParticlesWithInteractionCountBelow = 20

s:Sc/InteractionCountEqual0/Quantity = "EnergyDeposit"
s:Sc/InteractionCountEqual0/Component = "Phantom"
b:Sc/InteractionCountEqual0/OutputToConsole = "True"
s:Sc/InteractionCountEqual0/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountEqual0/OnlyIncludeParticlesWithInteractionCount = 0

s:Sc/InteractionCountEqual1/Quantity = "EnergyDeposit"
s:Sc/InteractionCountEqual1/Component = "Phantom"
b:Sc/InteractionCountEqual1/OutputToConsole = "True"
s:Sc/InteractionCountEqual1/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountEqual1/OnlyIncludeParticlesWithInteractionCount = 1

s:Sc/InteractionCountEqual2/Quantity = "EnergyDeposit"
s:Sc/InteractionCountEqual2/Component = "Phantom"
b:Sc/InteractionCountEqual2/OutputToConsole = "True"
s:Sc/InteractionCountEqual2/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountEqual2/OnlyIncludeParticlesWithInteractionCount = 2

s:Sc/InteractionCountNotEqual0/Quantity = "EnergyDeposit"
s:Sc/InteractionCountNotEqual0/Component = "Phantom"
b:Sc/InteractionCountNotEqual0/OutputToConsole = "True"
s:Sc/InteractionCountNotEqual0/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountNotEqual0/OnlyIncludeParticlesWithInteractionCountNot = 0

s:Sc/InteractionCountNotEqual1/Quantity = "EnergyDeposit"
s:Sc/InteractionCountNotEqual1/Component = "Phantom"
b:Sc/InteractionCountNotEqual1/OutputToConsole = "True"
s:Sc/InteractionCountNotEqual1/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountNotEqual1/OnlyIncludeParticlesWithInteractionCountNot = 1

s:Sc/InteractionCountNotEqual2/Quantity = "EnergyDeposit"
s:Sc/InteractionCountNotEqual2/Component = "Phantom"
b:Sc/InteractionCountNotEqual2/OutputToConsole = "True"
s:Sc/InteractionCountNotEqual2/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/InteractionCountNotEqual2/OnlyIncludeParticlesWithInteractionCountNot = 2

s:Gr/ViewA/Type = "OpenGL"

s:So/Example/Type                     = "Isotropic"
s:So/Example/Component                = "Phantom"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 100. keV
u:So/Example/BeamEnergySpread         = 0.
i:So/Example/NumberOfHistoriesInRun   = 10

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

FoilToBox.txt

# Test scoring in geometry of particle passing through a foil to a box

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Foil/Type     = "TsBox"
s:Ge/Foil/Parent   = "World"
s:Ge/Foil/Material = "Lead"
d:Ge/Foil/HLX      = 30.0 cm
d:Ge/Foil/HLY      = 30.0 cm
d:Ge/Foil/HLZ      = .5 cm
d:Ge/Foil/TransX   = 0. cm
d:Ge/Foil/TransY   = 0. cm
d:Ge/Foil/TransZ   = 0. cm
d:Ge/Foil/RotX     = 0. deg
d:Ge/Foil/RotY     = 0. deg
d:Ge/Foil/RotZ     = 0. deg
i:Ge/Foil/XBins    = 1
i:Ge/Foil/YBins    = 1
i:Ge/Foil/ZBins    = 1

s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Parent   = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX      = 20.0 cm
d:Ge/Box/HLY      = 20.0 cm
d:Ge/Box/HLZ      = 20.0 cm
d:Ge/Box/TransX   = 0. cm
d:Ge/Box/TransY   = 0. cm
d:Ge/Box/TransZ   = -30. cm
d:Ge/Box/RotX     = 0. deg
d:Ge/Box/RotY     = 0. deg
d:Ge/Box/RotZ     = 0. deg
s:Ge/Box/Color    = "blue"
i:Ge/Box/ZBins    = 2

s:Sc/MyScorer/Quantity                              = "SurfaceTrackCount"
s:Sc/MyScorer/Surface                               = "Box/ZPlusSurface"
b:Sc/MyScorer/OutputToConsole                       = "True"
s:Sc/MyScorer/OutputType                            = "csv"
s:Sc/MyScorer/IfOutputFileAlreadyExists             = "Overwrite"
#i:Sc/MyScorer/EBins                                = 10
s:Sc/MyScorer/OnlyIncludeParticlesGoing             = "Out"
#sv:Sc/MyScorer/OnlyIncludeParticlesNamed           = 1 "gamma"
s:Sc/MyScorer/OnlyIncludeParticlesOfGeneration      = "secondary"
#d:Sc/MyScorer/EBinMin                              = 0. MeV
d:Sc/MyScorer/EBinMax                               = 110. MeV
#d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKEAbove = 0 MeV

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

FoilToCylinder.txt

# Test scoring in geometry of particle passing through a foil to a cylinder

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Foil/Type     = "TsBox"
s:Ge/Foil/Parent   = "World"
s:Ge/Foil/Material = "Lead"
d:Ge/Foil/HLX      = 30.0 cm
d:Ge/Foil/HLY      = 30.0 cm
d:Ge/Foil/HLZ      = .5 cm
d:Ge/Foil/TransX   = 0. cm
d:Ge/Foil/TransY   = 0. cm
d:Ge/Foil/TransZ   = -10. cm
d:Ge/Foil/RotX     = 0. deg
d:Ge/Foil/RotY     = 0. deg
d:Ge/Foil/RotZ     = 0. deg
s:Ge/Foil/Color    = "blue"
i:Ge/Foil/XBins    = 1
i:Ge/Foil/YBins    = 1
i:Ge/Foil/ZBins    = 1

s:Ge/Cylinder/Type     = "TsCylinder"
s:Ge/Cylinder/Parent   = "World"
s:Ge/Cylinder/Material = "Vacuum"
d:Ge/Cylinder/RMin     = 50.0 cm
d:Ge/Cylinder/RMax     = 55.0 cm
d:Ge/Cylinder/SPhi     = 20.0 deg
d:Ge/Cylinder/DPhi     = 100. deg
d:Ge/Cylinder/HL       = 50. cm
d:Ge/Cylinder/TransX   = 0. cm
d:Ge/Cylinder/TransY   = 0. cm
d:Ge/Cylinder/TransZ   = -30. cm
d:Ge/Cylinder/RotX     = 0. deg
d:Ge/Cylinder/RotY     = 0. deg
d:Ge/Cylinder/RotZ     = 0. deg
s:Ge/Cylinder/Color    = "blue"
i:Ge/Cylinder/RBins    = 2

s:Sc/MyScorer/Quantity                              = "SurfaceTrackCount"
s:Sc/MyScorer/Surface                               = "Cylinder/OuterCurvedSurface"
b:Sc/MyScorer/OutputToConsole                       = "True"
s:Sc/MyScorer/OutputType                            = "csv"
s:Sc/MyScorer/IfOutputFileAlreadyExists             = "Overwrite"
#i:Sc/MyScorer/EBins                                = 10
s:Sc/MyScorer/OnlyIncludeParticlesGoing             = "Out"
#sv:Sc/MyScorer/OnlyIncludeParticlesNamed           = 1 "gamma"
s:Sc/MyScorer/OnlyIncludeParticlesOfGeneration      = "secondary"
#d:Sc/MyScorer/EBinMin                              = 0. MeV
d:Sc/MyScorer/EBinMax                               = 110. MeV
#d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKEAbove = 0 MeV

# Graphics
s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

FoilToSphere.txt

# Test scoring in geometry of particle passing through a foil to a sphere

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Foil/Type     = "TsBox"
s:Ge/Foil/Parent   = "World"
s:Ge/Foil/Material = "Lead"
d:Ge/Foil/HLX      = 30.0 cm
d:Ge/Foil/HLY      = 30.0 cm
d:Ge/Foil/HLZ      = .5 cm
d:Ge/Foil/TransX   = 0. cm
d:Ge/Foil/TransY   = 0. cm
d:Ge/Foil/TransZ   = -30. cm
d:Ge/Foil/RotX     = 0. deg
d:Ge/Foil/RotY     = 0. deg
d:Ge/Foil/RotZ     = 0. deg
s:Ge/Foil/Color    = "blue"
i:Ge/Foil/XBins    = 1
i:Ge/Foil/YBins    = 1
i:Ge/Foil/ZBins    = 1

s:Ge/Sphere/Type     = "TsSphere"
s:Ge/Sphere/Parent   = "World"
s:Ge/Sphere/Material = "Vacuum"
d:Ge/Sphere/RMin     = 50.0 cm
d:Ge/Sphere/RMax     = 55.0 cm
d:Ge/Sphere/SPhi     = 0.0 deg
d:Ge/Sphere/DPhi     = 120. deg
d:Ge/Sphere/STheta   = 0 deg
d:Ge/Sphere/DTheta   = 180 deg
d:Ge/Sphere/TransX   = 0. cm
d:Ge/Sphere/TransY   = 0. cm
d:Ge/Sphere/TransZ   = -30. cm
d:Ge/Sphere/RotX     = 0. deg
d:Ge/Sphere/RotY     = 0. deg
d:Ge/Sphere/RotZ     = 0. deg
s:Ge/Sphere/Color    = "blue"
i:Ge/Sphere/RBins    = 2

s:Sc/MyScorer/Quantity                              = "SurfaceTrackCount"
s:Sc/MyScorer/Surface                               = "Sphere/InnerCurvedSurface"
b:Sc/MyScorer/OutputToConsole                       = "True"
s:Sc/MyScorer/OutputType                            = "csv"
s:Sc/MyScorer/IfOutputFileAlreadyExists             = "Overwrite"
#i:Sc/MyScorer/EBins                                = 10
s:Sc/MyScorer/OnlyIncludeParticlesGoing             = "Out"
#sv:Sc/MyScorer/OnlyIncludeParticlesNamed           = 1 "gamma"
s:Sc/MyScorer/OnlyIncludeParticlesOfGeneration      = "secondary"
#d:Sc/MyScorer/EBinMin                              = 0. MeV
d:Sc/MyScorer/EBinMax                               = 110. MeV
#d:Sc/MyScorer/OnlyIncludeIfIncidentParticleKEAbove = 0 MeV

# Graphics
s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

Gated.txt

# Demonstrates Gated scoring.
# First scorer is gated, sometimes active, sometimes inactive,
# under the control of a time feature and outputs after each run.
# Second scorer is gated, sometimes active, sometimes inactive,
# under the control of a time feature and outputs only at end of session.
# Third scorer is always active and outputs only at end of session.

s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Parent   = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX      = 1. m
d:Ge/Box/HLY      = 1. m
d:Ge/Box/HLZ      = .4 m

s:Sc/GatedAndOutputPerRun/Quantity                      = "Fluence"
s:Sc/GatedAndOutputPerRun/Component                     = "Box"
s:Sc/GatedAndOutputPerRun/IfOutputFileAlreadyExists     = "Overwrite"
b:Sc/GatedAndOutputPerRun/OutputToConsole               = "True"
b:Sc/GatedAndOutputPerRun/Active                        = Tf/ScoringOnOff/Value
b:Sc/GatedAndOutputPerRun/OutputAfterRun                = "True"

s:Sc/GatedAndOutputPerSession/Quantity                  = "Fluence"
s:Sc/GatedAndOutputPerSession/Component                 = "Box"
s:Sc/GatedAndOutputPerSession/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/GatedAndOutputPerSession/OutputToConsole           = "True"
b:Sc/GatedAndOutputPerSession/Active                    = Tf/ScoringOnOff/Value

s:Sc/NotGated/Quantity                  = "Fluence"
s:Sc/NotGated/Component                 = "Box"
s:Sc/NotGated/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/NotGated/OutputToConsole           = "True"

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0

s:Tf/ScoringOnOff/Function = "Step"
dv:Tf/ScoringOnOff/Times   = 10 10  20   30    40    50   60   70   80    90 100 ms
bv:Tf/ScoringOnOff/Values  = 10   "true" "false" "true" "false" "false" "true" "true" "true" "false" "true"

i:Tf/Verbosity =1
d:Tf/TimelineEnd = 100.0 ms
i:Tf/NumberOfSequentialTimes = 10

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

GeometryDivisions.txt

# Demonstrates scoring by various geometry divisions.
# First scorer uses geometry of the regular world.
# Second scorer uses a parallel geometry with 2 X bins.
$ Third scorer uses a parallel geoemtry with 2 Y bins.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 1.1 cm
d:Ge/Phantom/TransX   = 0. cm
d:Ge/Phantom/TransY   = 0. cm
d:Ge/Phantom/TransZ   = -30. cm
d:Ge/Phantom/RotX     = 0. deg
d:Ge/Phantom/RotY     = 0. deg
d:Ge/Phantom/RotZ     = 0. deg
s:Ge/Phantom/Color    = "blue"

# Scores in regular world
s:Sc/DoseAtPhantom/Quantity                  = "EnergyDeposit"
s:Sc/DoseAtPhantom/Component                 = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"

# X binning causes creation of a parallel world for scoring
s:Sc/DoseAtPhantomParallel/Quantity                   = "EnergyDeposit"
s:Sc/DoseAtPhantomParallel/Component                  = "Phantom"
b:Sc/DoseAtPhantomParallel/OutputToConsole            = "TRUE"
s:Sc/DoseAtPhantomParallel/IfOutputFileAlreadyExists  = "Overwrite"
i:Sc/DoseAtPhantomParallel/XBins                      = 2

# Y binning causes creation of a parallel world for scoring
s:Sc/DoseAtPhantomParallel2/Quantity                  = "EnergyDeposit"
s:Sc/DoseAtPhantomParallel2/Component                 = "Phantom"
b:Sc/DoseAtPhantomParallel2/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantomParallel2/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/DoseAtPhantomParallel2/YBins                     = 2

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
sv:Gr/ViewA/VisibleWorlds                   = 1 "All"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 20

b:Ts/PauseBeforeQuit = "True"

Histograms.txt

# Create a variety of energy histograms

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "Lead"
d:Ge/Phantom/HLX      = 30.0 cm
d:Ge/Phantom/HLY      = 30.0 cm
d:Ge/Phantom/HLZ      = 10.0 cm
d:Ge/Phantom/TransX   = 0. cm
d:Ge/Phantom/TransY   = 0. cm
d:Ge/Phantom/TransZ   = -30. cm
d:Ge/Phantom/RotX     = 0. deg
d:Ge/Phantom/RotY     = 0. deg
d:Ge/Phantom/RotZ     = 0. deg
s:Ge/Phantom/Color    = "blue"

s:Sc/DoseAtPhantom/Quantity                     = "EnergyDeposit"
s:Sc/DoseAtPhantom/Component                    = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole              = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists    = "Overwrite"
s:Sc/DoseAtPhantom/OutputType                   = "Root"
i:Sc/DoseAtPhantom/HistogramBins                = 10
d:Sc/DoseAtPhantom/HistogramMin                 = 0. MeV
d:Sc/DoseAtPhantom/HistogramMax                 = 200. MeV

s:Sc/DoseAtPhantomByX/Quantity                  = "EnergyDeposit"
s:Sc/DoseAtPhantomByX/Component                 = "Phantom"
b:Sc/DoseAtPhantomByX/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantomByX/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantomByX/OutputType                = "Root"
i:Sc/DoseAtPhantomByX/XBins                     = 10
i:Sc/DoseAtPhantomByX/HistogramBins             = 10
d:Sc/DoseAtPhantomByX/HistogramMin              = 0. MeV
d:Sc/DoseAtPhantomByX/HistogramMax              = 200. MeV

s:Sc/DoseAtPhantomByY/Quantity                  = "EnergyDeposit"
s:Sc/DoseAtPhantomByY/Component                 = "Phantom"
b:Sc/DoseAtPhantomByY/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantomByY/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantomByY/OutputType                = "Root"
i:Sc/DoseAtPhantomByY/YBins                     = 10
i:Sc/DoseAtPhantomByY/HistogramBins             = 10
d:Sc/DoseAtPhantomByY/HistogramMin              = 0. MeV
d:Sc/DoseAtPhantomByY/HistogramMax              = 200. MeV

s:Sc/DoseAtPhantomByZ/Quantity                  = "EnergyDeposit"
s:Sc/DoseAtPhantomByZ/Component                 = "Phantom"
b:Sc/DoseAtPhantomByZ/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantomByZ/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantomByZ/OutputType                = "Root"
i:Sc/DoseAtPhantomByZ/ZBins                     = 10
i:Sc/DoseAtPhantomByZ/HistogramBins             = 10
d:Sc/DoseAtPhantomByZ/HistogramMin              = 0. MeV
d:Sc/DoseAtPhantomByZ/HistogramMax              = 200. MeV

s:Sc/DoseAtPhantomByE/Quantity                  = "EnergyDeposit"
s:Sc/DoseAtPhantomByE/Component                 = "Phantom"
b:Sc/DoseAtPhantomByE/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantomByE/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantomByE/OutputType                = "Root"
i:Sc/DoseAtPhantomByE/EBins                     = 10
d:Sc/DoseAtPhantomByE/EBinMax                   = 200. MeV
i:Sc/DoseAtPhantomByE/HistogramBins             = 10
d:Sc/DoseAtPhantomByE/HistogramMin              = 0. MeV
d:Sc/DoseAtPhantomByE/HistogramMax              = 200. MeV

#s:Gr/ViewA/Type            = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 900
i:Gr/ViewA/WindowSizeY      = 900
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10000

i:Ts/ShowHistoryCountAtInterval = 100

Inactive.txt

# Demonstrate effect of setting a scorer inactive

s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Parent   = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX      = 1. m
d:Ge/Box/HLY      = 1. m
d:Ge/Box/HLZ      = .4 m

s:Sc/WasActive/Quantity                    = "Fluence"
s:Sc/WasActive/Component                   = "Box"
s:Sc/WasActive/IfOutputFileAlreadyExists   = "Overwrite"
b:Sc/WasActive/OutputToConsole             = "True"

s:Sc/WasInActive/Quantity                  = "Fluence"
s:Sc/WasInActive/Component                 = "Box"
s:Sc/WasInActive/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/WasInActive/OutputToConsole           = "True"
b:Sc/WasInActive/Active                    = "False"

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

Ion.txt

# Test filtering on ions

s:Ge/World/Material  = "Vacuum"
d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/BeamPosition/Parent = "World"
s:Ge/BeamPosition/Type   = "Group"
d:Ge/BeamPosition/TransX = 0.0 cm
d:Ge/BeamPosition/TransY = 0.0 cm
d:Ge/BeamPosition/TransZ = Ge/World/HLZ m
d:Ge/BeamPosition/RotX   = 180. deg
d:Ge/BeamPosition/RotY   = 0. deg
d:Ge/BeamPosition/RotZ   = 0. deg

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 5.0 cm
d:Ge/Phantom/HLY      = 5.0 cm
d:Ge/Phantom/HLZ      = 5.0 cm
d:Ge/Phantom/TransX   = 0. cm
d:Ge/Phantom/TransY   = 0. cm
d:Ge/Phantom/TransZ   = 0. cm
d:Ge/Phantom/RotX     = 0. deg
d:Ge/Phantom/RotY     = 0.0 deg
d:Ge/Phantom/RotZ     = 0. deg
s:Ge/Phantom/Color    = "blue"
i:Ge/Phantom/XBins    = 1
i:Ge/Phantom/YBins    = 1
i:Ge/Phantom/ZBins    = 1

s:Sc/AllOfAtomicNumber6/Quantity                           = "EnergyDeposit"
s:Sc/AllOfAtomicNumber6/Component                          = "Phantom"
sv:Sc/AllOfAtomicNumber6/Report                            = 3 "Mean" "Count_In_Bin" "Standard_Deviation"
b:Sc/AllOfAtomicNumber6/OutputToConsole                    = "True"
s:Sc/AllOfAtomicNumber6/IfOutputFileAlreadyExists          = "Overwrite"
i:Sc/AllOfAtomicNumber6/OnlyIncludeParticlesOfAtomicNumber = 6

s:Sc/IonsWithWildCards/Quantity                    = "EnergyDeposit"
s:Sc/IonsWithWildCards/Component                   = "Phantom"
sv:Sc/IonsWithWildCards/Report                     = 3 "Mean" "Count_In_Bin" "Standard_Deviation"
b:Sc/IonsWithWildCards/OutputToConsole             = "True"
s:Sc/IonsWithWildCards/IfOutputFileAlreadyExists   = "Overwrite"
sv:Sc/IonsWithWildCards/OnlyIncludeParticlesNamed  = 1 "GenericIon(6,*,*)"

s:Sc/IonsWithCharge3to5/Quantity                   = "EnergyDeposit"
s:Sc/IonsWithCharge3to5/Component                  = "Phantom"
sv:Sc/IonsWithCharge3to5/Report                    = 3 "Mean" "Count_In_Bin" "Standard_Deviation"
b:Sc/IonsWithCharge3to5/OutputToConsole            = "True"
s:Sc/IonsWithCharge3to5/IfOutputFileAlreadyExists  = "Overwrite"
sv:Sc/IonsWithCharge3to5/OnlyIncludeParticlesNamed = 3 "GenericIon(6,12,3)" "GenericIon(6,12,4)" "GenericIon(6,12,5)"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "GenericIon(6,12)"
d:So/Example/BeamEnergy               = 100.0 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10000

i:Ts/ShowHistoryCountAtInterval = 1000

Origin.txt

# Particles pass through Film1Container which contains a divided box, Film1.
# We score fluence in a phantom, filtering several different ways based on
# origin of the scored particle.

s:Ge/Film1Container/Type     = "TsBox"
s:Ge/Film1Container/Parent   = "World"
s:Ge/Film1Container/Material = "G4_WATER"
d:Ge/Film1Container/HLX      = 2.1 m
d:Ge/Film1Container/HLY      = 2.1 m
d:Ge/Film1Container/HLZ      = .15 m
d:Ge/Film1Container/TransZ   = 1. m

s:Ge/Film1/Type     = "TsBox"
s:Ge/Film1/Parent   = "Film1Container"
s:Ge/Film1/Material = "G4_WATER"
d:Ge/Film1/HLX      = 2. m
d:Ge/Film1/HLY      = 2. m
d:Ge/Film1/HLZ      = .1 m
i:Ge/Film1/XBins    = 2
i:Ge/Film1/YBins    = 2
i:Ge/Film1/ZBins    = 2

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 3. m
d:Ge/Phantom/HLY      = 3. m
d:Ge/Phantom/HLZ      = 0.5 m
d:Ge/Phantom/TransZ   = -1. m
i:Ge/Phantom/XBins    = 1
i:Ge/Phantom/YBins    = 1
i:Ge/Phantom/ZBins    = 1

s:Sc/ParticlesFromFilm1ContainerAndSubcomponents/Quantity                  = "Fluence"
s:Sc/ParticlesFromFilm1ContainerAndSubcomponents/Component                 = "Phantom"
s:Sc/ParticlesFromFilm1ContainerAndSubcomponents/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/ParticlesFromFilm1ContainerAndSubcomponents/OutputToConsole           = "True"
sv:Sc/ParticlesFromFilm1ContainerAndSubcomponents/OnlyIncludeParticlesFromComponentOrSubComponentsOf = 1 "Film1Container"

s:Sc/ParticlesFromFilm1ContainerButNotSubcomponents/Quantity                  = "Fluence"
s:Sc/ParticlesFromFilm1ContainerButNotSubcomponents/Component                 = "Phantom"
s:Sc/ParticlesFromFilm1ContainerButNotSubcomponents/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/ParticlesFromFilm1ContainerButNotSubcomponents/OutputToConsole           = "True"
sv:Sc/ParticlesFromFilm1ContainerButNotSubcomponents/OnlyIncludeParticlesFromComponent = 1 "Film1Container"

s:Sc/ParticlesFromFilm1/Quantity                  = "Fluence"
s:Sc/ParticlesFromFilm1/Component                 = "Phantom"
s:Sc/ParticlesFromFilm1/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/ParticlesFromFilm1/OutputToConsole           = "True"
sv:Sc/ParticlesFromFilm1/OnlyIncludeParticlesFromComponentOrSubComponentsOf = 1 "Film1"

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 400 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

b:Ts/PauseBeforeQuit = "True"

OriginCount.txt

# Demonstrates use of the OriginCount scorer.
# Counts number of electrons and gammas produced in the
# inner and outer cones of a flattening filter.

s:Gr/MyViewA/Type = "OpenGL"
Ts/UseQt = "True"

d:Ge/World/HLX = 10. cm
d:Ge/World/HLY = 10. cm
d:Ge/World/HLZ = 10. cm

s:Ge/FlatteningFilter/Type = "Group"
s:Ge/FlatteningFilter/Parent = "World"
d:Ge/FlatteningFilter/RotY = 180. deg

# Inner section is implemented as a Solid Polycone
s:Ge/InnerCone/Type              = "G4SPolycone"
s:Ge/InnerCone/Parent            = "FlatteningFilter"
sc: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"
sc: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

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
sc:So/Example/BeamParticle             = "e-"
dc:So/Example/BeamEnergy               = 20. MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
ic:So/Example/NumberOfHistoriesInRun   = 10

s:Sc/CountInnerE/Quantity = "OriginCount"
s:Sc/CountInnerE/Component = "InnerCone"
b:Sc/CountInnerE/OutputToConsole = "True"
s:Sc/CountInnerE/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/CountInnerE/OnlyIncludeParticlesNamed = 1 "e-"

s:Sc/CountInnerG/Quantity = "OriginCount"
s:Sc/CountInnerG/Component = "InnerCone"
b:Sc/CountInnerG/OutputToConsole = "True"
s:Sc/CountInnerG/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/CountInnerG/OnlyIncludeParticlesNamed = 1 "gamma"

s:Sc/CountOuterE/Quantity = "OriginCount"
s:Sc/CountOuterE/Component = "OuterCone"
b:Sc/CountOuterE/OutputToConsole = "True"
s:Sc/CountOuterE/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/CountOuterE/OnlyIncludeParticlesNamed = 1 "e-"

s:Sc/CountOuterG/Quantity = "OriginCount"
s:Sc/CountOuterG/Component = "OuterCone"
b:Sc/CountOuterG/OutputToConsole = "True"
s:Sc/CountOuterG/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/CountOuterG/OnlyIncludeParticlesNamed = 1 "gamma"

ParallelBoxRebinned.txt

# Score in a variety of x, y and z divisions.
# Topas creates parallel worlds as needed to accomplish this.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/MassWorldBox/Parent     = "World"
s:Ge/MassWorldBox/Type       = "Group"
s:Ge/MassWorldBox/Material   = "G4_WATER"
b:Ge/MassWorldBox/IsParallel = "FALSE"
d:Ge/MassWorldBox/HLX        = 9.0 cm
d:Ge/MassWorldBox/HLY        = 9.0 cm
d:Ge/MassWorldBox/HLZ        = 9.0 cm
s:Ge/MassWorldBox/Color      = "blue"

s:Ge/ParallelWorldBox/Parent     = "MassWorldBox"
s:Ge/ParallelWorldBox/Type       = "TsBox"
b:Ge/ParallelWorldBox/IsParallel = "TRUE"
d:Ge/ParallelWorldBox/HLX        = 6.0 cm
d:Ge/ParallelWorldBox/HLY        = 5.0 cm
d:Ge/ParallelWorldBox/HLZ        = 4.0 cm
s:Ge/ParallelWorldBox/Color      = "green"
i:Ge/ParallelWorldBox/XBins      = 1
i:Ge/ParallelWorldBox/YBins      = 2
i:Ge/ParallelWorldBox/ZBins      = 3

s:Sc/Score2by3by4/Quantity                         = "DoseToMedium"
sv:Sc/Score2by3by4/OnlyIncludeParticlesFromProcess = 1 "eBrem"
s:Sc/Score2by3by4/Component                        = "ParallelWorldBox"
b:Sc/Score2by3by4/OutputToConsole                  = "TRUE"
s:Sc/Score2by3by4/IfOutputFileAlreadyExists        = "Overwrite"
i:Sc/Score2by3by4/XBins                            = 2
i:Sc/Score2by3by4/YBins                            = 3
i:Sc/Score2by3by4/ZBins                            = 4

s:Sc/Score3by4by5/Quantity                         = "DoseToMedium"
sv:Sc/Score3by4by5/OnlyIncludeParticlesFromProcess = 1 "hIoni"
s:Sc/Score3by4by5/Component                        = "ParallelWorldBox"
b:Sc/Score3by4by5/OutputToConsole                  = "TRUE"
s:Sc/Score3by4by5/IfOutputFileAlreadyExists        = "Overwrite"
i:Sc/Score3by4by5/XBins                            = 3
i:Sc/Score3by4by5/YBins                            = 4
i:Sc/Score3by4by5/ZBins                            = 5

s:Sc/Score4by5by6/Quantity                         = "DoseToMedium"
sv:Sc/Score4by5by6/OnlyIncludeParticlesFromProcess = 1 "hIoni"
s:Sc/Score4by5by6/Component                        = "ParallelWorldBox"
b:Sc/Score4by5by6/OutputToConsole                  = "TRUE"
s:Sc/Score4by5by6/IfOutputFileAlreadyExists        = "Overwrite"
i:Sc/Score4by5by6/XBins                            = 4
i:Sc/Score4by5by6/YBins                            = 5
i:Sc/Score4by5by6/ZBins                            = 6

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 50.
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 200

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

SplitByTimeFeature.txt

# Demonstrates how scoring can be split by a time feature.
# In this example, though the time feature ImageName doesn't really get # used to load any images,
# the scoring is still split by this time feature.
# This means that separate scorers are created for each of the
# three values of ImageName, and each scorer is active only when
# the ImageName value matches the that scorer's required value.

s:Ge/Phantom/Type     = "TsBox"
s:Ge/Phantom/Parent   = "World"
s:Ge/Phantom/Material = "G4_WATER"
d:Ge/Phantom/HLX      = 80.0 cm
d:Ge/Phantom/HLY      = 80.0 cm
d:Ge/Phantom/HLZ      = 80.0 cm
d:Ge/Phantom/TransX   = 0. cm
d:Ge/Phantom/TransY   = 0. cm
d:Ge/Phantom/TransZ   = -30. cm
d:Ge/Phantom/RotX     = 0. deg
d:Ge/Phantom/RotY     = 0. deg
d:Ge/Phantom/RotZ     = 0. deg

s:Sc/DoseAtPhantom/Quantity                  = "DoseToMedium"
s:Sc/DoseAtPhantom/Component                 = "Phantom"
b:Sc/DoseAtPhantom/OutputToConsole           = "TRUE"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom/SplitByTimeFeature        = "ImageName"

# This time feature will take one of three string values.
s:Tf/ImageName/Function      = "Step"
dv:Tf/ImageName/Times        = 3 10 20 30 ms
sv:Tf/ImageName/Values       = 3 "lung1" "lung2" "lung3"
d:Tf/TimelineEnd             = 40.0 ms
i:Tf/NumberOfSequentialTimes = 4
i:Tf/Verbosity               = 1

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

s:Gr/View/Type = "OpenGL"

Surfaces.txt

# Test of scoring on various surfaces

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

s:Ge/TestBox/Type     = "TsBox"
s:Ge/TestBox/Parent   = "World"
s:Ge/TestBox/Material = "G4_WATER"
d:Ge/TestBox/HLX      = 20.0 cm
d:Ge/TestBox/HLY      = 15.0 cm
d:Ge/TestBox/HLZ      = 10.0 cm
s:Ge/TestBox/Color    = "blue"

s:Ge/TestSphere/Type     = "TsSphere"
s:Ge/TestSphere/Parent   = "World"
s:Ge/TestSphere/Material = "G4_WATER"
d:Ge/TestSphere/RMin     = 5.0 cm
d:Ge/TestSphere/RMax     = 7.0 cm
d:Ge/TestSphere/SPhi     = 0. deg
d:Ge/TestSphere/DPhi     = 360. deg
d:Ge/TestSphere/STheta   = 0. deg
d:Ge/TestSphere/DTheta   = 180. deg
d:Ge/TestSphere/TransZ   = -20. cm
s:Ge/TestSphere/Color    = "blue"

s:Ge/TestCylinder/Type     = "TsCylinder"
s:Ge/TestCylinder/Parent   = "World"
s:Ge/TestCylinder/Material = "G4_WATER"
d:Ge/TestCylinder/RMin     = 0.0 cm
d:Ge/TestCylinder/RMax     = 8.0 cm
d:Ge/TestCylinder/HL       = 10.0 cm
d:Ge/TestCylinder/SPhi     = 0. deg
d:Ge/TestCylinder/DPhi     = 360. deg
d:Ge/TestCylinder/TransZ   = -40. cm
s:Ge/TestCylinder/Color    = "blue"

s:Sc/BoxXPlus/Quantity         = "SurfaceTrackCount"
s:Sc/BoxXPlus/Surface          = "TestBox/XPlusSurface"
b:Sc/BoxXPlus/OutputToConsole  = "TRUE"

s:Sc/BoxXMinus/Quantity        = "SurfaceTrackCount"
s:Sc/BoxXMinus/Surface         = "TestBox/XMinusSurface"
b:Sc/BoxXMinus/OutputToConsole = "TRUE"

s:Sc/BoxYPlus/Quantity         = "SurfaceTrackCount"
s:Sc/BoxYPlus/Surface          = "TestBox/YPlusSurface"
b:Sc/BoxYPlus/OutputToConsole  = "TRUE"

s:Sc/BoxYMinus/Quantity        = "SurfaceTrackCount"
s:Sc/BoxYMinus/Surface         = "TestBox/YMinusSurface"
b:Sc/BoxYMinus/OutputToConsole = "TRUE"

s:Sc/BoxZPlus/Quantity         = "SurfaceTrackCount"
s:Sc/BoxZPlus/Surface          = "TestBox/ZPlusSurface"
b:Sc/BoxZPlus/OutputToConsole  = "TRUE"

s:Sc/BoxZMinus/Quantity        = "SurfaceTrackCount"
s:Sc/BoxZMinus/Surface         = "TestBox/ZMinusSurface"
b:Sc/BoxZMinus/OutputToConsole = "TRUE"

s:Sc/SphereInner/Quantity        = "SurfaceTrackCount"
s:Sc/SphereInner/Surface         = "TestSphere/InnerCurvedSurface"
b:Sc/SphereInner/OutputToConsole = "TRUE"

s:Sc/SphereOuter/Quantity        = "SurfaceTrackCount"
s:Sc/SphereOuter/Surface         = "TestSphere/OuterCurvedSurface"
b:Sc/SphereOuter/OutputToConsole = "TRUE"


s:Sc/CylinderZPlus/Quantity         = "SurfaceTrackCount"
s:Sc/CylinderZPlus/Surface          = "TestCylinder/ZPlusSurface"
b:Sc/CylinderZPlus/OutputToConsole  = "TRUE"

s:Sc/CylinderZMinus/Quantity        = "SurfaceTrackCount"
s:Sc/CylinderZMinus/Surface         = "TestCylinder/ZMinusSurface"
b:Sc/CylinderZMinus/OutputToConsole = "TRUE"

s:Sc/CylinderInner/Quantity         = "SurfaceTrackCount"
s:Sc/CylinderInner/Surface          = "TestCylinder/InnerCurvedSurface"
b:Sc/CylinderInner/OutputToConsole  = "TRUE"

s:Sc/CylinderOuter/Quantity         = "SurfaceTrackCount"
s:Sc/CylinderOuter/Surface          = "TestCylinder/OuterCurvedSurface"
b:Sc/CylinderOuter/OutputToConsole  = "TRUE"

s:Gr/ViewA/Type = "OpenGL"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1000

i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/PauseBeforeQuit = "True"

VoxelMaterials.txt

sv:Ge/Phantom/VoxelMaterials = 1000
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air" "Air"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead"
"Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead"
"Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead"
"Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead" "Lead"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"
"G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER" "G4_WATER"

SpecialComponents

CAD.txt

# Builds components on-the-fly from information in CAD files.
# The first component is built from the PLY format.
# The second component is built from the STL format.

d:Ge/World/HLX = 10 cm
d:Ge/World/HLY = 10 cm
d:Ge/World/HLZ = 10 cm

d:Ge/BeamPosition/TransZ = -7 cm
d:Ge/BeamPosition/RotX   = 0 deg

s:Ge/CADVolumePly/Parent     = "World"
s:Ge/CADVolumePly/Material   = "Brass"
s:Ge/CADVolumePly/Type       = "TsCAD"
s:Ge/CADVolumePly/InputFile  = "Aperture_cm"
s:Ge/CADVolumePly/FileFormat = "ply"
d:Ge/CADVolumePly/Units      = 0.5 cm
d:Ge/CADVolumePly/TransX     = -4 cm
d:Ge/CADVolumePly/TransY     = -4 cm
d:Ge/CADVolumePly/TransZ     = -6.5 cm
d:Ge/CADVolumePly/RotX       = 0 deg
d:Ge/CADVolumePly/RotY       = 0 deg
d:Ge/CADVolumePly/RotZ       = 0 deg

s:Ge/CADVolumeStl/Parent     = "World"
s:Ge/CADVolumeStl/Material   = "Lead"
s:Ge/CADVolumeStl/Type       = "TsCAD"
s:Ge/CADVolumeStl/InputFile  = "Aperture_cm"
s:Ge/CADVolumeStl/FileFormat = "stl"
d:Ge/CADVolumeStl/Units      = 0.5 cm
d:Ge/CADVolumeStl/TransX     = -4 cm
d:Ge/CADVolumeStl/TransY     = -4 cm
d:Ge/CADVolumeStl/TransZ     = 0 cm
d:Ge/CADVolumeStl/RotX       = 0 deg
d:Ge/CADVolumeStl/RotY       = 0 deg
d:Ge/CADVolumeStl/RotZ       = 0 deg

s:Gr/view/Type        = "OpenGl"
d:Gr/view/Theta       = 45 deg
d:Gr/view/Phi         = 45 deg
u:Gr/view/Zoom        = 1.5
b:Gr/view/IncludeAxes = "True"
d:Gr/view/AxesSize    = 8 cm

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 150 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 3 cm
d:So/Example/BeamPositionCutoffY      = 3 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 30

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/PauseBeforeQuit = "True"

DipoleMagnet.txt

# Dipole magnet

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"

s:Ge/Dipole/Type          = "TsBox"
s:Ge/Dipole/Parent        = "Nozzle"
s:Ge/Dipole/Material      = "G4_AIR"
d:Ge/Dipole/HLX           = 10 cm
d:Ge/Dipole/HLY           = 10 cm
d:Ge/Dipole/HLZ           = 20 cm
s:Ge/Dipole/Field = "DipoleMagnet"
u:Ge/Dipole/MagneticFieldDirectionX    = 0.0
u:Ge/Dipole/MagneticFieldDirectionY    = 1.0
u:Ge/Dipole/MagneticFieldDirectionZ    = 0.0
d:Ge/Dipole/MagneticFieldStrength      = 3.0 tesla

s:Ge/InnerBox/Type     = "TsBox"
s:Ge/InnerBox/Parent   = "Dipole"
s:Ge/InnerBox/Material = "G4_AIR"
d:Ge/InnerBox/HLX      = 9 cm
d:Ge/InnerBox/HLY      = 9 cm
d:Ge/InnerBox/HLZ      = 18 cm

d:Ge/BeamPosition/TransZ = Ge/World/HLZ cm
d:Ge/BeamPosition/RotX   = 180. deg

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "chargedgeantino"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 5.0 cm
d:So/Example/BeamPositionCutoffY      = 5.0 cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 1

s:Gr/ViewA/Type              = "OpenGL"
i:Gr/ViewA/WindowSizeX       = 1024
i:Gr/ViewA/WindowSizeY       = 768
d:Gr/ViewA/Theta             = 55 deg
d:Gr/ViewA/Phi               = 20 deg
s:Gr/ViewA/Projection        = "Perspective"
d:Gr/ViewA/PerspectiveAngle  = 30 deg
u:Gr/ViewA/Zoom              = 1.
b:Gr/ViewA/IncludeStepPoints = "True"

b:Ts/PauseBeforeQuit = "True"

MultiLeafCollimator.txt

# Multileaf Collimator

d:Ge/World/HLX       = 2. m
d:Ge/World/HLY       = 2. m
d:Ge/World/HLZ       = 2. m
s:Ge/World/Material  = "G4_Galactic"
b:Ge/World/Invisible = "TRUE"


###########################################
# Multi-leaf Collimator
###########################################
s:Ge/MultiLeafCollimatorA/Type              = "TsMultiLeafCollimator"
s:Ge/MultiLeafCollimatorA/Parent            = "World"
s:Ge/MultiLeafCollimatorA/Material          = "Aluminum"
d:Ge/MultiLeafCollimatorA/TransX            = 0.0 cm
d:Ge/MultiLeafCollimatorA/TransY            = 0.0 cm
d:Ge/MultiLeafCollimatorA/TransZ            = 0.0 cm
d:Ge/MultiLeafCollimatorA/RotX              = 0.0 deg
d:Ge/MultiLeafCollimatorA/RotY              = 0.0 deg
d:Ge/MultiLeafCollimatorA/RotZ              = 0.0 deg
s:Ge/MultiLeafCollimatorA/DrawingStyle      = "Solid"
b:Ge/MultiLeafCollimatorA/PrintInformation  = "True"

d:Ge/MultiLeafCollimatorA/MaximumLeafOpen   = 5.0 cm
d:Ge/MultiLeafCollimatorA/Thickness         = 5.0 cm
d:Ge/MultiLeafCollimatorA/Length            = 6.0 cm
dv:Ge/MultiLeafCollimatorA/Widths           = 5 1.5 0.5 0.5 0.5 1.5 cm
dv:Ge/MultiLeafCollimatorA/XMinusLeavesOpen = 5 0.0 -0.3 -0.2 -0.5 0.0 cm
dv:Ge/MultiLeafCollimatorA/XPlusLeavesOpen  = 5 0.0  0.3 0.2  0.5 0.0 cm


##############################################################
# Physics and Beam Section
##############################################################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 230.0 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 1.0 cm
d:So/Example/BeamPositionSpreadY      = 1.0 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 5

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 600
i:Gr/ViewA/WindowSizeY      = 600
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Orthogonal"
d:Gr/ViewA/PerspectiveAngle = 20 deg
u:Gr/ViewA/Zoom             = 1.6
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

b:Gr/ViewA/IncludeAxes   = "true"
s:Gr/ViewA/AxesComponent = "MultiLeafCollimatorA"
d:Gr/ViewA/AxesSize      = 0.1 m

MultiLeafCollimator_sequence.txt

# Multileaf collimator moving in a time sequence

includeFile = MultiLeafCollimator.txt

dv:Ge/MultiLeafCollimatorA/XPlusLeavesOpen  = 5 0.0 Tf/LeafXPlus1/Value Tf/LeafXPlus0/Value Tf/LeafXPlus2/Value 0.0 cm
dv:Ge/MultiLeafCollimatorA/XMinusLeavesOpen = 5 0.0  Tf/LeafXMinus1/Value Tf/LeafXMinus0/Value Tf/LeafXMinus2/Value 0.0 cm

s:Tf/LeafXPlus0/Function            = "Linear cm"
d:Tf/LeafXPlus0/Rate                = 0.02 cm/ms
d:Tf/LeafXPlus0/StartValue          = 0.0 cm
d:Tf/LeafXPlus0/RepetitionInterval  = 100.0 ms

s:Tf/LeafXMinus0/Function           = "Linear cm"
d:Tf/LeafXMinus0/Rate               = 0.01 cm/ms
d:Tf/LeafXMinus0/StartValue         = -0.5 cm
d:Tf/LeafXMinus0/RepetitionInterval = 100.0 ms

s:Tf/LeafXPlus1/Function            = "Linear cm"
d:Tf/LeafXPlus1/Rate                = 0.04 cm/ms
d:Tf/LeafXPlus1/StartValue          = 0.5 cm
d:Tf/LeafXPlus1/RepetitionInterval  = 100.0 ms

s:Tf/LeafXMinus1/Function           = "Linear cm"
d:Tf/LeafXMinus1/Rate               = 0.01 cm/ms
d:Tf/LeafXMinus1/StartValue         = 0.0 cm
d:Tf/LeafXMinus1/RepetitionInterval = 100.0 ms

s:Tf/LeafXPlus2/Function            = "Linear cm"
d:Tf/LeafXPlus2/Rate                = -0.02 cm/ms
d:Tf/LeafXPlus2/StartValue          = 0.5 cm
d:Tf/LeafXPlus2/RepetitionInterval  = 100.0 ms

s:Tf/LeafXMinus2/Function           = "Linear cm"
d:Tf/LeafXMinus2/Rate               = -0.03 cm/ms
d:Tf/LeafXMinus2/StartValue         = 0.0 cm
d:Tf/LeafXMinus2/RepetitionInterval = 100.0 ms

d:Tf/TimelineEnd             = 100.0 ms
i:Tf/NumberOfSequentialTimes = 60
i:Tf/Verbosity               = 1
b:Ts/PauseBeforeQuit         = "False"

i:Gr/ViewA/WindowSizeX     = 1024
i:Gr/ViewA/WindowSizeY     = 768
u:Gr/ViewA/Zoom            = 2.
d:Gr/ViewA/Theta           = Tf/Rot1/Value deg
d:Gr/ViewA/Phi             = 90 deg + Tf/Rot1/Value
b:Gr/ViewA/CopyOpenGLToEPS = "False"

s:Tf/Rotate/Function           = "Linear deg"
d:Tf/Rotate/Rate               = 1. deg/ms
d:Tf/Rotate/StartValue         = -40.0 deg
d:Tf/Rotate/RepetitionInterval = 100. ms

s:Tf/Rot1/Function           = "Step"
dv:Tf/Rot1/Times             = 2 40 100 ms
dv:Tf/Rot1/Values            = 2 0. Tf/Rotate/Value deg
d:Tf/Rot1/RepetitionInterval = 100. ms

MultiWire_Chamber.txt

# Multiwire chamber

d:Ge/World/HLX = 50. cm
d:Ge/World/HLY = 60. cm
d:Ge/World/HLZ = 20. cm

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
b:Ts/PauseBeforeQuit = "True"

s:Ge/WireChamberA/Parent           = "World"
s:Ge/WireChamberA/Type             = "TsMultiWireChamber"
d:Ge/WireChamberA/HLX              = 30.0 cm
d:Ge/WireChamberA/HLY              = 30.0 cm
d:Ge/WireChamberA/HLZ              = 10.0 cm
s:Ge/WireChamberA/Material         = "Air"
d:Ge/WireChamberA/TransX           = 0.0 cm
d:Ge/WireChamberA/TransY           = 0.0 cm
d:Ge/WireChamberA/TransZ           = 0.0 cm
d:Ge/WireChamberA/RotX             = 0.0 deg
d:Ge/WireChamberA/RotY             = 0.0 deg
d:Ge/WireChamberA/RotZ             = 0.0 deg
b:Ge/WireChamberA/PrintInformation = "True"
i:Ge/WireChamberA/NbOfLayers       = 2

d:Ge/WireChamberA/Layer1/RMin          = 0.0 cm
d:Ge/WireChamberA/Layer1/RMax          = 1.0 cm
s:Ge/WireChamberA/Layer1/Material      = "Brass"
d:Ge/WireChamberA/Layer1/HL            = 20.0 cm
s:Ge/WireChamberA/Layer1/Align         = "X"
dv:Ge/WireChamberA/Layer1/Displacement = 3 -10 0 10 cm
d:Ge/WireChamberA/Layer1/PosZ          = 5.0 cm
s:Ge/WireChamberA/Layer1/DrawingStyle  = "FullWireFrame"
s:Ge/WireChamberA/Layer1/Color         = "red"

d:Ge/WireChamberA/Layer2/RMin          = 0.5 cm
d:Ge/WireChamberA/Layer2/RMax          = 1.0 cm
s:Ge/WireChamberA/Layer2/Material      = "Lexan"
d:Ge/WireChamberA/Layer2/HL            = 20.0 cm
s:Ge/WireChamberA/Layer2/Align         = "Y"
dv:Ge/WireChamberA/Layer2/Displacement = 5 -20 -10 0 10 20 cm
d:Ge/WireChamberA/Layer2/PosZ          = -5.0 cm
s:Ge/WireChamberA/Layer2/DrawingStyle  = "Solid"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 600
i:Gr/ViewA/WindowSizeY      = 600
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Orthogonal"
#s:Gr/ViewA/Projection       = "Perspective"
#d:Gr/ViewA/PerspectiveAngle = 20 deg
u:Gr/ViewA/Zoom             = 2.
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

b:Gr/ViewA/IncludeAxes   = "true"
s:Gr/ViewA/AxesComponent = "WireChamberA"
d:Gr/ViewA/AxesSize      = 0.1 m

Propeller_ContinuousRotation.txt

# Propeller with continuous rotation

includeFile = Propeller.txt

b:Ts/PauseBeforeQuit = "False"

d:Ge/PropellerA/RotZ = Tf/PropellerRot/Value deg

s:Tf/PropellerRot/Function           = "Linear deg"
d:Tf/PropellerRot/Rate               = 3.6 deg/ms
d:Tf/PropellerRot/StartValue         = 0.0 deg
d:Tf/PropellerRot/RepetitionInterval = 100.0 ms

d:Tf/TimelineEnd             = 100.0 ms
i:Tf/NumberOfSequentialTimes = 100
i:Tf/Verbosity               = 1

Propeller_StepRotation.txt

# Propeller with step rotation

includeFile = Propeller.txt

b:Ts/PauseBeforeQuit = "False"

d:Ge/PropellerA/RotZ       = Tf/PropellerRot/Value deg

s:Tf/PropellerRot/Function = "Step"
dv:Tf/PropellerRot/Times   = 10 10  20 30 40 50 60 70 80 90 100 ms
dv:Tf/PropellerRot/Values  = 10 0 36 72 108 144 180 216 252 288 324 deg

d:Tf/TimelineEnd                    = 100.0 ms
i:Tf/NumberOfSequentialTimes        = 100
i:So/Example/NumberOfHistoriesInRun = 10
i:Tf/Verbosity                      = 1

Propeller.txt

# Propeller

d:Ge/World/HLX = 30. cm
d:Ge/World/HLY = 30. cm
d:Ge/World/HLZ = 10. cm

s:Ge/PropellerA/Type             = "TsPropeller"
s:Ge/PropellerA/Parent           = "World"
d:Ge/PropellerA/TransX           = 0.0 cm
d:Ge/PropellerA/TransY           = 0.0 cm
d:Ge/PropellerA/TransZ           = 0.0 cm
d:Ge/PropellerA/RotX             = 0.0 deg
d:Ge/PropellerA/RotY             = 0.0 deg
d:Ge/PropellerA/RotZ             = 0.0 deg
b:Ge/PropellerA/Invisible        = "TRUE"
b:Ge/PropellerA/PrintInformation = "True"

i:Ge/PropellerA/NbOfBlades = 4
d:Ge/PropellerA/Rin        = 10.0 mm
d:Ge/PropellerA/Rout       = 127.5 mm

s:Ge/PropellerA/Blade/Material         = "Parent" #Set to Parent
s:Ge/PropellerA/Blade/Color            = "skyblue"
s:Ge/PropellerA/Blade/DrawingStyle     = "Solid"
i:Ge/PropellerA/Blade/VisSegsPerCircle = 360
d:Ge/PropellerA/Blade/MaxStepSize      = 10 mm

dv:Ge/PropellerA/Thickness = 10
0.5	0.6	0.7	0.8	0.9	1.0	1.1	1.2	1.3	1.4	mm

dv:Ge/PropellerA/Angles = 10
63.15  54.15  46.450  40.65  35.85  31.8   28.1   24.725  21.8   19.1   deg

sv:Ge/PropellerA/Materials = 10
"Lexan" "G4_WATER" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE"
"G4_POLYVINYL_ACETATE"  "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE" "G4_POLYVINYL_ACETATE"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 2

b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 600
i:Gr/ViewA/WindowSizeY      = 600
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 20 deg
u:Gr/ViewA/Zoom             = 2.
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

b:Gr/ViewA/IncludeAxes   = "true"
s:Gr/ViewA/AxesComponent = "PropellerA"
d:Gr/ViewA/AxesSize      = 0.1 m

PurgingMagnet_move.txt

# A purging magnet, with a non-uniform field,
# defined by the Opera3D format file, PurgMag3D.TABLE
# is moved through a beam, such that the beam encounters
# different areas of the field map at different times.
# The effect is seen as a change over time of beam deflection.

d:Ge/World/HLX       = 1.5 m
d:Ge/World/HLY       = 1.5 m
d:Ge/World/HLZ       = 1.5 m
s:Ge/World/Material  = "Vacuum"
b:Ge/World/Invisible = "True"

sv:Ma/Iron/Components  = 1 "Iron"
uv:Ma/Iron/Fractions   = 1 1.0
d:Ma/Iron/Density      = 7.87 g/cm3
s:Ma/Iron/DefaultColor = "skyblue"

# Nozzle (a group of components)
s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"
d:Ge/Nozzle/TransX = 0. m
d:Ge/Nozzle/TransY = 0. m
d:Ge/Nozzle/TransZ = 0. m
d:Ge/Nozzle/RotX   = 0. deg
d:Ge/Nozzle/RotY   = 0. deg
d:Ge/Nozzle/RotZ   = 0. deg

d:Ge/BeamPosition/TransZ = 15. cm
d:Ge/BeamPosition/RotX   = 180. deg

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 50.0 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution  = "None"

s:Ge/MagGroup/Type    = "Group"
s:Ge/MagGroup/Parent  = "Nozzle"
d:Ge/MagGroup/TransX  = 0. m
d:Ge/MagGroup/TransY  = 0. m
d:Ge/MagGroup/TransZ  = 0. m
#Topas will crash, it the following is used
#d:Ge/MagGroup/TransZ = Tf/BackStep/Value mm
d:Ge/MagGroup/RotX    = 0. deg
d:Ge/MagGroup/RotY    = 0. deg
d:Ge/MagGroup/RotZ    = 0. deg

s:Ge/V3DBox/Field3D/Type          = "TsBox"
s:Ge/V3DBox/Field3D/Field = "MappedMagnet"
s:Ge/V3DBox/Field3D/MagneticField3DTable       = "PurgMag3D.TABLE"
# ---> ... done reading
# ---> assumed the order:  x, y, z, Bx, By, Bz
# ---> Min values x,y,z: -5 -5 -26 cm
# ---> Max values x,y,z: 5 17 10 cm
#
#After reordering if neccesary
# ---> Min values x,y,z: -5 -5 -26 cm
# ---> Max values x,y,z: 5 17 10 cm
# ---> Dif values x,y,z (range): 10 22 36 cm in z

s:Ge/V3DBox/Field3D/Parent   = "MagGroup"
s:Ge/V3DBox/Field3D/Material = "Vacuum"
d:Ge/V3DBox/Field3D/HLX      = 5 cm
d:Ge/V3DBox/Field3D/HLY      = 17 cm
d:Ge/V3DBox/Field3D/HLZ 	 = 26 cm
d:Ge/V3DBox/Field3D/TransX   = 0.0 mm
d:Ge/V3DBox/Field3D/TransY   = 0.0 mm
d:Ge/V3DBox/Field3D/TransZ   = Tf/BackForward/Value mm
#d:Ge/V3DBox/Field3D/TransZ   = Tf/BackStep/Value mm
#d:Ge/V3DBox/Field3D/TransZ   = 4.4 mm
d:Ge/V3DBox/Field3D/RotX     = 0.0 deg
d:Ge/V3DBox/Field3D/RotY     = 0.0 deg
d:Ge/V3DBox/Field3D/RotZ     = 0.0 deg
b:Ge/V3DBox/Field3D/Include  = "TRUE"

d:Ge/Constants/SSD = -50.0 cm

s:Ge/MeasureVolume/Type     = "TsBox"
s:Ge/MeasureVolume/Parent   = "World"
s:Ge/MeasureVolume/Material = "World"
d:Ge/MeasureVolume/HLX      = 140.0 cm
d:Ge/MeasureVolume/HLY      = 140.0 cm
d:Ge/MeasureVolume/HLZ 	 	= 0.5   cm
d:Ge/MeasureVolume/TransX   = 0.0 cm
d:Ge/MeasureVolume/TransY   = 0.0 cm
#-1*(SSD + HLZ)
d:Ge/MeasureVolume/TransZ   = -50.5 cm
d:Ge/MeasureVolume/RotX     = 0.0 deg
d:Ge/MeasureVolume/RotY     = 0.0 deg
d:Ge/MeasureVolume/RotZ     = 0.0 deg

s:Ge/Gap1/Type     = "G4Trd"
s:Ge/Gap1/Parent   = "Nozzle"
#s:Ge/Gap1/Parent   = V3DBox
s:Ge/Gap1/Material = "Iron"
d:Ge/Gap1/HLX1     = 5.0 cm
d:Ge/Gap1/HLX2     = 9.185 cm
d:Ge/Gap1/HLY1     = 5.0 cm
d:Ge/Gap1/HLY2     = 5.0 cm
d:Ge/Gap1/HLZ 	   = 5.725 cm
d:Ge/Gap1/TransX   = -9.55 cm
d:Ge/Gap1/TransY   = 0.0 cm
d:Ge/Gap1/TransZ   = -6.89 cm
d:Ge/Gap1/RotX     = 0.0 deg
d:Ge/Gap1/RotY     = 0.0 deg
d:Ge/Gap1/RotZ     = 0.0 deg
s:Ge/Gap1/DrawingStyle = "FullWireFrame"
b:Ge/Gap1/Include  = "FALSE"

s:Ge/Gap2/Type     = "G4Trd"
s:Ge/Gap2/Parent   = "Nozzle"
#s:Ge/Gap2/Parent   = "V3DBox"
s:Ge/Gap2/Material = "Iron"
d:Ge/Gap2/HLX1     = 5.0 cm
d:Ge/Gap2/HLX2     = 9.185 cm
d:Ge/Gap2/HLY1     = 5.0 cm
d:Ge/Gap2/HLY2     = 5.0 cm
d:Ge/Gap2/HLZ 	   = 5.725 cm
d:Ge/Gap2/TransX   = 9.55 cm
d:Ge/Gap2/TransY   = 0.0 cm
d:Ge/Gap2/TransZ   = -6.89 cm
d:Ge/Gap2/RotX     = 0.0 deg
d:Ge/Gap2/RotY     = 0.0 deg
d:Ge/Gap2/RotZ     = 0.0 deg
b:Ge/Gap2/Include  = "FALSE"
s:Ge/Gap2/DrawingStyle = "FullWireFrame"

#1. Available steppers:
s:Ge/V3DBox/Field3D/Stepper = "ExplictEuler"
#ExplicitEuler (default)
#ImplicitEuler
#SimpleRunge
#SimpleHeum
#HelixExplicitEuler
#HelixImplicitEuler
#HelixSimpleRunge
#CashKarpRKF45
#RKG3_Stepper

#2. StepMinimum (1.0 mm by default)
d:Ge/V3DBox/Field3D/StepMinimum = 1.0 mm

#3. DeltaChord  (0.1 mm by default)
d:Ge/V3DBox/Field3D/DeltaChord = 0.1 mm

Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Tf/BackStep/Function           = "Linear mm"
d:Tf/BackStep/RepetitionInterval = 100.0 ms
d:Tf/BackStep/Rate               = 3 mm/ms
d:Tf/BackStep/StartValue         = 0.0 mm

s:Tf/ForwardStep/Function           = "Linear mm"
d:Tf/ForwardStep/RepetitionInterval = 100.0 ms
d:Tf/ForwardStep/Rate               = -3 mm/ms
d:Tf/ForwardStep/StartValue         = 300.0 mm

s:Tf/BackForward/Function = "step"
dv:Tf/BackForward/Times   = 2 100.0 200.0 ms
dv:Tf/BackForward/Values  = 2 Tf/BackStep/Value Tf/ForwardStep/Value mm

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 2.
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

i:So/Example/NumberOfHistoriesInRun = 4
d:Tf/TimelineEnd             = 200.0 ms
i:Tf/NumberOfSequentialTimes = 200

QuadAndDipoleMagnets.txt

# Beam passes through a quadrupole magnet followed by
# a time-varying dipole magnet.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"
s:Ge/World/Material  = "Vacuum"

# Nozzle (a group of components)
s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"
d:Ge/Nozzle/TransX = 0. m
d:Ge/Nozzle/TransY = 0. m
d:Ge/Nozzle/TransZ = 0. m
d:Ge/Nozzle/RotX   = 0. deg
d:Ge/Nozzle/RotY   = 0. deg
d:Ge/Nozzle/RotZ   = 0. deg


##########################################
# Quadrupole pair for focusing beam spot
##########################################
s:Ge/QBox1/Quad/Type          = "TsBox"
s:Ge/QBox1/Quad/Parent        = "Nozzle"
s:Ge/QBox1/Quad/Material      = "G4_AIR"
d:Ge/QBox1/Quad/HLX           = 15 cm
d:Ge/QBox1/Quad/HLY           = 15 cm
d:Ge/QBox1/Quad/HLZ           = 10 cm
d:Ge/QBox1/Quad/TransX        = 0.0 cm
d:Ge/QBox1/Quad/TransY        = 0.0 cm
d:Ge/QBox1/Quad/TransZ        = 160  cm + Ge/QBox1/Quad/HLZ
d:Ge/QBox1/Quad/RotX          = 0.0 deg
d:Ge/QBox1/Quad/RotY          = 0.0 deg
d:Ge/QBox1/Quad/RotZ          = 0.0 deg
s:Ge/QBox1/Quad/Field = "QuadrupoleMagnet"
d:Ge/QBox1/Quad/MagneticFieldGradientX     = .1 tesla/cm
d:Ge/QBox1/Quad/MagneticFieldGradientY     = .1 tesla/cm

s:Ge/QBox2/Quad/Type          = "TsBox"
s:Ge/QBox2/Quad/Parent        = "Nozzle"
s:Ge/QBox2/Quad/Material      = "G4_AIR"
d:Ge/QBox2/Quad/HLX           = 15 cm
d:Ge/QBox2/Quad/HLY           = 15 cm
d:Ge/QBox2/Quad/HLZ           = 10 cm
d:Ge/QBox2/Quad/TransX        = 0.0 cm
d:Ge/QBox2/Quad/TransY        = 0.0 cm
d:Ge/QBox2/Quad/TransZ        = 140  cm + Ge/QBox2/Quad/HLZ
d:Ge/QBox2/Quad/RotX          = 0.0 deg
d:Ge/QBox2/Quad/RotY          = 0.0 deg
d:Ge/QBox2/Quad/RotZ          = 0.0 deg
s:Ge/QBox2/Quad/Field = "QuadrupoleMagnet"
d:Ge/QBox2/Quad/MagneticFieldGradientX     = .1 tesla/cm
d:Ge/QBox2/Quad/MagneticFieldGradientY     = .1 tesla/cm

##########################################
# Dipole for stiring beam direction!
##########################################
s:Ge/VBox1/Dipole/Type          = "TsBox"
s:Ge/VBox1/Dipole/Parent        = "Nozzle"
s:Ge/VBox1/Dipole/Material      = "G4_AIR"
d:Ge/VBox1/Dipole/HLX           = 10 cm
d:Ge/VBox1/Dipole/HLY           = 10 cm
d:Ge/VBox1/Dipole/HLZ           = 20 cm
d:Ge/VBox1/Dipole/TransX        = 0.0 cm
d:Ge/VBox1/Dipole/TransY        = 0.0 cm
d:Ge/VBox1/Dipole/TransZ        = 50.0 cm + Ge/VBox1/Dipole/HLZ
d:Ge/VBox1/Dipole/RotX          = 0.0 deg
d:Ge/VBox1/Dipole/RotY          = 0.0 deg
d:Ge/VBox1/Dipole/RotZ          = 0.0 deg
s:Ge/VBox1/Dipole/Field = "DipoleMagnet"
u:Ge/VBox1/Dipole/MagneticFieldDirectionX    = 0.0
u:Ge/VBox1/Dipole/MagneticFieldDirectionY    = 1.0
u:Ge/VBox1/Dipole/MagneticFieldDirectionZ    = 0.0
d:Ge/VBox1/Dipole/MagneticFieldStrength      = 0.0 tesla

s:Ge/VBox2/Dipole/Type          = "TsBox"
s:Ge/VBox2/Dipole/Parent        = "Nozzle"
s:Ge/VBox2/Dipole/Material      = "G4_AIR"
d:Ge/VBox2/Dipole/HLX           = 10 cm
d:Ge/VBox2/Dipole/HLY           = 10 cm
d:Ge/VBox2/Dipole/HLZ           = 20 cm
d:Ge/VBox2/Dipole/TransX        = 0.0 cm
d:Ge/VBox2/Dipole/TransY        = 0.0 cm
d:Ge/VBox2/Dipole/TransZ        = 90.0 cm + Ge/VBox2/Dipole/HLZ
d:Ge/VBox2/Dipole/RotX          = 0.0 deg
d:Ge/VBox2/Dipole/RotY          = 0.0 deg
d:Ge/VBox2/Dipole/RotZ          = 0.0 deg
s:Ge/VBox2/Dipole/Field = "DipoleMagnet"
u:Ge/VBox2/Dipole/MagneticFieldDirectionX    = 1.0
u:Ge/VBox2/Dipole/MagneticFieldDirectionY    = 0.0
u:Ge/VBox2/Dipole/MagneticFieldDirectionZ    = 0.0
d:Ge/VBox2/Dipole/MagneticFieldStrength      = Tf/BField1st/Value tesla

##########################################
# Target window
##########################################
# Vacuum Window: Target !
s:Ge/VacFilm/Type         = "TsBox"
s:Ge/VacFilm/Parent       = "World"
s:Ge/VacFilm/Material     = "Lead"
d:Ge/VacFilm/HLX          = 50.0 cm
d:Ge/VacFilm/HLY          = 50.0 cm
d:Ge/VacFilm/HLZ          = 1.0 cm
d:Ge/VacFilm/TransX       = 0. cm
d:Ge/VacFilm/TransY       = 0. cm
d:Ge/VacFilm/TransZ       = -60. cm
d:Ge/VacFilm/RotX         = 0. deg
d:Ge/VacFilm/RotY         = 0.0 deg
d:Ge/VacFilm/RotZ         = 0. deg
s:Ge/VacFilm/Color        = "brown"
s:Ge/VacFilm/DrawingStyle = "solid"

##########################################
# Ps source
##########################################
d:Ge/BeamPosition/TransZ = Ge/World/HLZ cm
d:Ge/BeamPosition/RotX   = 180. deg

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 40.0 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 5.0 cm
d:So/Example/BeamPositionCutoffY      = 5.0 cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "None"

s:Tf/BField1st/Function = "Step"
dv:Tf/BField1st/Times   = 2 10.0 20.0 ms
dv:Tf/BField1st/Values  = 2 Tf/BField1stLeft/Value Tf/BField1stRight/Value tesla

s:Tf/BField1stLeft/Function            = "Linear tesla"
d:Tf/BField1stLeft/Rate                = 0.08 tesla/ms
d:Tf/BField1stLeft/StartValue          = -0.32 tesla
d:Tf/BField1stLeft/RepetitionInterval  = 10.0 ms

s:Tf/BField1stRight/Function           = "Linear tesla"
d:Tf/BField1stRight/Rate               = -0.08 tesla/ms
d:Tf/BField1stRight/StartValue         = 0.32 tesla
d:Tf/BField1stRight/RepetitionInterval = 10.0 ms

s:Tf/SmallBox/Function           = "Linear tesla"
d:Tf/SmallBox/Rate               = 0.1 tesla/ms
d:Tf/SmallBox/StartValue         = 0.0 tesla
d:Tf/SmallBox/RepetitionInterval = 70. ms

#Ph/Default/Modules = 1 "g4em-standard_opt0"

i:So/Example/NumberOfHistoriesInRun = 10
d:Tf/TimelineEnd             = 40.0 ms
i:Tf/NumberOfSequentialTimes = 120

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
u:Gr/ViewA/TransX           = -.2
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 2.0
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
b:Gr/ViewA/CopyOpenGLToEPS  = "False"

QuadInMovingNozzle.txt

# Magnet mounted in a rotating nozzle

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "ExitWindow"
s:So/Example/BeamParticle             = "chargedgeantino"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 3.0 cm
d:So/Example/BeamPositionCutoffY      = 3.0 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

b:Ts/PauseBeforeQuit = "True"

s:Tf/NozzleRotation/Function           = "Linear deg"
d:Tf/NozzleRotation/Rate               = 15. deg/ms
d:Tf/NozzleRotation/StartValue         = .0 deg
d:Tf/NozzleRotation/RepetitionInterval = 360. ms
d:Tf/TimelineEnd                       = 20.0 ms
i:Tf/NumberOfSequentialTimes           = 20

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"
d:Ge/Nozzle/RotX   = Tf/NozzleRotation/value deg

s:Ge/ExitWindow/Type         = "TsCylinder"
s:Ge/ExitWindow/Parent       = "Nozzle"
s:Ge/ExitWindow/Material     = "Mylar"
d:Ge/ExitWindow/RMax         = 50.0 mm
d:Ge/ExitWindow/HL           = 0.05 mm
d:Ge/ExitWindow/TransZ       = 40. cm
d:Ge/ExitWindow/RotY         = 180.0 deg
s:Ge/ExitWindow/DrawingStyle = "Solid"

s:Ge/MagnetBox/Type     = "TsBox"
s:Ge/MagnetBox/Parent   = "Nozzle"
s:Ge/MagnetBox/Material = "G4_AIR"
d:Ge/MagnetBox/HLX      = 18 cm
d:Ge/MagnetBox/HLY      = 10 cm
d:Ge/MagnetBox/HLZ      = 20 cm

#s:Ge/MagnetBox/Field = "DipoleMagnet"
#u:Ge/MagnetBox/MagneticFieldDirectionX    = 1.0
#u:Ge/MagnetBox/MagneticFieldDirectionY    = 1.0
#u:Ge/MagnetBox/MagneticFieldDirectionZ    = 0.0
#d:Ge/MagnetBox/MagneticFieldStrength      = 1.0 tesla

s:Ge/MagnetBox/Field = "QuadrupoleMagnet"
d:Ge/MagnetBox/MagneticFieldGradientX     = .1 tesla/cm
d:Ge/MagnetBox/MagneticFieldGradientY     = .1 tesla/cm

s:Gr/ViewA/Type                       = "OpenGL"
i:Gr/ViewA/WindowSizeX                = 1024
i:Gr/ViewA/WindowSizeY                = 768
d:Gr/ViewA/Theta                      = 55 deg
d:Gr/ViewA/Phi                        = 20 deg
s:Gr/ViewA/Projection                 = "Perspective"
d:Gr/ViewA/PerspectiveAngle           = 30 deg
u:Gr/ViewA/Zoom                       = 1.
b:Gr/ViewA/IncludeStepPoints          = "True"
#i:Gr/ViewA/MagneticFieldArrowDensity = 10

QuadrupoleMagnet.txt

# MagnetBox magnet

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"

s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"

s:Ge/MagnetBox/Type     = "TsBox"
s:Ge/MagnetBox/Parent   = "Nozzle"
s:Ge/MagnetBox/Material = "G4_AIR"
d:Ge/MagnetBox/HLX      = 10 cm
d:Ge/MagnetBox/HLY      = 10 cm
d:Ge/MagnetBox/HLZ      = 20 cm
d:Ge/MagnetBox/RotY     = 0 deg
d:Ge/MagnetBox/RotX     = 0 deg

#s:Ge/MagnetBox/Field = "DipoleMagnet"
#u:Ge/MagnetBox/MagneticFieldDirectionX    = 1.0
#u:Ge/MagnetBox/MagneticFieldDirectionY    = 1.0
#u:Ge/MagnetBox/MagneticFieldDirectionZ    = 0.0
#d:Ge/MagnetBox/MagneticFieldStrength      = 1.0 tesla

s:Ge/MagnetBox/Field = "QuadrupoleMagnet"
d:Ge/MagnetBox/MagneticFieldGradientX     = .1 tesla/cm
d:Ge/MagnetBox/MagneticFieldGradientY     = .1 tesla/cm
d:Ge/MagnetBox/TransX        = 0 cm

d:Ge/BeamPosition/TransZ = Ge/World/HLZ cm
d:Ge/BeamPosition/RotX   = 180. deg

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "chargedgeantino"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "Flat"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 3.0 cm
d:So/Example/BeamPositionCutoffY      = 3.0 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

s:Gr/ViewA/Type              = "OpenGL"
i:Gr/ViewA/WindowSizeX       = 1024
i:Gr/ViewA/WindowSizeY       = 768
d:Gr/ViewA/Theta             = 55 deg
d:Gr/ViewA/Phi               = 20 deg
s:Gr/ViewA/Projection        = "Perspective"
d:Gr/ViewA/PerspectiveAngle  = 30 deg
u:Gr/ViewA/Zoom              = 1.
b:Gr/ViewA/IncludeStepPoints = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

b:Ts/PauseBeforeQuit = "True"

RangeModulator_ConstantBeam.txt

# Range modulator wheel in constant current beam

includeFile = RangeModulator.txt

d:Ge/RangeModulatorA/Rotz = Tf/RMW_Rotation/Value deg

i:So/Example/NumberOfHistoriesInRun = 3

d:Tf/TimelineEnd             = 12.0 ms
i:Tf/NumberOfSequentialTimes = 20

s:Tf/RMW_Rotation/Function           = "Linear deg"
d:Tf/RMW_Rotation/Rate               = 3.6 deg/ms
d:Tf/RMW_Rotation/StartValue         = 0.0 deg
d:Tf/RMW_Rotation/RepetitionInterval = 100. ms

b:Ts/PauseBeforeQuit = "False"
i:Ts/ShowHistoryCountAtInterval = 0

# Show time feature steps on console
i:Tf/Verbosity = 1

b:Gr/ViewA/CopyOpenGLToEPS = "False"

RangeModulator_CurrentModulatedBeam.txt

# Range modulator wheel in modulated current beam

includeFile = RangeModulator_ConstantBeam.txt

s:Tf/BeamCurrent/Function = "Step"
dv:Tf/BeamCurrent/Times   = 1 10 ms
iv:Tf/BeamCurrent/Values  = 1 10

s:Tf/BeamWeight/Function = "Step"
dv:Tf/BeamWeight/Times   = 10  1 2 3 4 5 6 7 8 9 10 ms
iv:Tf/BeamWeight/Values  = 10  1 4 1 1 2 5 2 3 2 1

i:So/Example/NumberOfHistoriesInRun = Tf/BCM_1/Value

i:Tf/BCM_1/Value = Tf/BeamWeight/Value * Tf/BeamCurrent/Value

RangeModulator.txt

# Range modulator wheel

b:Ge/World/Invisible = "TRUE"

s:Ge/RangeModulatorA/Type                   = "TsRangeModulator"
s:Ge/RangeModulatorA/Material               = "Parent"
s:Ge/RangeModulatorA/Parent                 = "World"
d:Ge/RangeModulatorA/TransX                 = 10.0 cm
d:Ge/RangeModulatorA/TransY                 = 0.0  cm
d:Ge/RangeModulatorA/TransZ                 = 0.0  cm
d:Ge/RangeModulatorA/RotX                   = 0.0 deg
d:Ge/RangeModulatorA/RotY                   = 0.0 deg
d:Ge/RangeModulatorA/RotZ                   = 0.0 deg
b:Ge/RangeModulatorA/Invisible              = "TRUE"
b:Ge/RangeModulatorA/PrintInformation       = "True"

d:Ge/RangeModulatorA/HeightOfUpper          = 150 mm
d:Ge/RangeModulatorA/HeightOfMiddle         = 1.0 mm
d:Ge/RangeModulatorA/HeightOfLower          = 9.0 mm

d:Ge/RangeModulatorA/Shell/Rin              = 15.0 cm
d:Ge/RangeModulatorA/Shell/Rout             = 15.5 cm
s:Ge/RangeModulatorA/Shell/Material         = "Aluminum"
s:Ge/RangeModulatorA/Shell/Color            = "grey"
s:Ge/RangeModulatorA/Shell/DrawingStyle     = "Solid"
i:Ge/RangeModulatorA/Shell/VisSegsPerCircle = 360

d:Ge/RangeModulatorA/Hub/Rin                = 6.0 cm
d:Ge/RangeModulatorA/Hub/Rout               = 7.0 cm
s:Ge/RangeModulatorA/Hub/Material           = "Aluminum"
s:Ge/RangeModulatorA/Hub/Color              = "grey"
s:Ge/RangeModulatorA/Hub/DrawingStyle       = "Solid"
i:Ge/RangeModulatorA/Hub/VisSegsPerCircle   = 360

#Upper tracks
dv:Ge/RangeModulatorA/Upper/RadialDivisions  = 1 11.0 cm
s:Ge/RangeModulatorA/Upper/Track1/Pattern    = "LexanBlockT1"
s:Ge/RangeModulatorA/Upper/Track2/Pattern    = "NULL"
#Middle tracks
dv:Ge/RangeModulatorA/Middle/RadialDivisions = 1 11.0 cm
s:Ge/RangeModulatorA/Middle/Track1/Pattern   = "InterfaceDisk"
s:Ge/RangeModulatorA/Middle/Track2/Pattern   = "HoleTrackDisk"
#Lower tracks
dv:Ge/RangeModulatorA/Lower/RadialDivisions  = 1 11.0 cm
s:Ge/RangeModulatorA/Lower/Track1/Pattern    = "LeadBlockT1"
s:Ge/RangeModulatorA/Lower/Track2/Pattern    = "NULL"

#A track pattern: 14 blocks of Lexan
d:Ge/LexanBlockT1/Offset = 0.0 deg
dv:Ge/LexanBlockT1/Angles = 14
  5.00 115.00 146.50 173.2 195.07
216.15 230.14 243.00 255.5 270.60
282.20 294.60 306.20 324.00 deg
dv:Ge/LexanBlockT1/Heights = 14
 77.0  82.0  87.0  92.15 95.0
100.4 106.0 110.2 115.3 119.5
124.0 128.8 132.00 60.0 mm
sv:Ge/LexanBlockT1/Materials = 14
"Lexan" "Lexan" "Lexan" "Lexan" "Lexan"
"Lexan" "Lexan" "Lexan" "Lexan" "Lexan"
"Lexan" "Lexan" "Lexan" "Brass"

#A track pattern of single block
dv:Ge/InterfaceDisk/Angles    = 1 0.0 deg
dv:Ge/InterfaceDisk/Heights   = 1 1.0 mm
sv:Ge/InterfaceDisk/Materials = 1 "Aluminum"

#A track pattern of two blocks but one block is a hole
dv:Ge/HoleTrackDisk/Angles    = 2 90.0 110.0 deg
dv:Ge/HoleTrackDisk/Heights   = 2  0.0  1.0 mm
sv:Ge/HoleTrackDisk/Materials = 2 "NULL" "Aluminum"

#A track pattern of 8 Lead blocks
dv:Ge/LeadBlockT1/Angles = 9
  5.00 115.00 146.50 173.2 195.07
216.15 230.14 243.00 255.5 deg
dv:Ge/LeadBlockT1/Heights = 9
 0.890 0.75 0.60 0.52 0.40
 0.30 0.16 0.070 0.0 mm
sv:Ge/LeadBlockT1/Materials = 9
"Lead" "Lead" "Lead" "Lead" "Lead"
"Lead" "Lead" "Lead" "NULL"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 30 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 1.5
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
b:Gr/ViewA/IncludeAxes                      = "true"
s:Gr/ViewA/AxesComponent                    = "RangeModulatorA"
d:Gr/ViewA/AxesSize                         = 0.1 m

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

b:Ts/PauseBeforeQuit = "True"
i:Ts/ShowHistoryCountAtInterval = 0

RidgeFilter.txt

# Ridge filter

d:Ge/World/HLX       = 0.15 m
d:Ge/World/HLY       = 0.15 m
d:Ge/World/HLZ       = 0.05 m
b:Ge/World/Invisible = "True"

######################################
# RidgeFilter Group
######################################

s:Ge/RidgeGroup/Parent = "World"
s:Ge/RidgeGroup/Type   = "Group"
d:Ge/RidgeGroup/RotX   = 0.0 deg
d:Ge/RidgeGroup/RotY   = 0.0 deg
d:Ge/RidgeGroup/RotZ   = 0.0 deg
d:Ge/RidgeGroup/TransX = 0.0 cm
d:Ge/RidgeGroup/TransY = 0.0 cm
d:Ge/RidgeGroup/TransZ = 0.0 cm

#######################################
# Ridge Filter
#######################################
s:Ge/RidgeFilterA/Type     = "TsRidgeFilter"
s:Ge/RidgeFilterA/Parent   = "RidgeGroup"
s:Ge/RidgeFilterA/Material = "Aluminum"
d:Ge/RidgeFilterA/TransX   = 0.0 cm
d:Ge/RidgeFilterA/TransY   = 0.0 cm
d:Ge/RidgeFilterA/TransZ   = 0.0 cm
d:Ge/RidgeFilterA/RotX     = 0.0 deg
d:Ge/RidgeFilterA/RotY     = 0.0 deg
d:Ge/RidgeFilterA/RotZ     = 0.0 deg
s:Ge/RidgeFilterA/DrawingStyle 	   = "Solid"
b:Ge/RidgeFilterA/PrintInformation = "True"

# Ridge Geometry: TOPAS will connect points of x and z to build a ridge.
# Then copy a ridge and place it using Displacement parameter
dv:Ge/RidgeFilterA/XPoints  = 8
0.0  0.8 1.3 1.8 2.2 2.7 3.2 4.0 mm
dv:Ge/RidgeFilterA/ZPoints  = 8
2.4 4.0 9.1 14.0 14.0 9.1 4.0 2.4 mm
d:Ge/RidgeFilterA/Width         = 4.0 mm
d:Ge/RidgeFilterA/Length        = 1.0 cm
dv:Ge/RidgeFilterA/Displacement = 3 -5.0 0.0 5.0 mm

########################################
# Physics, Beam, and Graphic setting
########################################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 230.0 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 1.0 cm
d:So/Example/BeamPositionSpreadY      = 1.0 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
b:Ts/PauseBeforeQuit = "True"

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 600
i:Gr/ViewA/WindowSizeY      = 600
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Orthogonal"
d:Gr/ViewA/PerspectiveAngle = 20 deg
u:Gr/ViewA/Zoom             = 1.6
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

b:Gr/ViewA/IncludeAxes   = "true"
s:Gr/ViewA/AxesComponent = "RidgeGroup"
d:Gr/ViewA/AxesSize      = 0.1 m

RotatingMagnet.txt

# A dipole magnet has field strength changing over time
# such that magnet is sweeping back and forth.
# At the same time, the nozzle that contains this magnet is rotating.

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "TRUE"

# Nozzle (a group of components)
s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"
d:Ge/Nozzle/TransX = 0. m
d:Ge/Nozzle/TransY = 0. m
d:Ge/Nozzle/TransZ = 0. m
d:Ge/Nozzle/RotX   = 0. deg
d:Ge/Nozzle/RotY   = 0. deg
d:Ge/Nozzle/RotZ   = Tf/MagnetRotation/Value deg

s:Tf/MagnetRotation/Function           = "Linear deg"
d:Tf/MagnetRotation/Rate               = 2. deg/ms
d:Tf/MagnetRotation/StartValue         = -0. deg
d:Tf/MagnetRotation/RepetitionInterval = 80.0 ms

##########################################
# Dipole for stiring beam direction!
##########################################

s:Ge/VBox2/Dipole/Type          = "TsBox"
s:Ge/VBox2/Dipole/Parent        = "Nozzle"
s:Ge/VBox2/Dipole/Material      = "G4_AIR"
d:Ge/VBox2/Dipole/HLX           = 10 cm
d:Ge/VBox2/Dipole/HLY           = 10 cm
d:Ge/VBox2/Dipole/HLZ           = 20 cm
d:Ge/VBox2/Dipole/TransX        = 0.0 cm
d:Ge/VBox2/Dipole/TransY        = 0.0 cm
d:Ge/VBox2/Dipole/TransZ        = 90.0 cm + Ge/VBox2/Dipole/HLZ
d:Ge/VBox2/Dipole/RotX          = 0.0 deg
d:Ge/VBox2/Dipole/RotY          = 0.0 deg
d:Ge/VBox2/Dipole/RotZ          = 0.0 deg
s:Ge/VBox2/Dipole/Field = "DipoleMagnet"
u:Ge/VBox2/Dipole/MagneticFieldDirectionX    = 1.0
u:Ge/VBox2/Dipole/MagneticFieldDirectionY    = 0.0
u:Ge/VBox2/Dipole/MagneticFieldDirectionZ    = 0.0
d:Ge/VBox2/Dipole/MagneticFieldStrength      = Tf/BField1st/Value tesla

##########################################
# Vacuum window for phase space!
##########################################
# Vacuum Window: Target !
s:Ge/VacFilm/Type     = "TsCylinder"
s:Ge/VacFilm/Parent   = "World"
s:Ge/VacFilm/Material = "G4_WATER"
d:Ge/VacFilm/RMin     = 0.0 cm
d:Ge/VacFilm/RMax     = 100.0 cm
d:Ge/VacFilm/HL       = 1.0 cm
d:Ge/VacFilm/SPhi     = 0. deg
d:Ge/VacFilm/DPhi     = 360. deg
d:Ge/VacFilm/TransX   = 0. cm
d:Ge/VacFilm/TransY   = 0. cm
d:Ge/VacFilm/TransZ   = 0. cm
d:Ge/VacFilm/RotX     = 0. deg
d:Ge/VacFilm/RotY     = 0.0 deg
d:Ge/VacFilm/RotZ     = 0. deg
s:Ge/VacFilm/Color    = "skyblue"

#s:Sc/Plane1/Quantity         = "PhaseSpace"
#s:Sc/Plane1/Surface          = "VacFilm/ZMinusSurface"
#s:Sc/Plane1/OutputType       = "ASCII"
#i:Sc/Plane1/OutputBufferSize = 1000

##########################################
# Ps source
##########################################
d:Ge/BeamPosition/TransZ = Ge/World/HLZ cm
d:Ge/BeamPosition/RotX   = 180. deg

s:Ge/World/Material = "Vacuum"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e+"
d:So/Example/BeamEnergy               = 40.0 MeV
u:So/Example/BeamEnergySpread         = 5.
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 5.0 cm
d:So/Example/BeamPositionCutoffY      = 5.0 cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.005 rad
d:So/Example/BeamAngularSpreadY       = 0.005 rad
i:So/Example/NumberOfHistoriesInRun   = 500

s:Tf/BField1st/Function = "Step"
dv:Tf/BField1st/Times   = 2 10.0 20.0 ms
dv:Tf/BField1st/Values  = 2 Tf/BField1stLeft/Value Tf/BField1stRight/Value tesla

s:Tf/BField1stLeft/Function            = "Linear tesla"
d:Tf/BField1stLeft/Rate                = 0.064 tesla/ms
d:Tf/BField1stLeft/StartValue          = -0.32 tesla
d:Tf/BField1stLeft/RepetitionInterval  = 10.0 ms

s:Tf/BField1stRight/Function           = "Linear tesla"
d:Tf/BField1stRight/Rate               = -0.064 tesla/ms
d:Tf/BField1stRight/StartValue         = 0.32 tesla
d:Tf/BField1stRight/RepetitionInterval = 10.0 ms

s:Tf/SmallBox/Function           = "Linear tesla"
d:Tf/SmallBox/Rate               = 0.1 tesla/ms
d:Tf/SmallBox/StartValue         = 0.0 tesla
d:Tf/SmallBox/RepetitionInterval = 70. ms

d:Tf/TimelineEnd                    = 40.0 ms
i:Tf/NumberOfSequentialTimes        = 10

s:Gr/ViewA/Type             = "OpenGL"
i:Gr/ViewA/WindowSizeX      = 1024
i:Gr/ViewA/WindowSizeY      = 768
d:Gr/ViewA/Theta            = 55 deg
d:Gr/ViewA/Phi              = 20 deg
s:Gr/ViewA/Projection       = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 30 deg
u:Gr/ViewA/Zoom             = 1.4
u:Gr/ViewA/TransX           = -.2
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"

UniformElectroMagneticField.txt

# Uniform electric field

d:Ge/World/HLX       = 2.0 m
d:Ge/World/HLY       = 2.0 m
d:Ge/World/HLZ       = 2.0 m
b:Ge/World/Invisible = "True"
s:Ge/World/Material = "Vacuum"

s:Ge/DriftBox/Type          = "TsBox"
s:Ge/DriftBox/Parent        = "World"
s:Ge/DriftBox/Material      = "Vacuum"
d:Ge/DriftBox/HLX           = 80 cm
d:Ge/DriftBox/HLY           = 80 cm
d:Ge/DriftBox/HLZ           = 100 cm
s:Ge/DriftBox/Field = "UniformElectroMagnetic"
u:Ge/DriftBox/ElectricFieldDirectionX    = 1.0
u:Ge/DriftBox/ElectricFieldDirectionY    = 1.0
u:Ge/DriftBox/ElectricFieldDirectionZ    = 0.0
d:Ge/DriftBox/ElectricFieldStrength      = 5000 kV/cm
u:Ge/DriftBox/MagneticFieldDirectionX    = 0.0
u:Ge/DriftBox/MagneticFieldDirectionY    = 1.0
u:Ge/DriftBox/MagneticFieldDirectionZ    = 0.0
d:Ge/DriftBox/MagneticFieldStrength      = 5.0 tesla
d:Ge/DriftBox/RotZ     = Tf/RotationStep/Value deg

d:Ge/BeamPosition/TransZ = Ge/World/HLZ cm
d:Ge/BeamPosition/RotX   = 180. deg

i:Tf/Verbosity               = 1
d:Tf/TimelineEnd             = 30.0 ms
i:Tf/NumberOfSequentialTimes = 40

s:Tf/RotationStep/Function            = "Linear deg"
d:Tf/RotationStep/Rate                = 5. deg/ms
d:Tf/RotationStep/StartValue          = -28.0 deg
d:Tf/RotationStep/RepetitionInterval  = 360. ms

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "chargedgeantino"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.0
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 5.0 cm
d:So/Example/BeamPositionCutoffY      = 5.0 cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "None"
i:So/Example/NumberOfHistoriesInRun   = 10

s:Gr/ViewA/Type              = "OpenGL"
i:Gr/ViewA/WindowSizeX       = 1024
i:Gr/ViewA/WindowSizeY       = 768
d:Gr/ViewA/Theta             = 55 deg
d:Gr/ViewA/Phi               = 20 deg
s:Gr/ViewA/Projection        = "Perspective"
d:Gr/ViewA/PerspectiveAngle  = 30 deg
u:Gr/ViewA/Zoom              = 1.
b:Gr/ViewA/IncludeStepPoints = "True"

b:Ts/PauseBeforeQuit = "True"

TimeFeature

BoxWithinBox.txt

# A box undergoes rotation relative to a parent box
# which is itself undergoing a different rotation.

d:Ge/World/HLX       = 10. m
d:Ge/World/HLY       = 10. m
d:Ge/World/HLZ       = 10. m
s:Ge/World/Material  = "Vacuum"
b:Ge/World/Invisible = "True"

d:Ge/BeamPosition/TransX = 3.9 m
d:Ge/BeamPosition/TransY = 3.9 m

s:Ge/OuterBox/Parent   = "World"
s:Ge/OuterBox/Type     = "TsBox"
s:Ge/OuterBox/Material = "Air"
d:Ge/OuterBox/HLX      = 4. m
d:Ge/OuterBox/HLY      = 4. m
d:Ge/OuterBox/HLZ      = 4. m
d:Ge/OuterBox/TransX   = 2. m
d:Ge/OuterBox/TransY   = 2. m
d:Ge/OuterBox/TransZ   = 0. m
d:Ge/OuterBox/RotX     = 0. deg
d:Ge/OuterBox/RotY     = 0. deg
d:Ge/OuterBox/RotZ     = Tf/OuterBoxStep/Value deg

s:Ge/InnerBox/Parent       = "OuterBox"
s:Ge/InnerBox/Type         = "TsBox"
s:Ge/InnerBox/Material     = "Lead"
d:Ge/InnerBox/HLX          = 1. m
d:Ge/InnerBox/HLY          = 1. m
d:Ge/InnerBox/HLZ          = 2. m
d:Ge/InnerBox/TransX       = 1. m
d:Ge/InnerBox/TransY       = 1. m
d:Ge/InnerBox/TransZ       = 0. m
d:Ge/InnerBox/RotX         = 0. deg
d:Ge/InnerBox/RotY         = Tf/InnerBoxStep/Value deg
d:Ge/InnerBox/RotZ         = Tf/InnerBoxStep/Value deg
s:Ge/InnerBox/DrawingStyle = "Solid"
s:Ge/InnerBox/Color        = "red"

s:Tf/OuterBoxRot/Function            = "Linear deg"
d:Tf/OuterBoxRot/Rate                = 2. deg/ms
d:Tf/OuterBoxRot/StartValue          = -28.0 deg
d:Tf/OuterBoxRot/RepetitionInterval  = 360. ms

s:Tf/InnerBoxRot/Function            = "Linear deg"
d:Tf/InnerBoxRot/Rate                = -2. deg/ms
d:Tf/InnerBoxRot/StartValue          = 0.0 deg
d:Tf/InnerBoxRot/RepetitionInterval  = 360. ms

s:Tf/InnerBoxStep/Function           = "Step"
dv:Tf/InnerBoxStep/Times             = 2 6 60 ms
dv:Tf/InnerBoxStep/Values            = 2 0. Tf/InnerBoxRot/Value deg
d:Tf/InnerBoxStep/RepetitionInterval = 360. ms

s:Tf/OuterBoxStep/Function           = "Step"
dv:Tf/OuterBoxStep/Times             = 2 14 60 ms
dv:Tf/OuterBoxStep/Values            = 2 0. Tf/OuterBoxRot/Value deg
d:Tf/OuterBoxStep/RepetitionInterval = 360. ms

i:Tf/Verbosity               = 1
d:Tf/TimelineEnd             = 30.0 ms
i:Tf/NumberOfSequentialTimes = 40

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
b:Gr/ViewA/CopyOpenGLToEPS                  = "False"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

CameraRotateAndZoom.txt

# Graphics views zoom and rotate under control of time features

s:Ge/Box/Type         = "TsBox"
s:Ge/Box/Parent       = "World"
s:Ge/Box/Material     = "G4_WATER"
d:Ge/Box/HLX          = 1. m
d:Ge/Box/HLY          = 1. m
d:Ge/Box/HLZ          = .4 m
d:Ge/Box/TransX       = 0. m
d:Ge/Box/TransY       = 0. m
d:Ge/Box/TransZ       = 0. m
d:Ge/Box/RotX         = 0. deg
d:Ge/Box/RotY         = 0. deg
d:Ge/Box/RotZ         = 0. deg
s:Ge/Box/DrawingStyle = "Solid"

s:Gr/ViewA/Type                       = "OpenGL"
i:Gr/ViewA/WindowSizeX                = 400
i:Gr/ViewA/WindowSizeY                = 400
i:Gr/ViewA/WindowPosX                 = 0
i:Gr/ViewA/WindowPosY                 = 0
s:Gr/ViewA/ColorBy                    = "particletype"
sv:Gr/ViewA/ColorByParticleTypeNames  = 2 "proton" "e-"
sv:Gr/ViewA/ColorByParticleTypeColors = 2 "red" "green"
d:Gr/ViewA/Theta                      = Tf/Rotate/Value deg
d:Gr/ViewA/Phi                        = Tf/Rotate/Value deg

s:Gr/ViewB/Type                             = "OpenGL"
i:Gr/ViewB/WindowSizeX                      = 400
i:Gr/ViewB/WindowSizeY                      = 400
i:Gr/ViewB/WindowPosX                       = 0
i:Gr/ViewB/WindowPosY                       = 400
u:Gr/ViewB/Zoom                             = Tf/Zoom/Value
b:Gr/ViewB/HiddenLineRemovalForTrajectories = "t"
s:Gr/ViewB/ColorBy                          = "origincomponent"
sv:Gr/ViewB/ColorByOriginComponentNames     = 2 "World" "Box"
sv:Gr/ViewB/ColorByOriginComponentColors    = 2 "yellow" "red"

s:Tf/Rotate/Function           = "Linear deg"
d:Tf/Rotate/Rate               = 2. deg/ms
d:Tf/Rotate/StartValue         = 0.0 deg
d:Tf/Rotate/RepetitionInterval = 360. ms

s:Tf/Zoom/Function           = "Linear"
d:Tf/Zoom/Rate               = 0.1 1/ms
u:Tf/Zoom/StartValue         = 1
d:Tf/Zoom/RepetitionInterval = 360. ms

d:Tf/TimelineEnd             = 90.0 ms
i:Tf/NumberOfSequentialTimes = 90

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1

b:Ts/PauseBeforeQuit = "False"

ChangingKEFilterByTimeFeature.txt

# Kinetic Energy filter cutoff varies by time feature

b:Ts/PauseBeforeQuit          = "True"
b:Ge/CheckForUnusedComponents = "False"

s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Parent   = "World"
s:Ge/Box/Material = "G4_WATER"
d:Ge/Box/HLX      = 1. m
d:Ge/Box/HLY      = 1. m
d:Ge/Box/HLZ      = .4 m
d:Ge/Box/TransX   = 0. m
d:Ge/Box/TransY   = 0. m
d:Ge/Box/TransZ   = 0. m
d:Ge/Box/RotX     = 0. deg
d:Ge/Box/RotY     = 0. deg
d:Ge/Box/RotZ     = 0. deg

s:Sc/Box/Quantity                  = "Fluence"
s:Sc/Box/Component                 = "Box"
s:Sc/Box/IfOutputFileAlreadyExists = "Overwrite"
b:Sc/Box/OutputToConsole           = "True"

s:Sc/Boxb/Quantity                             = "Fluence"
s:Sc/Boxb/Component                            = "Box"
s:Sc/Boxb/IfOutputFileAlreadyExists            = "Overwrite"
b:Sc/Boxb/OutputToConsole                      = "True"
d:Sc/Boxb/OnlyIncludeIfIncidentParticleKEAbove = 160. MeV

s:Sc/Boxc/Quantity                             = "Fluence"
s:Sc/Boxc/Component                            = "Box"
s:Sc/Boxc/IfOutputFileAlreadyExists            = "Overwrite"
b:Sc/Boxc/OutputToConsole                      = "True"
d:Sc/Boxc/OnlyIncludeIfIncidentParticleKEAbove = Tf/Zoom/Value MeV

s:Gr/MyOGL/Type        = "OpenGL"
i:Gr/MyOGL/WindowSizeX = 600
i:Gr/MyOGL/WindowSizeY = 600
i:Gr/MyOGL/WindowPosX  = 0
i:Gr/MyOGL/WindowPosY  = 0

s:Tf/Zoom/Function           = "Linear MeV"
d:Tf/Zoom/Rate               = 1. MeV/ms
d:Tf/Zoom/StartValue         = 160.0 MeV
d:Tf/Zoom/RepetitionInterval = 360. ms

d:Tf/TimelineEnd             = 720.0 ms
i:Tf/NumberOfSequentialTimes = 720

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1

ColorChange.txt

# Demonstrates step time feature by changing a box's color over time

d:Ge/World/HLX       = 10. m
d:Ge/World/HLY       = 10. m
d:Ge/World/HLZ       = 10. m
b:Ge/World/Invisible = "TRUE"

s:Ge/BigBox/Parent   = "World"
s:Ge/BigBox/Type     = "TsBox"
s:Ge/BigBox/Material = "Air"
d:Ge/BigBox/HLX      = 2. m
d:Ge/BigBox/HLY      = 3. m
d:Ge/BigBox/HLZ      = 4. m
d:Ge/BigBox/TransX   = 0. m
d:Ge/BigBox/TransY   = 0. m
d:Ge/BigBox/TransZ   = 0. m
d:Ge/BigBox/RotX     = 0. deg
d:Ge/BigBox/RotY     = 0. deg
d:Ge/BigBox/RotZ     = 0. deg
s:Ge/BigBox/Color    = Tf/Color/Value

s:Tf/Color/Function = "Step"
sv:Tf/Color/Values  = 4 "white" "blue" "green" "red"
dv:Tf/Color/Times   = 4 1. 2. 3. 4. ms

i:Tf/Verbosity               = 1
d:Tf/TimelineEnd             = 60.0 ms
i:Tf/NumberOfSequentialTimes = 60

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

CylinderGrowingInPhi.txt

# Demonstrate time features by changing a cylinder's phi extent
# and color over time.

d:Ge/World/HLX       = 10. m
d:Ge/World/HLY       = 10. m
d:Ge/World/HLZ       = 10. m
b:Ge/World/Invisible = "True"

s:Ge/Outer/Type     = "TsCylinder"
s:Ge/Outer/Parent   = "World"
s:Ge/Outer/Material = "Vacuum"
d:Ge/Outer/RMin     = 0.0 cm
d:Ge/Outer/RMax     = 60.0 cm
d:Ge/Outer/SPhi     = 0.0 deg
d:Ge/Outer/DPhi     = 360. deg
d:Ge/Outer/HL       = 3. cm
d:Ge/Outer/TransX   = 0. cm
d:Ge/Outer/TransY   = 0. cm
d:Ge/Outer/TransZ   = -53. cm
d:Ge/Outer/RotX     = 0. deg
d:Ge/Outer/RotY     = 0. deg
d:Ge/Outer/RotZ     = 0. deg

s:Ge/Outer2/Type     = "TsCylinder"
s:Ge/Outer2/Parent   = "World"
s:Ge/Outer2/Material = "Vacuum"
d:Ge/Outer2/RMin     = 0.0 cm
d:Ge/Outer2/RMax     = 60.0 cm
d:Ge/Outer2/SPhi     = 0.0 deg
d:Ge/Outer2/DPhi     = 360. deg
d:Ge/Outer2/HL       = 3. cm
d:Ge/Outer2/TransX   = 0. cm
d:Ge/Outer2/TransY   = 0. cm
d:Ge/Outer2/TransZ   = 53. cm
d:Ge/Outer2/RotX     = 0. deg
d:Ge/Outer2/RotY     = 0. deg
d:Ge/Outer2/RotZ     = 0. deg

s:Ge/Cylinder/Type             = "TsCylinder"
s:Ge/Cylinder/Parent           = "World"
s:Ge/Cylinder/Material         = "Vacuum"
d:Ge/Cylinder/RMin             = 50.0 cm
d:Ge/Cylinder/RMax             = 55.0 cm
d:Ge/Cylinder/SPhi             = 20.0 deg
d:Ge/Cylinder/DPhi             = Tf/Phi/Value deg
d:Ge/Cylinder/HL               = 50. cm
d:Ge/Cylinder/TransX           = 0. cm
d:Ge/Cylinder/TransY           = 0. cm
d:Ge/Cylinder/TransZ           = 0. cm
d:Ge/Cylinder/RotX             = 0. deg
d:Ge/Cylinder/RotY             = 0. deg
d:Ge/Cylinder/RotZ             = 0. deg
s:Ge/Cylinder/Color            = Tf/Color/Value
i:Ge/Cylinder/VisSegsPerCircle = 360
s:Ge/Cylinder/DrawingStyle     = "FullWireFrame"

s:Tf/Color/Function = "Step"
sv:Tf/Color/Values  = 4 "white" "Blue" "grEEn" "red"
dv:Tf/Color/Times   = 4 1. 2. 3. 4. ms

s:Tf/PosPhi/Function           = "Linear deg"
d:Tf/PosPhi/Rate               = 12. deg/ms
d:Tf/PosPhi/StartValue         = 10.0 deg
d:Tf/PosPhi/RepetitionInterval = 29. ms

s:Tf/NegPhi/Function           = "Linear deg"
d:Tf/NegPhi/Rate               = -12. deg/ms
d:Tf/NegPhi/StartValue         = 358.0 deg
d:Tf/NegPhi/RepetitionInterval = 29. ms

s:Tf/Phi/Function           = "Step"
dv:Tf/Phi/Times             = 2 29 58 ms
dv:Tf/Phi/Values            = 2 Tf/PosPhi/Value Tf/NegPhi/value deg
d:Tf/Phi/RepetitionInterval = 100. ms

i:Tf/Verbosity               = 1
d:Tf/TimelineEnd             = 58.0 ms
i:Tf/NumberOfSequentialTimes = 58

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
u:Gr/ViewA/Zoom                             = 2.
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
b:Gr/ViewA/CopyOpenGLToEPS                  = "False"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

Darkening.txt

# Boxes are set up such that they darken as they receive radiation.
# They therefore represent pieces of radiosensitive film.
# One of these films starts outside of the beam
# and moves into the beam over the course of the session.

s:Ge/World/Material = "Vacuum"
d:Ge/World/HLX      = 10. m
d:Ge/World/HLY      = 10. m
d:Ge/World/HLZ      = 10. m

d:Ge/Phantom/TransY = Tf/BoxMove/Value cm

b:Ts/PauseBeforeQuit = "False"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.1 cm
d:So/Example/BeamPositionSpreadY      = 0.1 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.3 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 4

s:Tf/BoxMoveDown/Function           = "Linear m"
d:Tf/BoxMoveDown/Rate               = -5. cm/ms
d:Tf/BoxMoveDown/StartValue         = 1. m
d:Tf/BoxMoveDown/RepetitionInterval = 250. ms

s:Tf/BoxMove/Function = "Step"
dv:Tf/BoxMove/Times   = 2 20. 250 ms
dv:Tf/BoxMove/Values  = 2 Tf/BoxMoveDown/Value 0. cm

d:Tf/TimelineEnd             = 75.0 ms
i:Tf/NumberOfSequentialTimes = 200

# Graphics
s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 900
i:Gr/ViewA/WindowSizeY                      = 900
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg
u:Gr/ViewA/Zoom                             = 15.
u:Gr/ViewA/TransX                           = .0
u:Gr/ViewA/TransY                           = .2
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
#b:Gr/ViewA/CopyOpenGLToEPS                 = "True"

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:Ge/Phantom/Type         = "TsBox"
s:Ge/Phantom/Parent       = "World"
s:Ge/Phantom/Material     = "G4_WATER"
d:Ge/Phantom/HLX          = 30.0 cm
d:Ge/Phantom/HLY          = 30.0 cm
d:Ge/Phantom/HLZ          = 9. cm
d:Ge/Phantom/TransX       = 0. cm
d:Ge/Phantom/TransZ       = 20. cm
d:Ge/Phantom/RotX         = 0. deg
d:Ge/Phantom/RotY         = 0. deg
d:Ge/Phantom/RotZ         = 0. deg
s:Ge/Phantom/Color        = "white"
s:Ge/Phantom/DrawingStyle = "solid"

s:Ge/Phantom1/Type         = "TsBox"
s:Ge/Phantom1/Parent       = "World"
s:Ge/Phantom1/Material     = "G4_WATER"
d:Ge/Phantom1/HLX          = 30.0 cm
d:Ge/Phantom1/HLY          = 30.0 cm
d:Ge/Phantom1/HLZ          = 10.0 cm
d:Ge/Phantom1/TransX       = 0. cm
d:Ge/Phantom1/TransY       = 0. cm
d:Ge/Phantom1/TransZ       = -30. cm
d:Ge/Phantom1/RotX         = 0. deg
d:Ge/Phantom1/RotY         = 0. deg
d:Ge/Phantom1/RotZ         = 0. deg
s:Ge/Phantom1/Color        = "white"
s:Ge/Phantom1/DrawingStyle = "solid"

s:Ge/Phantom2/Type         = "TsBox"
s:Ge/Phantom2/Parent       = "World"
s:Ge/Phantom2/Material     = "G4_WATER"
d:Ge/Phantom2/HLX          = 30.0 cm
d:Ge/Phantom2/HLY          = 30.0 cm
d:Ge/Phantom2/HLZ          = 10.0 cm
d:Ge/Phantom2/TransX       = -70. cm
d:Ge/Phantom2/TransY       = 0. cm
d:Ge/Phantom2/TransZ       = -30. cm
d:Ge/Phantom2/RotX         = 0. deg
d:Ge/Phantom2/RotY         = 0. deg
d:Ge/Phantom2/RotZ         = 0. deg
s:Ge/Phantom2/Color        = "white"
s:Ge/Phantom2/DrawingStyle = "solid"

s:Ge/Phantom3/Type         = "TsBox"
s:Ge/Phantom3/Parent       = "World"
s:Ge/Phantom3/Material     = "G4_WATER"
d:Ge/Phantom3/HLX          = 30.0 cm
d:Ge/Phantom3/HLY          = 30.0 cm
d:Ge/Phantom3/HLZ          = 10.0 cm
d:Ge/Phantom3/TransX       = 70. cm
d:Ge/Phantom3/TransY       = 0. cm
d:Ge/Phantom3/TransZ       = -30. cm
d:Ge/Phantom3/RotX         = 0. deg
d:Ge/Phantom3/RotY         = 0. deg
d:Ge/Phantom3/RotZ         = 0. deg
s:Ge/Phantom3/Color        = "white"
s:Ge/Phantom3/DrawingStyle = "solid"

s:Ge/Phantom4/Type         = "TsBox"
s:Ge/Phantom4/Parent       = "World"
s:Ge/Phantom4/Material     = "G4_WATER"
d:Ge/Phantom4/HLX          = 30.0 cm
d:Ge/Phantom4/HLY          = 30.0 cm
d:Ge/Phantom4/HLZ          = 10.0 cm
d:Ge/Phantom4/TransX       = -140. cm
d:Ge/Phantom4/TransY       = 0. cm
d:Ge/Phantom4/TransZ       = -30. cm
d:Ge/Phantom4/RotX         = 0. deg
d:Ge/Phantom4/RotY         = 0. deg
d:Ge/Phantom4/RotZ         = 0. deg
s:Ge/Phantom4/Color        = "white"
s:Ge/Phantom4/DrawingStyle = "solid"

s:Ge/Phantom5/Type         = "TsBox"
s:Ge/Phantom5/Parent       = "World"
s:Ge/Phantom5/Material     = "G4_WATER"
d:Ge/Phantom5/HLX          = 30.0 cm
d:Ge/Phantom5/HLY          = 30.0 cm
d:Ge/Phantom5/HLZ          = 10.0 cm
d:Ge/Phantom5/TransX       = 140. cm
d:Ge/Phantom5/TransY       = 0. cm
d:Ge/Phantom5/TransZ       = -30. cm
d:Ge/Phantom5/RotX         = 0. deg
d:Ge/Phantom5/RotY         = 0. deg
d:Ge/Phantom5/RotZ         = 0. deg
s:Ge/Phantom5/Color        = "white"
s:Ge/Phantom5/DrawingStyle = "solid"

s:Sc/DoseAtPhantom/Quantity    = "EnergyDeposit"
s:Sc/DoseAtPhantom/Component   = "Phantom"
s:Sc/DoseAtPhantom/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom/ColorBy     = "Sum"
sv:Sc/DoseAtPhantom/ColorNames = 14
"white"
"grey240"
"grey220"
"grey200"
"grey180"
"grey160"
"grey140"
"grey120"
"grey100"
"grey080"
"grey060"
"grey040"
"grey020"
"black"

dv:Sc/DoseAtPhantom/ColorValues = 13
0.
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
MeV

b:Sc/DoseAtPhantom/OutputAfterRun = "True"


s:Sc/DoseAtPhantom1/Quantity    = "EnergyDeposit"
s:Sc/DoseAtPhantom1/Component   = "Phantom1"
s:Sc/DoseAtPhantom1/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom1/ColorBy     = "Sum"
sv:Sc/DoseAtPhantom1/ColorNames = 14
"white"
"grey240"
"grey220"
"grey200"
"grey180"
"grey160"
"grey140"
"grey120"
"grey100"
"grey080"
"grey060"
"grey040"
"grey020"
"black"

dv:Sc/DoseAtPhantom1/ColorValues = 13
0.
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
MeV

b:Sc/DoseAtPhantom1/OutputAfterRun = "True"


s:Sc/DoseAtPhantom2/Quantity    = "EnergyDeposit"
s:Sc/DoseAtPhantom2/Component   = "Phantom2"
s:Sc/DoseAtPhantom2/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom2/ColorBy     = "Sum"
sv:Sc/DoseAtPhantom2/ColorNames = 14
"white"
"grey240"
"grey220"
"grey200"
"grey180"
"grey160"
"grey140"
"grey120"
"grey100"
"grey080"
"grey060"
"grey040"
"grey020"
"black"

dv:Sc/DoseAtPhantom2/ColorValues = 13
0.
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
MeV

b:Sc/DoseAtPhantom2/OutputAfterRun = "True"


s:Sc/DoseAtPhantom3/Quantity    = "EnergyDeposit"
s:Sc/DoseAtPhantom3/Component   = "Phantom3"
s:Sc/DoseAtPhantom3/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom3/ColorBy     = "Sum"
sv:Sc/DoseAtPhantom3/ColorNames = 14
"white"
"grey240"
"grey220"
"grey200"
"grey180"
"grey160"
"grey140"
"grey120"
"grey100"
"grey080"
"grey060"
"grey040"
"grey020"
"black"

dv:Sc/DoseAtPhantom3/ColorValues = 13
0.
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
MeV

b:Sc/DoseAtPhantom3/OutputAfterRun = "True"



s:Sc/DoseAtPhantom4/Quantity    = "EnergyDeposit"
s:Sc/DoseAtPhantom4/Component   = "Phantom4"
s:Sc/DoseAtPhantom4/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom4/ColorBy     = "Sum"
sv:Sc/DoseAtPhantom4/ColorNames = 14
"white"
"grey240"
"grey220"
"grey200"
"grey180"
"grey160"
"grey140"
"grey120"
"grey100"
"grey080"
"grey060"
"grey040"
"grey020"
"black"

dv:Sc/DoseAtPhantom4/ColorValues = 13
0.
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
MeV

b:Sc/DoseAtPhantom4/OutputAfterRun = "True"



s:Sc/DoseAtPhantom5/Quantity    = "EnergyDeposit"
s:Sc/DoseAtPhantom5/Component   = "Phantom5"
s:Sc/DoseAtPhantom5/IfOutputFileAlreadyExists = "Overwrite"
s:Sc/DoseAtPhantom5/ColorBy     = "Sum"
sv:Sc/DoseAtPhantom5/ColorNames = 14
"white"
"grey240"
"grey220"
"grey200"
"grey180"
"grey160"
"grey140"
"grey120"
"grey100"
"grey080"
"grey060"
"grey040"
"grey020"
"black"

dv:Sc/DoseAtPhantom5/ColorValues = 13
0.
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
MeV

b:Sc/DoseAtPhantom5/OutputAfterRun = "True"

Logo.txt

# Constructs the name TOPAS out of a variety of geometry components
# and sends particles through this geometry.

b:Ge/World/Invisible = "True"

#--------- Letter T --------
s:Ge/Letter_T/Parent  = "World"
s:Ge/Letter_T/Type    = "Group"
d:Ge/Letter_T/TransX  = 0. m
d:Ge/Letter_T/TransY  = 0.5 m
d:Ge/Letter_T/TransZ  = 0. m
d:Ge/Letter_T/RotX    = 0. deg
d:Ge/Letter_T/RotY    = 0. deg
d:Ge/Letter_T/RotZ    = 0. deg
#b:Ge/Letter_T/Include = "False"

s:Ge/T_1st/Type     = "TsBox"
s:Ge/T_1st/Material = "Vacuum"
s:Ge/T_1st/Parent   = "Letter_T"
d:Ge/T_1st/HLX      = 50.0 cm
d:Ge/T_1st/HLY      = 10.0 cm
d:Ge/T_1st/HLZ      = 10.0 cm
d:Ge/T_1st/TransX   = 0. m
d:Ge/T_1st/TransY   = 0. m
d:Ge/T_1st/TransZ   = 0. m
d:Ge/T_1st/RotX     = 0. deg
d:Ge/T_1st/RotY     = 0. deg
d:Ge/T_1st/RotZ     = 0. deg

s:Ge/T_2nd/Type     = "TsCylinder"
#G4_Water doesn't work, CASE sensitive
s:Ge/T_2nd/Material = "G4_WATER"
s:Ge/T_2nd/Parent   = "Letter_T"
d:Ge/T_2nd/RMin     =   6.0 cm
d:Ge/T_2nd/RMax     =  10.0 cm
d:Ge/T_2nd/HL       =  50.0 cm
d:Ge/T_2nd/SPhi     =   0.0 deg
d:Ge/T_2nd/DPhi     = 360.0 deg
d:Ge/T_2nd/TransX   =   0.0 cm
d:Ge/T_2nd/TransY   = -1.25 * Ge/T_2nd/HL cm
d:Ge/T_2nd/TransZ   =   0.0 cm
d:Ge/T_2nd/RotX     =  90.0 deg
d:Ge/T_2nd/RotY     =   0.0 deg
d:Ge/T_2nd/RotZ     =   0.0 deg

#--------- Letter O --------
s:Ge/Letter_O/Parent  = "World"
s:Ge/Letter_O/Type    = "Group"
d:Ge/Letter_O/TransX  = 1.0 m
d:Ge/Letter_O/TransY  = 0. m
d:Ge/Letter_O/TransZ  = 0. m
d:Ge/Letter_O/RotX    = 0. deg
d:Ge/Letter_O/RotY    = 0. deg
d:Ge/Letter_O/RotZ    = 0. deg
#b:Ge/Letter_O/Include = "False"

s:Ge/O_Left/Type     = "G4Cons"
s:Ge/O_Left/Material = "Aluminum"
s:Ge/O_Left/Parent   = "Letter_O"
#RM[in,max]1 : -Z surface
#RM[in,max]2 : +Z surface
d:Ge/O_Left/RMin1    = 38.0 cm
d:Ge/O_Left/RMax1    = 45.0 cm
d:Ge/O_Left/RMin2    = 45.0 cm
d:Ge/O_Left/RMax2    = 50.0 cm
d:Ge/O_Left/HL    	 =  5.0 cm
#Sphi : angle from x axis
d:Ge/O_Left/SPhi     =  90.0 deg
d:Ge/O_Left/DPhi     = 180.0 deg #- doesn't work
d:Ge/O_Left/TransX   = 0. m
d:Ge/O_Left/TransY   = 0. m
d:Ge/O_Left/TransZ   = 0. m
d:Ge/O_Left/RotX     = 0. deg
d:Ge/O_Left/RotY     = 0. deg
d:Ge/O_Left/RotZ     = 0. deg

s:Ge/O_Right/Type     = "TsSphere"
s:Ge/O_Right/Material = "Carbon"
s:Ge/O_Right/Parent   = "Letter_O"
#RM[in,max]1 : -Z surface
#RM[in,max]2 : +Z surface
d:Ge/O_Right/RMin     = 45.0 cm
d:Ge/O_Right/RMax     = 50.0 cm
#Sphi : angle from x axis
d:Ge/O_Right/SPhi     = 271.0 deg
d:Ge/O_Right/DPhi     = 180.0 deg
#STheta : angle from Y rotation
d:Ge/O_Right/STheta   =  90.0 deg
d:Ge/O_Right/DTheta   = 45.0 deg
#When 180, it should cover half but actually not.
#need for more checks!
d:Ge/O_Right/TransX   = 0. m
d:Ge/O_Right/TransY   = 0. m
d:Ge/O_Right/TransZ   = 0. m
d:Ge/O_Right/RotX     = 0. deg
d:Ge/O_Right/RotY     = 0. deg
d:Ge/O_Right/RotZ     = 0. deg

#--------- Letter P --------
s:Ge/Letter_P/Parent  = "World"
s:Ge/Letter_P/Type    = "Group"
d:Ge/Letter_P/TransX  = 1.7 m
d:Ge/Letter_P/TransY  = 0. m
d:Ge/Letter_P/TransZ  = 0. m
d:Ge/Letter_P/RotX    = 0. deg
d:Ge/Letter_P/RotY    = 0. deg
d:Ge/Letter_P/RotZ    = 0. deg
#b:Ge/Letter_P/Include = "False"

s:Ge/P_1st/Type     = "G4EllipticalTube"
s:Ge/P_1st/Material = "Lexan"
s:Ge/P_1st/Parent   = "Letter_P"
d:Ge/P_1st/HLX      =  9.0 cm
d:Ge/P_1st/HLY      =  7.0 cm
d:Ge/P_1st/HLZ    	= 25.0 cm
d:Ge/P_1st/TransX   =  0.0 cm
d:Ge/P_1st/TransY   =  Ge/P_1st/HLZ cm
d:Ge/P_1st/TransZ   =  0.0 cm
d:Ge/P_1st/RotX     = 90.0 deg
d:Ge/P_1st/RotY     =  0.0 deg
d:Ge/P_1st/RotZ     =  0.0 deg

s:Ge/P_2nd/Type     = "G4Trd"
s:Ge/P_2nd/Material = "Kapton"
s:Ge/P_2nd/Parent   = "Letter_P"
d:Ge/P_2nd/HLX1     = 10.0 cm
d:Ge/P_2nd/HLY1     =  8.0 cm
d:Ge/P_2nd/HLX2     =  9.5 cm
d:Ge/P_2nd/HLY2     =  7.5 cm
d:Ge/P_2nd/HLZ    	= 25.0 cm
d:Ge/P_2nd/TransX   =  0.0 cm
d:Ge/P_2nd/TransY   = -1.0 * Ge/P_2nd/HLZ cm
d:Ge/P_2nd/TransZ   =  0.0 cm
d:Ge/P_2nd/RotX     = 90.0 deg
d:Ge/P_2nd/RotY     =  0.0 deg
d:Ge/P_2nd/RotZ     =  0.0 deg

s:Ge/P_3rd/Type     = "G4Torus"
s:Ge/P_3rd/Material = "Lucite"
s:Ge/P_3rd/Parent   = "Letter_P"
d:Ge/P_3rd/RMin     =  5.0 cm
d:Ge/P_3rd/RMax     =  6.0 cm
d:Ge/P_3rd/RTor     =  25.0 cm
d:Ge/P_3rd/SPhi     = 265.0 deg
d:Ge/P_3rd/DPhi    	= 190.0 deg
d:Ge/P_3rd/TransX   =  -8.0 cm + Ge/P_3rd/RTor
d:Ge/P_3rd/TransY   =  Ge/P_3rd/RTor cm
d:Ge/P_3rd/TransZ   =  0.0 cm
d:Ge/P_3rd/RotX     =  0.0 deg
d:Ge/P_3rd/RotY     =  0.0 deg
d:Ge/P_3rd/RotZ     =  0.0 deg

#--------- Letter A --------
s:Ge/Letter_A/Parent  = "World"
s:Ge/Letter_A/Type    = "Group"
d:Ge/Letter_A/TransX  = 2.7 m
d:Ge/Letter_A/TransY  = 0. m
d:Ge/Letter_A/TransZ  = 0. m
d:Ge/Letter_A/RotX    = 0. deg
d:Ge/Letter_A/RotY    = 0. deg
d:Ge/Letter_A/RotZ    = 0. deg
#b:Ge/Letter_A/Include = "False"

#HLZ, Theta, Phi, HLY1,
#HLX1, HLX2, HLX3, HLX4,
#Alp2, Alp1, HLY2,
s:Ge/A_1st/Type     = "G4Para"
s:Ge/A_1st/Material = "Brass"
s:Ge/A_1st/Parent   = "Letter_A"
d:Ge/A_1st/HLX      = 9.0 cm
d:Ge/A_1st/HLY      = 50.0 cm
d:Ge/A_1st/HLZ      = 7.0 cm
d:Ge/A_1st/Alpha    = 15.0 deg
d:Ge/A_1st/Theta    = 0.0 deg
d:Ge/A_1st/Phi      = 0.0 deg
d:Ge/A_1st/TransX   = -2.7 * Ge/A_1st/HLX  cm
d:Ge/A_1st/TransY   = 0.0 cm
d:Ge/A_1st/TransZ   = 0.0 cm
d:Ge/A_1st/RotX     = 0.0 deg
d:Ge/A_1st/RotY     = 0.0 deg
d:Ge/A_1st/RotZ     = 0.0 deg

#Will Try to build with G4GTrap or G4RTrap
s:Ge/A_2nd/Type     = "G4Para"
s:Ge/A_2nd/Material = "Mylar"
s:Ge/A_2nd/Parent   = "Letter_A"
d:Ge/A_2nd/HLX      = 9.0 cm
d:Ge/A_2nd/HLY      = 50.0 cm
d:Ge/A_2nd/HLZ      = 7.0 cm
d:Ge/A_2nd/Alpha    = -15.0 deg
d:Ge/A_2nd/Theta    = 0.0 deg
d:Ge/A_2nd/Phi      = 0.0 deg
d:Ge/A_2nd/TransX   = -1.0 * Ge/A_1st/TransX  cm
d:Ge/A_2nd/TransY   = 0.0 cm
d:Ge/A_2nd/TransZ   = 0.0 cm
d:Ge/A_2nd/RotX     = 0.0 deg
d:Ge/A_2nd/RotY     = 0.0 deg
d:Ge/A_2nd/RotZ     = 0.0 deg

s:Ge/A_3rd/Type     = "G4Orb"
s:Ge/A_3rd/Material = "Titanium"
s:Ge/A_3rd/Parent   = "Letter_A"
d:Ge/A_3rd/R        = 8.0 cm
d:Ge/A_3rd/TransX   = 0.0 cm
d:Ge/A_3rd/TransY   = 0.0 cm
d:Ge/A_3rd/TransZ   = 0.0 cm
d:Ge/A_3rd/RotX     = 0.0 deg
d:Ge/A_3rd/RotY     = 0.0 deg
d:Ge/A_3rd/RotZ     = 0.0 deg

#--------- Letter S --------
s:Ge/Letter_S/Parent  = "World"
s:Ge/Letter_S/Type    = "Group"
#d:Ge/Letter_S/TransX  = 0.0 m
d:Ge/Letter_S/TransX  = 3.7 m
d:Ge/Letter_S/TransY  = 0. m
d:Ge/Letter_S/TransZ  = 0. m
d:Ge/Letter_S/RotX    = 0. deg
d:Ge/Letter_S/RotY    = 0. deg
d:Ge/Letter_S/RotZ    = -20. deg
#b:Ge/Letter_S/Include = "False"

s:Ge/S_1st/Type     = "G4HPolycone"
s:Ge/S_1st/Material = "Copper"
s:Ge/S_1st/Parent   = "Letter_S"
d:Ge/S_1st/PhiStart =  350.0 deg
d:Ge/S_1st/PhiTotal =  225.0 deg
dv:Ge/S_1st/Z        =6   8.0  4.0  4.0 -4.0 -4.0 -8.0 cm
dv:Ge/S_1st/RInner   =6  10.0 10.0 10.0 10.0 10.0 10.0 cm
dv:Ge/S_1st/ROuter   =6  18.0 18.0 30.0 30.0 18.0 18.0 cm
d:Ge/S_1st/TransX   = 10.0 cm
d:Ge/S_1st/TransY   = 22.0 cm
d:Ge/S_1st/TransZ   =  0.0 cm
d:Ge/S_1st/RotX     =  0.0 deg
d:Ge/S_1st/RotY     =  0.0 deg
d:Ge/S_1st/RotZ     =  0.0 deg

s:Ge/S_2nd/Type      = "G4Hype"
s:Ge/S_2nd/Material  = "Brass"
s:Ge/S_2nd/Parent    = "Letter_S"
d:Ge/S_2nd/IR  	     = 7.0 cm
d:Ge/S_2nd/OR  	     = 10.0 cm
d:Ge/S_2nd/IS  	     = 10.0 deg
d:Ge/S_2nd/OS  	     = 20.0 deg
d:Ge/S_2nd/HLZ    	 = 10.0 cm
d:Ge/S_2nd/TransX   =  0.0 cm
d:Ge/S_2nd/TransY   =  0.0 cm
d:Ge/S_2nd/TransZ   =  0.0 cm
d:Ge/S_2nd/RotX     =  90.0 deg
d:Ge/S_2nd/RotY     =  35.0 deg
d:Ge/S_2nd/RotZ     =  0.0 deg
#b:Ge/S_2nd/Include  = "false"

s:Ge/S_3rd/Type     = "G4HPolyhedra"
s:Ge/S_3rd/Material = "Kapton"
s:Ge/S_3rd/Parent   = "Letter_S"
d:Ge/S_3rd/PhiStart =  170.0 deg
d:Ge/S_3rd/PhiTotal =  225.0 deg
i:Ge/S_3rd/NSides   =8
dv:Ge/S_3rd/Z        =6   8.0  4.0  4.0 -4.0 -4.0 -8.0 cm
dv:Ge/S_3rd/RInner   =6  10.0 10.0 10.0 10.0 10.0 10.0 cm
dv:Ge/S_3rd/ROuter   =6  18.0 18.0 30.0 30.0 18.0 18.0 cm
d:Ge/S_3rd/TransX   = -10.0 cm
d:Ge/S_3rd/TransY   = -23.0 cm
d:Ge/S_3rd/TransZ   =  0.0 cm
d:Ge/S_3rd/RotX     =  0.0 deg
d:Ge/S_3rd/RotY     =  0.0 deg
d:Ge/S_3rd/RotZ     =  0.0 deg

# Default Beam position (S)
s:Ge/BeamPosition/Parent   = "World"
s:Ge/BeamPosition/Type     = "Group"
d:Ge/BeamPosition/TransX   = 0.15 m
d:Ge/BeamPosition/TransY   = 0. m
d:Ge/BeamPosition/TransZ   = 0 m
#flipped cause the beam flies 0 to +z.
d:Ge/BeamPosition/RotX     = 0. deg
d:Ge/BeamPosition/RotY     = 270. deg
d:Ge/BeamPosition/RotZ     = 0. deg

b:Ge/CheckForOverlaps = "False"

s:Tf/BeamCurrent/Function = "Step"
dv:Tf/BeamCurrent/Times   = 2  18 20 s
iv:Tf/BeamCurrent/Values  = 2  10  0

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = Tf/BeamCurrent/Value

d:Tf/TimeLineEnd             = 20 s
i:Tf/NumberOfSequentialTimes = 20

s:Gr/ViewA/Type          = "OpenGL"
i:Gr/ViewA/WindowSizeX   = 800
i:Gr/ViewA/WindowSizeY   = 800
s:Gr/ViewA/ColorBy       = "particletype"
s:Gr/ViewA/AxesComponent = "Letter_O"
d:Gr/ViewA/AxesSize      = 20.0 cm
u:Gr/ViewA/Zoom          = 1
s:Gr/ViewA/Projection    = "Orthogonal"
#s:Gr/ViewA/Projection   = "Perspective"
d:Gr/ViewA/Theta         =  0.0 deg
d:Gr/ViewA/Phi           = 90.0 deg

b:Ts/PauseBeforeQuit = "True"

RasterScanOnMovingTarget.txt

# TOPAS Time Feature Example to paint a moving target with a scanning beam.

# This is the completed form of the example, after all steps have been completed.
# Sometimes a later step required commenting out a line from an earlier step
# (to avoid setting the same parameter twice in this same file).
# So if you're taking just a subset of this example, you may need to uncomment
# some of the lines.

# Step 1: Create a simple target and visualize it

# Create the Target as a box of water, 260 cm in X and Y, 2 cm total depth. 
# Place this into the world translated 200 cm from center in Z.
s:Ge/Target/Type = "TsBox"
s:Ge/Target/Parent = "World"
s:Ge/Target/Material = "G4_WATER"
d:Ge/Target/HLX = 130. cm
d:Ge/Target/HLY = 130. cm
d:Ge/Target/HLZ = 1. cm
d:Ge/Target/TransZ = -200. cm

# Create an OpenGL graphics view with rotations of 70 deg Theta and
# 10 deg Phi and zoom factor of 5.
# You will notice the Theta line commented out here because we set it differently
# at a later step. If you're just running this step, uncomment this line.
s:Gr/MyView/Type = "OpenGL"
#d:Gr/MyView/Theta = 70. deg
d:Gr/MyView/Phi = 10. deg
u:Gr/MyView/Zoom = 5

# For particle source, use the built-in demonstration source.
# Set it to make 200 histories per run.
i:So/Demo/NumberOfHistoriesInRun = 200
Ts/ShowHistoryCountAtInterval = 100

# Turn on PauseBeforeQuit so we have a chance to see the graphics.
b:Ts/PauseBeforeQuit = "True"

# Run. You should see 50 particle histories.
# Most of the created particles should hit the center of the target.

# MacOS 10.15 users will find that the Qt GUI starts up automatically.
# To generate particles, hit the Run button above the parameter control widget.


# Step 2: Make the simulation start faster

# Simplify the physics so that the simulation starts faster.
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

# Run. You should see that the simulation starts very fast.
# This happens at the expense of losing scattering accuracy and losing
# all hadronic physics.
# Remember to change back to full physics if you need high accuracy.


# Step 3: Improve the visualization

# Make the target solid.
s:Ge/Target/DrawingStyle = "Solid"

# Make trajectories disappear when they enter this solid.
b:Gr/MyView/HiddenLineRemovalForTrajectories = "True"

# Run. You should see a solid target and trajectories disappear into the target.


# Step 4: Simplify further by removing most of the scatter from the simulation
# and removing random variation in the beam model.

# Change World material to Vacuum
s:Ge/World/Material = "Vacuum"

# Change Beam to have no energy spread (BeamEnergySpread).
u:So/Demo/BeamEnergySpread = 0.

# Change Beam's initial profile to be 4.cm radius (BeamPositionCutoffX and Y).
d:So/Demo/BeamPositionCutoffX = 4. cm
d:So/Demo/BeamPositionCutoffY = 4. cm

# Change Beam's distribution within this profile to be flat
# (BeamPositionDistribution to Flat rather than Gaussian).
s:So/Demo/BeamPositionDistribution = "Flat"

# Turn off angular divergence of the beam (BeamAngularDistribution to None).
s:So/Demo/BeamAngularDistribution = "None"

# Run. You should no longer see delta rays produced in the air.
# There may still be a rare scatter, as Geant4, like nature,
# does not have the concept of an absolutely perfect vacuum.
# The beam should now be distributed in a uniform circular profile.


# Step 5: Create the components that will become our two bending magnets

# Create a Group Component that will represent our scanning nozzle.
# Place this into the World offset 100 cm to the left.
s:Ge/Nozzle/Type = "Group"
s:Ge/Nozzle/Parent = "World"
d:Ge/Nozzle/TransZ = 100. cm

# Make two cylinders of vacuum, one just before center of the Nozzle, one just after.
# Make each of them 20cm total length, 30 cm radius.
s:Ge/BendingMagnetX/Type = "TsCylinder"
s:Ge/BendingMagnetX/Parent = "Nozzle"
s:Ge/BendingMagnetX/Material = "Vacuum"
d:Ge/BendingMagnetX/HL = 40. cm
dc:Ge/BendingMagnetX/RMax = 30. cm
d:Ge/BendingMagnetX/TransZ = Ge/BendingMagnetX/HL cm

s:Ge/BendingMagnetY/Type = "TsCylinder"
s:Ge/BendingMagnetY/Parent = "Nozzle"
s:Ge/BendingMagnetY/Material = "Vacuum"
d:Ge/BendingMagnetY/HL = 40. cm
dc:Ge/BendingMagnetY/RMax = 70. cm
d:Ge/BendingMagnetY/TransZ = -1. * Ge/BendingMagnetY/HL cm

# Run. Notice that it's hard to tell the magnets apart as they are the same color.
# Since we have not specified color, the color was based on the material.
# since they are both Vacuum, they came out the same color.


# Step 6: Color the X magnet Red and the Y magnet Yellow
s:Ge/BendingMagnetX/Color = "Red"
s:Ge/BendingMagnetY/Color = "Yellow"

# Run. You should see that the bending mangets now each have their own color.


# Step 7: Give each magnet a dipole magnetic field

# Make each magnet have the appropriate field direction cosines.
# Set the X bending magnet to -.8 tesla and the X bending magnet to -1. tesla.
# Make the field strength be a Changeable parameter (use "dc:" instead of "d:").

s:Ge/BendingMagnetX/Field = "DipoleMagnet"
u:Ge/BendingMagnetX/MagneticFieldDirectionX = 0.0
u:Ge/BendingMagnetX/MagneticFieldDirectionY = 1.0
u:Ge/BendingMagnetX/MagneticFieldDirectionZ = 0.0
#dc:Ge/BendingMagnetX/MagneticFieldStrength = -.8 tesla

s:Ge/BendingMagnetY/Field = "DipoleMagnet"
u:Ge/BendingMagnetY/MagneticFieldDirectionX = 1.0
u:Ge/BendingMagnetY/MagneticFieldDirectionY = 0.0
u:Ge/BendingMagnetY/MagneticFieldDirectionZ = 0.0
#dc:Ge/BendingMagnetY/MagneticFieldStrength = -1. tesla

# Turn on the Qt GUI
# MacOS 10.15 users do not need to do this since on that system the
# Qt GUI starts up automatically.
# To generate particles, hit the Run button above the parameter control widget.
#b:Ts/UseQt = "True"

# You should see that the beam has been bent in both the X and Y direction.
# Study the effect of various magnetic field strengths by adjusting the
# field strengths in the GUI and hitting the GUI's run button after each change.
# The combination of these two fields controls where the beam hits the target.


# Step 8: Make a time feature control the strength of BendingMagnetX

# Create a time feature that creates an increasing magnetic field.
s:Tf/XFieldIncreasing/Function           = "Linear tesla"
d:Tf/XFieldIncreasing/Rate               = 0.16 tesla/ms
d:Tf/XFieldIncreasing/StartValue         = -.8 tesla
d:Tf/XFieldIncreasing/RepetitionInterval = 11.0 ms

# Use this time feature to control the X magnet.
#d:Ge/BendingMagnetX/MagneticFieldStrength = Tf/XFieldIncreasing/Value tesla

# Declare that the simulation should contain 11 runs.
i:Tf/NumberOfSequentialTimes = 110

# Specify an end time for the run sequence.
d:Tf/TimelineEnd = 110. ms

# Set verbosity to get more information about the runs.
i:Tf/Verbosity = 2

# Run. You should see that the beam sweeps from left to right and the repeats.


# Step 9: Make the scan go the opposite direction

# Create a time feature that creates a decreasing magnetic field.
s:Tf/XFieldDecreasing/Function           = "Linear tesla"
d:Tf/XFieldDecreasing/Rate               = -0.16 tesla/ms
d:Tf/XFieldDecreasing/StartValue         = .8 tesla
d:Tf/XFieldDecreasing/RepetitionInterval = 11.0 ms

# Use this time feature to control the X magnet.
#d:Ge/BendingMagnetX/MagneticFieldStrength = Tf/XFieldDecreasing/Value tesla

# Run. You should see that the beam sweeps from right to left and the repeats.


# Step 10: Use a Step time feature to make the scan alternate directions

# Use a Step function and have the value come first from
# Tf/XFieldIncreasing/Value and then from Tf/XFieldIncreasing/Value.
s:Tf/XFieldAlternating/Function = "Step"
dv:Tf/XFieldAlternating/Times   = 2 11. 22. ms
dv:Tf/XFieldAlternating/Values  = 2 Tf/XFieldIncreasing/Value Tf/XFieldDecreasing/Value tesla

# Use this time feature to control the X magnet
#d:Ge/BendingMagnetX/MagneticFieldStrength = Tf/XFieldAlternating/Value tesla

# Run. You should see that the beam sweeps back and forth.
# It is alternately being driven by Tf/XFieldIncreasing and Tf/XFieldDecreasing.


# Step 11: Complete the raster scan pattern by controlling the Y magnet

# Create a field that increases every 11 ms (each time the X scan is completed).
s:Tf/YFieldDecreasing/Function = "Step"
dv:Tf/YFieldDecreasing/Times   = 10 11. 22. 33. 44. 55. 66. 77. 88. 99. 110. ms
dv:Tf/YFieldDecreasing/Values  = 10 -1. -.8 -.6 -.4 -.2 0. .2 .4 .6 .8 tesla

# Use this time feature to control the Y magnet.
d:Ge/BendingMagnetY/MagneticFieldStrength = Tf/YFieldDecreasing/Value tesla

# Run. You should see that the beam moves downward at the end of each
# horizontal sweep. This combination of horizontal and vertical scanning is
# called "raster scanning."


# Step 12: Simulate patient motion by making the target move horizontally
# in a sinusoidal motion

# Use a Sine function time feature.
s:Tf/HorizontalMoveSine/Function           = "Sine"
d:Tf/HorizontalMoveSine/RepetitionInterval = 110. ms
d:Tf/HorizontalMoveSine/Rate               = 6. deg/ms
d:Tf/HorizontalMoveSine/StartValue         = -90. deg

# Use this time feature to control the Target
dc:Ge/Target/TransX = 100.0 cm * Tf/HorizontalMoveSine/Value

# Adjust the graphics view so it is easier to see the target motion.
d:Gr/MyView/Theta = 20. deg

# Run. You will see that the beam is sometimes missing the target.


# Step 13: Make the beam compensate to stay on the target

# Create a new parameter to hold amplitude of necessary beam magnet adjustment.
d:FieldAdjustment = .6 tesla * Tf/HorizontalMoveSine/Value

# Add this adjustment to the value that was controlling the simple X scan.
d:Ge/BendingMagnetX/MagneticFieldStrength = Tf/XFieldAlternating/Value + FieldAdjustment tesla

# As an additional diagnostic, ask for parameters to be printed out at each run:
b:Ts/DumpNonDefaultParameters = "True"

# Run. You will see that the raster scan now stays on the target as the target moves.

RotateResizeRecolor.txt

# A box is set to rotate, grow and change color
# as a test of the time feature system.

d:Ge/World/HLX = 10. m
d:Ge/World/HLY = 10. m
d:Ge/World/HLZ = 10. m

s:Ge/Box/Parent   = "World"
s:Ge/Box/Type     = "TsBox"
s:Ge/Box/Material = "Air"
d:Ge/Box/HLX      = Tf/Size/Value m
d:Ge/Box/HLY      = Tf/Size/Value m
d:Ge/Box/HLZ      = 4. m
d:Ge/Box/TransX   = 0. m
d:Ge/Box/TransY   = 0. m
d:Ge/Box/TransZ   = 0. m
d:Ge/Box/RotX     = 0. deg
d:Ge/Box/RotY     = 0. deg
d:Ge/Box/RotZ     = Tf/Box/Value deg
s:Ge/Box/Color    = Tf/Color/Value

s:Tf/Box/Function            = "Linear deg"
d:Tf/Box/Rate                = 1. deg/ms
d:Tf/Box/StartValue          = 0.0 deg
d:Tf/Box/RepetitionInterval  = 60. ms

s:Tf/Size/Function           = "Linear cm"
d:Tf/Size/Rate               = 0.1 m/ms
d:Tf/Size/StartValue         = 1.0 m
d:Tf/Size/RepetitionInterval = 60. ms

s:Tf/Color/Function = "Step"
sv:Tf/Color/Values  = 4 "white" "blue" "green" "red"
dv:Tf/Color/Times   = 4 1. 2. 3. 4. ms

i:Tf/Verbosity               = 1
d:Tf/TimelineEnd             = 60.0 ms
i:Tf/NumberOfSequentialTimes = 60

s:Sc/MyScorer/Quantity                  = "EnergyDeposit"
s:Sc/MyScorer/Component                 = "Box"
b:Sc/MyScorer/OutputToConsole           = "1"
s:Sc/MyScorer/IfOutputFileAlreadyExists = "Overwrite"

s:Gr/ViewA/Type                             = "OpenGL"
i:Gr/ViewA/WindowSizeX                      = 1024
i:Gr/ViewA/WindowSizeY                      = 768
d:Gr/ViewA/Theta                            = 55 deg
d:Gr/ViewA/Phi                              = 20 deg
u:Gr/ViewA/Zoom                             = 1.3
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "True"
s:Gr/ViewA/Projection                       = "Perspective"
d:Gr/ViewA/PerspectiveAngle                 = 30 deg

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

b:Ts/PauseBeforeQuit = "True"

RotatingCylinderWithPhiCut.txt

# TOPAS Time Feature Example to rotate a notched cylinder in a beam.

# Step 1: Create a simplified wheel and visualize it

# Create the Wheel as a cylinder of aluminum, 20cm total length, 20 cm radius.
# Place this into the world just using default translation and rotation.
s:Ge/Wheel/Type = "TsCylinder"
s:Ge/Wheel/Parent = "World"
s:Ge/Wheel/Material = "G4_Al"
d:Ge/Wheel/HL = 10. cm
d:Ge/Wheel/RMax = 20. cm

# Create an OpenGL graphics view with a 50 degree rotation in Theta.
# and zoom factor of 25.
s:Gr/MyView/Type = "OpenGL"
d:Gr/MyView/Theta = 50. deg
u:Gr/MyView/Zoom = 25

# For particle source, use the built-in demonstration source.
# Set it to make 50 histories per run.
i:So/Demo/NumberOfHistoriesInRun = 50

# Turn on PauseBeforeQuit so we have a chance to see the graphics.
b:Ts/PauseBeforeQuit = "True"

# Run. You should see 50 particle histories.
# Most or all of the particles will be stopped by the Wheel.

# MacOS 10.15 users will find that the Qt GUI starts up automatically.
# To generate particles, hit the Run button above the parameter control widget.


# Step 2: Make the simulation start faster

# Simplify the physics so that the simulation starts faster.
sv:Ph/Default/Modules = 1 "g4em-standard_opt0"

# Run. You should see that the simulation starts very fast.
# This happens at the expense of losing scattering accuracy and losing
# all hadronic physics.
# Remember to change back to full physics if you need high accuracy.


# Step 3: Improve the visualization

# Make the wheel solid.
s:Ge/Wheel/DrawingStyle = "Solid"

# Make trajectories disappear when they enter this solid.
b:Gr/MyView/HiddenLineRemovalForTrajectories = "True"

# Run. You should see a solid wheel and trajectories disappear into the wheel.


# Step 4: Make the Wheel a little more like a Range Modulator Wheel

# Offset the Wheel relative to the Beam in X by 1/2 the Wheel's radius.
d:Ge/Wheel/TransX = -0.5 * Ge/Wheel/RMax cm

# Cut a 90 degree phi segment out of the Wheel by adjusting the dphi parameter.
d:Ge/Wheel/DPhi = 270. deg
dc:Ge/Wheel/SPhi = 45. deg

# Run: The wheel will be missing a 90 degree segment in phi.


# Step 5: Make simulation include multiple runs

# Declare that the simulation should contain 8 runs.
i:Tf/NumberOfSequentialTimes = 8

# Run. You will see 8 separate runs happen, each with 50 histories.
# This will be reflected in the console, where you will see not just the
# History number increasing but also the Run number increasing.


# Step 6: Increase time feature verbosity

# Set verbosity to get more information about the 8 runs.
i:Tf/Verbosity = 2

# Run. Study the console information.
# Note that there are no significant differences between the 8 runs.
# They all happen with time = 0.


# Step 7: Make each run have different time

# Specify an end time for the run sequence.
d:Tf/TimelineEnd = 8. s

# Run. Note that each run has a different time.


# Step 8: Create a TOPAS Time Feature

# The following four parameters define a Time Feature we are calling MyRotation.
s:Tf/MyRotation/Function = "Linear deg"
d:Tf/MyRotation/Rate = 45. deg/s
d:Tf/MyRotation/StartValue = 0.0 deg
d:Tf/MyRotation/RepetitionInterval = 8. s

# Run. See from the console that Tf/MyRotation/Value changes for each run.


# Step 9: Use the time feature to rotate the wheel

# Make the time feature control the cylinder rotation.
d:Ge/Wheel/RotZ = Tf/MyRotation/Value deg

# As an additional diagnostic, ask for parameters to be printed out at each run:
b:Ts/DumpNonDefaultParameters = "True"

# Run. The Wheel should now rotate under control of the time feature.

# You will find eight html files in your current directory.
# These show the values of all non-default parameters for each run.
# You can see how the current value of Ge/Wheel/RotZ was computed at each run.

Rotation.txt

# Demonstrates direction of rotations in TOPAS placements
# by rotating a simple structure three ways.
# First, it rotates in the X direction.
# Then, after resetting, it rotates in the Y direction.
# Then, after resetting, it rotates in the Z direction.

d:Ge/World/HLX   = 1.1 cm
d:Ge/World/HLY   = 1.1 cm
d:Ge/World/HLZ   = 1.1 cm
s:Ge/World/Color = "black"

s:Ge/system/Parent = "World"
s:Ge/system/Type   = "Group"
d:Ge/system/RotX   = Tf/rotationX/Value deg
d:Ge/system/RotY   = Tf/rotationY/Value deg
d:Ge/system/RotZ   = Tf/rotationZ/Value deg

s:Ge/tet/Parent   = "system"
s:Ge/tet/Material = "Air"
s:Ge/tet/Type     = "G4Tet"
dv:Ge/tet/Anchor  = 3 0 0 1 cm
dv:Ge/tet/P2      = 3 1 0 0 cm
dv:Ge/tet/P3      = 3 0 1 0 cm
dv:Ge/tet/P4      = 3 0 0 0 cm
s:Ge/tet/Color    = "yellow"
#d:Ge/tet/RotX    = Tf/rotationX/Value deg
#d:Ge/tet/RotY    = Tf/rotationY/Value deg
#d:Ge/tet/RotZ    = Tf/rotationZ/Value deg

s:Ge/pointz/Parent       = "system"
s:Ge/pointz/Material     = "Air"
s:Ge/pointz/Type         = "G4Orb"
d:Ge/pointz/R            = 0.2 mm
s:Ge/pointz/Color        = "blue"
s:Ge/pointz/DrawingStyle = "solid"
d:Ge/pointz/TransZ       = 1 cm

s:Ge/pointy/Parent       = "system"
s:Ge/pointy/Material     = "Air"
s:Ge/pointy/Type         = "G4Orb"
d:Ge/pointy/R            = 0.2 mm
s:Ge/pointy/Color        = "grass"
s:Ge/pointy/DrawingStyle = "solid"
d:Ge/pointy/TransY       = 1 cm

s:Ge/pointx/Parent       = "system"
s:Ge/pointx/Material     = "Air"
s:Ge/pointx/Type         = "G4Orb"
d:Ge/pointx/R            = 0.2 mm
s:Ge/pointx/Color        = "red"
s:Ge/pointx/DrawingStyle = "solid"
d:Ge/pointx/TransX       = 1 cm

s:Tf/rotationX/Function = "Step"
dv:Tf/rotationX/Times =  288
1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98    99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195  196  197  198  199  200  201  202  203  204  205  206  207  208  209  210  211  212  213  214  215  216  217  218  219  220  221  222  223  224  225  226  227  228  229  230  231  232  233  234  235  236  237  238  239  240  241  242  243  244  245  246  247  248  249  250  251  252  253  254  255  256  257  258  259  260  261  262  263  264  265  266  267  268  269  270  271  272  273  274  275  276  277  278  279  280  281  282  283  284  285  286  287  288  ms
dv:Tf/rotationX/Values =  288
1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 deg

s:Tf/rotationY/Function = "Step"
dv:Tf/rotationY/Times =  288
1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195  196  197  198  199  200  201  202  203  204  205  206  207  208  209  210  211  212  213  214  215  216  217  218  219  220  221  222  223  224  225  226  227  228  229  230  231  232  233  234  235  236  237  238  239  240  241  242  243  244  245  246  247  248  249  250  251  252  253  254  255  256  257  258  259  260  261  262  263  264  265  266  267  268  269  270  271  272  273  274  275  276  277  278  279  280  281  282  283  284  285  286  287  288  ms
dv:Tf/rotationY/Values = 288
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 deg

s:Tf/rotationZ/Function = "Step"
dv:Tf/rotationZ/Times =  288
1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195  196  197  198  199  200  201  202  203  204  205  206  207  208  209  210  211  212  213  214  215  216  217  218  219  220  221  222  223  224  225  226  227  228  229  230  231  232  233  234  235  236  237  238  239  240  241  242  243  244  245  246  247  248  249  250  251  252  253  254  255  256  257  258  259  260  261  262  263  264  265  266  267  268  269  270  271  272  273  274  275  276  277  278  279  280  281  282  283  284  285  286  287  288  ms
dv:Tf/rotationZ/Values = 288
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90 deg

d:Tf/TimelineEnd             = 288 ms
i:Tf/NumberOfSequentialTimes = 288
b:Ts/ShowCPUTime             = "True"

s:Gr/view/Type        = "OpenGl"
b:Gr/view/IncludeAxes = "True"
d:Gr/view/AxesSize    = 1 cm
d:Gr/view/Theta       = 45 deg
d:Gr/view/Phi         = 45 deg
u:Gr/view/Zoom        = 1.8

sv:Ph/Default/Modules = 1 "g4em-standard_opt0"
b:Ge/CheckForOverlaps = "False"

b:Ts/PauseBeforeQuit = "True"

s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 169.23 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1

RunRandom_Mode.txt

includeFile = RunSequential_Mode.txt

#============================================================================#
#--- Timeline setting
#============================================================================#
b:Tf/RandomizeTimeDistribution = "True"

#============================================================================#
#--- Time Feature for Probability
#============================================================================#
s:Tf/Weights/Function = "Step"
dv:Tf/Weights/Times   = 5   1   2   3   4   5  s
uv:Tf/Weights/Values  = 5 1.0 0.8 0.6 0.4 0.2


#============================================================================#
#--- Assign particles
#============================================================================#
#Same number of total particles in RunSequential_Mode.txt
i:So/Example/NumberOfHistoriesInRandomJob = 3000

u:So/Example/ProbabilityOfUsingAGivenRandomTime = Tf/Weights/Value
i:Ts/ShowHistoryCountAtInterval = 0

#============================================================================#
#--- Dose for DoseGrid
#============================================================================#
s:Sc/dose/OutputFile = "Dose_Rand"

RunSequential_Mode.txt

# Demostration of TOPAS time modes: Sequential Time Mode

#============================================================================#
#--- Time Feature for Energy and Number of particles
#============================================================================#
s:Tf/Energies/Function  = "Step"
dv:Tf/Energies/Times    = 5 1 2 3 4 5  s
dv:Tf/Energies/Values   = 5 110.0 100.0 90.0 80.0 70.0 MeV

s:Tf/Particles/Function = "Step"
dv:Tf/Particles/Times   = 5 1 2 3 4 5  s
iv:Tf/Particles/Values  = 5 1000 800 600 400 200

#============================================================================#
#--- Timeline setting
#============================================================================#
d:Tf/TimelineStart  = 0.0 s
d:Tf/TimelineEnd    = 5.0 s

#For Sequential Time Mode
i:Tf/NumberOfSequentialTimes = 5

#============================================================================#
#--- Assign particles
#============================================================================#
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad

#Change number of particles per time stamps
#total particles are 1000 + 800 + 600 + 400 + 200 = 300
i:So/Example/NumberOfHistoriesInRun = Tf/Particles/Value

#Energy changes
d:So/Example/BeamEnergy = Tf/Energies/Value MeV
#From 10.0 cm
d:Ge/BeamPosition/TransZ = 10.0 cm

#============================================================================#
#--- Water phantom target
#============================================================================#
s:Ge/waterphantom/Type     = "TsBox"
s:Ge/waterphantom/Parent   = "World"
s:Ge/waterphantom/Material = "G4_WATER"
d:Ge/waterphantom/HLX      = 5 cm
d:Ge/waterphantom/HLY      = 5 cm
d:Ge/waterphantom/HLZ      = 6 cm
d:Ge/waterphantom/TransX   = 0. cm
d:Ge/waterphantom/TransY   = 0. cm
d:Ge/waterphantom/Upstream = 0.0 cm
d:Ge/waterphantom/TransZ   = -1.0 * Ge/waterphantom/HLZ cm
d:Ge/waterphantom/RotX     = 0. deg
d:Ge/waterphantom/RotY     = 0. deg
d:Ge/waterphantom/RotZ     = 0. deg
i:Ge/waterphantom/XBins    = 1
i:Ge/waterphantom/YBins    = 1
i:Ge/waterphantom/ZBins    = 1
s:Ge/waterphantom/Color    = "red"

#============================================================================#
#--- Dose grid for 1D PDD
#============================================================================#
s:Ge/dosegrid/Type       = "TsCylinder"
s:Ge/dosegrid/Parent     = "waterphantom"
d:Ge/dosegrid/RMin       = 0.0 cm
d:Ge/dosegrid/RMax       = 5 cm
d:Ge/dosegrid/SPhi       = 0.0 deg
d:Ge/dosegrid/DPhi       = 360.0 deg
d:Ge/dosegrid/HL         = Ge/waterphantom/HLZ cm
d:Ge/dosegrid/TransX     = 0. cm
d:Ge/dosegrid/TransY     = 0. cm
d:Ge/dosegrid/TransZ     = 0. cm
d:Ge/dosegrid/RotX       = 0. deg
d:Ge/dosegrid/RotY       = 0. deg
d:Ge/dosegrid/RotZ       = 0. deg
i:Ge/dosegrid/RBins      = 1
i:Ge/dosegrid/PhiBins    = 1
i:Ge/dosegrid/ZBins      = 120
b:Ge/dosegrid/IsParallel = "T"

#============================================================================#
#--- Dose for DoseGrid
#============================================================================#
s:Sc/dose/Quantity                  = "DoseToMedium"
s:Sc/dose/Component                 = "dosegrid"
s:Sc/dose/OutputFile                = "Dose_Seq"
s:Sc/dose/OutputType                = "binary"
b:Sc/dose/OutputToConsole           = "F"
b:Sc/dose/Visualize                 = "F"
s:Sc/dose/IfOutputFileAlreadyExists = "Overwrite"

#============================================================================#
#--- Summary
#============================================================================#
b:Ts/ShowCPUTime                = "tRuE" #For checking case sensitivity
i:Ts/ShowHistoryCountAtInterval = 10000

UCSFETF

UCSF_Beamline_Base.txt

includeFile = UCSF_DefaultParameters.txt

sv:Ma/Gold/Components=1 "Gold"
uv:Ma/Gold/Fractions=1 1.0
d:Ma/Gold/Density=19.3 g/cm3
d:Ma/Gold/MeanExcitationEnergy= 790.0 eV
s:Ma/Gold/DefaultColor="orange"

sv:Ma/NitrogenGas/Components=1 "Nitrogen"
uv:Ma/NitrogenGas/Fractions=1 1.0
#Wikipedia: 0.001251 g/cm3 (gas)
#PDG(PTSim): 0.8073  g/cm3
d:Ma/NitrogenGas/Density= 0.001251 g/cm3

#Treatment room
#The HL[X,Y,Z] must be extended enough to cover patient's body.

s:Ge/Nozzle/Parent  = "World"
s:Ge/Nozzle/Type    = "Group"
d:Ge/Nozzle/RotX    = 0.0 deg
d:Ge/Nozzle/RotY    = 0.0 deg
d:Ge/Nozzle/RotZ    = 0.0 deg
d:Ge/Nozzle/TransX  = 0.0 cm
d:Ge/Nozzle/TransY  = 0.0 cm
d:Ge/Nozzle/TransZ  = 0.0 cm

# NIM.A 380 (1996) P. 597-612
#Exit2Iso = 241.8 cm (19 Dec 2011)
#d:Ge/Exit2Iso/Distance = Ge/WaterColumn/BaseLine + Ge/ExtWindow/TransZ cm

###########################################################################
#1. Beam Exit Window
#25 um thickness Mylar window
###########################################################################
s:Ge/ExtWindow/Parent  = "Nozzle"
s:Ge/ExtWindow/Type    = "TsCylinder"
s:Ge/ExtWindow/Material= "Mylar"
d:Ge/ExtWindow/RMin    = 0.0 mm
d:Ge/ExtWindow/RMax    = 110.0 mm
d:Ge/ExtWindow/HL      = 0.0125 mm
d:Ge/ExtWindow/SPhi    = 0.0 deg
d:Ge/ExtWindow/DPhi    = 360.0 deg
d:Ge/ExtWindow/TransX  = 0.0 mm
d:Ge/ExtWindow/TransY  = 0.0 mm
d:Ge/ExtWindow/TransZ  = 102.7 cm + Ge/WaterColumn/BaseLine 
d:Ge/ExtWindow/RotX    = 0.0 deg
d:Ge/ExtWindow/RotY    = 0.0 deg
d:Ge/ExtWindow/RotZ    = 0.0 deg
b:Ge/ExtWindow/Include = "True"
s:Ge/ExtWindow/DrawingStyle = "Solid"
s:Ge/ExtWindow/Message = "UCSFETF::ExitWindow is constructed!"

###########################################################################
#2. Wire Chamber
#NitrogenGas 
#Kapton	window 
#MWC: material(brass), dimensions
#Topasized : only dummy envolope boxes were implemented
###########################################################################
s:Ge/WireChamber/Parent="Nozzle"
s:Ge/WireChamber/Type="TsBox"
s:Ge/WireChamber/Material= "NitrogenGas"
d:Ge/WireChamber/HLX=170.0   mm
d:Ge/WireChamber/HLY=110.0   mm
d:Ge/WireChamber/HLZ=17.5 mm
d:Ge/WireChamber/TransX=0.0   mm
d:Ge/WireChamber/TransY=0.0   mm
d:Ge/WireChamber/TransZ= 94.55 cm + Ge/WaterColumn/BaseLine  
d:Ge/WireChamber/RotX=0.0 deg
d:Ge/WireChamber/RotY=0.0 deg
d:Ge/WireChamber/RotZ=0.0 deg
i:Ge/WireChamber/NbOfLayers=2
d:Ge/WireChamber/MaxStepSize=100.0 mm
b:Ge/WireChamber/Include="True"
s:Ge/WireChamber/Message = "UCSFETF::WireChamber is constructed!"

s:Ge/WireChamber/Window1/Parent   = "WireChamber"
s:Ge/WireChamber/Window1/Type     = "TsBox"
s:Ge/WireChamber/Window1/Material = "Kapton"
d:Ge/WireChamber/Window1/HLX      = 165.0  mm
d:Ge/WireChamber/Window1/HLY      = 105.0  mm
d:Ge/WireChamber/Window1/HLZ      = 0.0635 mm
d:Ge/WireChamber/Window1/TransX   = 0.0 mm
d:Ge/WireChamber/Window1/TransY   = 0.0 mm
d:Ge/WireChamber/Window1/TransZ   = 15.123 mm
d:Ge/WireChamber/Window1/RotX     = 0.0 deg
d:Ge/WireChamber/Window1/RotY     = 0.0 deg
d:Ge/WireChamber/Window1/RotZ     = 0.0 deg

s:Ge/WireChamber/Window2/Parent   = "WireChamber"
s:Ge/WireChamber/Window2/Type     = "TsBox"
s:Ge/WireChamber/Window2/Material = "Kapton"
d:Ge/WireChamber/Window2/HLX      = 165.0  mm
d:Ge/WireChamber/Window2/HLY      = 105.0  mm
d:Ge/WireChamber/Window2/HLZ      = 0.0635 mm
d:Ge/WireChamber/Window2/TransX   = 0.0 mm
d:Ge/WireChamber/Window2/TransY   = 0.0 mm
d:Ge/WireChamber/Window2/TransZ   = -15.123 mm
d:Ge/WireChamber/Window2/RotX     = 0.0 deg
d:Ge/WireChamber/Window2/RotY     = 0.0 deg
d:Ge/WireChamber/Window2/RotZ     = 0.0 deg
#s:Ge/WireChamber/Window2/DrawingStyle = "Solid"

s:Ge/MWC/Parent="WireChamber"
s:Ge/MWC/Type="TsMultiWireChamber"
s:Ge/MWC/Material= "parent"
d:Ge/MWC/HLX=170.0  mm
d:Ge/MWC/HLY=110.0  mm
d:Ge/MWC/HLZ=15.0   mm
d:Ge/MWC/TransX=0.0 mm
d:Ge/MWC/TransY=0.0 mm
d:Ge/MWC/TransZ=0.0 mm
d:Ge/MWC/RotX=0.0   deg
d:Ge/MWC/RotY=0.0   deg
d:Ge/MWC/RotZ=0.0   deg
i:Ge/MWC/NbOfLayers=2
d:Ge/MWC/MaxStepSize= Ge/WireChamber/MaxStepSize cm

d:Ge/MWC/Layer1/RMin=0.0   mm
d:Ge/MWC/Layer1/RMax=0.029 mm
s:Ge/MWC/Layer1/Material="Brass"
d:Ge/MWC/Layer1/HL=160.0 mm
s:Ge/MWC/Layer1/Align="X"
d:Ge/MWC/Layer1/PosZ=5.0 mm
d:Ge/MWC/Layer1/MaxStepSize=100.0 mm
s:Ge/MWC/Layer1/DrawingStyle="FullWireFrame"
dv:Ge/MWC/Layer1/Displacement=72
-71.9855 -69.9855 -67.9855 -65.9855 -63.9855 -61.9855 -59.9855 -57.9855 -55.9855 -53.9855
-51.9855 -49.9855 -47.9855 -45.9855 -43.9855 -41.9855 -39.9855 -37.9855 -35.9855 -33.9855
-31.9855 -29.9855 -27.9855 -25.9855 -23.9855 -21.9855 -19.9855 -17.9855 -15.9855 -13.9855
-11.9855  -9.9855  -7.9855  -5.9855  -3.9855 -1.9855   0.0145   2.0145   4.0145   6.0145
  8.0145  10.0145  12.0145  14.0145  16.0145 18.0145  20.0145  22.0145  24.0145  26.0145
 28.0145  30.0145  32.0145  34.0145  36.0145 38.0145  40.0145  42.0145  44.0145  46.0145
 48.0145  50.0145  52.0145  54.0145  56.0145 58.0145  60.0145  62.0145  64.0145  66.0145
 68.0145  70.0145 mm

d:Ge/MWC/Layer2/RMin=0.0   mm
d:Ge/MWC/Layer2/RMax=0.029 mm
s:Ge/MWC/Layer2/Material="Brass"
d:Ge/MWC/Layer2/HL=100.0 mm
s:Ge/MWC/Layer2/Align="Y"
d:Ge/MWC/Layer2/PosZ=-5.0 mm
d:Ge/MWC/Layer2/MaxStepSize=100.0 mm
s:Ge/MWC/Layer2/DrawingStyle="FullWireFrame"
s:Ge/MWC/Layer2/Color="red"
dv:Ge/MWC/Layer2/Displacement=72
-71.9855 -69.9855 -67.9855 -65.9855 -63.9855 -61.9855 -59.9855 -57.9855 -55.9855 -53.9855
-51.9855 -49.9855 -47.9855 -45.9855 -43.9855 -41.9855 -39.9855 -37.9855 -35.9855 -33.9855
-31.9855 -29.9855 -27.9855 -25.9855 -23.9855 -21.9855 -19.9855 -17.9855 -15.9855 -13.9855
-11.9855  -9.9855  -7.9855  -5.9855  -3.9855 -1.9855   0.0145   2.0145   4.0145   6.0145
  8.0145  10.0145  12.0145  14.0145  16.0145 18.0145  20.0145  22.0145  24.0145  26.0145
 28.0145  30.0145  32.0145  34.0145  36.0145 38.0145  40.0145  42.0145  44.0145  46.0145
 48.0145  50.0145  52.0145  54.0145  56.0145 58.0145  60.0145  62.0145  64.0145  66.0145
 68.0145  70.0145 mm


###########################################################################
#3. Collimator 1
# A 30 cm diameter brass collimator with openining in the center downstream from
# the wire chamber limits the beam size to 50 mm at the first transmission IC1
###########################################################################
s:Ge/Collimator1/Parent  = "Nozzle"
s:Ge/Collimator1/Type    = "TsCylinder"
s:Ge/Collimator1/Material= "Brass"
d:Ge/Collimator1/RMin    = 2.5  cm
d:Ge/Collimator1/RMax    = 15.0 cm
d:Ge/Collimator1/HL      = 1.3  cm
d:Ge/Collimator1/SPhi    = 0.0 deg
d:Ge/Collimator1/DPhi    = 360.0 deg
d:Ge/Collimator1/TransX  = 0.0 mm
d:Ge/Collimator1/TransY  = 0.0 mm
d:Ge/Collimator1/TransZ  = 86.5 cm + Ge/WaterColumn/BaseLine
d:Ge/Collimator1/RotX    = 0.0 deg
d:Ge/Collimator1/RotY    = 0.0 deg
d:Ge/Collimator1/RotZ    = 0.0 deg
b:Ge/Collimator1/Include = "True"
s:Ge/Collimator1/DrawingStyle = "Solid"
s:Ge/Collimator1/Messange= "UCSFETF::Collimator1 is constructed!"

###########################################################################
#4.  IonChamber1 
#NitrogenGas 10
#Mat    Rin        Rout   dZ       z
#Kapton 0	       200	  0.0254  -23.9873 : plate
#Gold   0	       10	  1E-7    1.2700050E-2
#Gold   10.00254   30	  1E-7    1.2700050E-2
#Gold   30.00254   60	  1E-7    1.2700050E-2
#Gold   60.00254   90	  1E-7    1.2700050E-2
#Gold   90.00254   120	  1E-7    1.2700050E-2
#Gold   120.00254  150	  1E-7    1.2700050E-2
#Gold   150.00254  180	  1E-7    1.2700050E-2
#Kapton 0	       200	  0.0254  0.0 : plates
#Kapton 0	       200	  0.0254  23.9873 : plates
#Initially implemented at 11Oct2010
###########################################################################
s:Ge/IonChamber1/Parent   = "Nozzle"
s:Ge/IonChamber1/Type     = "TsCylinder"
s:Ge/IonChamber1/Material = "NitrogenGas"
d:Ge/IonChamber1/RMin     = 0.0  mm
d:Ge/IonChamber1/RMax     = 200.0 mm
d:Ge/IonChamber1/HL       = 24.0  mm
d:Ge/IonChamber1/SPhi     = 0.0   deg
d:Ge/IonChamber1/DPhi     = 360.0 deg
d:Ge/IonChamber1/RotX     = 0.0 deg
d:Ge/IonChamber1/RotY     = 0.0 deg
d:Ge/IonChamber1/RotZ     = 0.0 deg
d:Ge/IonChamber1/TransX   = 0.0 mm
d:Ge/IonChamber1/TransY   = 0.0 mm
d:Ge/IonChamber1/TransZ   = 77.8 cm + Ge/WaterColumn/BaseLine 
b:Ge/IonChamber1/Include  = "True"
s:Ge/IonChamber1/Message  = "UCSFETF::IonChamber1 is constructed!"

s:Ge/IonChamber1/Layer1/Parent   = "IonChamber1"
s:Ge/IonChamber1/Layer1/Type     = "TsCylinder"
s:Ge/IonChamber1/Layer1/Material = "Kapton"
d:Ge/IonChamber1/Layer1/RMin     =   0.0  mm
d:Ge/IonChamber1/Layer1/RMax     = 200.0  mm
d:Ge/IonChamber1/Layer1/HL       = 0.0127 mm
d:Ge/IonChamber1/Layer1/SPhi     = 0.0   deg
d:Ge/IonChamber1/Layer1/DPhi     = 360.0 deg
d:Ge/IonChamber1/Layer1/TransX   = 0.0 mm
d:Ge/IonChamber1/Layer1/TransY   = 0.0 mm
d:Ge/IonChamber1/Layer1/TransZ   = -23.9873 mm
d:Ge/IonChamber1/Layer1/RotX     = 0.0 deg
d:Ge/IonChamber1/Layer1/RotY     = 0.0 deg 
d:Ge/IonChamber1/Layer1/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring1/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring1/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring1/Material = "Gold"
d:Ge/IonChamber1/Ring1/RMin     =  0.0 mm
d:Ge/IonChamber1/Ring1/RMax     = 10.0 mm
d:Ge/IonChamber1/Ring1/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring1/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring1/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring1/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring1/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring1/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring1/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring1/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring1/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring2/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring2/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring2/Material = "Gold"
d:Ge/IonChamber1/Ring2/RMin     = 10.0025 mm
d:Ge/IonChamber1/Ring2/RMax     = 30.0 mm
d:Ge/IonChamber1/Ring2/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring2/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring2/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring2/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring2/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring2/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring2/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring2/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring2/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring3/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring3/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring3/Material = "Gold"
d:Ge/IonChamber1/Ring3/RMin     = 30.0025 mm
d:Ge/IonChamber1/Ring3/RMax     = 60.0 mm
d:Ge/IonChamber1/Ring3/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring3/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring3/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring3/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring3/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring3/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring3/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring3/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring3/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring4/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring4/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring4/Material = "Gold"
d:Ge/IonChamber1/Ring4/RMin     = 60.0025 mm
d:Ge/IonChamber1/Ring4/RMax     = 90.0 mm
d:Ge/IonChamber1/Ring4/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring4/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring4/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring4/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring4/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring4/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring4/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring4/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring4/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring5/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring5/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring5/Material = "Gold"
d:Ge/IonChamber1/Ring5/RMin     = 90.0025 mm
d:Ge/IonChamber1/Ring5/RMax     = 120.0 mm
d:Ge/IonChamber1/Ring5/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring5/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring5/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring5/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring5/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring5/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring5/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring5/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring5/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring6/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring6/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring6/Material = "Gold"
d:Ge/IonChamber1/Ring6/RMin     = 120.003 mm
d:Ge/IonChamber1/Ring6/RMax     = 150.0 mm
d:Ge/IonChamber1/Ring6/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring6/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring6/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring6/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring6/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring6/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring6/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring6/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring6/RotZ     = 0.0 deg

s:Ge/IonChamber1/Ring7/Parent   = "IonChamber1"
s:Ge/IonChamber1/Ring7/Type     = "TsCylinder"
s:Ge/IonChamber1/Ring7/Material = "Gold"
d:Ge/IonChamber1/Ring7/RMin     = 150.003 mm
d:Ge/IonChamber1/Ring7/RMax     = 180.0 mm
d:Ge/IonChamber1/Ring7/HL       = 5e-8 mm
d:Ge/IonChamber1/Ring7/SPhi     = 0.0   deg
d:Ge/IonChamber1/Ring7/DPhi     = 360.0 deg
d:Ge/IonChamber1/Ring7/TransX   = 0.0 mm
d:Ge/IonChamber1/Ring7/TransY   = 0.0 mm
d:Ge/IonChamber1/Ring7/TransZ   = 0.0127 mm
d:Ge/IonChamber1/Ring7/RotX     = 0.0 deg
d:Ge/IonChamber1/Ring7/RotY     = 0.0 deg 
d:Ge/IonChamber1/Ring7/RotZ     = 0.0 deg
s:Ge/IonChamber1/Ring7/DrawingStyle = "Solid"

s:Ge/IonChamber1/Layer2/Parent   = "IonChamber1"
s:Ge/IonChamber1/Layer2/Type     = "TsCylinder"
s:Ge/IonChamber1/Layer2/Material = "Kapton"
d:Ge/IonChamber1/Layer2/RMin     =   0.0  mm
d:Ge/IonChamber1/Layer2/RMax     = 200.0  mm
d:Ge/IonChamber1/Layer2/HL       = 0.0127 mm
d:Ge/IonChamber1/Layer2/SPhi     = 0.0   deg
d:Ge/IonChamber1/Layer2/DPhi     = 360.0 deg
d:Ge/IonChamber1/Layer2/TransX   = 0.0 mm
d:Ge/IonChamber1/Layer2/TransY   = 0.0 mm
d:Ge/IonChamber1/Layer2/TransZ   = 10.0127 mm
d:Ge/IonChamber1/Layer2/RotX     = 0.0 deg
d:Ge/IonChamber1/Layer2/RotY     = 0.0 deg 
d:Ge/IonChamber1/Layer2/RotZ     = 0.0 deg

s:Ge/IonChamber1/Layer3/Parent   = "IonChamber1"
s:Ge/IonChamber1/Layer3/Type     = "TsCylinder"
s:Ge/IonChamber1/Layer3/Material = "Kapton"
d:Ge/IonChamber1/Layer3/RMin     =   0.0  mm
d:Ge/IonChamber1/Layer3/RMax     = 200.0  mm
d:Ge/IonChamber1/Layer3/HL       = 0.0127 mm
d:Ge/IonChamber1/Layer3/SPhi     = 0.0   deg
d:Ge/IonChamber1/Layer3/DPhi     = 360.0 deg
d:Ge/IonChamber1/Layer3/TransX   = 0.0 mm
d:Ge/IonChamber1/Layer3/TransY   = 0.0 mm
d:Ge/IonChamber1/Layer3/TransZ   = 23.9853 mm
d:Ge/IonChamber1/Layer3/RotX     = 0.0 deg
d:Ge/IonChamber1/Layer3/RotY     = 0.0 deg 
d:Ge/IonChamber1/Layer3/RotZ     = 0.0 deg

###########################################################################
#5. PropellerBlade
#Lucite ~= PMMA ~= G4_PLEXIGLASS : density: 1.4, Iev = 74.0 eV
###########################################################################
d:Ge/UCSFPropeller/Position =  58.1 cm +  Ge/WaterColumn/BaseLine

###########################################################################
#6. Collimator 2
#Topasized : done at 11 Oct 2010
###########################################################################
s:Ge/Collimator2/Parent  = "Nozzle"
s:Ge/Collimator2/Type    = "TsCylinder"
s:Ge/Collimator2/Material= "Brass"
d:Ge/Collimator2/RMin    = 2.5  cm
d:Ge/Collimator2/RMax    = 15.0  cm
d:Ge/Collimator2/HL      = 1.3 cm
d:Ge/Collimator2/SPhi    = 0.0 deg
d:Ge/Collimator2/DPhi    = 360.0 deg
d:Ge/Collimator2/RotX    = 0.0 deg
d:Ge/Collimator2/RotY    = 0.0 deg
d:Ge/Collimator2/RotZ    = 0.0 deg
d:Ge/Collimator2/TransX  = 0.0 mm
d:Ge/Collimator2/TransY  = 0.0 mm
d:Ge/Collimator2/TransZ  =  44.8 cm + Ge/WaterColumn/BaseLine
b:Ge/Collimator2/Include = "True"
s:Ge/Collimator2/DrawingStyle = "Solid"
s:Ge/Collimator2/Message = "UCSFETF::Collimator2 is constructed!"

###########################################################################
#7. WaterColumn
#The HL of WC_Water varies from 0.0 mm to 13.0 mm
#!!!!!!!IMPORTANT #
#Ge/WaterColumn/Water/HL = 0.0 must lead WaterColumn/Water/Include=False
# 0.0 cm thickness is used sometimes when they won't modulate beam energy!
###########################################################################
#The WaterColumn extends. 
# ||> <--------- || 
# ||> <--------- ||
# ||> <--------- ||
# ||> <--------- ||
#     water   base line (138.9 cm)
# Air gap between Water colum and Collimator3 is 6 mm
# Base line is fixed. 
# So water volume extends toward/backward beam source. 
# i.e. Not bi-directional movement
d:Ge/WCColl3/AirGap        		 = 6.0 mm
d:Ge/WaterColumn/BaseLine  		 = 138.5 cm + Ge/WCColl3/AirGap
d:Ge/WaterColumn/Thickness 		 = 10.0 mm
d:Ge/WaterColumn/HalfOfThickness = 0.5 * Ge/WaterColumn/Thickness mm 

s:Ge/WC_Container/Parent  = "Nozzle"
s:Ge/WC_Container/Type    = "TsCylinder"
s:Ge/WC_Container/Material= "G4_PLEXIGLASS"
d:Ge/WC_Container/RMin    = 0.0 mm
d:Ge/WC_Container/RMax    = 100.0 mm
##The wall thickness will be updated by Inder. (14Feb2011)
#0.25 mm as WC wall thickness.
d:Ge/WC_Container/HL      = 1.0 mm + Ge/WC_Water/HL
d:Ge/WC_Container/SPhi    = 0.0 deg
d:Ge/WC_Container/DPhi    = 360.0 deg
d:Ge/WC_Container/RotX    = 0.0 deg
d:Ge/WC_Container/RotY    = 0.0 deg
d:Ge/WC_Container/RotZ    = 0.0 deg
d:Ge/WC_Container/TransX  = 0.0 mm
d:Ge/WC_Container/TransY  = 0.0 mm
d:Ge/WC_Container/TransZ  = Ge/WaterColumn/BaseLine + Ge/WC_Container/HL cm
b:Ge/WC_Container/Include = "True"
s:Ge/WC_Container/DrawingStyle   = "FullWireFrame"
s:Ge/WC_Container/Message = "UCSFETF::WaterColumn Container is constructed!"

s:Ge/WC_Water/Parent  = "WC_Container"
s:Ge/WC_Water/Type    = "TsCylinder"
s:Ge/WC_Water/Material= "G4_WATER"
d:Ge/WC_Water/RMin    =  0.0 mm
d:Ge/WC_Water/RMax    = 95.0 mm
d:Ge/WC_Water/HL      = 0.05  mm + Ge/WaterColumn/HalfOfThickness
d:Ge/WC_Water/SPhi    = 0.0 deg
d:Ge/WC_Water/DPhi    = 360.0 deg
d:Ge/WC_Water/TransX  = 0.0 mm
d:Ge/WC_Water/TransY  = 0.0 mm
d:Ge/WC_Water/TransZ  = 0.0 mm
d:Ge/WC_Water/RotX    = 0.0 deg
d:Ge/WC_Water/RotY    = 0.0 deg
d:Ge/WC_Water/RotZ    = 0.0 deg
b:Ge/WC_Water/Include = "True"
s:Ge/WC_Water/DrawingStyle   = "Solid"
s:Ge/WC_Water/Messange= "UCSFETF::WaterColumn Water is constructed!"

###########################################################################
#8. Collimator 3
###########################################################################
s:Ge/Collimator3/Parent   = "Nozzle"
s:Ge/Collimator3/Type     = "TsCylinder"
s:Ge/Collimator3/Material = "Brass"
d:Ge/Collimator3/RMin     = 25.0 mm
d:Ge/Collimator3/RMax     = 150.0 mm
d:Ge/Collimator3/HL       = 13.0 mm
d:Ge/Collimator3/SPhi     = 0.0 deg
d:Ge/Collimator3/DPhi     = 360.0 deg
d:Ge/Collimator3/RotX     = 0.0   deg
d:Ge/Collimator3/RotY     = 0.0   deg
d:Ge/Collimator3/RotZ     = 0.0   deg
d:Ge/Collimator3/TransX   = 0.0   mm
d:Ge/Collimator3/TransY   = 0.0   mm
d:Ge/Collimator3/TransZ   = 135.9 cm + Ge/Collimator3/HL
b:Ge/Collimator3/Include  = "True"
s:Ge/Collimator3/DrawingStyle = "Solid"
s:Ge/Collimator3/Messange = "UCSFETF::Collimator3 is constructed!"

###########################################################################
#9.  IonChamber2 
#NitrogenGas Gas
###########################################################################
s:Ge/IonChamber2/Parent   = "Nozzle"
s:Ge/IonChamber2/Type     = "TsCylinder"
s:Ge/IonChamber2/Material = "NitrogenGas"
d:Ge/IonChamber2/RMin     = 0.0 mm
d:Ge/IonChamber2/RMax     = 200.0 mm
d:Ge/IonChamber2/HL       = 24.0 mm
d:Ge/IonChamber2/SPhi     = 0.0 deg
d:Ge/IonChamber2/DPhi     = 360.0 deg
d:Ge/IonChamber2/RotX     = 0.0 deg
d:Ge/IonChamber2/RotY     = 0.0 deg
d:Ge/IonChamber2/RotZ     = 0.0 deg
d:Ge/IonChamber2/TransX   = 0.0 mm
d:Ge/IonChamber2/TransY   = 0.0 mm
d:Ge/IonChamber2/TransZ   = 85.8 cm + Ge/IonChamber2/HL
b:Ge/IonChamber2/Include  = "True"
s:Ge/IonChamber2/Message  = "UCSFETF::IonChamber2 is constructed!"

s:Ge/IonChamber2/Layer1/Parent   = "IonChamber2"
s:Ge/IonChamber2/Layer1/Type     = "TsCylinder"
s:Ge/IonChamber2/Layer1/Material = "Kapton"
d:Ge/IonChamber2/Layer1/RMin     =   0.0  mm
d:Ge/IonChamber2/Layer1/RMax     = 200.0  mm
d:Ge/IonChamber2/Layer1/HL       = 0.0127 mm
d:Ge/IonChamber2/Layer1/SPhi     = 0.0   deg
d:Ge/IonChamber2/Layer1/DPhi     = 360.0 deg
d:Ge/IonChamber2/Layer1/TransX   = 0.0 mm
d:Ge/IonChamber2/Layer1/TransY   = 0.0 mm
d:Ge/IonChamber2/Layer1/TransZ   = -13.9873 mm
d:Ge/IonChamber2/Layer1/RotX     = 0.0 deg
d:Ge/IonChamber2/Layer1/RotY     = 0.0 deg 
d:Ge/IonChamber2/Layer1/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring1/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring1/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring1/Material = "Gold"
d:Ge/IonChamber2/Ring1/RMin     =  0.0 mm
d:Ge/IonChamber2/Ring1/RMax     = 10.0 mm
d:Ge/IonChamber2/Ring1/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring1/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring1/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring1/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring1/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring1/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring1/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring1/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring1/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring2/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring2/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring2/Material = "Gold"
d:Ge/IonChamber2/Ring2/RMin     = 10.00254 mm
d:Ge/IonChamber2/Ring2/RMax     = 30.0 mm
d:Ge/IonChamber2/Ring2/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring2/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring2/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring2/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring2/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring2/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring2/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring2/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring2/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring3/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring3/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring3/Material = "Gold"
d:Ge/IonChamber2/Ring3/RMin     = 30.00254 mm
d:Ge/IonChamber2/Ring3/RMax     = 60.0 mm
d:Ge/IonChamber2/Ring3/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring3/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring3/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring3/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring3/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring3/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring3/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring3/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring3/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring4/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring4/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring4/Material = "Gold"
d:Ge/IonChamber2/Ring4/RMin     = 60.00254 mm
d:Ge/IonChamber2/Ring4/RMax     = 90.0 mm
d:Ge/IonChamber2/Ring4/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring4/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring4/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring4/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring4/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring4/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring4/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring4/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring4/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring5/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring5/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring5/Material = "Gold"
d:Ge/IonChamber2/Ring5/RMin     = 90.00254 mm
d:Ge/IonChamber2/Ring5/RMax     = 120.0 mm
d:Ge/IonChamber2/Ring5/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring5/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring5/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring5/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring5/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring5/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring5/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring5/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring5/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring6/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring6/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring6/Material = "Gold"
d:Ge/IonChamber2/Ring6/RMin     = 120.00254 mm
d:Ge/IonChamber2/Ring6/RMax     = 150.0 mm
d:Ge/IonChamber2/Ring6/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring6/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring6/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring6/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring6/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring6/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring6/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring6/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring6/RotZ     = 0.0 deg

s:Ge/IonChamber2/Ring7/Parent   = "IonChamber2"
s:Ge/IonChamber2/Ring7/Type     = "TsCylinder"
s:Ge/IonChamber2/Ring7/Material = "Gold"
d:Ge/IonChamber2/Ring7/RMin     = 150.00254 mm
d:Ge/IonChamber2/Ring7/RMax     = 180.0 mm
d:Ge/IonChamber2/Ring7/HL       = 5e-08 mm
d:Ge/IonChamber2/Ring7/SPhi     = 0.0   deg
d:Ge/IonChamber2/Ring7/DPhi     = 360.0 deg
d:Ge/IonChamber2/Ring7/TransX   = 0.0 mm
d:Ge/IonChamber2/Ring7/TransY   = 0.0 mm
d:Ge/IonChamber2/Ring7/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Ring7/RotX     = 0.0 deg
d:Ge/IonChamber2/Ring7/RotY     = 0.0 deg 
d:Ge/IonChamber2/Ring7/RotZ     = 0.0 deg

s:Ge/IonChamber2/Layer2/Parent   = "IonChamber2"
s:Ge/IonChamber2/Layer2/Type     = "TsCylinder"
s:Ge/IonChamber2/Layer2/Material = "Kapton"
d:Ge/IonChamber2/Layer2/RMin     =   0.0  mm
d:Ge/IonChamber2/Layer2/RMax     = 200.0  mm
d:Ge/IonChamber2/Layer2/HL       = 5e-08 mm
d:Ge/IonChamber2/Layer2/SPhi     = 0.0   deg
d:Ge/IonChamber2/Layer2/DPhi     = 360.0 deg
d:Ge/IonChamber2/Layer2/TransX   = 0.0 mm
d:Ge/IonChamber2/Layer2/TransY   = 0.0 mm
d:Ge/IonChamber2/Layer2/TransZ   = 10.0127 mm
d:Ge/IonChamber2/Layer2/RotX     = 0.0 deg
d:Ge/IonChamber2/Layer2/RotY     = 0.0 deg 
d:Ge/IonChamber2/Layer2/RotZ     = 0.0 deg

s:Ge/IonChamber2/Layer3/Parent   = "IonChamber2"
s:Ge/IonChamber2/Layer3/Type     = "TsCylinder"
s:Ge/IonChamber2/Layer3/Material = "Kapton"
d:Ge/IonChamber2/Layer3/RMin     =   0.0  mm
d:Ge/IonChamber2/Layer3/RMax     = 200.0  mm
d:Ge/IonChamber2/Layer3/HL       = 0.0127 mm
d:Ge/IonChamber2/Layer3/SPhi     = 0.0   deg
d:Ge/IonChamber2/Layer3/DPhi     = 360.0 deg
d:Ge/IonChamber2/Layer3/TransX   = 0.0 mm
d:Ge/IonChamber2/Layer3/TransY   = 0.0 mm
d:Ge/IonChamber2/Layer3/TransZ   = 13.9873 mm
d:Ge/IonChamber2/Layer3/RotX     = 0.0 deg
d:Ge/IonChamber2/Layer3/RotY     = 0.0 deg 
d:Ge/IonChamber2/Layer3/RotZ     = 0.0 deg

###########################################################################
#10. Patient shield: 61 diameter
###########################################################################
s:Ge/PatientShield/Parent   = "Nozzle"
s:Ge/PatientShield/Type     = "TsCylinder"
s:Ge/PatientShield/Material = "Aluminum"
d:Ge/PatientShield/RMin     =  2.5 cm
d:Ge/PatientShield/RMax     = 30.5 cm
d:Ge/PatientShield/HL       =  1.6 cm
d:Ge/PatientShield/SPhi     =  0.0 deg
d:Ge/PatientShield/DPhi     = 360.0 deg
d:Ge/PatientShield/TransX   = 0.0 mm
d:Ge/PatientShield/TransY   = 0.0 mm
d:Ge/PatientShield/TransZ   = 77.8 cm
d:Ge/PatientShield/RotX     = 0.0 deg
d:Ge/PatientShield/RotY     = 0.0 deg 
d:Ge/PatientShield/RotZ     = 0.0 deg
s:Ge/PatientShield/DrawingStyle = "FullWireFrame"
s:Ge/PatientShield/Message = "UCSFETF::Patient Shield is constructed!"

###########################################################################
#11. Patient assembly
###########################################################################
s:Ge/PatientAssembly/Parent = "Nozzle"
s:Ge/PatientAssembly/Type   = "Group"
d:Ge/PatientAssembly/RotX   = 0.0 deg
d:Ge/PatientAssembly/RotY   = 0.0 deg
d:Ge/PatientAssembly/RotZ   = 0.0 deg
d:Ge/PatientAssembly/TransX = 0.0 mm
d:Ge/PatientAssembly/TransY = 0.0 mm
#This value means distance from isocenter
d:Ge/PatientAssembly/TransZ = 50.0 mm
d:Ge/PatientAssembly/Opening = 12.5 mm
s:Ge/PatientAssembly/Message = "UCSFETF::Patient Assembly is constructed!"

#Plate is important component
s:Ge/PatientAssembly/Plate/Parent   = "PatientAssembly"
s:Ge/PatientAssembly/Plate/Type     = "TsCylinder"
s:Ge/PatientAssembly/Plate/Material = "Brass"
d:Ge/PatientAssembly/Plate/RMin     = Ge/PatientAssembly/Opening mm
d:Ge/PatientAssembly/Plate/RMax     = 130.0 mm
d:Ge/PatientAssembly/Plate/HL       = 10.0  mm
d:Ge/PatientAssembly/Plate/SPhi     = 0.0   deg
d:Ge/PatientAssembly/Plate/DPhi     = 360.0 deg
d:Ge/PatientAssembly/Plate/TransX   = 0.0   mm
d:Ge/PatientAssembly/Plate/TransY   = 0.0   mm
d:Ge/PatientAssembly/Plate/TransZ   = 10.0 cm + Ge/PatientAssembly/Plate/HL
d:Ge/PatientAssembly/Plate/RotX     = 0.0 deg
d:Ge/PatientAssembly/Plate/RotY     = 0.0 deg
d:Ge/PatientAssembly/Plate/RotZ     = 0.0 deg
s:Ge/PatientAssembly/Plate/DrawingStyle = "Solid"

s:Ge/PatientAssembly/Tube/Parent   = "PatientAssembly"
s:Ge/PatientAssembly/Tube/Type     = "TsCylinder"
s:Ge/PatientAssembly/Tube/Material = "Brass"
d:Ge/PatientAssembly/Tube/RMin     = Ge/PatientAssembly/Opening mm
d:Ge/PatientAssembly/Tube/RMax     = 4.0 mm + Ge/PatientAssembly/Opening
d:Ge/PatientAssembly/Tube/HL       = 50.0 mm
d:Ge/PatientAssembly/Tube/SPhi     = 0.0  deg
d:Ge/PatientAssembly/Tube/DPhi     = 360.0 deg
d:Ge/PatientAssembly/Tube/TransX   = 0.0  mm
d:Ge/PatientAssembly/Tube/TransY   = 0.0 mm
d:Ge/PatientAssembly/Tube/TransZ   = Ge/PatientAssembly/Tube/HL cm
d:Ge/PatientAssembly/Tube/RotX     = 0.0 deg
d:Ge/PatientAssembly/Tube/RotY     = 0.0 deg
d:Ge/PatientAssembly/Tube/RotZ     = 0.0 deg
s:Ge/PatientAssembly/Tube/DrawingStyle = "Solid"

UCSF_Beamline_Propeller10.txt

includeFile   = UCSF_Beamline_Base.txt 

#2. Propeller 10.
s:Ge/Propeller/Parent    = "Nozzle"
s:Ge/Propeller/Type      = "TsPropeller"
s:Ge/Propeller/Material  = "World"
d:Ge/Propeller/TransX    = 0.0 mm
d:Ge/Propeller/TransY    = Ge/PropellerConstant/YShift mm
d:Ge/Propeller/TransZ    = Ge/PropellerConstant/ZPosition mm
d:Ge/Propeller/RotX      = 0.0 deg
d:Ge/Propeller/RotY      = 0.0 deg
d:Ge/Propeller/RotZ      = Tf/Rotation/Value deg
b:Ge/Propeller/Invisible = "True"
b:Ge/Propeller/Include   = "True"
s:Ge/Propeller/Message   = "UCSFETF::Propeller10 is constructed!"


i:Ge/Propeller/NbOfBlades = Ge/PropellerConstant/NbBlades 
d:Ge/Propeller/Rin        = Ge/PropellerConstant/Rin mm
d:Ge/Propeller/Rout       = Ge/PropellerConstant/Rout mm

s:Ge/Propeller/Blade/Material = "World"
s:Ge/Propeller/Blade/Color = "skyblue"
s:Ge/Propeller/Blade/DrawingStyle = "Solid"
d:Ge/Propeller/Blade/MaxStepSize = Ge/PropellerConstant/MaxStepSize mm

#Becareful the order of file up the pieces
#bottom -> top
dv:Ge/Propeller/Thickness= 9
1.03	1.03	1.03	1.03	1.03	
1.03	1.03	1.03	1.03	mm

#bottom -> top (ver03)
#v:Ge/Propeller/Angles= 9
#8.36  15.58 22.80 30.02 37.24 44.46 
#51.68 58.90 66.12 deg

#edited by j.shin (4May 2011): ver04
#Also chosen (19Dec 2011)
dv:Ge/Propeller/Angles= 9
11.36  17.00 26.00 33.02 40.24 47.46 
53.68 61.90 70.12 deg

sv:Ge/Propeller/Materials=9
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"

UCSF_Beamline_Propeller15.txt

includeFile   = UCSF_Beamline_Base.txt

#2. Propeller 15.
s:Ge/Propeller/Parent    = "Nozzle"
s:Ge/Propeller/Type      = "TsPropeller"
s:Ge/Propeller/Material  = "World"
d:Ge/Propeller/TransX    = 0.0 mm
d:Ge/Propeller/TransY    = Ge/PropellerConstant/YShift mm 
d:Ge/Propeller/TransZ    = Ge/PropellerConstant/ZPosition cm
d:Ge/Propeller/RotX      = 0.0 deg
d:Ge/Propeller/RotY      = 0.0 deg
d:Ge/Propeller/RotZ      = Tf/Rotation/Value deg
b:Ge/Propeller/Invisible = "True"
s:Ge/Propeller/Message   = "UCSFETF::Propeller15 is constructed!"

i:Ge/Propeller/NbOfBlades  = Ge/PropellerConstant/NbBlades 
d:Ge/Propeller/Rin         = Ge/PropellerConstant/Rin mm
d:Ge/Propeller/Rout        = Ge/PropellerConstant/Rout mm

s:Ge/Propeller/Blade/Material = "World"
s:Ge/Propeller/Blade/Color = "skyblue"
s:Ge/Propeller/Blade/DrawingStyle = "FullWireFrame"
d:Ge/Propeller/Blade/MaxStepSize = Ge/PropellerConstant/MaxStepSize mm

#Becareful the order of file up the pieces
#bottom -> top
dv:Ge/Propeller/Thickness = 9
1.54	1.54	1.54	1.54	1.54	
1.54	1.54	1.54	1.54	mm

#tuned (4 May 2011)
dv:Ge/Propeller/Angles= 9
 13.07 19.64 28.21 33.78 43.35
47.92  59.49 66.06 72.63 deg

sv:Ge/Propeller/Materials=9
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"

UCSF_Beamline_Propeller20.txt

includeFile   = UCSF_Beamline_Base.txt

#Propeller 20.
s:Ge/Propeller/Parent   = "Nozzle"
s:Ge/Propeller/Type     = "TsPropeller"
s:Ge/Propeller/Material = "World"
d:Ge/Propeller/TransX   =  0.0 mm
d:Ge/Propeller/TransY   =  Ge/PropellerConstant/YShift mm 
d:Ge/Propeller/TransZ   =  Ge/PropellerConstant/ZPosition mm
d:Ge/Propeller/RotX     = 0.0 deg
d:Ge/Propeller/RotY     = 0.0 deg
d:Ge/Propeller/RotZ      = Tf/Rotation/Value deg
b:Ge/Propeller/Invisible = "True"
s:Ge/Propeller/Message  = "UCSFETF::Propeller20 is constructed!"

i:Ge/Propeller/NbOfBlades  = Ge/PropellerConstant/NbBlades 
d:Ge/Propeller/Rin         = Ge/PropellerConstant/Rin mm
d:Ge/Propeller/Rout        = Ge/PropellerConstant/Rout mm

s:Ge/Propeller/Blade/Material     = "World"
s:Ge/Propeller/Blade/Color        = "skyblue"
s:Ge/Propeller/Blade/DrawingStyle = "FullWireFrame"
d:Ge/Propeller/Blade/MaxStepSize  = Ge/PropellerConstant/MaxStepSize mm

#Becareful the order of file up the pieces
#bottom -> top
dv:Ge/Propeller/Thickness =11 
1.54	1.54	1.54	1.54	1.54	
1.54	1.54	1.54	1.54	1.54	
1.54	mm

#bottom -> top
dv:Ge/Propeller/Angles=11 
 9.16   15.70	22.24	28.78	35.32	
41.86	48.40	54.94	61.48	68.02	
74.56	deg

sv:Ge/Propeller/Materials=11
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"
"G4_PLEXIGLASS"

UCSF_Beamline_Propeller24.txt

includeFile   = UCSF_Beamline_Base.txt

#4. Propeller 24.
s:Ge/Propeller/Parent   = "Nozzle"
s:Ge/Propeller/Type     = "TsPropeller"
s:Ge/Propeller/Material = "World"
d:Ge/Propeller/TransX   =  0.0 mm 
d:Ge/Propeller/TransY   = Ge/PropellerConstant/YShift mm
d:Ge/Propeller/TransZ   = Ge/PropellerConstant/ZPosition cm
d:Ge/Propeller/RotX     = 0.0 deg
d:Ge/Propeller/RotY     = 0.0 deg
d:Ge/Propeller/RotZ      = Tf/Rotation/Value deg
b:Ge/Propeller/Invisible= "True"
s:Ge/Propeller/Message  = "UCSFETF::Propeller24 is constructed!"

i:Ge/Propeller/NbOfBlades  = Ge/PropellerConstant/NbBlades 
d:Ge/Propeller/Rin         = Ge/PropellerConstant/Rin mm
d:Ge/Propeller/Rout        = Ge/PropellerConstant/Rout mm

s:Ge/Propeller/Blade/Material = "World"
s:Ge/Propeller/Blade/Color    = "skyblue"
s:Ge/Propeller/Blade/DrawingStyle = "Solid"
d:Ge/Propeller/Blade/MaxStepSize = Ge/PropellerConstant/MaxStepSize mm

#Becareful the order of file up the pieces
#bottom -> top
dv:Ge/Propeller/Thickness =13
1.8     1.8     1.8     1.8     1.8     
1.8     1.8     1.8     1.8     1.8     
1.8     1.8     1.8    mm

#bottom -> top
dv:Ge/Propeller/Angles=13
1.042 1.4  8.12 16.41  24.80
33.09 40.08    47.67 54.86     61.05
66.94 72.73    78.2 deg

sv:Ge/Propeller/Materials= 13
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"
"G4_PLEXIGLASS" "G4_PLEXIGLASS" "G4_PLEXIGLASS"

UCSF_DefaultParameters.txt

#Treatment room
#The HL[X,Y,Z] must be extended enough to cover patient's body.
d:Ge/World/HLX=50.0 cm
d:Ge/World/HLY=50.0 cm
d:Ge/World/HLZ=300.0 cm

#Beam Energy
s:So/Default/Type                     = "Beam"
s:So/Default/Component                = "BeamPosition"
s:So/Default/BeamParticle             = "proton"
d:So/Default/BeamEnergy               = 67.5 MeV
u:So/Default/BeamEnergySpread         = 0.10
s:So/Default/BeamPositionDistribution = "Gaussian"
s:So/Default/BeamPositionCutoffShape  = "Ellipse"
d:So/Default/BeamPositionCutoffX      = 0.2 cm
d:So/Default/BeamPositionCutoffY      = 0.2 cm
d:So/Default/BeamPositionSpreadX      = 0.65 cm
d:So/Default/BeamPositionSpreadY      = 0.65 cm
s:So/Default/BeamAngularDistribution  = "Gaussian"
d:So/Default/BeamAngularCutoffX       = 90. deg
d:So/Default/BeamAngularCutoffY       = 90. deg
d:So/Default/BeamAngularSpreadX       = 0.0020 rad
d:So/Default/BeamAngularSpreadY       = 0.0020 rad
i:So/Default/NumberOfHistoriesInRun   = 0

d:Ge/BeamPosition/TransZ = 245.00 cm

# ===============================================#
# Execution mode setting
# ===============================================#
Ts/PauseBeforeSequence = "True"

#Defined again to prevent Chain ambuiguity
Tf/RandomizeTimeDistribution = "False"
Tf/TimelineStart = 0. s
Tf/TimelineEnd = Tf/TimelineStart s
Tf/NumberOfSequentialTimes = 1

Tf/Verbosity = 1 # set to 1 to get time log, 2 to get update messages
i:Tf/UCSF_NbHistoriesInRun = 1
d:Tf/TimeOfPropellerRotation = 100.0 ms
i:Tf/UCSF_NbTimes = 100

# ===============================================#
# Constants for propeller setting
# ===============================================#
d:Ge/PropellerConstant/YShift      = -71.0 mm
d:Ge/PropellerConstant/Rin         = 49.6  mm
d:Ge/PropellerConstant/Rout        = 124.7 mm
i:Ge/PropellerConstant/NbBlades    = 4
d:Ge/PropellerConstant/MaxStepSize = 10 mm
d:Ge/PropellerConstant/ZPosition   = 191.66 cm

# ===============================================#
# TimeFeature for Propeller rotation
# 6.7 turns per sec
# ===============================================#
s:Tf/Rotation/Function = "Linear deg"
d:Tf/Rotation/Rate = 2.40 deg/ms
d:Tf/Rotation/StartValue = 0.0 deg
d:Tf/Rotation/RepetitionInterval = 150. ms

UCSF_WaterPhantom.txt

includeFile = UCSF_DefaultParameters.txt 
##########################################
# Sensitive area filled with Water
##########################################

d:Ge/WP_Constants/SizeX         = 8.0 cm
d:Ge/WP_Constants/SizeY         = 8.0 cm
d:Ge/WP_Constants/SizeZ         = 4.0 cm
#WallThickness = 1.0668 mm
d:Ge/WP_Constants/WallThickness = 2.1336 mm
d:Ge/WP_Constants/BoxSizeX  = Ge/WP_Constants/SizeX + Ge/WP_Constants/WallThickness cm
d:Ge/WP_Constants/BoxSizeY  = Ge/WP_Constants/SizeY + Ge/WP_Constants/WallThickness cm
d:Ge/WP_Constants/BoxSizeZ  = Ge/WP_Constants/SizeZ + Ge/WP_Constants/WallThickness cm
d:Ge/WP_Constants/ZShift    = -0.5 * Ge/WP_Constants/BoxSizeZ cm

d:Ge/WaterPhantomBox/ZShiftFromISO  = 0.0 cm

##########################################
# Sensitive area filled with Water
##########################################
s:Ge/WaterPhantomBox/Type="TsBox"
s:Ge/WaterPhantomBox/Parent="World"
s:Ge/WaterPhantomBox/Material="G4_PLEXIGLASS"
d:Ge/WaterPhantomBox/HLX= 0.5 * Ge/WP_Constants/BoxSizeX cm
d:Ge/WaterPhantomBox/HLY= 0.5 * Ge/WP_Constants/BoxSizeY cm
d:Ge/WaterPhantomBox/HLZ= 0.5 * Ge/WP_Constants/BoxSizeZ cm
d:Ge/WaterPhantomBox/TransX= 0. cm
d:Ge/WaterPhantomBox/TransY= 0. cm
d:Ge/WaterPhantomBox/TransZ=  Ge/WP_Constants/ZShift + Ge/WaterPhantomBox/ZShiftFromISO cm
d:Ge/WaterPhantomBox/RotX=0. deg
d:Ge/WaterPhantomBox/RotY=0. deg
d:Ge/WaterPhantomBox/RotZ=0. deg
s:Ge/WaterPhantomBox/Color="red"

#with sign (+: toward beam, -:backward beam)

s:Ge/WaterPhantom/Type="TsBox"
s:Ge/WaterPhantom/Parent="WaterPhantomBox"
s:Ge/WaterPhantom/Material="G4_WATER"
d:Ge/WaterPhantom/HLX= 0.5 * Ge/WP_Constants/SizeX cm
d:Ge/WaterPhantom/HLY= 0.5 * Ge/WP_Constants/SizeY cm
d:Ge/WaterPhantom/HLZ= 0.5 * Ge/WP_Constants/SizeZ cm
d:Ge/WaterPhantom/TransX= 0. cm
d:Ge/WaterPhantom/TransY= 0. cm
d:Ge/WaterPhantom/TransZ= 0. cm
d:Ge/WaterPhantom/RotX=0. deg
d:Ge/WaterPhantom/RotY=0. deg
d:Ge/WaterPhantom/RotZ=0. deg
s:Ge/WaterPhantom/Color="red"
i:Ge/WaterPhantom/XBins=1 
i:Ge/WaterPhantom/YBins=1 
i:Ge/WaterPhantom/ZBins=1 

User_Beamline_WC_Viewer.txt

includeFile = UCSF_Beamline_Base.txt Viewer.txt
# ===============================================#
# This example shows Waterphantom expansion
# as a function of time
# ===============================================#

Ph/Default/Modules = 1 "g4em-standard_opt0"
Ge/Nozzle/TransZ  = -133.66 cm

# ===============================================#
# Many of components are not included
# ===============================================#
Ge/ExtWindow/Include      = "TRUE"
Ge/WireChamber/Include    = "TRUE"
Ge/Collimator1/Include    = "TRUE"
Ge/IonChamber1/Include    = "TRUE"
Ge/Collimator2/Include    = "TRUE"
b:Ge/Collimator3/Include     = "FALSE"
b:Ge/IonChamber2/Include     = "TRUE"
b:Ge/PatientShield/Include   = "TRUE"
b:Ge/PatientAssembly/Include = "TRUE"

# ===============================================#
#Water phantom Thickness is under control by TimeFeature
# ===============================================#
Ge/WC_Water/HL			= 0.001 mm + Tf/WCThickness/Value
s:Tf/WCThickness/Function="Linear mm"
d:Tf/WCThickness/RepetitionInterval=30.0 ms
d:Tf/WCThickness/Rate=3. mm/ms
d:Tf/WCThickness/StartValue=0.0 mm


# ===============================================#
# Execution setting
# ===============================================#
i:So/Default/NumberOfHistoriesInRun = 2
So/Default/BeamEnergySpread = 0.0
Ts/PauseBeforeSequence = "False"
Ts/ShowHistoryCountAtInterval = 1
d:Tf/TimelineEnd=12.0 ms
i:Tf/NumberOfSequentialTimes=120

# ===============================================#
# Visualization
# ===============================================#
i:Gr/ViewA/WindowSizeX = 1024
i:Gr/ViewA/WindowSizeY = 768
d:Gr/ViewA/Theta = 90 deg
d:Gr/ViewA/Phi = 0 deg
u:Gr/ViewA/TransX = -0.06
b:Gr/ViewA/IncludeAxes = "True"
u:Gr/ViewA/Zoom = 25
s:Gr/ViewA/AxesComponent = "WC_Container"
b:Gr/ViewA/CopyOpenGLToEPS = "False"

User_BP_R28_WaterPhantom.txt

includeFile = UCSF_Beamline_Base.txt UCSF_WaterPhantom.txt 

# ===============================================#
# WaterColumn thickness adjustment to define Range
# ===============================================#
Ge/WaterColumn/Thickness = 4.0 mm

# ===============================================#
# Execution mode setting. non-4D
# ===============================================#
i:So/Default/NumberOfHistoriesInRun = 15625

b:Ts/ShowCPUTime = "True"

Ts/PauseBeforeQuit = "False"

# ===============================================#
# Water phantom. voxelization for scoring
# Scoring option
# ===============================================#
i:Ge/WaterPhantom/XBins=1
i:Ge/WaterPhantom/YBins=1
i:Ge/WaterPhantom/ZBins=80

s:Sc/DoseAtWaterPhantom/Quantity    = "DoseToMedium"
s:Sc/DoseAtWaterPhantom/Component   = "WaterPhantom"
s:Sc/DoseAtWaterPhantom/OutputFile  = "BP_R28"
s:Sc/DoseAtWaterPhantom/OutputType  = "binary"
b:Sc/DoseAtWaterPhantom/OutputToConsole = "False"
b:Sc/DoseAtWaterPhantom/Visualize   = "True"
s:Sc/DoseAtWaterPhantom/IfOutputFileAlreadyExists = "Overwrite"

User_SOBP24_R28_WaterPhantom.txt

includeFile = UCSF_Beamline_Propeller24.txt UCSF_WaterPhantom.txt 

# ===============================================#
# WaterColumn thickness adjustment to define Range
# ===============================================#
Ge/WaterColumn/Thickness = 4.0 mm

# ===============================================#
# Execution mode setting (RandomJob & SequentialJob)
# ===============================================#
Tf/TimelineEnd = Tf/TimeOfPropellerRotation ms
Tf/NumberOfSequentialTimes = Tf/UCSF_NbTimes 

b:Tf/RandomizeTimeDistribution = "True"

So/Default/NumberOfHistoriesInRun  = 100 * Tf/UCSF_NbHistoriesInRun
i:So/Default/NumberOfHistoriesInRandomJob = 15625
b:Ts/ShowCPUTime = "True"

Ts/PauseBeforeQuit = "False"

# ===============================================#
# Water phantom. voxelization for scoring
# Scoring option
# ===============================================#
i:Ge/WaterPhantom/XBins=1
i:Ge/WaterPhantom/YBins=1
i:Ge/WaterPhantom/ZBins=80

s:Sc/DoseAtWaterPhantom/Quantity    = "DoseToMedium"
s:Sc/DoseAtWaterPhantom/Component   = "WaterPhantom"
s:Sc/DoseAtWaterPhantom/OutputFile  = "SOBP24_R28"
s:Sc/DoseAtWaterPhantom/OutputType  = "binary"
b:Sc/DoseAtWaterPhantom/OutputToConsole = "False"
b:Sc/DoseAtWaterPhantom/Visualize   = "True"
s:Sc/DoseAtWaterPhantom/IfOutputFileAlreadyExists = "Overwrite"

User_SOBP24_Viewer.txt

includeFile = UCSF_Beamline_Propeller24.txt Viewer.txt 

Ge/WaterColumn/Thickness = 0.0 mm
b:Ge/World/Invisible = "True"

Tf/TimelineEnd = Tf/TimeOfPropellerRotation ms
Tf/NumberOfSequentialTimes = Tf/UCSF_NbTimes 
So/Default/NumberOfHistoriesInRun  = 2 * Tf/UCSF_NbHistoriesInRun

Gr/ViewA/Zoom =3.
u:Gr/ViewA/TransX = -0.2
Ts/PauseBeforeSequence = "False"
Ph/Default/Modules =1 "g4em-standard_opt0"

Ge/Nozzle/TransZ  = -150.0 cm

i:Gr/ViewA/WindowSizeX = 1024
i:Gr/ViewA/WindowSizeY = 768
d:Gr/ViewA/Theta = 40 deg
d:Gr/ViewA/Phi   = 15 deg
b:Gr/ViewA/CopyOpenGLToEPS = "False"

Viewer.txt

includeFile = UCSF_DefaultParameters.txt 
## Graphics
s:Gr/ViewA/Type = "OpenGL"
i:Gr/ViewA/WindowSizeX = 768
i:Gr/ViewA/WindowSizeY = 768
d:Gr/ViewA/Theta = 25 deg
d:Gr/ViewA/Phi = 14 deg
s:Gr/ViewA/Projection = "Perspective"
d:Gr/ViewA/PerspectiveAngle = 20 deg
u:Gr/ViewA/Zoom = 10
b:Gr/ViewA/HiddenLineRemovalForTrajectories = "False"
b:Gr/ViewA/IncludeAxes="True"
s:Gr/ViewA/AxesComponent = "World"
d:Gr/ViewA/AxesSize= 0.1 m

#b:Gr/ViewA/CopyOpenGLToEPS = "True"
b:Gr/ViewA/IncludeTrajectories = "True"

s:Gr/ViewA/ColorBy = "Charge"
s:Gr/ViewA/ChargeColors = "red green cyan" 

VarianceReduction

AmbientDoseEquivalent.txt

########################
# Simple shielding example
########################
d:Ge/World/HLX = 2 m
d:Ge/World/HLY = 2 m
d:Ge/World/HLZ = 2.1 m

#########################
# Gemetry for vrt
#########################
d:Ge/ScorerHLX = 1 m
d:Ge/ScorerHLY = 1 m
d:Ge/ScorerHLZ = 1 m

d:Ge/subComponent/Thickness     = 20 cm
d:Ge/subComponent/StartPosition = -1.0 * Ge/ScorerHLZ cm

s:Ge/subComponent1/Material  = "G4_CONCRETE"
s:Ge/subComponent2/Material  = "G4_CONCRETE"
s:Ge/subComponent3/Material  = "G4_CONCRETE"
s:Ge/subComponent4/Material  = "G4_CONCRETE"
s:Ge/subComponent5/Material  = "G4_CONCRETE"
s:Ge/subComponent6/Material  = "G4_CONCRETE"
s:Ge/subComponent7/Material  = "G4_CONCRETE"
s:Ge/subComponent8/Material  = "G4_CONCRETE"
s:Ge/subComponent9/Material  = "G4_CONCRETE"
s:Ge/subComponent10/Material = "G4_CONCRETE"
s:Ge/subComponent11/Material = "G4_CONCRETE"

s:Ge/subComponent1/Type      = "TsBox"
s:Ge/subComponent1/Parent    = "World"
d:Ge/subComponent1/HLX       = Ge/ScorerHLX m
d:Ge/subComponent1/HLY       = Ge/ScorerHLY m
d:Ge/subComponent1/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent1/TransX    = 0 cm
d:Ge/subComponent1/TransY    = 0 cm
d:Ge/subComponent1/TransZ    = Ge/subComponent/StartPosition + Ge/subComponent1/HLZ cm
d:Ge/subComponent1/RotX      = 0 deg
d:Ge/subComponent1/RotY      = 0 deg
d:Ge/subComponent1/RotZ      = 0 deg

s:Ge/subComponent2/Type      = "TsBox"
s:Ge/subComponent2/Parent    = "World"
d:Ge/subComponent2/HLX       = Ge/ScorerHLX m
d:Ge/subComponent2/HLY       = Ge/ScorerHLY m
d:Ge/subComponent2/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent2/TransX    = 0 cm
d:Ge/subComponent2/TransY    = 0 cm
d:Ge/subComponent2/TransZTmp = Ge/subComponent1/TransZ + Ge/subComponent1/HLZ cm
d:Ge/subComponent2/TransZ    = Ge/subComponent2/TransZTmp + Ge/subComponent2/HLZ cm
d:Ge/subComponent2/RotX      = 0 deg
d:Ge/subComponent2/RotY      = 0 deg
d:Ge/subComponent2/RotZ      = 0 deg

s:Ge/subComponent3/Type      = "TsBox"
s:Ge/subComponent3/Parent    = "World"
d:Ge/subComponent3/HLX       = Ge/ScorerHLX m
d:Ge/subComponent3/HLY       = Ge/ScorerHLY m
d:Ge/subComponent3/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent3/TransX    = 0 cm
d:Ge/subComponent3/TransY    = 0 cm
d:Ge/subComponent3/TransZTmp = Ge/subComponent2/TransZ + Ge/subComponent2/HLZ cm
d:Ge/subComponent3/TransZ    = Ge/subComponent3/TransZTmp + Ge/subComponent3/HLZ cm
d:Ge/subComponent3/RotX      = 0 deg
d:Ge/subComponent3/RotY      = 0 deg
d:Ge/subComponent3/RotZ      = 0 deg

s:Ge/subComponent4/Type      = "TsBox"
s:Ge/subComponent4/Parent    = "World"
d:Ge/subComponent4/HLX       = Ge/ScorerHLX m
d:Ge/subComponent4/HLY       = Ge/ScorerHLY m
d:Ge/subComponent4/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent4/TransX    = 0 cm
d:Ge/subComponent4/TransY    = 0 cm
d:Ge/subComponent4/TransZTmp = Ge/subComponent3/TransZ + Ge/subComponent3/HLZ cm
d:Ge/subComponent4/TransZ    = Ge/subComponent4/TransZTmp + Ge/subComponent4/HLZ cm
d:Ge/subComponent4/RotX      = 0 deg
d:Ge/subComponent4/RotY      = 0 deg
d:Ge/subComponent4/RotZ      = 0 deg

s:Ge/subComponent5/Type      = "TsBox"
s:Ge/subComponent5/Parent    = "World"
d:Ge/subComponent5/HLX       = Ge/ScorerHLX m
d:Ge/subComponent5/HLY       = Ge/ScorerHLY m
d:Ge/subComponent5/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent5/TransX    = 0 cm
d:Ge/subComponent5/TransY    = 0 cm
d:Ge/subComponent5/TransZTmp = Ge/subComponent4/TransZ + Ge/subComponent4/HLZ cm
d:Ge/subComponent5/TransZ    = Ge/subComponent5/TransZTmp + Ge/subComponent5/HLZ cm
d:Ge/subComponent5/RotX      = 0 deg
d:Ge/subComponent5/RotY      = 0 deg
d:Ge/subComponent5/RotZ      = 0 deg

s:Ge/subComponent6/Type      = "TsBox"
s:Ge/subComponent6/Parent    = "World"
d:Ge/subComponent6/HLX       = Ge/ScorerHLX m
d:Ge/subComponent6/HLY       = Ge/ScorerHLY m
d:Ge/subComponent6/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent6/TransX    = 0 cm
d:Ge/subComponent6/TransY    = 0 cm
d:Ge/subComponent6/TransZTmp = Ge/subComponent5/TransZ + Ge/subComponent5/HLZ cm
d:Ge/subComponent6/TransZ    = Ge/subComponent6/TransZTmp + Ge/subComponent6/HLZ cm
d:Ge/subComponent6/RotX      = 0 deg
d:Ge/subComponent6/RotY      = 0 deg
d:Ge/subComponent6/RotZ      = 0 deg

s:Ge/subComponent7/Type       = "TsBox"
s:Ge/subComponent7/Parent     = "World"
d:Ge/subComponent7/HLX        = Ge/ScorerHLX m
d:Ge/subComponent7/HLY        = Ge/ScorerHLY m
d:Ge/subComponent7/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent7/TransX     = 0 cm
d:Ge/subComponent7/TransY     = 0 cm
d:Ge/subComponent7/TransZTmp  = Ge/subComponent6/TransZ + Ge/subComponent6/HLZ cm
d:Ge/subComponent7/TransZ     = Ge/subComponent7/TransZTmp + Ge/subComponent7/HLZ cm
d:Ge/subComponent7/RotX       = 0 deg
d:Ge/subComponent7/RotY       = 0 deg
d:Ge/subComponent7/RotZ       = 0 deg

s:Ge/subComponent8/Type       = "TsBox"
s:Ge/subComponent8/Parent     = "World"
d:Ge/subComponent8/HLX        = Ge/ScorerHLX m
d:Ge/subComponent8/HLY        = Ge/ScorerHLY m
d:Ge/subComponent8/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent8/TransX     = 0 cm
d:Ge/subComponent8/TransY     = 0 cm
d:Ge/subComponent8/TransZTmp  = Ge/subComponent7/TransZ + Ge/subComponent7/HLZ cm
d:Ge/subComponent8/TransZ     = Ge/subComponent8/TransZTmp + Ge/subComponent8/HLZ cm
d:Ge/subComponent8/RotX       = 0 deg
d:Ge/subComponent8/RotY       = 0 deg
d:Ge/subComponent8/RotZ       = 0 deg

s:Ge/subComponent9/Type       = "TsBox"
s:Ge/subComponent9/Parent     = "World"
d:Ge/subComponent9/HLX        = Ge/ScorerHLX m
d:Ge/subComponent9/HLY        = Ge/ScorerHLY m
d:Ge/subComponent9/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent9/TransX     = 0 cm
d:Ge/subComponent9/TransY     = 0 cm
d:Ge/subComponent9/TransZTmp  = Ge/subComponent8/TransZ + Ge/subComponent8/HLZ cm
d:Ge/subComponent9/TransZ     = Ge/subComponent9/TransZTmp + Ge/subComponent9/HLZ cm
d:Ge/subComponent9/RotX       = 0 deg
d:Ge/subComponent9/RotY       = 0 deg
d:Ge/subComponent9/RotZ       = 0 deg

s:Ge/subComponent10/Type      = "TsBox"
s:Ge/subComponent10/Parent    = "World"
d:Ge/subComponent10/HLX       = Ge/ScorerHLX m
d:Ge/subComponent10/HLY       = Ge/ScorerHLY m
d:Ge/subComponent10/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent10/TransX    = 0 cm
d:Ge/subComponent10/TransY    = 0 cm
d:Ge/subComponent10/TransZTmp = Ge/subComponent9/TransZ + Ge/subComponent9/HLZ cm
d:Ge/subComponent10/TransZ    = Ge/subComponent10/TransZTmp + Ge/subComponent10/HLZ cm
d:Ge/subComponent10/RotX      = 0 deg
d:Ge/subComponent10/RotY      = 0 deg
d:Ge/subComponent10/RotZ      = 0 deg

s:Ge/subComponent11/Type      = "TsBox"
s:Ge/subComponent11/Parent    = "World"
d:Ge/subComponent11/HLX       = Ge/ScorerHLX m
d:Ge/subComponent11/HLY       = Ge/ScorerHLY m
d:Ge/subComponent11/HLZ       = 0.05 mm
d:Ge/subComponent11/TransX    = 0 cm
d:Ge/subComponent11/TransY    = 0 cm
d:Ge/subComponent11/TransZTmp = Ge/subComponent10/TransZ + Ge/subComponent10/HLZ cm
d:Ge/subComponent11/TransZ    = Ge/subComponent11/TransZTmp + Ge/subComponent11/HLZ cm
d:Ge/subComponent11/RotX      = 0 deg
d:Ge/subComponent11/RotY      = 0 deg
d:Ge/subComponent11/RotZ      = 0 deg

#########################
# VRT
#########################
b:Vr/UseVarianceReduction         = "true"
b:Vr/ParticleSplit/Active         = "true"
sv:Vr/ParticleSplit/ParticleName  = 1 "neutron"
s:Vr/ParticleSplit/Component      = "subComponent1"
sv:Vr/ParticleSplit/SubComponents = 10
"subComponent2"
"subComponent3" "subComponent4"
"subComponent5" "subComponent6"
"subComponent7" "subComponent8"
"subComponent9" "subComponent10" "subComponent11"
s:Vr/ParticleSplit/Type = "ImportanceSampling"
uv:Vr/ParticleSplit/ImportanceValues = 10 2 4 8 16 32 64 128 256 512 512

#########################
# Scorer
#########################
# Fix binwidth
sv:Sc/scorerFix/OnlyIncludeParticlesNamed = 1 "neutron"
s:Sc/scorerFix/Quantity                   = "Fluence"
s:Sc/scorerFix/Component                  = "subComponent11"
s:Sc/scorerFix/OutputFile                 = "FluenceSpectra_FixedBin"
s:Sc/scorerFix/OutputType                 = "Binary"
s:Sc/scorerFix/IfOutputFileAlreadyExists  = "Overwrite"
i:Sc/scorerFix/EBins                      = 100
d:Sc/scorerFix/EBinMin                    = 0.01 MeV
d:Sc/scorerFix/EBinMax                    = 110.1 MeV

# Logarithmic binwidth
sv:Sc/scorerLog/OnlyIncludeParticlesNamed = 1 "neutron"
s:Sc/scorerLog/Quantity                   = "Fluence"
s:Sc/scorerLog/Component                  = "subComponent11"
s:Sc/scorerLog/OutputFile                 = "FluenceSpectra_LogBin"
s:Sc/scorerLog/OutputType                 = "Binary"
s:Sc/scorerLog/IfOutputFileAlreadyExists  = "Overwrite"
i:Sc/scorerLog/EBins                      = 100
d:Sc/scorerLog/EBinMin                    = 0.01 MeV
d:Sc/scorerLog/EBinMax                    = 110.1 MeV
b:Sc/scorerLog/EBinLog                    = "True"

# Score dose to medium
sv:Sc/scorerDosePerSource/OnlyIncludeParticlesNamed = 1 "neutron"
s:Sc/scorerDosePerSource/Quantity                   = "DoseToMedium"
s:Sc/scorerDosePerSource/Component                  = "subComponent11"
s:Sc/scorerDosePerSource/OutputFile                 = "DoseNeutronPerSourceNeutron"
b:Sc/scorerDosePerSource/OutputToConsole            = "True"
s:Sc/scorerDosePerSource/IfOutputFileAlreadyExists  = "Overwrite"
sv:Sc/scorerDosePerSource/Report                    = 1 "Mean"

# Score ambient dose equivalent for neutrons
sv:Sc/scorerAmbDosePerSource/OnlyIncludeParticlesNamed = 1 "neutron"
s:Sc/scorerAmbDosePerSource/Quantity                   = "AmbientDoseEquivalent"
s:Sc/scorerAmbDosePerSource/Component                  = "subComponent11"
s:Sc/scorerAmbDosePerSource/OutputFile                 = "AmbientDoseNeutronPerSourceNeutron"
b:Sc/scorerAmbDosePerSource/OutputToConsole            = "True"
s:Sc/scorerAmbDosePerSource/IfOutputFileAlreadyExists  = "Overwrite"
sv:Sc/scorerAmbDosePerSource/Report                    = 1 "Mean"
# Set the fluence-to-dose conversion factors.
s:Sc/scorerAmbDosePerSource/GetAmbientDoseEquivalentForParticleNamed = "neutron"
dv:Sc/scorerAmbDosePerSource/FluenceToDoseConversionEnergies = 58
2.5314e-08 7.71605e-08 2.35195e-07 6.33404e-07 1.70582e-06 4.05885e-06 1.02746e-05 2.44475e-05 6.18866e-05 0.000142765
0.000309568 0.000611723 0.00100388 0.00150131 0.00217678 0.00305995 0.00430144 0.00604662 0.00849986  0.0119484
 0.0157877  0.0221931  0.0293242  0.0399651  0.0511969  0.0676476  0.0866593   0.101168     0.1296   0.171243
  0.233382   0.289858    0.37132   0.490632   0.590784   0.711379          1    1.85741    2.95521    4.95083
   9.98711    14.7825     18.937    20.1466    48.9368    98.7183    195.073    504.105    996.138    2182.41
   5086.78     9846.4      29400    99357.1     302853     982103 3.05600e+06 9.91011e+06  MeV
dv:Sc/scorerAmbDosePerSource/FluenceToDoseConversionValues   = 58
1.04694e-09 1.0279e-09 1.00922e-09 9.90868e-10 9.72854e-10 9.55168e-10 9.37803e-10 9.29239e-10 9.12346e-10 8.95759e-10
8.79474e-10 8.71443e-10 8.63485e-10 1.07615e-09 1.31681e-09 1.59657e-09 1.91809e-09 2.32559e-09 2.79393e-09 3.35658e-09
3.99571e-09 4.7131e-09 5.50853e-09 6.55742e-09 7.52478e-09 8.71443e-09 9.8182e-09 1.09608e-08 1.29287e-08 1.56754e-08
1.86602e-08 2.18095e-08 2.59623e-08 3.06236e-08 3.51412e-08 3.95922e-08 4.93432e-08 4.67006e-08 4.46069e-08 4.26071e-08
4.69871e-08 5.15014e-08 5.64495e-08 5.24551e-08 3.61218e-08 2.6443e-08 2.2418e-08 2.95202e-08 3.7933e-08 4.31315e-08
4.93432e-08 5.27769e-08 5.15014e-08 5.05651e-08 5.96437e-08 7.20944e-08 9.0956e-08 1.17594e-07 Sv*mm2

#########################
# Beam setting
#########################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "neutron"
d:So/Example/BeamEnergy               = 100.0 MeV
u:So/Example/BeamEnergySpread         = 0.5
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1000

d:Ge/BeamPosition/TransZ = -1.0 * Ge/World/HLZ m
d:Ge/BeamPosition/RotX   = 0 deg

i:Ts/ShowHistoryCountAtInterval = 100

CrossSectionEnhancement.txt

#
i:Ts/NumberOfThreads = 1

# Secondary biasing occurs in the region
# of this component
s:Ge/target/Parent   = "World"
s:Ge/target/Material = "Lead"
s:Ge/target/Type     = "TsBox"
d:Ge/target/HLX      = 1.5 cm
d:Ge/target/HLY      = 1.5 cm
d:Ge/target/HLZ      = 0.5 mm
s:Ge/target/Color    = "yellow"
# Set the region
s:Ge/target/AssignToRegionNaMed = "targetregion"

# Component for scoring
s:Ge/scorer/Parent   = "World"
s:Ge/scorer/Material = "G4_WATER"
s:Ge/scorer/Type     = "TsSphere"
d:Ge/scorer/RMin     = 5 cm
d:Ge/scorer/RMax     = 5.01 cm
s:Ge/scorer/Color    = "yellow"
s:Ge/scorer/AssignToRegionNamed = "scorerregion"

s:Sc/scorer/Quantity   = "EnergyFluence"
s:Sc/scorer/Component  = "scorer"
s:Sc/scorer/OutputFile = "secondaryBiasing"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"
i:Sc/scorer/EBins = 50
d:Sc/scorer/EBinMin = 0.01 MeV
d:Sc/scorer/EBinMax = 6 MeV
b:Sc/scorer/EBinLog = "True"

# VISUALIZATION
s:Gr/view/Type        = "OpenGl"
i:Gr/view/WindowSizeX = 600
i:Gr/view/WindowSizeY = 600
d:Gr/view/Phi         = 0 deg
d:Gr/view/Theta       = 270 deg
u:Gr/view/Zoom        = 5

b:Ts/PauseBeforeQuit = "True"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 6 MeV
u:So/Example/BeamEnergySpread         = 0.1
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad

Ge/BeamPosition/Parent = "World"
Ge/BeamPosition/TransX = 0.0 cm
Ge/BeamPosition/TransZ = -1.0 * Ge/target/HLZ cm
Ge/BeamPosition/TransY = 0.0 mm
Ge/BeamPosition/RotX   = 0 deg

# GEOMETRY
d:Ge/World/HLX      = 16.1 cm
d:Ge/World/HLY      = 16.1 cm
d:Ge/World/HLZ      = 1.5 m
s:Ge/World/Material = "Air"

sv:Ph/Default/Modules = 1 "g4em-standard_opt3"

i:So/Example/NumberOfHistoriesInRun = 100
i:Ts/ShowHistoryCountAtInterval = 10
b:Ts/ShowCPUTime = "True"

#Cross section enhancement
#This occurs everywhere
b:Vr/UseVarianceReduction = "true"    
s:Vr/CrossectionEnhancement/Type   = "CrosssectionEnhancement"
sv:Vr/CrossectionEnhancement/processesNamed    = 1 "eBrem"
uv:Vr/CrossectionEnhancement/EnhancementFactor = 1 400

#Brem Uniform splitting in the target region
b:Vr/UniformSplitting/Active = "True"
s:Vr/UniformSplitting/Type   = "UniformSplitting"
sv:Vr/UniformSplitting/forregion/targetregion/processesNamed   = 1 "eBrem"
uv:Vr/UniformSplitting/ForRegion/targetregion/SplitNumber      = 1   10
dv:Vr/UniformSplitting/ForRegion/targetregion/MaximumEnergies  = 1   6 MeV 

#Forced Interaction in the sphere shell
s:Vr/ForcedInteraction/Type   = "ForcedInteraction"
sv:Vr/ForcedInteraction/forregion/scorerregion/processesNamed   = 1 "compt" 
dv:Vr/ForcedInteraction/ForRegion/scorerregion/ForcedDistances  = 1 0.001 cm 
b:Vr/ForcedInteraction/ForRegion/scorerregion/CorrectByWeight = "True"

ForcedInteraction.txt

#
i:Ts/NumberOfThreads = 1

# Secondary biasing occurs in the region
# of this component
s:Ge/target/Parent   = "World"
s:Ge/target/Material = "G4_WATER"
s:Ge/target/Type     = "TsBox"
d:Ge/target/HLX      = 1.5 cm
d:Ge/target/HLY      = 1.5 cm
d:Ge/target/HLZ      = 0.5 mm
s:Ge/target/Color    = "yellow"
# Set the region
s:Ge/target/AssignToRegionNaMed = "targetregion"

# Component for scoring
s:Ge/scorer/Parent   = "World"
s:Ge/scorer/Material = "G4_WATER"
s:Ge/scorer/Type     = "TsCylinder"
d:Ge/scorer/RMax     = 5 cm
d:Ge/scorer/HL       = 0.05 mm
d:Ge/scorer/SPhi     = 0 deg
d:Ge/scorer/DPhi     = 360 deg
d:Ge/scorer/TransZ   = 1 m + Ge/scorer/HL
s:Ge/scorer/Color    = "yellow"
i:Ge/scorer/RBins    = 20
i:Ge/scorer/PhiBins  = 1
i:Ge/scorer/ZBins    = 1

s:Sc/scorer/Quantity   = "EnergyFluence"
s:Sc/scorer/Component  = "scorer"
s:Sc/scorer/OutputFile = "secondaryBiasing"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"

# VISUALIZATION
s:Gr/view/Type        = "OpenGl"
i:Gr/view/WindowSizeX = 600
i:Gr/view/WindowSizeY = 600
d:Gr/view/Phi         = 0 deg
d:Gr/view/Theta       = 270 deg
u:Gr/view/Zoom        = 5

b:Ts/PauseBeforeQuit = "True"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "gamma"
d:So/Example/BeamEnergy               = 10 MeV
u:So/Example/BeamEnergySpread         = 0.1
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad

Ge/BeamPosition/Parent = "World"
Ge/BeamPosition/TransX = 0.0 cm
Ge/BeamPosition/TransZ = -1.0 * Ge/target/HLZ cm
Ge/BeamPosition/TransY = 0.0 mm
Ge/BeamPosition/RotX   = 0 deg

# GEOMETRY
d:Ge/World/HLX      = 16.1 cm
d:Ge/World/HLY      = 16.1 cm
d:Ge/World/HLZ      = 1.5 m
s:Ge/World/Material = "Air"

sv:Ph/Default/Modules = 1 "g4em-standard_opt3"

i:So/Example/NumberOfHistoriesInRun = 1000
i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/ShowCPUTime = "True"

#Forced interaction in a region
#A distance value shorter than the thickness of the volume 
#of interest must be set.
#By setting that distance of interaction large enough,
#then the true physic length is taken into account. This
#will mimic activation deactivation of this technique.
s:Tf/ActiveVRT/Function = "step"
dv:Tf/ActiveVRT/Times    = 5 1 2 3 4 5 ms
dv:Tf/ActiveVRT/Values   = 5 0.1 Ge/World/HLZ 0.1 Ge/World/HLZ 0.1 mm 

Tf/TimeLineEnd = 5 ms
Tf/NumberOfSequentialTimes = 5

b:Vr/UseVarianceReduction = "true"
s:Vr/ForcedInteraction/Type   = "ForcedInteraction"
sv:Vr/ForcedInteraction/forregion/targetregion/processesNamed   = 2 "compt" "conv"
dv:Vr/ForcedInteraction/ForRegion/targetregion/ForcedDistances  = 2 Tf/ActiveVRT/Value Tf/ActiveVRT/Value mm
b:Vr/ForcedInteraction/ForRegion/targetregion/CorrectByWeight = "True"

GeometricalParticleSplit.txt

########################
# Time features
########################
s:Tf/Phi/Function            = "Linear deg"
d:Tf/Phi/Rate                = 90. deg/ms
d:Tf/Phi/StartValue          = 45 deg
d:Tf/Phi/RepetitionInterval  = 4. ms
d:Tf/TimelineEnd             = 4. ms
i:Tf/NumberOfSequentialTimes = 4

########################
#  Geometry
########################
d:Ge/World/HLX       = 1.0 m
d:Ge/World/HLY       = 1.0 m
d:Ge/World/HLZ       = 1.0 m
b:Ge/World/Invisible = "TRUE"

#########################
# Phantom
#########################
s:Ge/Phantom/Type      = "TsSphere"
s:Ge/Phantom/Parent    = "World"
s:Ge/Phantom/Material  = "G4_WATER"
s:Ge/Phantom/Color     = "blue"
d:Ge/Phantom/RMin      = 0.0 cm
d:Ge/Phantom/RMax      = 10.0 cm
d:Ge/Phantom/SPhi      = 0.0 deg
d:Ge/Phantom/DPhi      = 360 deg
d:Ge/Phantom/STheta    = 0 deg
d:Ge/Phantom/DTheta    = 180 deg
d:Ge/Phantom/TransX    = 0 cm
d:Ge/Phantom/TransY    = 0 cm
d:Ge/Phantom/TransZ    = 0 cm
d:Ge/Phantom/RotX      = 0 deg
d:Ge/Phantom/RotY      = 0 deg
d:Ge/Phantom/RotZ      = 0 deg

#########################
# Nozzle
#########################
s:Ge/Nozzle/Type   = "Group"
s:Ge/Nozzle/Parent = "World"
d:Ge/Nozzle/TransX = 0. cm
d:Ge/Nozzle/TransY = 0. cm
d:Ge/Nozzle/TransZ = 0. cm
d:Ge/Nozzle/RotX   = Tf/Phi/Value deg
d:Ge/Nozzle/RotY   = 0 deg
d:Ge/Nozzle/RotZ   = 0 deg
s:Ge/Nozzle/Color  = "blue"

#########################
# Scatterers
#########################
s:Ge/Scatterer1/Type      = "TsBox"
s:Ge/Scatterer1/Parent    = "Nozzle"
s:Ge/Scatterer1/Material  = "Lead"
d:Ge/Scatterer1/HLX       = 2.0 cm
d:Ge/Scatterer1/HLY       = 2.0 cm
d:Ge/Scatterer1/HLZ       = 0.25 cm
d:Ge/Scatterer1/TransX    = 0. cm
d:Ge/Scatterer1/TransY    = 0. cm
d:Ge/Scatterer1/TransZ    = -50 cm + Ge/Scatterer1/HLZ
d:Ge/Scatterer1/RotX      = 0 deg
d:Ge/Scatterer1/RotY      = 0 deg
d:Ge/Scatterer1/RotZ      = 0 deg
s:Ge/Scatterer1/Color     = "red"

s:Ge/Scatterer2/Type      = "TsBox"
s:Ge/Scatterer2/Parent    = "Nozzle"
s:Ge/Scatterer2/Material  = "Lead"
d:Ge/Scatterer2/HLX       = 4.0 cm
d:Ge/Scatterer2/HLY       = 4.0 cm
d:Ge/Scatterer2/HLZ       = 0.25 cm
d:Ge/Scatterer2/TransX    = 0. cm
d:Ge/Scatterer2/TransY    = 0. cm
d:Ge/Scatterer2/TransZtmp = -1.0 * Ge/Scatterer2/HLZ cm
d:Ge/Scatterer2/TransZ    = -40 cm + Ge/Scatterer2/TransZTmp
d:Ge/Scatterer2/RotX      = 0 deg
d:Ge/Scatterer2/RotY      = 0 deg
d:Ge/Scatterer2/RotZ      = 0 deg
s:Ge/Scatterer2/Color     = "red"

#########################
# Gemetry for vrt
#########################
s:Ge/VrtParallelWorld/Type       = "TsBox"
s:Ge/VrtParallelWorld/Parent     = "Nozzle"
d:Ge/VrtParallelWorld/HLX        = 15 cm
d:Ge/VrtParallelWorld/HLY        = 15 cm
d:Ge/VrtParallelWorld/HLZ        = 80 cm
d:Ge/VrtParallelWorld/TransX     = 0 cm
d:Ge/VrtParallelWorld/TransY     = 0 cm
d:Ge/VrtParallelWorld/TransZ     = -40 cm
d:Ge/VrtParallelWorld/RotX       = 0 deg
d:Ge/VrtParallelWorld/RotY       = 0 deg
d:Ge/VrtParallelWorld/RotZ       = 0 deg
b:Ge/VrtParallelWorld/IsParallel = "true"

s:Ge/subComponent1/Type       = "TsBox"
s:Ge/subComponent1/Parent     = "VrtParallelWorld"
d:Ge/subComponent1/HLX        = 0.9 * Ge/VrtParallelWorld/HLX cm
d:Ge/subComponent1/HLY        = 0.9 * Ge/VrtParallelWorld/HLY cm
d:Ge/subComponent1/HLZ        = 5.0 cm
d:Ge/subComponent1/TransX     = 0 cm
d:Ge/subComponent1/TransY     = 0 cm
d:Ge/subComponent1/TransZ     = -5.0 cm
d:Ge/subComponent1/RotX       = 0 deg
d:Ge/subComponent1/RotY       = 0 deg
d:Ge/subComponent1/RotZ       = 0 deg
b:Ge/subComponent1/IsParallel = "true"

s:Ge/subComponent2/Type       = "TsBox"
s:Ge/subComponent2/Parent     = "VrtParallelWorld"
d:Ge/subComponent2/HLX        = 0.9 * Ge/VrtParallelWorld/HLX cm
d:Ge/subComponent2/HLY        = 0.9 * Ge/VrtParallelWorld/HLX cm
d:Ge/subComponent2/HLZ        = 35.0 cm
d:Ge/subComponent2/TransX     = 0 cm
d:Ge/subComponent2/TransY     = 0 cm
d:Ge/subComponent2/TransZTmp  = Ge/subComponent1/TransZ + Ge/subComponent1/HLZ cm
d:Ge/subComponent2/TransZ     = Ge/subComponent2/TransZTmp + Ge/subComponent2/HLZ cm
d:Ge/subComponent2/RotX       = 0 deg
d:Ge/subComponent2/RotY       = 0 deg
d:Ge/subComponent2/RotZ       = 0 deg
b:Ge/subComponent2/IsParallel = "true"

##########################
# Variance reduction
##########################
b:Vr/UseVarianceReduction                    = "true"
b:Vr/ParticleSplit/Active                    = "true"
sv:Vr/ParticleSplit/ParticleName             = 1 "proton"
s:Vr/ParticleSplit/Component                 = "VrtParallelWorld"
sv:Vr/ParticleSplit/SubComponents            = 2 "subComponent1" "subComponent2"
s:Vr/ParticleSplit/Type                      = "GeometricalParticleSplit"
iv:Vr/ParticleSplit/SplitNumber              = 2 4 4
bv:Vr/ParticleSplit/Symmetric                = 2 "false" "true"
d:Vr/ParticleSplit/RussianRoulette/ROIRadius = 2.5 cm
d:Vr/ParticleSplit/RussianRoulette/ROITrans  = 20 cm
bv:Vr/ParticleSplit/RussianRoulette          = 2 "true" "true"
s:Vr/ParticleSplit/SplitAxis                 = "zaxis"

##########################
# Beam settings
##########################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "proton"
d:So/Example/BeamEnergy               = 170 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 0.15 cm
d:So/Example/BeamPositionCutoffY      = 0.15 cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad

s:Ge/BeamPosition/Parent = "Nozzle"
d:Ge/BeamPosition/RotX   = 0 deg
d:Ge/BeamPosition/TransZ = -60. cm

##########################
# Scorer
##########################
s:Sc/scorer/Quantity                  = "DoseToMedium"
s:Sc/scorer/Component                 = "Phantom"
sv:Sc/scorer/Report                   = 3 "Sum" "Mean" "Variance"
s:Sc/scorer/OutputType                = "CSV"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"

##########################
# Histories
##########################
i:So/Example/NumberOfHistoriesInRun = 100
i:Ts/ShowHistoryCountAtInterval     = 100
b:Ts/PauseBeforeQuit                = "False"

##########################
# Visualization
##########################
s:Gr/viewer/Type                = "OpenGl"
u:Gr/viewer/Zoom                = 0.5
i:Gr/viewer/WindowSizeX         = 900
i:Gr/viewer/WindowSizeY         = 900
i:Gr/viewer/WindowPosX          = 0
i:Gr/viewer/WindowPosY          = 0
s:Gr/viewer/Projection          = "Orthogonal"
d:Gr/viewer/Theta               = -90. deg
d:Gr/viewer/Phi                 = 0. deg
b:Gr/viewer/IncludeAxes         = "true"
s:Gr/viewer/AxesComponent       = "World"
sv:Gr/OnlyIncludeParticlesNamed = 1 "proton"
d:Gr/viewer/AxesSize            = 20 cm

ImportanceSampling.txt

########################
# Simple shielding example
########################
d:Ge/World/HLX = 2 m
d:Ge/World/HLY = 2 m
d:Ge/World/HLZ = 2.1 m

s:Ge/wall/Type     = "TsBox"
s:Ge/wall/Parent   = "World"
s:Ge/wall/Material = "G4_CONCRETE"
d:Ge/wall/HLX      =  1 m
d:Ge/wall/HLY      =  1 m
d:Ge/wall/HLZ      =  1 m
d:Ge/wall/TransX   =  0 m
d:Ge/wall/TransY   =  0 m
d:Ge/wall/TransZ   =  0 m
d:Ge/wall/RotX     =  0 deg
d:Ge/wall/RotY     =  0 deg
d:Ge/wall/RotZ     =  0 deg
s:Ge/wall/Color    =  "red"
i:Ge/wall/XBins    =  1
i:Ge/wall/YBins    =  1
i:Ge/wall/ZBins    = 10

#########################
# Gemetry for vrt
#########################
d:Ge/subComponent/Thickness     = 20 cm
d:Ge/subComponent/StartPosition = -1.0 * Ge/wall/HLZ cm

s:Ge/VrtParallelWorld/Type       = "TsBox"
s:Ge/VrtParallelWorld/Parent     = "World"
d:Ge/VrtParallelWorld/HLX        = 1.1 m
d:Ge/VrtParallelWorld/HLY        = 1.1 m
d:Ge/VrtParallelWorld/HLZ        = 1.1 m
d:Ge/VrtParallelWorld/TransX     = 0 cm
d:Ge/VrtParallelWorld/TransY     = 0 cm
d:Ge/VrtParallelWorld/TransZ     = 0 cm
d:Ge/VrtParallelWorld/RotX       = 0 deg
d:Ge/VrtParallelWorld/RotY       = 0 deg
d:Ge/VrtParallelWorld/RotZ       = 0 deg
b:Ge/VrtParallelWorld/IsParallel = "true"

s:Ge/subComponent1/Type       = "TsBox"
s:Ge/subComponent1/Parent     = "VrtParallelWorld"
d:Ge/subComponent1/HLX        = Ge/Wall/HLX m
d:Ge/subComponent1/HLY        = Ge/Wall/HLY m
d:Ge/subComponent1/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent1/TransX     = 0 cm
d:Ge/subComponent1/TransY     = 0 cm
d:Ge/subComponent1/TransZ     = Ge/subComponent/StartPosition + Ge/subComponent1/HLZ cm
d:Ge/subComponent1/RotX       = 0 deg
d:Ge/subComponent1/RotY       = 0 deg
d:Ge/subComponent1/RotZ       = 0 deg
b:Ge/subComponent1/IsParallel = "true"

s:Ge/subComponent2/Type       = "TsBox"
s:Ge/subComponent2/Parent     = "VrtParallelWorld"
d:Ge/subComponent2/HLX        = Ge/Wall/HLX m
d:Ge/subComponent2/HLY        = Ge/Wall/HLY m
d:Ge/subComponent2/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent2/TransX     = 0 cm
d:Ge/subComponent2/TransY     = 0 cm
d:Ge/subComponent2/TransZTmp  = Ge/subComponent1/TransZ + Ge/subComponent1/HLZ cm
d:Ge/subComponent2/TransZ     = Ge/subComponent2/TransZTmp + Ge/subComponent2/HLZ cm
d:Ge/subComponent2/RotX       = 0 deg
d:Ge/subComponent2/RotY       = 0 deg
d:Ge/subComponent2/RotZ       = 0 deg
b:Ge/subComponent2/IsParallel = "true"

s:Ge/subComponent3/Type       = "TsBox"
s:Ge/subComponent3/Parent     = "VrtParallelWorld"
d:Ge/subComponent3/HLX        = Ge/Wall/HLX m
d:Ge/subComponent3/HLY        = Ge/Wall/HLY m
d:Ge/subComponent3/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent3/TransX     = 0 cm
d:Ge/subComponent3/TransY     = 0 cm
d:Ge/subComponent3/TransZTmp  = Ge/subComponent2/TransZ + Ge/subComponent2/HLZ cm
d:Ge/subComponent3/TransZ     = Ge/subComponent3/TransZTmp + Ge/subComponent3/HLZ cm
d:Ge/subComponent3/RotX       = 0 deg
d:Ge/subComponent3/RotY       = 0 deg
d:Ge/subComponent3/RotZ       = 0 deg
b:Ge/subComponent3/IsParallel = "true"

s:Ge/subComponent4/Type       = "TsBox"
s:Ge/subComponent4/Parent     = "VrtParallelWorld"
d:Ge/subComponent4/HLX        = Ge/Wall/HLX m
d:Ge/subComponent4/HLY        = Ge/Wall/HLY m
d:Ge/subComponent4/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent4/TransX     = 0 cm
d:Ge/subComponent4/TransY     = 0 cm
d:Ge/subComponent4/TransZTmp  = Ge/subComponent3/TransZ + Ge/subComponent3/HLZ cm
d:Ge/subComponent4/TransZ     = Ge/subComponent4/TransZTmp + Ge/subComponent4/HLZ cm
d:Ge/subComponent4/RotX       = 0 deg
d:Ge/subComponent4/RotY       = 0 deg
d:Ge/subComponent4/RotZ       = 0 deg
b:Ge/subComponent4/IsParallel = "true"

s:Ge/subComponent5/Type       = "TsBox"
s:Ge/subComponent5/Parent     = "VrtParallelWorld"
d:Ge/subComponent5/HLX        = Ge/Wall/HLX m
d:Ge/subComponent5/HLY        = Ge/Wall/HLY m
d:Ge/subComponent5/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent5/TransX     = 0 cm
d:Ge/subComponent5/TransY     = 0 cm
d:Ge/subComponent5/TransZTmp  = Ge/subComponent4/TransZ + Ge/subComponent4/HLZ cm
d:Ge/subComponent5/TransZ     = Ge/subComponent5/TransZTmp + Ge/subComponent5/HLZ cm
d:Ge/subComponent5/RotX       = 0 deg
d:Ge/subComponent5/RotY       = 0 deg
d:Ge/subComponent5/RotZ       = 0 deg
b:Ge/subComponent5/IsParallel = "true"

s:Ge/subComponent6/Type       = "TsBox"
s:Ge/subComponent6/Parent     = "VrtParallelWorld"
d:Ge/subComponent6/HLX        = Ge/Wall/HLX m
d:Ge/subComponent6/HLY        = Ge/Wall/HLY m
d:Ge/subComponent6/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent6/TransX     = 0 cm
d:Ge/subComponent6/TransY     = 0 cm
d:Ge/subComponent6/TransZTmp  = Ge/subComponent5/TransZ + Ge/subComponent5/HLZ cm
d:Ge/subComponent6/TransZ     = Ge/subComponent6/TransZTmp + Ge/subComponent6/HLZ cm
d:Ge/subComponent6/RotX       = 0 deg
d:Ge/subComponent6/RotY       = 0 deg
d:Ge/subComponent6/RotZ       = 0 deg
b:Ge/subComponent6/IsParallel = "true"

s:Ge/subComponent7/Type       = "TsBox"
s:Ge/subComponent7/Parent     = "VrtParallelWorld"
d:Ge/subComponent7/HLX        = Ge/Wall/HLX m
d:Ge/subComponent7/HLY        = Ge/Wall/HLY m
d:Ge/subComponent7/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent7/TransX     = 0 cm
d:Ge/subComponent7/TransY     = 0 cm
d:Ge/subComponent7/TransZTmp  = Ge/subComponent6/TransZ + Ge/subComponent6/HLZ cm
d:Ge/subComponent7/TransZ     = Ge/subComponent7/TransZTmp + Ge/subComponent7/HLZ cm
d:Ge/subComponent7/RotX       = 0 deg
d:Ge/subComponent7/RotY       = 0 deg
d:Ge/subComponent7/RotZ       = 0 deg
b:Ge/subComponent7/IsParallel = "true"

s:Ge/subComponent8/Type       = "TsBox"
s:Ge/subComponent8/Parent     = "VrtParallelWorld"
d:Ge/subComponent8/HLX        = Ge/Wall/HLX m
d:Ge/subComponent8/HLY        = Ge/Wall/HLY m
d:Ge/subComponent8/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent8/TransX     = 0 cm
d:Ge/subComponent8/TransY     = 0 cm
d:Ge/subComponent8/TransZTmp  = Ge/subComponent7/TransZ + Ge/subComponent7/HLZ cm
d:Ge/subComponent8/TransZ     = Ge/subComponent8/TransZTmp + Ge/subComponent8/HLZ cm
d:Ge/subComponent8/RotX       = 0 deg
d:Ge/subComponent8/RotY       = 0 deg
d:Ge/subComponent8/RotZ       = 0 deg
b:Ge/subComponent8/IsParallel = "true"

s:Ge/subComponent9/Type       = "TsBox"
s:Ge/subComponent9/Parent     = "VrtParallelWorld"
d:Ge/subComponent9/HLX        = Ge/Wall/HLX m
d:Ge/subComponent9/HLY        = Ge/Wall/HLY m
d:Ge/subComponent9/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent9/TransX     = 0 cm
d:Ge/subComponent9/TransY     = 0 cm
d:Ge/subComponent9/TransZTmp  = Ge/subComponent8/TransZ + Ge/subComponent8/HLZ cm
d:Ge/subComponent9/TransZ     = Ge/subComponent9/TransZTmp + Ge/subComponent9/HLZ cm
d:Ge/subComponent9/RotX       = 0 deg
d:Ge/subComponent9/RotY       = 0 deg
d:Ge/subComponent9/RotZ       = 0 deg
b:Ge/subComponent9/IsParallel = "true"

s:Ge/subComponent10/Type       = "TsBox"
s:Ge/subComponent10/Parent     = "VrtParallelWorld"
d:Ge/subComponent10/HLX        = Ge/Wall/HLX m
d:Ge/subComponent10/HLY        = Ge/Wall/HLY m
d:Ge/subComponent10/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent10/TransX     = 0 cm
d:Ge/subComponent10/TransY     = 0 cm
d:Ge/subComponent10/TransZTmp  = Ge/subComponent9/TransZ + Ge/subComponent9/HLZ cm
d:Ge/subComponent10/TransZ     = Ge/subComponent10/TransZTmp + Ge/subComponent10/HLZ cm
d:Ge/subComponent10/RotX       = 0 deg
d:Ge/subComponent10/RotY       = 0 deg
d:Ge/subComponent10/RotZ       = 0 deg
b:Ge/subComponent10/IsParallel = "true"

#########################
# VRT
#########################
b:Vr/UseVarianceReduction         = "true"
b:Vr/ParticleSplit/Active         = "true"
sv:Vr/ParticleSplit/ParticleName  = 1 "neutron"
s:Vr/ParticleSplit/Component      = "VrtParallelWorld"
sv:Vr/ParticleSplit/SubComponents = 10
"subComponent1" "subComponent2"
"subComponent3" "subComponent4"
"subComponent5" "subComponent6"
"subComponent7" "subComponent8"
"subComponent9" "subComponent10"
s:Vr/ParticleSplit/Type = "ImportanceSampling"
uv:Vr/ParticleSplit/ImportanceValues = 10 2 4 8 16 32 64 128 256 512 1024

#########################
# Scorer
#########################
s:Sc/scorer/Quantity                  = "DoseToMedium"
s:Sc/scorer/Component                 = "Wall"
s:Sc/scorer/OutputFile                = "ImportanceSampling"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/scorer/Report                   = 3 "Sum" "Mean" "Variance"

#########################
# Beam setting
#########################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "neutron"
d:So/Example/BeamEnergy               = 10 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

d:Ge/BeamPosition/TransZ = -1.0 * Ge/World/HLZ m
d:Ge/BeamPosition/RotX   = 0 deg

i:Ts/ShowHistoryCountAtInterval = 10

b:Ts/PauseBeforeQuit = "True"
s:Gr/view/Type = "OpenGl"
b:Gr/view/IncludeAxes = "True"

ImportanceSamplingMassGeometry.txt

########################
# Simple shielding example
########################
d:Ge/World/HLX = 2 m
d:Ge/World/HLY = 2 m
d:Ge/World/HLZ = 2.1 m

########################
# Scoring region
########################
s:Ge/Scorer/Type       = "TsBox"
s:Ge/Scorer/Parent     = "World"
b:Ge/Scorer/IsParallel = "True"
d:Ge/Scorer/HLX        =  1 m
d:Ge/Scorer/HLY        =  1 m
d:Ge/Scorer/HLZ        =  1 m
d:Ge/Scorer/TransX     =  0 m
d:Ge/Scorer/TransY     =  0 m
d:Ge/Scorer/TransZ     =  0 m
d:Ge/Scorer/RotX       =  0 deg
d:Ge/Scorer/RotY       =  0 deg
d:Ge/Scorer/RotZ       =  0 deg
s:Ge/Scorer/Color      =  "red"
i:Ge/Scorer/XBins      =  1
i:Ge/Scorer/YBins      =  1
i:Ge/Scorer/ZBins      = 10

#########################
# Gemetry for vrt
#########################
d:Ge/subComponent/Thickness     = 20 cm
d:Ge/subComponent/StartPosition = -1.0 * Ge/Scorer/HLZ cm

s:Ge/subComponent1/Material  = "G4_CONCRETE"
s:Ge/subComponent2/Material  = "G4_CONCRETE"
s:Ge/subComponent3/Material  = "G4_CONCRETE"
s:Ge/subComponent4/Material  = "G4_CONCRETE"
s:Ge/subComponent5/Material  = "G4_CONCRETE"
s:Ge/subComponent6/Material  = "G4_CONCRETE"
s:Ge/subComponent7/Material  = "G4_CONCRETE"
s:Ge/subComponent8/Material  = "G4_CONCRETE"
s:Ge/subComponent9/Material  = "G4_CONCRETE"
s:Ge/subComponent10/Material = "G4_CONCRETE"

s:Ge/subComponent1/Type      = "TsBox"
s:Ge/subComponent1/Parent    = "World"
d:Ge/subComponent1/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent1/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent1/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent1/TransX    = 0 cm
d:Ge/subComponent1/TransY    = 0 cm
d:Ge/subComponent1/TransZ    = Ge/subComponent/StartPosition + Ge/subComponent1/HLZ cm
d:Ge/subComponent1/RotX      = 0 deg
d:Ge/subComponent1/RotY      = 0 deg
d:Ge/subComponent1/RotZ      = 0 deg

s:Ge/subComponent2/Type      = "TsBox"
s:Ge/subComponent2/Parent    = "World"
d:Ge/subComponent2/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent2/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent2/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent2/TransX    = 0 cm
d:Ge/subComponent2/TransY    = 0 cm
d:Ge/subComponent2/TransZTmp = Ge/subComponent1/TransZ + Ge/subComponent1/HLZ cm
d:Ge/subComponent2/TransZ    = Ge/subComponent2/TransZTmp + Ge/subComponent2/HLZ cm
d:Ge/subComponent2/RotX      = 0 deg
d:Ge/subComponent2/RotY      = 0 deg
d:Ge/subComponent2/RotZ      = 0 deg

s:Ge/subComponent3/Type      = "TsBox"
s:Ge/subComponent3/Parent    = "World"
d:Ge/subComponent3/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent3/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent3/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent3/TransX    = 0 cm
d:Ge/subComponent3/TransY    = 0 cm
d:Ge/subComponent3/TransZTmp = Ge/subComponent2/TransZ + Ge/subComponent2/HLZ cm
d:Ge/subComponent3/TransZ    = Ge/subComponent3/TransZTmp + Ge/subComponent3/HLZ cm
d:Ge/subComponent3/RotX      = 0 deg
d:Ge/subComponent3/RotY      = 0 deg
d:Ge/subComponent3/RotZ      = 0 deg

s:Ge/subComponent4/Type      = "TsBox"
s:Ge/subComponent4/Parent    = "World"
d:Ge/subComponent4/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent4/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent4/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent4/TransX    = 0 cm
d:Ge/subComponent4/TransY    = 0 cm
d:Ge/subComponent4/TransZTmp = Ge/subComponent3/TransZ + Ge/subComponent3/HLZ cm
d:Ge/subComponent4/TransZ    = Ge/subComponent4/TransZTmp + Ge/subComponent4/HLZ cm
d:Ge/subComponent4/RotX      = 0 deg
d:Ge/subComponent4/RotY      = 0 deg
d:Ge/subComponent4/RotZ      = 0 deg

s:Ge/subComponent5/Type      = "TsBox"
s:Ge/subComponent5/Parent    = "World"
d:Ge/subComponent5/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent5/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent5/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent5/TransX    = 0 cm
d:Ge/subComponent5/TransY    = 0 cm
d:Ge/subComponent5/TransZTmp = Ge/subComponent4/TransZ + Ge/subComponent4/HLZ cm
d:Ge/subComponent5/TransZ    = Ge/subComponent5/TransZTmp + Ge/subComponent5/HLZ cm
d:Ge/subComponent5/RotX      = 0 deg
d:Ge/subComponent5/RotY      = 0 deg
d:Ge/subComponent5/RotZ      = 0 deg

s:Ge/subComponent6/Type      = "TsBox"
s:Ge/subComponent6/Parent    = "World"
d:Ge/subComponent6/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent6/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent6/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent6/TransX    = 0 cm
d:Ge/subComponent6/TransY    = 0 cm
d:Ge/subComponent6/TransZTmp = Ge/subComponent5/TransZ + Ge/subComponent5/HLZ cm
d:Ge/subComponent6/TransZ    = Ge/subComponent6/TransZTmp + Ge/subComponent6/HLZ cm
d:Ge/subComponent6/RotX      = 0 deg
d:Ge/subComponent6/RotY      = 0 deg
d:Ge/subComponent6/RotZ      = 0 deg

s:Ge/subComponent7/Type      = "TsBox"
s:Ge/subComponent7/Parent    = "World"
d:Ge/subComponent7/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent7/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent7/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent7/TransX    = 0 cm
d:Ge/subComponent7/TransY    = 0 cm
d:Ge/subComponent7/TransZTmp = Ge/subComponent6/TransZ + Ge/subComponent6/HLZ cm
d:Ge/subComponent7/TransZ    = Ge/subComponent7/TransZTmp + Ge/subComponent7/HLZ cm
d:Ge/subComponent7/RotX      = 0 deg
d:Ge/subComponent7/RotY      = 0 deg
d:Ge/subComponent7/RotZ      = 0 deg

s:Ge/subComponent8/Type       = "TsBox"
s:Ge/subComponent8/Parent     = "World"
d:Ge/subComponent8/HLX        = Ge/Scorer/HLX m
d:Ge/subComponent8/HLY        = Ge/Scorer/HLY m
d:Ge/subComponent8/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent8/TransX     = 0 cm
d:Ge/subComponent8/TransY     = 0 cm
d:Ge/subComponent8/TransZTmp  = Ge/subComponent7/TransZ + Ge/subComponent7/HLZ cm
d:Ge/subComponent8/TransZ     = Ge/subComponent8/TransZTmp + Ge/subComponent8/HLZ cm
d:Ge/subComponent8/RotX       = 0 deg
d:Ge/subComponent8/RotY       = 0 deg
d:Ge/subComponent8/RotZ       = 0 deg

s:Ge/subComponent9/Type       = "TsBox"
s:Ge/subComponent9/Parent     = "World"
d:Ge/subComponent9/HLX        = Ge/Scorer/HLX m
d:Ge/subComponent9/HLY        = Ge/Scorer/HLY m
d:Ge/subComponent9/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent9/TransX     = 0 cm
d:Ge/subComponent9/TransY     = 0 cm
d:Ge/subComponent9/TransZTmp  = Ge/subComponent8/TransZ + Ge/subComponent8/HLZ cm
d:Ge/subComponent9/TransZ     = Ge/subComponent9/TransZTmp + Ge/subComponent9/HLZ cm
d:Ge/subComponent9/RotX       = 0 deg
d:Ge/subComponent9/RotY       = 0 deg
d:Ge/subComponent9/RotZ       = 0 deg

s:Ge/subComponent10/Type      = "TsBox"
s:Ge/subComponent10/Parent    = "World"
d:Ge/subComponent10/HLX       = Ge/Scorer/HLX m
d:Ge/subComponent10/HLY       = Ge/Scorer/HLY m
d:Ge/subComponent10/HLZ       = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent10/TransX    = 0 cm
d:Ge/subComponent10/TransY    = 0 cm
d:Ge/subComponent10/TransZTmp = Ge/subComponent9/TransZ + Ge/subComponent9/HLZ cm
d:Ge/subComponent10/TransZ    = Ge/subComponent10/TransZTmp + Ge/subComponent10/HLZ cm
d:Ge/subComponent10/RotX      = 0 deg
d:Ge/subComponent10/RotY      = 0 deg
d:Ge/subComponent10/RotZ      = 0 deg

#########################
# VRT
#########################
b:Vr/UseVarianceReduction         = "true"
b:Vr/ParticleSplit/Active         = "true"
sv:Vr/ParticleSplit/ParticleName  = 4 "neutron" "gamma" "proton" "e-"
s:Vr/ParticleSplit/Component      = "subComponent1"
sv:Vr/ParticleSplit/SubComponents = 9
 "subComponent2"
"subComponent3" "subComponent4"
"subComponent5" "subComponent6"
"subComponent7" "subComponent8"
"subComponent9" "subComponent10"
s:Vr/ParticleSplit/Type = "ImportanceSampling"
uv:Vr/ParticleSplit/ImportanceValues = 9 2 4 8 16 32 64 128 256 512

#########################
# Scorer
#########################
s:Sc/scorer/Quantity                  = "DoseToMedium"
s:Sc/scorer/Component                 = "Scorer"
s:Sc/scorer/OutputFile                = "ImportanceSamplingAllMassNew"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/scorer/Report                   = 2 "Mean" "Standard_Deviation"

#########################
# Beam setting
#########################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "neutron"
d:So/Example/BeamEnergy               = 10 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 100

d:Ge/BeamPosition/TransZ = -1.0 * Ge/World/HLZ m
d:Ge/BeamPosition/RotX   = 0 deg

i:Ts/ShowHistoryCountAtInterval = 10

b:Ts/PauseBeforeQuit  = "True"
s:Gr/view/Type        = "OpenGl"
b:Gr/view/IncludeAxes = "True"

ImportanceSamplingSecondaryBiasing.txt

#
# This example demonstrate the use of two variance reduction
# techniques in the same simulation: uniform bremsstrahlung splitting
# and importance sampling.
# Bremstrahlung x-rays produced by e- hitting a lead target are split
# and further split in their propagation through a parallel geometry 
# of stacked slabs.
# Due to the high number of tracks, only the e- shower is shown in the
# OpenGl viewer.
#
########################
# Simple shielding example
########################
d:Ge/World/HLX = 4 m
d:Ge/World/HLY = 4 m
d:Ge/World/HLZ = 4.1 m
b:Ge/World/Invisible = "True"
s:Ge/World/Material = "G4_WATER"

s:Ge/group/Parent = "World"
s:Ge/group/Type = "Group"

s:Ge/target/Type     = "TsBox"
s:Ge/target/Parent   = "group" 
s:Ge/target/Material = "G4_Pb"
s:Ge/target/Color = "magenta"
s:Ge/target/DrawingStyle = "Solid"
d:Ge/target/HLX      =  1 cm
d:Ge/target/HLY      =  1 cm
d:Ge/target/HLZ      =  2 mm
d:Ge/target/TransX   =  0 m
d:Ge/target/TransY   =  0 m
d:Ge/target/TransZ   =  0 m
d:Ge/target/RotX     =  0 deg
d:Ge/target/RotY     =  0 deg
d:Ge/target/RotZ     =  0 deg

s:Ge/target/AssignToRegionNamed = "targetregion"

#########################
# Gemetry for vrt
#########################
d:Ge/subComponent/Thickness     = 2 mm
d:Ge/subComponent/StartPosition = -1.0 * Ge/VrtParallelWorld/HLZ cm

s:Ge/VrtParallelWorld/Type       = "TsBox"
s:Ge/VrtParallelWorld/Parent     = "group" 
d:Ge/VrtParallelWorld/HLX        = 21 cm
d:Ge/VrtParallelWorld/HLY        = 21 cm
d:Ge/VrtParallelWorld/HLZ        = 6 cm
d:Ge/VrtParallelWorld/TransX     = 0 cm
d:Ge/VrtParallelWorld/TransY     = 0 cm
d:Ge/VrtParallelWorld/TransZ     = Ge/target/HLZ + Ge/VrtParallelWorld/HLZ cm
d:Ge/VrtParallelWorld/RotX       = 0 deg
d:Ge/VrtParallelWorld/RotY       = 0 deg
d:Ge/VrtParallelWorld/RotZ       = 0 deg
b:Ge/VrtParallelWorld/IsParallel = "true"

s:Ge/subComponent1/Type       = "TsBox"
s:Ge/subComponent1/Parent     = "VrtParallelWorld"
d:Ge/subComponent1/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent1/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent1/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent1/TransX     = 0 cm
d:Ge/subComponent1/TransY     = 0 cm
d:Ge/subComponent1/TransZ     = Ge/subComponent/StartPosition + Ge/subComponent1/HLZ cm
d:Ge/subComponent1/RotX       = 0 deg
d:Ge/subComponent1/RotY       = 0 deg
d:Ge/subComponent1/RotZ       = 0 deg
b:Ge/subComponent1/IsParallel = "true"

s:Ge/subComponent2/Type       = "TsBox"
s:Ge/subComponent2/Parent     = "VrtParallelWorld"
d:Ge/subComponent2/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent2/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent2/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent2/TransX     = 0 cm
d:Ge/subComponent2/TransY     = 0 cm
d:Ge/subComponent2/TransZTmp  = Ge/subComponent1/TransZ + Ge/subComponent1/HLZ cm
d:Ge/subComponent2/TransZ     = Ge/subComponent2/TransZTmp + Ge/subComponent2/HLZ cm
d:Ge/subComponent2/RotX       = 0 deg
d:Ge/subComponent2/RotY       = 0 deg
d:Ge/subComponent2/RotZ       = 0 deg
b:Ge/subComponent2/IsParallel = "true"

s:Ge/subComponent3/Type       = "TsBox"
s:Ge/subComponent3/Parent     = "VrtParallelWorld"
d:Ge/subComponent3/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent3/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent3/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent3/TransX     = 0 cm
d:Ge/subComponent3/TransY     = 0 cm
d:Ge/subComponent3/TransZTmp  = Ge/subComponent2/TransZ + Ge/subComponent2/HLZ cm
d:Ge/subComponent3/TransZ     = Ge/subComponent3/TransZTmp + Ge/subComponent3/HLZ cm
d:Ge/subComponent3/RotX       = 0 deg
d:Ge/subComponent3/RotY       = 0 deg
d:Ge/subComponent3/RotZ       = 0 deg
b:Ge/subComponent3/IsParallel = "true"

s:Ge/subComponent4/Type       = "TsBox"
s:Ge/subComponent4/Parent     = "VrtParallelWorld"
d:Ge/subComponent4/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent4/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent4/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent4/TransX     = 0 cm
d:Ge/subComponent4/TransY     = 0 cm
d:Ge/subComponent4/TransZTmp  = Ge/subComponent3/TransZ + Ge/subComponent3/HLZ cm
d:Ge/subComponent4/TransZ     = Ge/subComponent4/TransZTmp + Ge/subComponent4/HLZ cm
d:Ge/subComponent4/RotX       = 0 deg
d:Ge/subComponent4/RotY       = 0 deg
d:Ge/subComponent4/RotZ       = 0 deg
b:Ge/subComponent4/IsParallel = "true"

s:Ge/subComponent5/Type       = "TsBox"
s:Ge/subComponent5/Parent     = "VrtParallelWorld"
d:Ge/subComponent5/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent5/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent5/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent5/TransX     = 0 cm
d:Ge/subComponent5/TransY     = 0 cm
d:Ge/subComponent5/TransZTmp  = Ge/subComponent4/TransZ + Ge/subComponent4/HLZ cm
d:Ge/subComponent5/TransZ     = Ge/subComponent5/TransZTmp + Ge/subComponent5/HLZ cm
d:Ge/subComponent5/RotX       = 0 deg
d:Ge/subComponent5/RotY       = 0 deg
d:Ge/subComponent5/RotZ       = 0 deg
b:Ge/subComponent5/IsParallel = "true"

s:Ge/subComponent6/Type       = "TsBox"
s:Ge/subComponent6/Parent     = "VrtParallelWorld"
d:Ge/subComponent6/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent6/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent6/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent6/TransX     = 0 cm
d:Ge/subComponent6/TransY     = 0 cm
d:Ge/subComponent6/TransZTmp  = Ge/subComponent5/TransZ + Ge/subComponent5/HLZ cm
d:Ge/subComponent6/TransZ     = Ge/subComponent6/TransZTmp + Ge/subComponent6/HLZ cm
d:Ge/subComponent6/RotX       = 0 deg
d:Ge/subComponent6/RotY       = 0 deg
d:Ge/subComponent6/RotZ       = 0 deg
b:Ge/subComponent6/IsParallel = "true"

s:Ge/subComponent7/Type       = "TsBox"
s:Ge/subComponent7/Parent     = "VrtParallelWorld"
d:Ge/subComponent7/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent7/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent7/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent7/TransX     = 0 cm
d:Ge/subComponent7/TransY     = 0 cm
d:Ge/subComponent7/TransZTmp  = Ge/subComponent6/TransZ + Ge/subComponent6/HLZ cm
d:Ge/subComponent7/TransZ     = Ge/subComponent7/TransZTmp + Ge/subComponent7/HLZ cm
d:Ge/subComponent7/RotX       = 0 deg
d:Ge/subComponent7/RotY       = 0 deg
d:Ge/subComponent7/RotZ       = 0 deg
b:Ge/subComponent7/IsParallel = "true"

s:Ge/subComponent8/Type       = "TsBox"
s:Ge/subComponent8/Parent     = "VrtParallelWorld"
d:Ge/subComponent8/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent8/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent8/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent8/TransX     = 0 cm
d:Ge/subComponent8/TransY     = 0 cm
d:Ge/subComponent8/TransZTmp  = Ge/subComponent7/TransZ + Ge/subComponent7/HLZ cm
d:Ge/subComponent8/TransZ     = Ge/subComponent8/TransZTmp + Ge/subComponent8/HLZ cm
d:Ge/subComponent8/RotX       = 0 deg
d:Ge/subComponent8/RotY       = 0 deg
d:Ge/subComponent8/RotZ       = 0 deg
b:Ge/subComponent8/IsParallel = "true"

s:Ge/subComponent9/Type       = "TsBox"
s:Ge/subComponent9/Parent     = "VrtParallelWorld"
d:Ge/subComponent9/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent9/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent9/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent9/TransX     = 0 cm
d:Ge/subComponent9/TransY     = 0 cm
d:Ge/subComponent9/TransZTmp  = Ge/subComponent8/TransZ + Ge/subComponent8/HLZ cm
d:Ge/subComponent9/TransZ     = Ge/subComponent9/TransZTmp + Ge/subComponent9/HLZ cm
d:Ge/subComponent9/RotX       = 0 deg
d:Ge/subComponent9/RotY       = 0 deg
d:Ge/subComponent9/RotZ       = 0 deg
b:Ge/subComponent9/IsParallel = "true"

s:Ge/subComponent10/Type       = "TsBox"
s:Ge/subComponent10/Parent     = "VrtParallelWorld"
d:Ge/subComponent10/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent10/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent10/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent10/TransX     = 0 cm
d:Ge/subComponent10/TransY     = 0 cm
d:Ge/subComponent10/TransZTmp  = Ge/subComponent9/TransZ + Ge/subComponent9/HLZ cm
d:Ge/subComponent10/TransZ     = Ge/subComponent10/TransZTmp + Ge/subComponent10/HLZ cm
d:Ge/subComponent10/RotX       = 0 deg
d:Ge/subComponent10/RotY       = 0 deg
d:Ge/subComponent10/RotZ       = 0 deg
b:Ge/subComponent10/IsParallel = "true"

s:Ge/subComponent11/Type       = "TsBox"
s:Ge/subComponent11/Parent     = "VrtParallelWorld"
d:Ge/subComponent11/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent11/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent11/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent11/TransX     = 0 cm
d:Ge/subComponent11/TransY     = 0 cm
d:Ge/subComponent11/TransZTmp  = Ge/subComponent10/TransZ + Ge/subComponent10/HLZ cm
d:Ge/subComponent11/TransZ     = Ge/subComponent11/TransZTmp + Ge/subComponent11/HLZ cm
d:Ge/subComponent11/RotX       = 0 deg
d:Ge/subComponent11/RotY       = 0 deg
d:Ge/subComponent11/RotZ       = 0 deg
b:Ge/subComponent11/IsParallel = "true"

s:Ge/subComponent12/Type       = "TsBox"
s:Ge/subComponent12/Parent     = "VrtParallelWorld"
d:Ge/subComponent12/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent12/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent12/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent12/TransX     = 0 cm
d:Ge/subComponent12/TransY     = 0 cm
d:Ge/subComponent12/TransZTmp  = Ge/subComponent11/TransZ + Ge/subComponent11/HLZ cm
d:Ge/subComponent12/TransZ     = Ge/subComponent12/TransZTmp + Ge/subComponent12/HLZ cm
d:Ge/subComponent12/RotX       = 0 deg
d:Ge/subComponent12/RotY       = 0 deg
d:Ge/subComponent12/RotZ       = 0 deg
b:Ge/subComponent12/IsParallel = "true"

s:Ge/subComponent13/Type       = "TsBox"
s:Ge/subComponent13/Parent     = "VrtParallelWorld"
d:Ge/subComponent13/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent13/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent13/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent13/TransX     = 0 cm
d:Ge/subComponent13/TransY     = 0 cm
d:Ge/subComponent13/TransZTmp  = Ge/subComponent12/TransZ + Ge/subComponent12/HLZ cm
d:Ge/subComponent13/TransZ     = Ge/subComponent13/TransZTmp + Ge/subComponent13/HLZ cm
d:Ge/subComponent13/RotX       = 0 deg
d:Ge/subComponent13/RotY       = 0 deg
d:Ge/subComponent13/RotZ       = 0 deg
b:Ge/subComponent13/IsParallel = "true"

s:Ge/subComponent14/Type       = "TsBox"
s:Ge/subComponent14/Parent     = "VrtParallelWorld"
d:Ge/subComponent14/HLX        = Ge/VrtParallelWorld/HLX m
d:Ge/subComponent14/HLY        = Ge/VrtParallelWorld/HLY m
d:Ge/subComponent14/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent14/TransX     = 0 cm
d:Ge/subComponent14/TransY     = 0 cm
d:Ge/subComponent14/TransZTmp  = Ge/subComponent13/TransZ + Ge/subComponent13/HLZ cm
d:Ge/subComponent14/TransZ     = Ge/subComponent14/TransZTmp + Ge/subComponent14/HLZ cm
d:Ge/subComponent14/RotX       = 0 deg
d:Ge/subComponent14/RotY       = 0 deg
d:Ge/subComponent14/RotZ       = 0 deg
b:Ge/subComponent14/IsParallel = "true"

#########################
# VRT
#########################
b:Vr/UseVarianceReduction         = "true"
# Importance sampling
b:Vr/ImportanceSampling/Active         = "true"
sv:Vr/ImportanceSampling/ParticleName  = 1 "gamma" 
s:Vr/ImportanceSampling/Component      = "VrtParallelWorld"
sv:Vr/ImportanceSampling/SubComponents = 14
"subComponent1" "subComponent2"
"subComponent3" "subComponent4"
"subComponent5" "subComponent6"
"subComponent7" "subComponent8"
"subComponent9" "subComponent10"
"subComponent11" "subComponent12"
"subComponent13" "subComponent14"

s:Vr/ImportanceSampling/Type = "ImportanceSampling"
uv:Vr/ImportanceSampling/ImportanceValues = 14 2 4 8 16 32 64 128 256 512 1024 2048 2048 2048 2048

# Uniform split in the lead target 
s:Vr/Uniform/Type = "SecondaryBiasing"
sv:Vr/Uniform/forregion/targetregion/processesNamed   = 1 "eBrem"
uv:Vr/Uniform/ForRegion/targetregion/SplitNumber      = 1   100.
dv:Vr/Uniform/ForRegion/targetregion/MaximumEnergies  = 1   6  MeV


#########################
# Beam setting
#########################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-" 
d:So/Example/BeamEnergy               = 6 MeV 
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 1

Ge/BeamPosition/Parent = "group"
d:Ge/BeamPosition/TransZ = -1.0 * Ge/target/HLZ m
d:Ge/BeamPosition/RotX   = 0 deg

i:Ts/ShowHistoryCountAtInterval = 1000

b:Ts/PauseBeforeQuit = "True"
s:Gr/view/Type = "OpenGl"
u:Gr/view/Zoom = 4
sv:Gr/OnlyIncludeParticlesNamed = 1 "e-"

SecondaryBiasing.txt

#
i:Ts/NumberOfThreads = 2

# Secondary biasing occurs in the region
# of this component
s:Ge/target/Parent   = "World"
s:Ge/target/Material = "Lead"
s:Ge/target/Type     = "TsBox"
d:Ge/target/HLX      = 1.5 cm
d:Ge/target/HLY      = 1.5 cm
d:Ge/target/HLZ      = 0.5 cm
s:Ge/target/Color    = "yellow"
# Set the region
s:Ge/target/AssignToRegionNaMed = "targetregion"

# Component for scoring
s:Ge/scorer/Parent   = "World"
s:Ge/scorer/Material = "G4_WATER"
s:Ge/scorer/Type     = "TsCylinder"
d:Ge/scorer/RMax     = 5 cm
d:Ge/scorer/HL       = 0.05 mm
d:Ge/scorer/SPhi     = 0 deg
d:Ge/scorer/DPhi     = 360 deg
d:Ge/scorer/TransZ   = 1 m + Ge/scorer/HL
s:Ge/scorer/Color    = "yellow"
i:Ge/scorer/RBins    = 20
i:Ge/scorer/PhiBins  = 1
i:Ge/scorer/ZBins    = 1

s:Sc/scorer/Quantity   = "EnergyFluence"
s:Sc/scorer/Component  = "scorer"
s:Sc/scorer/OutputFile = "secondaryBiasing"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"

# VISUALIZATION
s:Gr/view/Type        = "OpenGl"
i:Gr/view/WindowSizeX = 600
i:Gr/view/WindowSizeY = 600
d:Gr/view/Phi         = 0 deg
d:Gr/view/Theta       = 270 deg
u:Gr/view/Zoom        = 5

b:Ts/PauseBeforeQuit = "True"

# SOURCE
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "e-"
d:So/Example/BeamEnergy               = 6 MeV
u:So/Example/BeamEnergySpread         = 0.1
s:So/Example/BeamPositionDistribution = "None"
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad

Ge/BeamPosition/Parent = "World"
Ge/BeamPosition/TransX = 0.0 cm
Ge/BeamPosition/TransZ = -1.0 * Ge/target/HLZ cm
Ge/BeamPosition/TransY = 0.0 mm
Ge/BeamPosition/RotX   = 0 deg

# GEOMETRY
d:Ge/World/HLX      = 16.1 cm
d:Ge/World/HLY      = 16.1 cm
d:Ge/World/HLZ      = 1.5 m
s:Ge/World/Material = "Air"

sv:Ph/Default/Modules = 1 "g4em-standard_opt3"

i:So/Example/NumberOfHistoriesInRun = 1000
i:Ts/ShowHistoryCountAtInterval = 100
b:Ts/ShowCPUTime = "True"

#Secondary biasing
b:Vr/UseVarianceReduction = "True"
b:Vr/BremsstrahlungSplit/Active = "True"
s:Vr/BremsstrahlungSplit/Type   = "secondarybiasing"
# The secondary particles produced in this process will
# be split  100 times if their energies are below of 6 MeV
sv:Vr/ParTicleSplit1/forregion/targetregion/processesNamed   = 1 "eBrem"
uv:Vr/BremsstrahlungSplit/ForRegion/targetregion/SplitNumber      = 1   100.
dv:Vr/BremsstrahlungSplit/ForRegion/targetregion/MaximumEnergies  = 1   6  MeV

WeightWindow.txt

########################
# Simple shielding example
########################
d:Ge/World/HLX = 2 m
d:Ge/World/HLY = 2 m
d:Ge/World/HLZ = 2.1 m

s:Ge/wall/Type     = "TsBox"
s:Ge/wall/Parent   = "World"
s:Ge/wall/Material = "G4_CONCRETE"
d:Ge/wall/HLX      =  1 m
d:Ge/wall/HLY      =  1 m
d:Ge/wall/HLZ      =  1 m
d:Ge/wall/TransX   =  0 m
d:Ge/wall/TransY   =  0 m
d:Ge/wall/TransZ   =  0 m
d:Ge/wall/RotX     =  0 deg
d:Ge/wall/RotY     =  0 deg
d:Ge/wall/RotZ     =  0 deg
s:Ge/wall/Color    =  "red"
i:Ge/wall/XBins    =  1
i:Ge/wall/YBins    =  1
i:Ge/wall/ZBins    = 10

#########################
# Gemetry for vrt
#########################
d:Ge/subComponent/Thickness     = 20 cm
d:Ge/subComponent/StartPosition = -1.0 * Ge/wall/HLZ cm

s:Ge/VrtParallelWorld/Type       = "TsBox"
s:Ge/VrtParallelWorld/Parent     = "World"
d:Ge/VrtParallelWorld/HLX        = 1.1 m
d:Ge/VrtParallelWorld/HLY        = 1.1 m
d:Ge/VrtParallelWorld/HLZ        = 1.1 m
d:Ge/VrtParallelWorld/TransX     = 0 cm
d:Ge/VrtParallelWorld/TransY     = 0 cm
d:Ge/VrtParallelWorld/TransZ     = 0 cm
d:Ge/VrtParallelWorld/RotX       = 0 deg
d:Ge/VrtParallelWorld/RotY       = 0 deg
d:Ge/VrtParallelWorld/RotZ       = 0 deg
b:Ge/VrtParallelWorld/IsParallel = "true"

s:Ge/subComponent1/Type       = "TsBox"
s:Ge/subComponent1/Parent     = "VrtParallelWorld"
d:Ge/subComponent1/HLX        = Ge/Wall/HLX m
d:Ge/subComponent1/HLY        = Ge/Wall/HLY m
d:Ge/subComponent1/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent1/TransX     = 0 cm
d:Ge/subComponent1/TransY     = 0 cm
d:Ge/subComponent1/TransZ     = Ge/subComponent/StartPosition + Ge/subComponent1/HLZ cm
d:Ge/subComponent1/RotX       = 0 deg
d:Ge/subComponent1/RotY       = 0 deg
d:Ge/subComponent1/RotZ       = 0 deg
b:Ge/subComponent1/IsParallel = "true"

s:Ge/subComponent2/Type       = "TsBox"
s:Ge/subComponent2/Parent     = "VrtParallelWorld"
d:Ge/subComponent2/HLX        = Ge/Wall/HLX m
d:Ge/subComponent2/HLY        = Ge/Wall/HLY m
d:Ge/subComponent2/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent2/TransX     = 0 cm
d:Ge/subComponent2/TransY     = 0 cm
d:Ge/subComponent2/TransZTmp  = Ge/subComponent1/TransZ + Ge/subComponent1/HLZ cm
d:Ge/subComponent2/TransZ     = Ge/subComponent2/TransZTmp + Ge/subComponent2/HLZ cm
d:Ge/subComponent2/RotX       = 0 deg
d:Ge/subComponent2/RotY       = 0 deg
d:Ge/subComponent2/RotZ       = 0 deg
b:Ge/subComponent2/IsParallel = "true"

s:Ge/subComponent3/Type       = "TsBox"
s:Ge/subComponent3/Parent     = "VrtParallelWorld"
d:Ge/subComponent3/HLX        = Ge/Wall/HLX m
d:Ge/subComponent3/HLY        = Ge/Wall/HLY m
d:Ge/subComponent3/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent3/TransX     = 0 cm
d:Ge/subComponent3/TransY     = 0 cm
d:Ge/subComponent3/TransZTmp  = Ge/subComponent2/TransZ + Ge/subComponent2/HLZ cm
d:Ge/subComponent3/TransZ     = Ge/subComponent3/TransZTmp + Ge/subComponent3/HLZ cm
d:Ge/subComponent3/RotX       = 0 deg
d:Ge/subComponent3/RotY       = 0 deg
d:Ge/subComponent3/RotZ       = 0 deg
b:Ge/subComponent3/IsParallel = "true"

s:Ge/subComponent4/Type       = "TsBox"
s:Ge/subComponent4/Parent     = "VrtParallelWorld"
d:Ge/subComponent4/HLX        = Ge/Wall/HLX m
d:Ge/subComponent4/HLY        = Ge/Wall/HLY m
d:Ge/subComponent4/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent4/TransX     = 0 cm
d:Ge/subComponent4/TransY     = 0 cm
d:Ge/subComponent4/TransZTmp  = Ge/subComponent3/TransZ + Ge/subComponent3/HLZ cm
d:Ge/subComponent4/TransZ     = Ge/subComponent4/TransZTmp + Ge/subComponent4/HLZ cm
d:Ge/subComponent4/RotX       = 0 deg
d:Ge/subComponent4/RotY       = 0 deg
d:Ge/subComponent4/RotZ       = 0 deg
b:Ge/subComponent4/IsParallel = "true"

s:Ge/subComponent5/Type       = "TsBox"
s:Ge/subComponent5/Parent     = "VrtParallelWorld"
d:Ge/subComponent5/HLX        = Ge/Wall/HLX m
d:Ge/subComponent5/HLY        = Ge/Wall/HLY m
d:Ge/subComponent5/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent5/TransX     = 0 cm
d:Ge/subComponent5/TransY     = 0 cm
d:Ge/subComponent5/TransZTmp  = Ge/subComponent4/TransZ + Ge/subComponent4/HLZ cm
d:Ge/subComponent5/TransZ     = Ge/subComponent5/TransZTmp + Ge/subComponent5/HLZ cm
d:Ge/subComponent5/RotX       = 0 deg
d:Ge/subComponent5/RotY       = 0 deg
d:Ge/subComponent5/RotZ       = 0 deg
b:Ge/subComponent5/IsParallel = "true"

s:Ge/subComponent6/Type       = "TsBox"
s:Ge/subComponent6/Parent     = "VrtParallelWorld"
d:Ge/subComponent6/HLX        = Ge/Wall/HLX m
d:Ge/subComponent6/HLY        = Ge/Wall/HLY m
d:Ge/subComponent6/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent6/TransX     = 0 cm
d:Ge/subComponent6/TransY     = 0 cm
d:Ge/subComponent6/TransZTmp  = Ge/subComponent5/TransZ + Ge/subComponent5/HLZ cm
d:Ge/subComponent6/TransZ     = Ge/subComponent6/TransZTmp + Ge/subComponent6/HLZ cm
d:Ge/subComponent6/RotX       = 0 deg
d:Ge/subComponent6/RotY       = 0 deg
d:Ge/subComponent6/RotZ       = 0 deg
b:Ge/subComponent6/IsParallel = "true"

s:Ge/subComponent7/Type       = "TsBox"
s:Ge/subComponent7/Parent     = "VrtParallelWorld"
d:Ge/subComponent7/HLX        = Ge/Wall/HLX m
d:Ge/subComponent7/HLY        = Ge/Wall/HLY m
d:Ge/subComponent7/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent7/TransX     = 0 cm
d:Ge/subComponent7/TransY     = 0 cm
d:Ge/subComponent7/TransZTmp  = Ge/subComponent6/TransZ + Ge/subComponent6/HLZ cm
d:Ge/subComponent7/TransZ     = Ge/subComponent7/TransZTmp + Ge/subComponent7/HLZ cm
d:Ge/subComponent7/RotX       = 0 deg
d:Ge/subComponent7/RotY       = 0 deg
d:Ge/subComponent7/RotZ       = 0 deg
b:Ge/subComponent7/IsParallel = "true"

s:Ge/subComponent8/Type       = "TsBox"
s:Ge/subComponent8/Parent     = "VrtParallelWorld"
d:Ge/subComponent8/HLX        = Ge/Wall/HLX m
d:Ge/subComponent8/HLY        = Ge/Wall/HLY m
d:Ge/subComponent8/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent8/TransX     = 0 cm
d:Ge/subComponent8/TransY     = 0 cm
d:Ge/subComponent8/TransZTmp  = Ge/subComponent7/TransZ + Ge/subComponent7/HLZ cm
d:Ge/subComponent8/TransZ     = Ge/subComponent8/TransZTmp + Ge/subComponent8/HLZ cm
d:Ge/subComponent8/RotX       = 0 deg
d:Ge/subComponent8/RotY       = 0 deg
d:Ge/subComponent8/RotZ       = 0 deg
b:Ge/subComponent8/IsParallel = "true"

s:Ge/subComponent9/Type       = "TsBox"
s:Ge/subComponent9/Parent     = "VrtParallelWorld"
d:Ge/subComponent9/HLX        = Ge/Wall/HLX m
d:Ge/subComponent9/HLY        = Ge/Wall/HLY m
d:Ge/subComponent9/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent9/TransX     = 0 cm
d:Ge/subComponent9/TransY     = 0 cm
d:Ge/subComponent9/TransZTmp  = Ge/subComponent8/TransZ + Ge/subComponent8/HLZ cm
d:Ge/subComponent9/TransZ     = Ge/subComponent9/TransZTmp + Ge/subComponent9/HLZ cm
d:Ge/subComponent9/RotX       = 0 deg
d:Ge/subComponent9/RotY       = 0 deg
d:Ge/subComponent9/RotZ       = 0 deg
b:Ge/subComponent9/IsParallel = "true"

s:Ge/subComponent10/Type       = "TsBox"
s:Ge/subComponent10/Parent     = "VrtParallelWorld"
d:Ge/subComponent10/HLX        = Ge/Wall/HLX m
d:Ge/subComponent10/HLY        = Ge/Wall/HLY m
d:Ge/subComponent10/HLZ        = 0.5 * Ge/subComponent/Thickness cm
d:Ge/subComponent10/TransX     = 0 cm
d:Ge/subComponent10/TransY     = 0 cm
d:Ge/subComponent10/TransZTmp  = Ge/subComponent9/TransZ + Ge/subComponent9/HLZ cm
d:Ge/subComponent10/TransZ     = Ge/subComponent10/TransZTmp + Ge/subComponent10/HLZ cm
d:Ge/subComponent10/RotX       = 0 deg
d:Ge/subComponent10/RotY       = 0 deg
d:Ge/subComponent10/RotZ       = 0 deg
b:Ge/subComponent10/IsParallel = "true"

#########################
# VRT
#########################
b:Vr/UseVarianceReduction         = "true"
b:Vr/ParticleSplit/Active         = "true"
sv:Vr/ParticleSplit/ParticleName  = 1 "neutron"
s:Vr/ParticleSplit/Component      = "VrtParallelWorld"
sv:Vr/ParticleSplit/SubComponents = 10
"subComponent1" "subComponent2"
"subComponent3" "subComponent4"
"subComponent5" "subComponent6"
"subComponent7" "subComponent8"
"subComponent9" "subComponent10"
s:Vr/ParticleSplit/Type = "WeightWindow"
uv:Vr/ParticleSplit/WeightMap = 10 1.0 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125 0.00390625 0.001953125
dv:Vr/ParticleSplit/EnergyMap = 10 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 GeV
u:Vr/ParticleSplit/UpperLimitFactor    = 1
u:Vr/ParticleSplit/SurvivalFactor      = 1
i:Vr/ParticleSplit/MaximumSplitNumber  = 100
s:Vr/ParticleSplit/PlaceOfAction       = "OnBoundary"

#########################
# Scorer
#########################
s:Sc/scorer/Quantity                  = "DoseToMedium"
s:Sc/scorer/Component                 = "Wall"
s:Sc/scorer/OutputFile                = "WeightWindow"
s:Sc/scorer/IfOutputFileAlreadyExists = "Overwrite"
sv:Sc/scorer/Report                   = 3 "Sum" "Mean" "Variance"

#########################
# Beam setting
#########################
s:So/Example/Type                     = "Beam"
s:So/Example/Component                = "BeamPosition"
s:So/Example/BeamParticle             = "neutron"
d:So/Example/BeamEnergy               = 10 MeV
u:So/Example/BeamEnergySpread         = 0.757504
s:So/Example/BeamPositionDistribution = "Gaussian"
s:So/Example/BeamPositionCutoffShape  = "Ellipse"
d:So/Example/BeamPositionCutoffX      = 10. cm
d:So/Example/BeamPositionCutoffY      = 10. cm
d:So/Example/BeamPositionSpreadX      = 0.65 cm
d:So/Example/BeamPositionSpreadY      = 0.65 cm
s:So/Example/BeamAngularDistribution  = "Gaussian"
d:So/Example/BeamAngularCutoffX       = 90. deg
d:So/Example/BeamAngularCutoffY       = 90. deg
d:So/Example/BeamAngularSpreadX       = 0.0032 rad
d:So/Example/BeamAngularSpreadY       = 0.0032 rad
i:So/Example/NumberOfHistoriesInRun   = 10

d:Ge/BeamPosition/TransZ = -1.0 * Ge/World/HLZ m
d:Ge/BeamPosition/RotX   = 0 deg
i:Ts/ShowHistoryCountAtInterval = 1

b:Ts/PauseBeforeQuit  = "True"
s:Gr/view/Type        = "OpenGl"
b:Gr/view/IncludeAxes = "True"

Introduction to Extensions

While most TOPAS users will find that they can implement everything they want from parameter files, those who require additional functionality are free to write their own C++ code to extend TOPAS. Your code can take advantage of the full syntax richness of C++. You may use almost any Geant4 class in your work.

These new classes can be:

  • Geometry Components
  • Scorers
  • Outcome Models
  • Filters
  • Physics Lists and Physics Modules
  • Particle Sources
  • Magnetic Field Descriptions
  • ElectroMagnetic Field Descriptions
  • Imaging To Material Converters

And you can also provide classes that will be called to do whatever you want at:

  • Start or End of Session
  • Start or End of Run
  • Start or End of History

As the first line of each of your classes, you will provide very specific comment lines that tells us how to weave your class into the rest of TOPAS. For example, to define your own Geometry Component, your class will start with something like:

// Component for MyComponent1

This tells TOPAS that your class defines a Geometry Component, and that this component should be used if a parameter file has the matching component type:

s:Ge/something/Type = "MyComponent1"

C++ does not require that a give file, such as MyComponent1.cc, contain a class of the same name. However the Topas make system DOES require that this file name and class name match. So, for example, a file named MyComponent1.cc and is corresponding MyComponent1.hh must contain a class named MyComponent1.

You can find a set of example extensions on the topasmc.org code repository page. You can see there what the special comment string is for each type of class (Geometry Component, Scorer, Filter, etc.).

To build your new TOPAS executable that incorporates all of your extensions, you run CMake with an argument that tells it the location of your extensions. Your extensions then coexist with the rest of the TOPAS code.

You can even have subdirectories within your extensions directory, so that you might for example have different subdirectories with extensions from different collaborators:

extensions/my_extensions_from_university_a
extensions/my_estensions_from_company_b
extensions/some_other_extensions

Our CMake script will recursively search your extensions directory to take all of your extensions.

Details are in the README in TOPAS.

Even when you have to write your own C++ code, TOPAS work is still easier than plain Geant4. You write your extensions as concrete implementations of TOPAS base classes which provide a wealth of helper functions to simplify your work. You may use the TOPAS parameter system to provide parameters to your classes, and those parameters can vary in time, like any other TOPAS parameters. All user extensions have a pointer to the parameter manager in their constructor. Thus, to access TOPAS parameters, call one of the following methods: fPm->someMethod

In all of the following forms, the parameterName argument can be either a G4String or a char*.

// See if parameter exists
G4bool ParameterExists(parameterName);
// Get number of values in a vector parameter
G4int GetVectorLength(parameterName);
// Get dimensioned double value of parameter in Geant4's internal units
G4double GetDoubleParameter(parameterName, const char* unitCategory);
// Get double value of a unitless parameter
G4double GetUnitlessParameter(parameterName);
// Get integer value of parameter
G4int GetIntegerParameter(parameterName);
// Get Boolean value of parameter
G4bool GetBooleanParameter(parameterName);
// Get string value of parameter (whether it is actually a string parameter of not)
G4String GetStringParameter(parameterName);
// Get vector of dimensioned double values of parameter in Geant4's internal units
G4double* GetDoubleVector(parameterName, const char* unitCategory);
// Get vector of double values of a unitless parameter
G4double* GetUnitlessVector(parameterName);
// Get vector of integer values of parameter
G4int* GetIntegerVector(parameterName);
// Get vector of Boolean values of parameter
G4bool* GetBooleanVector(parameterName);
// Get vector of string values of parameter
G4String* GetStringVector(parameterName);
// Get TwoVector of double values of parameter in Geant4's internal units
G4TwoVector GetTwoVectorParameter(parameterName, const char* unitCategory);
// Get ThreeVector of double values of parameter in Geant4's internal units
G4ThreeVector GetThreeVectorParameter(parameterName, const char* unitCategory);

Stubs of extension classes are included in the topas/extensions directory in your TOPAS release. A set of additional example components, scorers and filters are distributed as a zip file on the TOPAS web site (see the file called extension_examples…). To create your own extension, start with the example that is the closest to what you want, then change the file name (and the class name throughout the file), then adjust the code as you wish.

We believe this extensions mechanism should allow you to do almost anything you like from within TOPAS. If you find any significant limitations, please reach out to us. We want to enable your unique research.

Extra Classes

First line of the cc file must be of the form:

// Extra Class for use by TsMyBeginHistory

Any of your extension classes are welcome to themselves instantiate other classes. You just need to advise us to link in these classes by providing the above special line.

Changeable Parameters

In general, parameters cannot change once the TOPAS session has begun. Changes due to Time Features are fine (since the time feature’s behavior itself is well defined), but any other change violates basic principles of repeatability.

C++ code that changes a parameter during the session, aside from time features, is allowed only for a special case in which a specialized geometry component needs to set a parameter value on the fly. An example is when TsCompensator reads in the compensator definition from a special file format. The resulting compensator thickness updates a parameter that affects positioning of other components.

Such a special case is allowed if the relevant parameter is defined from the start to be “Changeable”. This is done by adding a c at the end of the parameter type, for example:

dc:Ge/Compensator/TransZ = 2. cm # the initial dc indicates that this is a double that is changeable

For vector parameters, the c still comes just before the colon, for example:

svc:...

In a complex parameter file chain, if any level of the chain redefines this as just a d rather than a dc, other parameter files will see this as a non-changeable parameter. Thus one parameter file may lock out others from making such changes.

TOPAS makes note of which parts of the system uses this changeable parameter (either directly or through a chain of parameters depending on other parameters) and takes care to explicitly update those parts of the system if this parameter ever changes.

Of course any parameter value can override the same parameter’s value from a parent parameter file. This override at initial parameter read-in time is not what we mean by changeable. By Changeable we mean a value that changes during the TOPAS session.

The c syntax is not required when you are simply setting a parameter’s value to a time feature. We allow:

d:Ge/Propeller/RotZ = Tf/PropellerRot/Value

It is true that this Tf/PropellerRot/Value is changeable, but that is handled internally by TOPAS.

Transient Parameters

When a parameter is changed during the session, either because it is a time feature value, or because some piece of C++ code changes the parameter, TOPAS does not actually overwrite the original parameter in memory, but instead adds it to a “Transient Parameter List”. The Transient Parameter list always takes precedence over any other parameters file.

Transient parameters may be the first occurrence of a given parameter, as for the materials for a patient that are only instantiated as the patient is read in from DICOM, or transient parameters may override previously-defined parameters.

Custom Geometry Components

First line of the cc file must be of the form:

// Component for MyComponent1

TOPAS geometry components are like small pieces of what Geant4 users call their “detector construction” class. The Geometry sections of the Geant4 Application Developers Guide provide details on the full geometrical functionality of Geant4. In this section, we explain some details about how to write TOPAS components, but we assume that you are already comfortable with basic concepts of C++ and Geant4 geometry. The notes below are intended to discuss only those parts which may not be obvious.

Your geometry component class will be a concrete implementation of the base class: TsVGeometryComponent.

You can get any parameter name of the current component by using the GetFullParmName method. For example, if your parameter file specifies:

d:Ge/MyComponent/Blatz = 42. mm

GetFullParmName("Blatz") will return Ge/MyComponent/Blatz. You can then feed this resulting string into the parameter access methods such as:

G4Double blatzLength = fPm->GetDoubleParameter(GetFullParmName("Blatz"), "length");

Your component may contain any of the following methods. Careful attention to what goes where will insure that your classes are robust under 4D and the base classes will do much of the work for you.

Constructor: Must exist and may be empty. This method will only be called at the very beginning of the simulation. It will not be called after changes in 4D. Only put things here if you are absolutely certain you will not need to recompute them during the simulation.

Destructor: Must exist and may be empty. Destroy any special objects you created with “new” statements. You may not destroy solids, logical volumes or physical volumes. These destructions are handled for you by the base class.

You do not need to do anything to handle the basic parameters, Parent, TransX, TransY, TransZ, RotX, RotY, RotZ, Material and Color. These are handled for you by the base class, including 4D capabilities.

If there are any other parameters that you may want to vary in 4D, provide a method UpdateForSpecificParameterChange(G4String parameter).

  • If the parameter name is one that you want to handle, do so. Be sure to use GetFullParmNameLower rather than GetFullParmName in your check.
  • If your handing of this parameter moves a volume relative to its mother volume, advise Geant4’s smart voxel system that it needs to re-optimize the mother volume by calling AddToReoptimizeList. The argument should be the mother’s logical volume.
  • If the parameter name is not one that you want to handle, pass it on to the base class handler, TsVGeometryComponent::UpdateForSpecificParameterChange. This is essential to enable basic 4D behaviors such as overall component motion.

TsMultiLeafCollimator.cc is a good example of this kind of behavior. It allows leaf position to change over time.

For the rest of your work, provide a method Construct.

The first line of Construct MUST be:

BeginConstruction();

The rest of Construct is whatever you want to do to create Geant4 Solids, Logical Volumes and Physical Volumes. But you must follow some rules to insure that TOPAS will be able to properly manage your volumes in 4D.

  • You create Geant4 Solids just as you would in any Geant4 geometry.
  • You DO NOT create Geant4 Logical Volumes or Physical Volumes directly, but instead use helper methods from the base class. This allows TOPAS to manage your solids and volumes efficiently, even if they are moving.

To create the overall logical volume for your component, use:

fEnvelopeLog = CreateLogicalVolume(G4VSolid* solid);

The logical volume will automatically get the material and visualization properties specified in your parameter file for this component, such as Ge/MyComponent/Material and Ge/MyComponent/Color. Be sure that the value on the left side of the above is exactly “fEnvelopeLog”. This insures that TOPAS knows the overall logical volume’s name and is essential for TOPAS to support your component in 4D.

If a component is made up of more than one volume, these additional volumes are called “SubComponents.” A component may have more zero, one or more SubComponents. An example of SubComponents is the Blades in a Propeller, such as:

s:Ge/Propeller/Type = "TsPropeller"
...
i:Ge/Propeller/NbOfBlades = Ge/PropellerConstant/NbBlades
s:Ge/Propeller/Blade/Material = "World"
s:Ge/Propeller/Blade/Color = "skyblue"

In all of the following forms, the subComponentName argument can be either a G4String or a char*.

To create a logical volume for a subcomponent, use:

G4LogicalVolume* CreateLogicalVolume(subComponentName, G4VSolid* solid);

TOPAS will look for material and visualization parameters such as:

Ge/ComponentName/SubComponentName/Material = ...

To hard-code the material, rather than having it come from this parameter, use:

G4LogicalVolume* CreateLogicalVolume( subComponentName, G4String& materialName, G4VSolid* solid);

This is particularly useful in cases where you want the material to be the same as the component’s mother, that is, the material surrounding your component. We do this, for example, when we want to make a void in a collimator. To get that mother volume’s material name, use:

G4String envelopeMaterialName = fParentComponent->GetResolvedMaterialName();

The base class will take care of automatically setting your component’s visualization attributes based on the component’s parameters. But you can set different attributes for subComponents with code such as:

G4VisAttributes* yokeColor = new G4VisAttributes(G4Colour(0.2, 1.0, 0.2)); // Sets RGB color
RegisterVisAtt(yokeColor); // Necessary so that TOPAS can delete the attribute if the component is rebuild during 4D behavior
yokeLogicalVolumePointer->SetVisAttributes(yokeColor);

To create the overall physical volume for your component, use:

fEnvelopePhys = CreatePhysicalVolume(fEnvelopeLog);

Be sure that the value on the left side of the above is exactly fEnvelopePhys. This insures that TOPAS knows the overall physical volume’s name and is essential for TOPAS to support your component in 4D.

Additional forms of CreatePhysicalVolume allow you to place subcomponents within your component.

To place a subcomponent in the center of your logical volume lVol:

G4VPhysicalVolume* CreatePhysicalVolume(subComponentName, G4LogicalVolume* lVol, G4VPhysicalVolume* parent);

To place a subcomponent into your logical volume lVol, with an offset or rotation:

G4VPhysicalVolume* CreatePhysicalVolume(subComponentName, G4LogicalVolume* lVol, G4RotationMatrix* rot, G4ThreeVector* trans, G4VPhysicalVolume* parent);

To place multiple copies of the same subcomponent name into your logical volume, call:

G4VPhysicalVolume* CreatePhysicalVolume(subComponentName, G4int copy, G4bool reuseLogical, G4LogicalVolume* lVol, G4RotationMatrix* rot, G4ThreeVector* trans, G4VPhysicalVolume* parent);
  • copy should be a unique integer to differentiate the different copies of your subcomponent. This copy number is useful in some of the visualization commands when you want to control just one copy or another.
  • Set reuseLogical true if you are using the same logical volume in all of these placements. This is efficient if all of the copies of the subcomponent are identical except for their placement.
  • Set reuseLogical false if you are using different logical volumes in each of these placements. This allows you to make each copy of the subcomponent different (different material, different shape, different size, etc.).

To place multiple copies of the same subcomponent using a Geant4 parameterization (creating Geant4 parameterized volumes), call:

G4VPhysicalVolume* CreatePhysicalVolume(const char* subComponentName, G4LogicalVolume* lVol, G4VPhysicalVolume* parent, const EAxis pAxis, const G4int nReplicas, G4VPVParameterisation* pParam);

To place multiple copies of the same subcomponent using a Geant4 replica volume, call:

G4VPhysicalVolume* CreatePhysicalVolume(const char* subComponentName, G4LogicalVolume* lVol, G4VPhysicalVolume* parent, const EAxis pAxis, const G4int nReplicas, G4double width);

The last line of Construct MUST be:

return fEnvelopePhys;

Some helper functions you may want to use from the TsParameterManager:

G4VisAttributes* GetColor(G4String name);
G4VisAttributes* GetColor(const char* name);
G4VisAttributes* GetInvisible();

Some helper functions you may want to use from the TsVGeometryComponent:

SetTooComplexForOGLS()

Call this to tell Graphics that this component has become too complex to efficiently render in OpenGL’s Stored Mode. It will instead be rendered in OpenGL’s Immediate Mode (can be less quick to update, but uses less memory)

GetMaterial

By default, the logical volumes you create will get their material from the material parameter you specified for this component. But you can use GetMaterial to obtain any other named material.

Custom Particle Sources

First line of the cc file must be of the form:

// Particle Source for MyParticleSource1
or
// Particle Generator for MyParticleGenerator1

Your particle source defines the initial particles that are then transported by the simulation. Because Geant4’s multi-threaded capability keeps part of this functionality in the master thread and other parts in the worker threads, you actually create two separate classes to create a particle source.

For the part of the source that controls overall behavior (usually just setting the number of histories, but optionally also things like reading in some kind of phase space file), you write a class derived from TsSource. TOPAS instantiates this in the Geant4 Master thread. If you really just need this class to set the number of histories, you may just use our existing TsSource (that is, you don’t have to write your own class at all for this part).

For the part of the source that generates the individual events (setting the primary particle positions and momenta), you write a class derived from TsVGenerator. TOPAS instantiates this in the Geant4 worker thread.

In both cases, parameter lookups should be done in ResolveParameters. Call ResolveParameters directly from your constructor, and then you can also rely on TOPAS to re-call this method any time one of this particle source’s parameters is changed.

TOPAS will call your GeneratePrimaries method once per history. You should always start this method with this test:

if (CurrentSourceHasGeneratedEnough()) return;

This allows your source to properly coexist with other sources that may have other numbers of histories.

The body of your GeneratePrimaries method should create and fill some number of TsPrimaryParticles (a single history may contain zero, one or more primary particles).

The TsPrimaryParticle structure is defined in the header file TsVParticleSource.hh. For each TsPrimaryParticle that you define, call GenerateOnePrimary.

Once you have finished creating all of the TsPrimaryParticles for this history, call AddPrimariesToEvent.

Custom Physics Lists and Physics Modules

First line of the cc file must be of the form:

// Physics List for MyPhysicsList1
or
// Physics Module for MyPhysicsModule1

You can supply your own physics list or physics module. Note however that this option is not recommended unless you have significant Geant4 expertise. Even most long-time Geant4 users get into difficultly writing their own physics lists and physics modules. Wherever possible, you should try to use one of the Reference physics list or the Modular physics list with pre-written Geant4 physics modules.

The example physics list and physics module provided in topas/extensions/MyPhysicsList1 and MyPhysicsModule include pointers to the TOPAS parameter manager as their arguments. This is not required, but allows you to use TOPAS parameters to adjust options within your list or modules.

Custom Scorers

First line of the cc file must be of the form:

// Scorer for MyScorer1

Your custom scorer can either accumulate binned data (like our built-in dose scorer), or n-tuple data (like our built-in phase space scorer).

  • For binned scorers, your scorer should inherit from TsVBinnedScorer.
  • For n-tuple scorers, your scorer should inherit from TsVNtupleScorer.

At a minimum, your scorer should provide a constructor, a destructor and a ProcessHits method. The base class will take care of all the details of filtering, accumulating and outputting results.

For binned scorers, your scorer’s constructor must contain a call to:

SetUnits

For n-tuple scorers, your scorer’s constructor defines each column and its data type by calls to:

RegisterColumnD
RegisterColumnF
RegisterColumnI
RegisterColumnI8
RegisterColumnB
RegisterColumnS

RegisterColumnD and RegisterColumnF also take a unit string.

If your scorer is a Surface Scorer, the constructor must also contain the line:

SetSurfaceScorer();

Otherwise, your scorer is assumed to be a Volume Scorer.

The scorer’s ProcessHits method must be written carefully to avoid slowing down the simulation since this method is called for every hit in the scoring component. Slow operations such as string comparisons should be avoided here. Try to write your code so that you perform these sorts of slow operations only during construction, save values and pointers in class variables and then use these pre-calculated values in the ProcessHits method. Once you have your value computed:

  • For binned scorers, accumulate data by calling AccumulateHit
  • For n-tuple scorers, accumulate data by calling fNtuple->Fill

If you want to take more complete control of the scoring process, you can provide optional methods:

// called after the last hit of a given track
void UserHookForEndOfTrack()
// called after the last hit of all tracks resulting from a given particle incident on the scoring component
void UserHookForEndOfIncidentParticle()
// called at the end of the event
void UserHookForEndOfEvent()
// called at the end of the run
void UserHookForEndOfRun()

Between the ProcessHits method and these other four methods, you have complete control over how you will accumulate and handle your scored values. Accumulate values in your own data structures that you provide in your scorer’s header file or in other classes that your scorer calls. Manipulate and output these values as you wish. It is all up to you. You can still choose to fill the fEvtMap just like a regular scorer, in which case TOPAS will accumulate and output those values, or you can fill nothing into that fEvtMap, in which case TOPAS will not take any further action for this scorer.

Some helper functions you may want to use from the TsParameterManager:

// Activates creation of the TsTrackInformation object
SetNeedsTrackingAction
// Activates creation of the extra part of the TsTrackInformation object that contains information on what volumes were traversed
SetNeedsSteppingAction

Some helper functions you may want to use from the TsVScorer:

// Get pointer to a material
GetMaterial
// Tell whether a given material is used in the geometry
UsedMaterial
// Get the voxel index from hits in divided or parameterized components
GetIndex
// Get the current TOPAS time (for the time of flight, use fTimeOfFlight)
GetTime
GetRunID
GetEventID
GetRandomNumberStatusForThisEvent
// Disable the automatic creation and filling of output, leaving this work entirely to your scorer
SuppressStandardOutputHandling

For divided components, the combined index one finds in scorers is formed from three bin indices (x,y,z or r, phi, z or r, phi, theta for TsBox, TsCylinder and TsSphere respectively). A helper function is now provided to return the individual bin indices given the combined index:

GetBin(index, iBin) // where iBin is 0, 1 or 2

A scorer can itself instantiate additional scorers. We refer to these as “SubScorers”. The main scorer can then perform calculations using results of one or more subscorers to obtain a final value. A good example of this is in ExtensionExamplesMore/MyScoreProtonLET. At the end of the constructor, it contains the following:

InstantiateSubScorer("ProtonLET_Denominator", outFileName, "Denominator");

And later there is a method that combines the scorer and the subscorer on a bin-by-bin basis to obtain a final quantity per bin:

G4int MyScoreProtonLET::CombineSubScorers()
...
TsVBinnedScorer* denomScorer = dynamic_cast<TsVBinnedScorer*>(GetSubScorer("Denominator"));
    fFirstMomentMap[index] = fFirstMomentMap[index] / denomScorer->fFirstMomentMap[index];

Custom Outcome Models

First line of the cc file must be of the form:

// Outcome Model for MyOutcomeModel1

Your custom outcome model can perform whatever analysis you wish from a TOPAS DVH. The work is all in your Initialize method.

See ExtensionsExamples/MyOutcomeModel1

Custom Filters

First line of the cc file must be of the form:

// Filter for OnlyIncludeParticlesOfTwiceAtomicNumber,OnlyIncludeParticlesNotOfTwiceAtomicNumber

Note that a single filter can be used for more than one filter condition, hence comma separated list.

Filters must be written carefully to avoid slowing down the simulation. The filter’s Accept method is called for every hit in the scoring component. Slow operations such as string comparisons should be avoided during this method. Try to write your code so that you perform these sorts of slow operations only during the constructor, ResolveParameters method or CacheGeometryPointers method, save values and pointers in class variables and then use these pre-calculated values in the ProcessHits method.

Parameter lookups should be done in ResolveParameters. Call ResolveParameters directly from your constructor, and then you can also rely on TOPAS to re-call this method any time one of this filter’s parameters is changed.

4D behaviors may require TOPAS to destroy and rebuild components during the simulation. Accordingly, you can not rely on the pointer to a given component remaining the same throughout the simulation. Any lookup of a component pointer should be done in the filter’s CacheGeometryPointers method. TOPAS will re-call this method any time relevant components are rebuilt.

Some helper functions you may want to use from the TsParameterManager:

// Activates creation of the TsTrackInformation object
SetNeedsTrackingAction
// Activates creation of the extra part of the TsTrackInformation object that contains information on what volumes were traversed
SetNeedsSteppingAction

Some helper functions you may want to use from the TsVFilter:

// Get pointer to a material
GetMaterial
// Get pointer to a named physics volume
GetPhysicalVolume
// Get pointer to a named component
GetComponent
// Get pointers to all children of a named component
GetChildComponentsOf

Custom Fields

While an ElectroMagnetic Field can have just an electric field, just a magnetic field, or a combination of the two, Geant4’s architecture does not provide any base class for a purely electric field, but instead provides one base class for purely Magnetic fields and another for combined ElectroMagnetic fields. To allow you to use all features of both Geant4 classes, TOPAS emulates this curious aspect of Geant4’s design.

If you want to create a purely magnetic field, the first line of the cc file should be of the form:

// Magnetic Field for MyField1

If you want to create a purely electric field, or a combined electromagnetic field, the first line of the cc file should be of the form:

// ElectroMagnetic Field for MyField1

and then if what you really wanted was just an electric field, you implement the magnetic field strength as just zero.

Geant4 will call your GetFieldValue every time it needs to query the field. For reasons that are not clear to this author, Geant4 will sometimes query your field for points outside of your intended geometry component, so make sure to return at least some value (at least a zero) for every possible point.

Parameter lookups should be done in ResolveParameters. Call ResolveParameters directly from your constructor, and then you can also rely on TOPAS to re-call this method any time one of this field class’s parameters is changed.

Custom Imaging to Material Conversion

First line of the cc file must be of the form:

// Imaging to Material Converter for MyImagingToMaterialConverter1

You can supply your own class to assign imaging values to materials.

To use your Imaging to Material converter, reference its name in the parameter:

s:Ge/Patient/ImagingtoMaterialConverter = "MyImagingToMaterialConverter1"

The number of image files read by Topas is determined by the parameter:

i:Ge/Patient/NumberOfEnergies = 1 # defaults to 1

If this value is just 1, Topas will look for imaging files directly in your DicomDirectory. If this value is larger, Topas will expect your DicomDirectory to contain numbered subdirectories:

YourDicomDirectory/1
YourDicomDirectory/2
etc.

The allowed modalities of the imaging files is determined by the parameter:

sv:Ge/Patient/DicomModalityTags = 1 "CT" # defaults to just CT

Other modality tags are, for example, MR for Magnetic Resonance and US for Ultrasound. A complete list can be found here.

You apply whatever algorithm you like in your class’s AssignMaterial method.

This will be called once for each voxel. TOPAS will pass you a vector of imagingValues, with each value representing this voxel’s value from one of your image values:

std::vector< signed short >* imagingValues

For example, if you are doing Dual Energy CT, you will get two values in this vector, the HU values from each of the two CT files.

The materials you use can be defined in your parameter file, in your ImagingToMaterial class’s constructor or in your ImagingToMaterial class’s AssignMaterial method. Either way, by the time you are finished assigning all of your materials, you will have built up a vector of pointers to materials in fMaterialList and, for each voxel, your AssignMaterials method will have returned an appropriate index into this vector.

AssignMaterials is also passed a timeSliceIndex, which is useful if your imaging is time-dependent (that is, 4D imaging). In this case you can use the timeSliceIndex however you wish in your AssignMaterials algorithm.

To avoid spending CPU time on repeated parameter lookups, it is best to do them in ResolveParameters. Call ResolveParameters directly from your constructor, and then you can also rely on TOPAS to re-call this method any time one of this class’s parameters are changed.

Additional User Hooks

Six additional hooks are provided in TsExtensionManager for you to attach your own code.

  • BeginSession
  • BeginRun
  • BeginHistory
  • EndHistory
  • EndRun
  • EndSession

First line of the cc file must be of the form:

// BeginSession for TOPAS
// BeginRun for TOPAS
// BeginHistory for TOPAS
// EndHistory for TOPAS
// EndRun for TOPAS
// EndSession for TOPAS

There are no particular constraints on what you can do in these methods. They are provided simply to give you more flexibility in the design of your extensions.

Proton RBE Scorers

TOPAS has included RBE scorers for several RBE models. These extensions are available from Github at: https://github.com/topasmc/extensions

The implementation follows in principle the methods described in [Polster2015]. The models can be separated into two categories, scorers that depend on dose, LET and alpha/beta ratios, and scorers that are not directly a function of LET. For a detailed description of each model please refer to the references provided.

The following models have been implemented for proton RBE calculations:

LET-based scorers:

  1. Carabe [Carabe2012]; [Carabe2007]
  2. Chen [Chen2012]
  3. McNamara [McNamara2015]
  4. Microdosimetric Kinetic Model (MKM), LET based version [Hawkins1998]; [Kase2007]
  5. Min-Max Model (a generic class, including McNamara and Carabe models)
  6. Wedenberg [Wedenberg2013]
  7. Wilkens [Wilkens2004]

Non-LET based scorers

  1. Monte Carlo Damage Simulation (MCDS) for DSB Induction [Semenenko2004]; [Semenenko2006]; [Stewart2011]; [Stewart2015]
  2. Repair Misrepair Fixation (RMF) [Carlson2008]; [Frese2012]
  3. Tabulated RBE tables (e.g. using the PIDE data base) [Friedrich2012]

The basic concept behind the RBE scorers is to first calculate separately the dose and LET or other relevant quantities, and then, after the simulation is complete, to call the function CombineSubScorers to combine these separate quantities on a voxel by voxel bases to calculate one of the following quantities:

  • RBE (“rbe”)
  • Alpha (“alpha”)
  • Beta (“beta”)
  • Survival fraction (“survivalfraction” or “SF”)
  • RBE x Dose (“rbe_x_dose” or “RWD”, short for RBE weighted dose)

The desired quantity is requested by specifying the OutputQuantity parameter, for example:

s:Sc/MyScorer/OutputQuantity = "RBE"

using the options indicated in brackets above (case insensitive).

Important notes

  1. RBE-related calculations have to consider the entire radiation field. For single field irradiations, the RBE scorers provided here can be used to directly calculate RBE. However, for patient simulations that try to estimate RBE for multiple field treatments, one has to consider the total dose each voxel receives to obtain the correct RBE. Thus one would have to follow a dose-averaged summation of alpha and beta (see also the description in [Polster2015]).
  2. For most LET-based scorers, it may be easier to simply score dose and LET, sum the dose and LET distributions across fields in a post-processing step, and then calculate RBE or RBE-weighted dose. TOPAS currently only provides an LET scorer for protons (ProtonLET Scorer).
  3. Proton LET only considers energy depositions from protons and secondary electrons. Non-LET based models can also include contributions from other secondaries (Z>1) and can be used for other ion irradiation modalities. This may also result in differences in RBE for some scenarios.

Normalizing simulations to prescriptions

Since the simulated number of histories is typically much smaller than the number of protons delivered, it is important to correctly normalize accumulated quantities (e.g. dose, fluence) to the prescribed dose, before using them to compute the RBE. We provide two normalization schemes which are appropriate for different types of simulation.

  1. Simultaneous Exposure (default). This is appropriate for patient simulations, where the scorer bins measure RBE for a single irradiation. That is, a single beam passes through the scoring volume, and the RBE found in each bin is reported. In this case, the accumulated quantities are normalized by a scaling factor, whose numerator (i.e. the delivered dose) is set by the PrescribedDose parameter (e.g. Sc/MyScorer/PrescribedDose = 60 Gy) and whose denominator (i.e. the simulated dose) is chosen by the PrescribedDoseMetric and PrescribedDoseStructure parameters. The PrescribedDoseMetric can be chosen from “Max” (default), “Mean” and “D90”. The PrescribedDoseStructure parameter identifies an RTSTRUCT structure (e.g. “CTV”) for which the PrescribedDoseMetric is calculated. If PrescribedDoseStructure is not set, then the metric is evaluated for the entire scoring volume.

    Note that, to use RTStructures in an RBE scorer, it is currently necessary to include the RTStructure in the Ge/Patient/ColorByRTStructNames parameter. Also, RTStructures can only be used when scoring RBE upon the CT grid (i.e. the scorer Component is a TsDicomPatient, not a TsBox).

  2. Repeat exposures (chosen with Sc/MyScorer/SimultaneousExposure = "False"). This is appropriate for simulations of cell experiments, where each scorer bin measures RBE for a separate irradiation. That is, cell experiments are repeated in each scoring bin (e.g. depth) using the same prescribed dose (e.g. 2 Gy). TOPAS can simulate all these experiments in a single run, by normalizing accumulated quantities appropriately. In this case, the prescribed dose delivered to each scorer bin is set by the PrescribedDose parameter (e.g. Sc/MyScorer/PrescribedDose = 2 Gy).

Using tissue-specific RBE model parameters

When performing patient simulations, it is useful to ascribe different RBE model parameters to different tissues. For example, it is well known that the tumor can have a dramatically different alpha/beta ratio to the surrounding normal tissue. TOPAS supports this feature by enabling the user to assign cell lines (e.g. Sc/CellLineV79) to structures in the RTSTRUCT DICOM file. When scoring RBE in a specific voxel, the RBE model parameters are then retrieved from the corresponding cell line.

This is specified using the following parameters:

sv:Sc/MyScorer/RTStructures = 2 "CTV" "Brain"
sv:Sc/MyScorer/CellLines = 3 "Tumor" "BrainTissue" "OtherTissue"

The order of RTStructures is important because earlier structures take precedence over structures listed later (e.g. if a voxel is in CTV and Brain, then it uses model parameters for CTV). The number of strings in CellLines (which is used to lookup model parameters) is one greater than the number of structures. This allows a default CellLine to be defined (at the end). If no structures are listed (i.e. RTStructures parameter not defined), then CellLines has only one string, which defines the model parameters to use everywhere.

Note that, to use RTStructures in an RBE scorer, it is currently necessary to include the RTStructure in the Ge/Patient/ColorByRTStructNames parameter. Also, RTStructures can only be used when scoring RBE upon the CT grid (i.e. the scorer Component is a TsDicomPatient, not a TsBox).

Reusing sub-scorers to reduce simulation memory requirements

Each RBE scorer creates an additional scoring grid for each variable that is being used (known as sub-scorers). For example, the McNamara RBE scorer creates dose and LET sub-scorers. This significantly increases the memory footprint of the simulation. In particular, if one wants to use multiple RBE scorers, each has their own sub-scorers, which can result in huge requirements in RAM and CPU time. To avoid duplicating sub-scorers unnecessarily, we added the option for scorers to share sub-scorers, for example, when a dose scorer is already defined, let’s say it’s called “PhysDose”, and an LET scorer called “ProtonLET”, then multiple RBE scorers can use these scorers by defining:

s:Sc/McNamara/ReferencedSubScorer_Dose   = "PhysDose"
s:Sc/McNamara/ReferencedSubScorer_LET    = "ProtonLET"

Content

The RBE scorers are contained in a folder that includes an example folder. The directory consists of the following file types:

Scorers:

  • TsScoreDose* : These score quantities in the ProcessHits function like normal scorers.
  • RBE Scorers: These do not have a ProcessHits function and instead combine scored properties (dose, LET, etc) to RBE or biological dose, etc.
  • TsV*: Base classes for the scorers

A schematic view of the class hierarchy is shown below.

_images/rbe_scorers.png

Additionally, the example directory contains an example experiment irradiation (experiment.txt) scoring each of the available RBE scorers (rbe_scorers.txt) for V79 cells (CellLineV79.txt). V79 cells are used because they are one of the most studied cells and biological parameters for all models were available.

The simulations can be run with topas run.txt and analyzed with the provided python script.

In order to change the experimental setup, edit experiment.txt.

In order to change the cell line, provide a new cell line file and change the following line in run.txt:

sv:Sc/CellLines     = 1 "CellLineV79"

run.txt also controls the PrescribedDose used to calculate RBE and the OutputQuantity. The output quantities available depend on the RBE model.

RBE scorers are defined in rbe_scorers.txt and can be edited there. Typically, we recommend not to run too many scorers at once as that increases memory use. In particular, the two parameters ReferencedSubScorer_Dose and ReferencedSubScorer_LET should be set if a dose and LET scorer already exists, otherwise each RBE scorer will create sub-scorers for all properties it needs, potentially resulting in duplicated scorers.

Scoring

A typical scorer for using the RBE model looks like this (from examples/rbe_scorers.txt):

s:Sc/McNamara/Quantity                   = "RBE_McNamara"
s:Sc/McNamara/Component                  = "Sample"
s:Sc/McNamara/OutputQuantity             = "RBE"
d:Sc/McNamara/PrescribedDose             = 2 Gy
sv:Sc/McNamara/CellLines                 = 1 "CellLineV79"
b:Sc/McNamara/SimultaneousExposure       = "True"
s:Sc/McNamara/OutputType                 = "csv"
s:Sc/McNamara/OutputFile                 = "OutputFileName"
s:Sc/McNamara/IfOutputFileAlreadyExists  = "Overwrite"
s:Sc/McNamara/ReferencedSubScorer_Dose   = "PhysDose"   # these two scorers need
s:Sc/McNamara/ReferencedSubScorer_LET    = "ProtonLET"  # to be defined as well.

Each RBE scorer needs a cell line and selected variables to be defined. The file CellLineV79.txt includes all necessary information for all RBE scorers available. The cell lines can easily be changed by changing the CellLines parameter. You must provide the relevant parameters (e.g. alpha/beta ratio) for new cell lines. Note: We recommend to not use the provided CellLineV79.txt parameter file as it includes parameters for all models. Using a smaller file with only the parameters necessary for your simulations guarantees that you will use the correct values, not duplicate ones available in the sample file.

For a list of parameters necessary for each scorer please refer to the text files. The parameters necessary also depend on the selected OutputQuantity, for example in the Carabe model, to get RBE, one only has to define AlphaBetaRatiox, i.e. the ratio of α/β, as:

d:Sc/CellLineV79/AlphaBetaRatiox = 1.412 Gy

If the requested output quantity is alpha, one also needs to define:

d:Sc/CellLineV79/Alphax = 0.0722 /Gy

For beta:

d:Sc/CellLineV79/Betax = 0.0502 /Gy2

and for the survival fraction all three parameters need to be set. Please refer to the example files and the scorers for details.

References

[Carabe2012]Carabe, A. et al., 2012. Range uncertainty in proton therapy due to variable biological effectiveness. Physics in Medicine and Biology, 57(5), pp.1159–1172.
[Carabe2007]Carabe-Fernandez, A., Dale, R.G. & Jones, B., 2007. The incorporation of the concept of minimum RBE ( RBEmin) into the linear-quadratic model and the potential for improved radiobiological analysis of high-LET treatments. International Journal of Radiation Biology, 83(1), pp.27–39.
[Carlson2008]Carlson, D.J. et al., 2008. Combined use of Monte Carlo DNA damage simulations and deterministic repair models to examine putative mechanisms of cell killing. Radiation Research, 169(4), pp.447–459.
[Chen2012]Chen, Y. & Ahmad, S., 2012. Empirical model estimation of relative biological effectiveness for proton beam therapy. Radiat.Prot.Dosim., 149(2), pp.116–123.
[Frese2012]Frese, M.C. et al., 2012. A Mechanism-Based Approach to Predict the Relative Biological Effectiveness of Protons and Carbon Ions in Radiation Therapy. Int J Radiat Oncol, 83(1), pp.442–450.
[Friedrich2012]Friedrich, T. et al., 2012. Systematic analysis of RBE and related quantities using a database of cell survival experiments with ion beam irradiation. Journal of Radiation Research, 54(3), pp.rrs114–514.
[Hawkins1998]Hawkins, R.B., 1998. A microdosimetric-kinetic theory of the dependence of the RBE for cell death on LET. Medical Physics, 25(7), pp.1157–1170.
[Kase2007]Kase, Y. et al., 2007. Biophysical calculation of cell survival probabilities using amorphous track structure models for heavy-ion irradiation. Physics in Medicine and Biology, 53(1), pp.37–59.
[McNamara2015]McNamara, A.L., Schuemann, J. & Paganetti, H., 2015. A phenomenological relative biological effectiveness (RBE) model for proton therapy based on all published in vitro cell survival data. Physics in Medicine and Biology, 60(21), pp.8399–8416.
[Polster2015](1, 2) Polster, L. et al., 2015. Extension of TOPAS for the simulation of proton radiation effects considering molecular and cellular endpoints. Physics in Medicine and Biology, 60(13), pp.5053–5070.
[Semenenko2004]Semenenko, V.A. & Stewart, R.D., 2004. A fast Monte Carlo algorithm to simulate the spectrum of DNA damages formed by ionizing radiation. Radiation Research, 161(4), pp.451–457.
[Semenenko2006]Semenenko, V.A. & Stewart, R.D., 2006. Fast Monte Carlo simulation of DNA damage formed by electrons and light ions. Physics in Medicine and Biology, 51(7), pp.1693–1706.
[Stewart2011]Stewart, R.D. et al., 2011. Effects of Radiation Quality and Oxygen on Clustered DNA Lesions and Cell Death. Radiation Research, 176(5), pp.587–602.
[Stewart2015]Stewart, R.D. et al., 2015. Rapid MCNP simulation of DNA double strand break (DSB) relative biological effectiveness (RBE) for photons, neutrons, and light ions. Physics in Medicine and Biology, 60(21), pp.8249–8274.
[Wedenberg2013]Wedenberg, M., Lind, B.K. & Hårdemark, B., 2013. A model for the relative biological effectiveness of protons: the tissue specific parameter α/β of photons is a predictor for the sensitivity to LET changes. Acta Oncologica, 52(3), pp.580–588.
[Wilkens2004]Wilkens, J.J. & Oelfke, U., 2004. A phenomenological model for the relative biological effectiveness in therapeutic proton beams. Physics in Medicine and Biology, 49(13), pp.2811–2825.