From af6e5915fe381cff6c9d5864c5cc96dd3ffa24e6 Mon Sep 17 00:00:00 2001 From: niccolo Date: Tue, 19 Mar 2024 15:23:30 +0100 Subject: [PATCH] Clean Threshod --- .gitignore | 2 + CMakeLists.txt | 4 +- inc/adani/ApproximateCoefficientFunctions.h | 2 +- ...tions.h => ThresholdCoefficientFunction.h} | 1 + inc/adani/adani.h | 2 +- ...ons.cc => ThresholdCoefficientFunction.cc} | 64 +++++++++++++------ 6 files changed, 53 insertions(+), 22 deletions(-) rename inc/adani/{ThresholdCoefficientFunctions.h => ThresholdCoefficientFunction.h} (97%) rename src/{ThresholdCoefficientFunctions.cc => ThresholdCoefficientFunction.cc} (89%) diff --git a/.gitignore b/.gitignore index 586444e..4e8d28b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ MANIFEST.in env/ venv/ + +tests/__pycache__/ diff --git a/CMakeLists.txt b/CMakeLists.txt index aecc394..b79d90b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ if(PYTHON_ONLY) src/CoefficientFunction.cc src/ApproximateCoefficientFunctions.cc src/ExactCoefficientFunctions.cc - src/ThresholdCoefficientFunctions.cc + src/ThresholdCoefficientFunction.cc src/AsymptoticCoefficientFunctions.cc src/MasslessCoefficientFunctions.cc src/Convolutions.cc @@ -98,7 +98,7 @@ else(PYTHON_ONLY) src/CoefficientFunction.cc src/ApproximateCoefficientFunctions.cc src/ExactCoefficientFunctions.cc - src/ThresholdCoefficientFunctions.cc + src/ThresholdCoefficientFunction.cc src/AsymptoticCoefficientFunctions.cc src/MasslessCoefficientFunctions.cc src/Convolutions.cc diff --git a/inc/adani/ApproximateCoefficientFunctions.h b/inc/adani/ApproximateCoefficientFunctions.h index b2efb0f..195c821 100644 --- a/inc/adani/ApproximateCoefficientFunctions.h +++ b/inc/adani/ApproximateCoefficientFunctions.h @@ -18,7 +18,7 @@ #define Approximate_h #include "adani/CoefficientFunction.h" -#include "adani/ThresholdCoefficientFunctions.h" +#include "adani/ThresholdCoefficientFunction.h" #include "adani/AsymptoticCoefficientFunctions.h" #include "adani/ExactCoefficientFunctions.h" diff --git a/inc/adani/ThresholdCoefficientFunctions.h b/inc/adani/ThresholdCoefficientFunction.h similarity index 97% rename from inc/adani/ThresholdCoefficientFunctions.h rename to inc/adani/ThresholdCoefficientFunction.h index 346a377..55f156b 100644 --- a/inc/adani/ThresholdCoefficientFunctions.h +++ b/inc/adani/ThresholdCoefficientFunction.h @@ -27,6 +27,7 @@ class ThresholdCoefficientFunction : public CoefficientFunction { ThresholdCoefficientFunction(const int& order, const char& kind, const char& channel) ; ~ThresholdCoefficientFunction() override ; + double fx(double x, double m2Q2, double m2mu2, int nf) const override ; Value fxBand(double x, double m2Q2, double m2mu2, int nf) const override ; double BetaIndependentTerms(double x, double m2Q2, double m2mu2) const; diff --git a/inc/adani/adani.h b/inc/adani/adani.h index 84fb9b2..cc79a42 100644 --- a/inc/adani/adani.h +++ b/inc/adani/adani.h @@ -14,6 +14,6 @@ #include "adani/MatchingConditions.h" #include "adani/SpecialFunctions.h" #include "adani/SplittingFunctions.h" -#include "adani/ThresholdCoefficientFunctions.h" +#include "adani/ThresholdCoefficientFunction.h" #endif diff --git a/src/ThresholdCoefficientFunctions.cc b/src/ThresholdCoefficientFunction.cc similarity index 89% rename from src/ThresholdCoefficientFunctions.cc rename to src/ThresholdCoefficientFunction.cc index d380860..7c44e2c 100644 --- a/src/ThresholdCoefficientFunctions.cc +++ b/src/ThresholdCoefficientFunction.cc @@ -1,4 +1,4 @@ -#include "adani/ThresholdCoefficientFunctions.h" +#include "adani/ThresholdCoefficientFunction.h" #include "adani/Constants.h" #include "adani/SpecialFunctions.h" @@ -8,36 +8,44 @@ using std::cout ; using std::endl ; +//==========================================================================================// +// ThresholdCoefficientFunction: constructor +//------------------------------------------------------------------------------------------// + ThresholdCoefficientFunction::ThresholdCoefficientFunction(const int& order, const char& kind, const char& channel) : CoefficientFunction(order, kind, channel) { exactlo_ = new ExactCoefficientFunction(1, GetKind(), GetChannel()); SetFunctions(); } +//==========================================================================================// +// ThresholdCoefficientFunction: destructor +//------------------------------------------------------------------------------------------// + ThresholdCoefficientFunction::~ThresholdCoefficientFunction() { delete exactlo_; } -Value ThresholdCoefficientFunction::fxBand(double x, double m2Q2, double m2mu2, int nf) const { - return Value((this->*fx_)(x, m2Q2, m2mu2, nf)); +//==========================================================================================// +// ThresholdCoefficientFunction: contral value of the full contribution +//------------------------------------------------------------------------------------------// + +double ThresholdCoefficientFunction::fx(double x, double m2Q2, double m2mu2, int nf) const { + return (this->*fx_)(x, m2Q2, m2mu2, nf); } -void ThresholdCoefficientFunction::SetFunctions() { - if (GetChannel() == 'q') fx_ = &ThresholdCoefficientFunction::ZeroFunction; - else if (GetChannel() == 'g') { - if (GetOrder() == 1 && GetKind() == '2') fx_ = &ThresholdCoefficientFunction::C2_g1_threshold ; - else if (GetOrder() == 1 && GetKind() == 'L') fx_ = &ThresholdCoefficientFunction::ZeroFunction; - else if (GetOrder() == 2 && GetKind() == '2') fx_ = &ThresholdCoefficientFunction::C2_g2_threshold ; - else if (GetOrder() == 2 && GetKind() == 'L') fx_ = &ThresholdCoefficientFunction::CL_g2_threshold ; - else if (GetOrder() == 3 && GetKind() == '2') fx_ = &ThresholdCoefficientFunction::C2_g3_threshold ; - else if (GetOrder() == 3 && GetKind() == 'L') fx_ = &ThresholdCoefficientFunction::CL_g3_threshold ; - else { - cout << "Error: something has gone wrong in ThresholdCoefficientFunction::SetFunctions!" << endl; - exit(-1); - } - } +//==========================================================================================// +// ThresholdCoefficientFunction: band of the full contribution +//------------------------------------------------------------------------------------------// + +Value ThresholdCoefficientFunction::fxBand(double x, double m2Q2, double m2mu2, int nf) const { + return Value(fx(x, m2Q2, m2mu2, nf)); } +//==========================================================================================// +// ThresholdCoefficientFunction: central value of the beta-independent terms +//------------------------------------------------------------------------------------------// + double ThresholdCoefficientFunction::BetaIndependentTerms(double x, double m2Q2, double m2mu2) const { if (GetChannel() == 'q') return 0.; else if (GetChannel() == 'g') { @@ -57,9 +65,29 @@ double ThresholdCoefficientFunction::BetaIndependentTerms(double x, double m2Q2, } } +//==========================================================================================// +// ThresholdCoefficientFunction: function that sets the pointer for fx +//------------------------------------------------------------------------------------------// + +void ThresholdCoefficientFunction::SetFunctions() { + if (GetChannel() == 'q') fx_ = &ThresholdCoefficientFunction::ZeroFunction; + else if (GetChannel() == 'g') { + if (GetOrder() == 1 && GetKind() == '2') fx_ = &ThresholdCoefficientFunction::C2_g1_threshold ; + else if (GetOrder() == 1 && GetKind() == 'L') fx_ = &ThresholdCoefficientFunction::ZeroFunction; + else if (GetOrder() == 2 && GetKind() == '2') fx_ = &ThresholdCoefficientFunction::C2_g2_threshold ; + else if (GetOrder() == 2 && GetKind() == 'L') fx_ = &ThresholdCoefficientFunction::CL_g2_threshold ; + else if (GetOrder() == 3 && GetKind() == '2') fx_ = &ThresholdCoefficientFunction::C2_g3_threshold ; + else if (GetOrder() == 3 && GetKind() == 'L') fx_ = &ThresholdCoefficientFunction::CL_g3_threshold ; + else { + cout << "Error: something has gone wrong in ThresholdCoefficientFunction::SetFunctions!" << endl; + exit(-1); + } + } +} + //==========================================================================================// // Threshold limit (x->xmax) of the gluon coefficient function for F2 at -// O(alpha_s). In order to pass to klmv normalization multiply +// O(as). In order to pass to klmv normalization multiply // m2Q2*4*M_PI*M_PI*x // // Eq. (3.15) of Ref. [arXiv:1205.5727]