cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
EvolutionStructureFunctions.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2024 Laurent Forthomme
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <APFEL/APFEL.h>
20
21#include <cmath>
22
25#include "CepGen/Physics/PDG.h"
27
28using namespace std::string_literals;
29
30namespace cepgen {
31 namespace apfel {
33 public:
35 : strfun::Parameterisation(params),
36 proc_(steer<std::string>("processDIS")),
37 q2_range_(steer<Limits>("q2range")),
38 xbj_min_(steer<double>("xBjmin")) {
39 if (!q2_range_.valid())
40 throw CG_FATAL("apfel:EvolutionStructureFunctions") << "Invalid Q^2 range: " << q2_range_ << ".";
41 const auto qrange = q2_range_.compute([](double lim) { return std::sqrt(lim); });
42 APFEL::SetMassScheme(steer<std::string>("massScheme"));
43 APFEL::SetProcessDIS(proc_);
44 APFEL::SetQLimits(qrange.min(), qrange.max());
45 APFEL::SetPerturbativeOrder(steer<int>("perturbativeOrder"));
46 APFEL::SetMaxFlavourAlpha(steer<int>("maxFlavourAlpha"));
47 APFEL::SetMaxFlavourPDFs(steer<int>("maxFlavourPDFs"));
48 APFEL::SetPDFSet(steer<std::string>("pdfSet"));
49 APFEL::SetTargetDIS(steer<std::string>("targetDIS"));
50 APFEL::InitializeAPFEL_DIS();
51 APFEL::ComputeStructureFunctionsAPFEL(qrange.min(), qrange.max());
52 APFEL::CacheStructureFunctionsAPFEL(qrange.min());
53 }
54
57 desc.setDescription("APFEL DIS structure functions");
58 desc.add("q2range", Limits{1., 1.e6}).setDescription("evolution scale range, in GeV^2");
59 desc.add<double>("xBjmin", 2.e-6).setDescription("minimum Bjorken-x reachable for this PDF set");
60 desc.add("massScheme", "FFNS"s /*"FONLL-A"s*/).setDescription("mass scheme for the structure functions");
61 desc.add("processDIS", "NC"s).setDescription("process of the structure functions (EM, NC, or CC)");
62 desc.add("perturbativeOrder", 0)
63 .setDescription("perturbative order for alpha(S) evolution")
64 .allow(0, "LO")
65 .allow(1, "NLO")
66 .allow(2, "NNLO")
67 .allow(3, "NNNLO");
68 desc.add<int>("maxFlavourAlpha", 5)
69 .setDescription("maximum number of flavours that the evolution of alpha(S) and alpha(EM) can reach");
70 desc.add<int>("maxFlavourPDFs", 5)
71 .setDescription("maximum number of flavours that the evolution of PDFs can reach");
72 desc.add("pdfSet", "CT14lo"s).setDescription("name of the PDF set to be used at the initial scale");
73 desc.add("targetDIS", "isoscalar"s);
74 return desc;
75 }
76
77 private:
78 void eval() override {
79 if (!q2_range_.contains(args_.q2) || args_.xbj < xbj_min_) {
80 CG_WARNING("apfel:EvolutionStructureFunctions")
81 << "(xBj=" << args_.xbj << ", Q^2=" << args_.q2 << ")"
82 << " not in validity range (min.xBj = " << xbj_min_ << ", Q^2 = " << q2_range_ << ").";
83 clear();
84 return;
85 }
86 const auto q = std::sqrt(args_.q2);
87 setF2(APFEL::StructureFunctionxQ(proc_, "F2", "total", args_.xbj, q));
88 setFL(APFEL::StructureFunctionxQ(proc_, "FL", "total", args_.xbj, q));
89 }
90
91 const std::string proc_;
92 const Limits q2_range_;
93 const double xbj_min_;
94 };
95 } // namespace apfel
96} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
#define CG_WARNING(mod)
Definition Message.h:228
#define REGISTER_STRFUN(name, id, obj)
Add a structure functions definition to the list of handled parameterisation.
Validity interval for a variable.
Definition Limits.h:28
bool valid() const
Is there a lower and upper limit?
Definition Limits.cpp:85
Limits compute(double(*)(double)) const
Compute a copy of limits with an operator applied on boundaries Compute a copy of limits with an oper...
Definition Limits.cpp:152
bool contains(double val, bool exclude_boundaries=false) const
Check if value is inside limits' boundaries.
Definition Limits.cpp:77
A description object for parameters collection.
T steer(const std::string &key) const
Retrieve a parameters as previously steered.
Definition Steerable.h:39
Base object for the parameterisation of nucleon structure functions.
Parameterisation & clear()
Reset the structure functions values.
Arguments args_
Last couple computed.
Parameterisation & setF2(double f2)
Parameterisation(const ParametersList &)
static ParametersDescription description()
Generic description for the structure functions.
Parameterisation & setFL(double fl)
Common namespace for this Monte Carlo generator.