Skip to content

Commit

Permalink
Fix switch to limits
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Apr 8, 2024
1 parent a67112c commit a2f695a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
2 changes: 0 additions & 2 deletions inc/adani/ExactCoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ class ExactCoefficientFunction : public CoefficientFunction {
double C2_ps20(double x, double m2Q2, int /*nf*/) const;
double CL_ps20(double x, double m2Q2, int /*nf*/) const;

double CheckRanges(double x, double m2Q2) const;

//==========================================================================================//
// Exact massive coefficient functions O(as^2): terms
// proportional to log(mu^2/m^2)
Expand Down
62 changes: 36 additions & 26 deletions src/ExactCoefficientFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,28 +291,6 @@ ExactCoefficientFunction::CL_g1(double x, double m2Q2, int /*nf*/) const {
// outside the grid one contribution is set to zero while the other is not.
//------------------------------------------------------------------------------------------//

//==========================================================================================//
// Check that the (eta, xi) values are inside the interpolation grid:
// 1e-6 < eta < 1e6
// 1e-3 < xi < 1e5
//------------------------------------------------------------------------------------------//

double ExactCoefficientFunction::CheckRanges(double x, double m2Q2) const {

double xi = 1. / m2Q2;
double eta = 0.25 * xi * (1 - x) / x - 1.;

// using nf = nan since at O(as2) the coefficient functions don't depend on nf
int nf = static_cast<int>(nan(""));

if (eta < 1e-6) return thr_ -> MuIndependentTerms(x, m2Q2, nf);
if (eta > 1e6 || xi > 1e5) return asy_ -> MuIndependentTerms(x, m2Q2, nf);
if (xi < 1e-3) {
cout << "Error in ExactCoefficientFunction::C" << GetKind() << "_" << GetChannel() << "2 : max value of m2Q2 is 1e3. Got " << m2Q2 << endl;
exit(-1);
}
}

/// @cond UNNECESSARY
/**
* @name Fortran massive coefficient functions
Expand Down Expand Up @@ -348,7 +326,15 @@ ExactCoefficientFunction::C2_ps20(double x, double m2Q2, int /*nf*/) const {
double xi = 1. / m2Q2;
double eta = 0.25 * xi * (1 - x) / x - 1.;

CheckRanges(x, m2Q2);
// using nf = nan since at O(as2) the coefficient functions don't depend on nf
int nf = static_cast<int>(nan(""));

if (eta < 1e-6) return thr_ -> MuIndependentTerms(x, m2Q2, nf);
if (eta > 1e6 || xi > 1e5) return asy_ -> MuIndependentTerms(x, m2Q2, nf);
if (xi < 1e-3) {
cout << "Error in ExactCoefficientFunction::C2_ps20 : max value of m2Q2 is 1e3. Got " << m2Q2 << endl;
exit(-1);
}

return 16 * M_PI * xi * c2nloq_(&eta, &xi) / x;
}
Expand Down Expand Up @@ -385,7 +371,15 @@ ExactCoefficientFunction::CL_ps20(double x, double m2Q2, int /*nf*/) const {
double xi = 1. / m2Q2;
double eta = 0.25 * xi * (1 - x) / x - 1.;

CheckRanges(x, m2Q2);
// using nf = nan since at O(as2) the coefficient functions don't depend on nf
int nf = static_cast<int>(nan(""));

if (eta < 1e-6) return thr_ -> MuIndependentTerms(x, m2Q2, nf);
if (eta > 1e6 || xi > 1e5) return asy_ -> MuIndependentTerms(x, m2Q2, nf);
if (xi < 1e-3) {
cout << "Error in ExactCoefficientFunction::CL_ps20 : max value of m2Q2 is 1e3. Got " << m2Q2 << endl;
exit(-1);
}

return 16 * M_PI * xi * clnloq_(&eta, &xi) / x;
}
Expand All @@ -404,7 +398,15 @@ ExactCoefficientFunction::C2_g20(double x, double m2Q2, int /*nf*/) const {
double xi = 1. / m2Q2;
double eta = 0.25 * xi * (1 - x) / x - 1.;

CheckRanges(x, m2Q2);
// using nf = nan since at O(as2) the coefficient functions don't depend on nf
int nf = static_cast<int>(nan(""));

if (eta < 1e-6) return thr_ -> MuIndependentTerms(x, m2Q2, nf);
if (eta > 1e6 || xi > 1e5) return asy_ -> MuIndependentTerms(x, m2Q2, nf);
if (xi < 1e-3) {
cout << "Error in ExactCoefficientFunction::C2_g20 : max value of m2Q2 is 1e3. Got " << m2Q2 << endl;
exit(-1);
}

return 16 * M_PI * xi * c2nlog_(&eta, &xi) / x;
}
Expand Down Expand Up @@ -441,7 +443,15 @@ ExactCoefficientFunction::CL_g20(double x, double m2Q2, int /*nf*/) const {
double xi = 1. / m2Q2;
double eta = 0.25 * xi * (1 - x) / x - 1.;

CheckRanges(x, m2Q2);
// using nf = nan since at O(as2) the coefficient functions don't depend on nf
int nf = static_cast<int>(nan(""));

if (eta < 1e-6) return thr_ -> MuIndependentTerms(x, m2Q2, nf);
if (eta > 1e6 || xi > 1e5) return asy_ -> MuIndependentTerms(x, m2Q2, nf);
if (xi < 1e-3) {
cout << "Error in ExactCoefficientFunction::CL_g20 : max value of m2Q2 is 1e3. Got " << m2Q2 << endl;
exit(-1);
}

return 16 * M_PI * xi * clnlog_(&eta, &xi) / x;
}
Expand Down

0 comments on commit a2f695a

Please sign in to comment.