EGS Brachy
An egs++ user code for rapid brachytherapy calculations
Loading...
Searching...
No Matches
test.py
Go to the documentation of this file.
1"""
2
3A test for ensuring that the fluorescent photon cutoff works. A monoenergetic
4source of 0.015keV is placed within a thin Ti sphere and photon counts are
5scored on the outer surface of the sphere. Normally there would be a
6fluorescent peak at ~4.5keV so when the `fluorescent photon cutoff` setting is
7set to 0.005 MeV that peak should not be present.
8
9Two energy bins from 0-10keV and 10-20keV are used. If fluorescent photon cutoff
10feature is working correctly 100% of photons should be in the 10-20keV range.
11
12"""
13
14import math
15import re
16
17from eb_tests.utils import read_csv_spectrum, values_close
18
19EGSINP = "flu_cutoff.egsinp"
20TIME_LIMIT_S_PER_MHZ = 2/2993. # s / MHz
21
22
23def compare_results(egslst, inp_name):
24
25 energies, counts, uncs = read_csv_spectrum(inp_name+".surfcount.csv")
26
27 lower, upper = counts
28 if not (lower == 0 and upper == 100):
29 return False, "Photon Count < 10keV = %f" %(lower), "Expected 0"
30
31 return True, "", ""