def test_energy_transfer_cross_section(self): # The plot from github.com/tomkooij/lio-project/photons/check_sapphire_gammas.py # has been checked with Evans (1955) p. 693 figure 5.1 # Peaks from this plot: (E [MeV], cross_section [barn]) combinations = ((0.511, 1.6), (1.2, 0.52), (2.76, 0.22)) barn = 1e-28 # m**2. Note that the figure in Evans is in centibarn! for E, cross_section in combinations: edge = gammas.compton_edge(E) self.assertAlmostEqual(gammas.energy_transfer_cross_section(E, edge) / barn, cross_section, places=1)
def test_compton_energy_transfer(self, mock_random): # if random() return 1, energy should approach the kinematic maximum (compton edge) mock_random.return_value = 1.0 for gamma_energy in [3., 10., 100.]: expected = gammas.compton_edge(gamma_energy) self.assertAlmostEqual(gammas.compton_energy_transfer(gamma_energy), expected, places=0) # if random() returns 0, energy should approach 0 mock_random.return_value = 0.0 for gamma_energy in [3., 10., 100.]: self.assertAlmostEqual(gammas.compton_energy_transfer(gamma_energy), 0.)
def test_compton_edge(self): # Compton edges of well known gammas sources # http://web.mit.edu/lululiu/Public/8.13/xray/TKA%20files/annihilation-Na.pdf # Na-22 # 0.511 MeV: 0.344 MeV # 1.27 MeV: 1.06 MeV # http://www.spectrumtechniques.com/PDF/Compton%20Scattering%20Experiment%20by%20Prutchi.pdf # Cs-137 # 0.662 MeV : 482 MeV # Co-60 # 1.17 MeV: 0.96 MeV # 1.33 MeV: 1.12 MeV combinations = ((0.511, 0.340), (1.27, 1.06), (0.662, 0.482), (1.17, 0.96), (1.33, 1.12)) for E, edge in combinations: self.assertAlmostEqual(gammas.compton_edge(E), edge, places=2)