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

APFEL: added DIS structure functions modelling #75

Merged
merged 3 commits into from Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion CepGenAddOns/APFELWrapper/CMakeLists.txt
Expand Up @@ -8,7 +8,9 @@ endif()

#----- build the object

cepgen_build(CepGenAPFEL SOURCES AlphaSAPFEL.cpp APFELCollinearFlux.cpp PartonicStructureFunctionsAPFEL.cpp
cepgen_build(CepGenAPFEL
SOURCES AlphaSAPFEL.cpp APFELCollinearFlux.cpp
EvolutionStructureFunctions.cpp PartonicStructureFunctionsAPFEL.cpp
EXT_LIBS ${APFEL}
EXT_HEADERS ${APFEL_INCLUDE}
INSTALL_COMPONENT apfel)
Expand Down
86 changes: 86 additions & 0 deletions CepGenAddOns/APFELWrapper/EvolutionStructureFunctions.cpp
@@ -0,0 +1,86 @@
/*
* CepGen: a central exclusive processes event generator
* Copyright (C) 2024 Laurent Forthomme
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <APFEL/APFEL.h>

#include <cmath>

#include "CepGen/Core/Exception.h"
#include "CepGen/Modules/StructureFunctionsFactory.h"
#include "CepGen/Physics/PDG.h"
#include "CepGen/StructureFunctions/Parameterisation.h"

using namespace std::string_literals;

namespace cepgen {
namespace apfel {
class EvolutionStructureFunctions final : public strfun::Parameterisation {
public:
explicit EvolutionStructureFunctions(const ParametersList& params)
: strfun::Parameterisation(params),
proc_(steer<std::string>("processDIS")),
xbj_min_(steer<double>("xBjmin")) {
const auto q2range = steer<Limits>("q2range");
if (!q2range.valid())
throw CG_FATAL("apfel:EvolutionStructureFunctions") << "Invalid Q^2 range: " << q2range << ".";
const auto qrange = q2range.compute([](double lim) { return std::sqrt(lim); });

APFEL::SetMassScheme(steer<std::string>("massScheme"));
APFEL::SetProcessDIS(proc_);
APFEL::SetQLimits(qrange.min(), qrange.max());
APFEL::SetMaxFlavourAlpha(steer<int>("maxFlavourAlpha"));
APFEL::SetMaxFlavourPDFs(steer<int>("maxFlavourPDFs"));
APFEL::SetPDFSet(steer<std::string>("pdfSet"));
APFEL::SetTargetDIS(steer<std::string>("targetDIS"));
APFEL::InitializeAPFEL_DIS();
APFEL::ComputeStructureFunctionsAPFEL(qrange.min(), qrange.max());
APFEL::CacheStructureFunctionsAPFEL(qrange.min());
}

static ParametersDescription description() {
auto desc = strfun::Parameterisation::description();
desc.setDescription("APFEL DIS structure functions");
desc.add("q2range", Limits{1., 1.e6});
desc.add<double>("xBjmin", 1.e-6);
desc.add("massScheme", "ZM-VFNS"s);
desc.add("processDIS", "NC"s);
desc.add<int>("maxFlavourAlpha", 5);
desc.add<int>("maxFlavourPDFs", 5);
desc.add("pdfSet", "CT14nnlo"s);
desc.add("targetDIS", "isoscalar"s);
return desc;
}

private:
void eval() override {
if (args_.xbj < xbj_min_) {
clear();
return;
}
const auto q = std::sqrt(args_.q2);
setF2(APFEL::StructureFunctionxQ(proc_, "F2", "total", args_.xbj, q));
setFL(APFEL::StructureFunctionxQ(proc_, "FL", "total", args_.xbj, q));
}

const std::string proc_;
const double xbj_min_;
};
} // namespace apfel
} // namespace cepgen
using ApfelEvolutionStructureFunctions = cepgen::apfel::EvolutionStructureFunctions;
REGISTER_STRFUN("apfelEvol", 404, ApfelEvolutionStructureFunctions);
forthommel marked this conversation as resolved.
Show resolved Hide resolved