Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt transformation function for PhotoPairInterpolant #383

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Jean1995
Copy link
Member

@Jean1995 Jean1995 commented Dec 6, 2023

This is an attempt at solving issue #382

The first approach that brought better results was to adapt the transformation function in x for the interpolation tables.

At the moment, the nodes in x in the interpolation tables are distributed linearly in the logarithmic room. However, as x is always between 0 and 1, and symmetric around 0.5, this transformation rule is not really suitable here.
Therefore, I have changed the notes to be linear in x.

For large energies, this significantly improves the results. For small energies, there are still some problems, although the distribution at least looks more symmetric now.

I have also implemented functions to use the CrossSectionIntegral instead of CrossSectionInterpol functions for the secondary calculators of PhotoPairProduction, see #382, so I am able to make comparisons.

Improvements

Here are the sampled distributions for the current master and with this PR.
Note that the computation time stays identical.

1e5 MeV Photons:

Old distributions:

image

New distributions:

image

10 MeV photons:

Old distributions:

image

New distributions:

image

2 MeV photons:

Here one can still see a significant deviation between Integral and Interpol.

Old distributions:

image

New distributions:

image

…ables to increase numerical efficiency.

Add constructor to use Integral instead if Interpolation Crosssections for secondaries::PhotoPairProductionInterpolant classes
@Jean1995
Copy link
Member Author

Jean1995 commented Dec 7, 2023

Attention: For whatever reasons, tests are having problems at the moment...

@@ -126,7 +126,7 @@ double crosssection::PhotoPairKochMotz::DifferentialCrossSection(
};
auto dNdx_nocorrection = i.Integrate(limits.v_min, limits.v_max, integrand, 3);
auto A = interpolant_->InterpolateArray(comp.GetNucCharge(), energy) / dNdx_nocorrection;
return A * DifferentialCrossSectionWithoutA(p, comp, energy, v);
return std::max(A * DifferentialCrossSectionWithoutA(p, comp, energy, v), 0.);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually requires re-calculation of the A factors! Otherwise, we get a problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant