cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PartonicStructureFunctions.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023-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
26
27namespace cepgen {
28 namespace apfel {
31 public:
33 enum class Mode { full = 0, valence = 1, sea = 2 };
36 : PartonicParameterisation(params), q_limits_(steer<Limits>("qrange")), xbj_min_(steer<double>("xBjmin")) {
37 const auto perturbative_order = steer<int>("perturbativeOrder");
38 APFEL::SetPerturbativeOrder(perturbative_order);
39 APFEL::InitializeAPFEL();
40 APFEL::EvolveAPFEL(q_limits_.min(), q_limits_.max());
41 APFEL::CachePDFsAPFEL(q_limits_.min());
42 CG_INFO("apfel:PartonicStructureFunctions") << "Partonic structure functions evaluator successfully built.\n"
43 << " * APFEL version: " << APFEL::GetVersion() << "\n"
44 << " * number of flavours: " << num_flavours_ << "\n"
45 << " * quarks mode: " << mode_ << "\n"
46 << " * Q range: " << q_limits_ << ", min xBj: " << xbj_min_ << "\n"
47 << " * perturbative order: " << perturbative_order << ".";
48 }
49
51 auto desc = PartonicParameterisation::description();
52 desc.setDescription("APFEL (partonic)");
53 desc.add<int>("perturbativeOrder", 2);
54 desc.add<Limits>("qrange", {1., 100.});
55 desc.add<double>("xBjmin", 2.e-6).setDescription("minimum Bjorken-x reachable for this PDF set");
56 return desc;
57 }
58
59 private:
60 double evalxQ2(int flavour, double xbj, double q2) override {
61 if (xbj < xbj_min_)
62 return 0.;
63 const auto q = std::sqrt(q2);
64 if (!q_limits_.contains(q))
65 return 0.;
66 return APFEL::xPDFxQ(flavour, xbj, q);
67 }
68 const Limits q_limits_;
69 const double xbj_min_;
70 };
71 } // namespace apfel
72} // namespace cepgen
#define CG_INFO(mod)
Definition Message.h:216
#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
double min() const
Lower limit to apply on the variable.
Definition Limits.h:52
bool contains(double val, bool exclude_boundaries=false) const
Check if value is inside limits' boundaries.
Definition Limits.cpp:77
double max() const
Upper limit to apply on the variable.
Definition Limits.h:54
A description object for parameters collection.
T steer(const std::string &key) const
Retrieve a parameters as previously steered.
Definition Steerable.h:39
Generic partonic level perturbative structure functions built from an external PDFs grid.
PartonicStructureFunctions(const ParametersList &params)
Build a calculator from its Parameters object.
Generic partonic level perturbative structure functions built from an external PDFs grid.
const unsigned short num_flavours_
Number of quark flavours considered in the SF building.
const Mode mode_
Quarks types considered in the SF building.
Common namespace for this Monte Carlo generator.