# 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"