|
28 | 28 | #include <iostream> |
29 | 29 |
|
30 | 30 | /** Opens GADRAS GAM files. |
31 | | - * Opens only the newer format of GAM files (that start with two 0's). |
| 31 | + * |
| 32 | + * Currently only opens .gam files that start with two 0's, called version 1, and GamFileVersion = 2.0 and 2.1. |
| 33 | + * |
| 34 | + * Does not currently parse all information, such as model geometry, largest dimension, multiplicity, etc. |
32 | 35 | */ |
33 | 36 | class GadrasGamFile |
34 | 37 | { |
35 | 38 | public: |
36 | 39 | GadrasGamFile(); |
37 | 40 |
|
38 | 41 |
|
39 | | - /** Parses the cooresponding stream. |
| 42 | + /** Parses the corresponding stream. |
40 | 43 | * Throws runtime_error exception when the file is not formatted properly. |
41 | 44 | */ |
42 | 45 | void parse_data( std::istream &strm ); |
43 | 46 |
|
44 | 47 |
|
| 48 | + enum class GamFileVersion |
| 49 | + { |
| 50 | + /** The .gam files that start with two 0's. |
| 51 | + The gamma lines do not include shielding information. |
| 52 | + */ |
| 53 | + Version_1, |
| 54 | + |
| 55 | + /** Indicated by a "GamFileVersion = 2.0" header in the file. */ |
| 56 | + Version_2_0, |
| 57 | + |
| 58 | + /** Indicated by a "GamFileVersion = 2.1" header in the file. */ |
| 59 | + Version_2_1, |
| 60 | + |
| 61 | + /** */ |
| 62 | + NumGamFileVersions |
| 63 | + };//enum class GamFileVersion |
45 | 64 |
|
46 | | - /* A relevant note from the GADRAS users manual: |
47 | | - * If the width of the group exceeds 1% of the average energy of the group, |
48 | | - * the radiation within the group is assumed to be distributed uniformly |
49 | | - * within the group. For groups that have widths under 1% of the average |
50 | | - * energy, any excess flux within the group relative to a linear interpolation |
51 | | - * of surrounding groups is assumed to be emitted at a discrete energy, |
52 | | - * corresponding to the midpoint of the group. |
| 65 | + |
| 66 | + /** Writes the .gam file to the provided stream. |
| 67 | + * |
| 68 | + * Currently only supports writing GamFileVersion::Version_2_0, and will throw exception for other versions. |
| 69 | + * |
| 70 | + * Throws runtime_error exception if output fails or errors encountered. |
| 71 | + */ |
| 72 | + void write_gam( std::ostream &output, const GamFileVersion version ); |
| 73 | + |
| 74 | + |
| 75 | + /* |
| 76 | + A relevant note is: |
| 77 | + If the width, W, or a photon group with lower energy EL, meets any of the following conditions, |
| 78 | + GADRAS transport will treat the group as a discrete line: |
| 79 | + - W < 0.25 keV |
| 80 | + - W < 0.4 keV and EL > 200 keV |
| 81 | + - W < 1.0 keV and EL > 10 MeV |
| 82 | + If any of these conditions are met, GADRAS will look at the (assumed) continuum groups above and |
| 83 | + below the potential discrete group. The counts-per-keV in the potential discrete group must be |
| 84 | + greater than the adjacent continuum groups. If it is, it uses the higher-energy continuum group |
| 85 | + and subtracts those counts from the discrete group to get the net discrete counts, with energy |
| 86 | + equal to the midpoint of the group. |
| 87 | + */ |
| 88 | + |
| 89 | + /** The gamma file version parsed. |
53 | 90 | */ |
| 91 | + GamFileVersion m_version; |
54 | 92 |
|
55 | | - /** Energy, in keV of the un-collided gamma rays. |
| 93 | + /** Energy, in keV of the un-collided gamma rays. |
56 | 94 | * Will have same number of entries as, and coorespond index-wise to |
57 | 95 | * #m_photon_lines_flux, #m_photon_lines_an, and #m_photon_lines_ad. |
58 | 96 | */ |
59 | 97 | std::vector<float> m_photon_lines_energy; |
60 | 98 |
|
61 | | - /** The flux into 4pi for the cooresponding m_photon_lines_energy energy.*/ |
| 99 | + /** The flux into 4pi for the corresponding m_photon_lines_energy energy.*/ |
62 | 100 | std::vector<float> m_photon_lines_flux; |
63 | 101 |
|
64 | | - /** The yeild-effective weighted atomic number of interveining material. */ |
| 102 | + /** The yield-effective weighted atomic number of intervening material. */ |
65 | 103 | std::vector<float> m_photon_lines_an; |
66 | 104 |
|
67 | | - /** The yield-effective weighted areal density of interveining material. */ |
| 105 | + /** The yield-effective weighted areal density of intervening material. */ |
68 | 106 | std::vector<float> m_photon_lines_ad; |
69 | 107 |
|
70 | 108 |
|
71 | | - /** Lower energy of energy group for the cooresponding (index-wise) |
| 109 | + /** Lower energy of energy group for the corresponding (index-wise) |
72 | 110 | * #m_photon_group_flux. Energy is in keV. |
73 | 111 | */ |
74 | 112 | std::vector<float> m_photon_group_boundries; |
75 | 113 |
|
76 | | - /** Flux of the continuum for the given energy group. |
| 114 | + /** Flux of the continuum for the given energy group. |
77 | 115 | * Note that the last last entry should have a flux of 0, in order to allow |
78 | 116 | * defining the upper energy of the last group. |
79 | 117 | */ |
80 | 118 | std::vector<float> m_photon_group_flux; |
81 | 119 |
|
82 | 120 |
|
83 | | - /** Lower energy of the neutron energy group. Will have same number of |
| 121 | + /** Lower energy of the neutron energy group. Will have same number of |
84 | 122 | * entries as #m_neutron_group_flux. |
85 | 123 | * Energy is in keV (note that .gam files use eV). |
86 | 124 | */ |
87 | 125 | std::vector<float> m_neutron_group_boundries; |
88 | 126 |
|
89 | | - /** Flux in cooresponding energy group. |
| 127 | + /** Flux in corresponding energy group. |
90 | 128 | */ |
91 | 129 | std::vector<float> m_neutron_group_flux; |
92 | 130 | };//class GadrasGamFile |
|
0 commit comments