) moment_cross_sections = Collision.createLogLogLogCorrelatedMomentPreservingElasticReaction( native_data, 0.9, 1e-7) # if z == 'Pb-Native': # energies = [1e-5,4e-4,1e5] # else: # energies = [1e-5, 1e-3, 1e5 ] for interp in interps: print "\n--- ", interp, "Tests ---" cutoff_dist = Collision.createLogLogLogCorrelatedCutoffElasticDistribution( native_data, 0.9, 1e-7) if interp == "LinLinLog": cutoff_dist = Collision.createLinLinLogCorrelatedCutoffElasticDistribution( native_data, 0.9, 1e-15) elif interp == "LinLinLin": cutoff_dist = Collision.createLinLinLinCorrelatedCutoffElasticDistribution( native_data, 0.9, 1e-15) ### ### Moment Preserving Reaction Unit Test Check ### for energy in energies: index = 0 for i in range(0, energy_grid.size): if energy_grid[i] <= energy: index = i energy_0 = energy_grid[index]
### ### Cutoff Distribution Pyfrensie Unit Test Check ### interpolations = ["LinLinLin", "LinLinLog", "LogLogLog"] cutoff_angle_cosines = [0.9, 0.999999] energies = [1e5, 1e-3, 4e-4] angles = [0.0, 0.9] interpolations = ["LinLinLog"] cutoff_angle_cosines = [0.9] for interp in interpolations: print "\n\n\t-----",interp,"-----" for cutoff in cutoff_angle_cosines: cutoff_dist = Collision.createLinLinLogCorrelatedCutoffElasticDistribution(native_data, cutoff, 1e-14) full_cutoff_dist = Collision.createLinLinLogCorrelatedCutoffElasticDistribution( native_data, 1.0, 1e-14) print "\n\t--- Cutoff Angle Cosine = ",cutoff," ---" print "\n\tEvaluate" for energy in energies: print "Energy = ",energy for angle in angles: pdf = cutoff_dist.evaluate( energy, angle ) full_pdf = full_cutoff_dist.evaluate( energy, angle ) print '\teval[',angle,'] = ','%.16e' % pdf # print '\tfull eval[',angle,'] = ','%.16e' % full_pdf print "\n\tEvaluate PDF" for energy in energies: print "Energy = ",energy