cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
CollinearFlux.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
25#include "CepGen/Physics/PDG.h"
27
28namespace cepgen {
29 namespace apfel {
31 class CollinearFlux final : public cepgen::CollinearFlux {
32 public:
34 explicit CollinearFlux(const ParametersList& params)
35 : cepgen::CollinearFlux(params), pdgid_(steer<pdgid_t>("partonPdgId")), q_range_(steer<Limits>("qrange")) {
36 APFEL::SetPerturbativeOrder(steer<int>("perturbativeOrder"));
37 const auto pdfset = steer<std::string>("set");
38 if (!pdfset.empty())
39 APFEL::SetPDFSet(pdfset);
40 //APFEL::SetMaxFlavourPDFs(7);
41 APFEL::SetFastEvolution(steer<bool>("fastEvolution"));
42 APFEL::InitializeAPFEL();
43 APFEL::EvolveAPFEL(q_range_.min(), q_range_.max());
44 APFEL::CachePDFsAPFEL(q_range_.min());
45 CG_INFO("apfel:CollinearFlux") << "Partonic collinear parton flux evaluator successfully built.\n"
46 << " * APFEL version: " << APFEL::GetVersion() << "\n"
47 << " * Parton PDG identifier: " << pdgid_
48 << ", max flavours: " << APFEL::GetMaxFlavourPDFs() << "\n"
49 << " * Q range: " << q_range_ << " ("
50 << Limits{APFEL::GetMuF0(), APFEL::GetMuF()} << ") GeV\n"
51 << " * perturbative order: " << APFEL::GetPerturbativeOrder() << ".";
52 }
53
54 cepgen::pdgid_t partonPdgId() const override { return pdgid_; }
55 bool fragmenting() const override { return true; }
56 double mass2() const override { return mp2_; }
57
58 double fluxQ2(double x, double q2) const override {
59 if (!x_range_.contains(x, true))
60 return 0.;
61 const auto q = std::sqrt(q2);
62 if (!q_range_.contains(q))
63 return 0.;
64 return prefactor_ * APFEL::xPDFxQ(pdgid_, x, q) / x;
65 }
66
69 desc.setDescription("APFEL coll.flux");
70 desc.add<std::string>("set", "").setDescription("LHAPDF set to use at the initial scale");
71 desc.add<pdgid_t>("partonPdgId", PDG::photon).setDescription("parton PDG identifier");
72 desc.add<Limits>("qrange", {1., 100.});
73 desc.add<int>("perturbativeOrder", 2);
74 desc.add<bool>("fastEvolution", false);
75 return desc;
76 }
77
78 private:
79 const pdgid_t pdgid_;
80 const Limits q_range_;
81 };
82 } // namespace apfel
83} // namespace cepgen
#define CG_INFO(mod)
Definition Message.h:216
#define REGISTER_COLLINEAR_FLUX(name, obj)
Add a generic collinear parton flux evaluator builder definition.
static ParametersDescription description()
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
@ photon
Definition PDG.h:41
A description object for parameters collection.
const double prefactor_
Definition PartonFlux.h:38
const double mp2_
Definition PartonFlux.h:39
const Limits x_range_
Definition PartonFlux.h:40
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.
bool fragmenting() const override
Is initiator particle fragmenting after parton emission?
double fluxQ2(double x, double q2) const override
Compute the collinear flux for this x value and virtuality.
cepgen::pdgid_t partonPdgId() const override
Parton PDG identifier.
static ParametersDescription description()
CollinearFlux(const ParametersList &params)
Build a calculator from its Parameters object.
double mass2() const override
Initiator particle squared mass (in )
Common namespace for this Monte Carlo generator.
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.