cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Parameterisation.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2013-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
22#include "CepGen/Physics/PDG.h"
24
25namespace cepgen {
26 namespace strfun {
28 : NamedModule(params),
29 r_ratio_(SigmaRatiosFactory::get().build(steer<ParametersList>("sigmaRatio"))),
30 mp_(PDG::get().mass(PDG::proton)),
31 mp2_(mp_ * mp_),
32 mx_min_(mp_ + PDG::get().mass(PDG::piZero)) {
33 CG_DEBUG("Parameterisation") << "Structure functions parameterisation to be built using following parameters:\n"
35 }
36
38 const auto args = Arguments{xbj, q2};
39 if (args == args_)
40 return *this;
41 clear();
42 if (!args.valid()) {
43 CG_WARNING("StructureFunctions") << "Invalid range for Q² = " << q2 << " or xBj = " << xbj << ".";
44 return *this;
45 }
46 args_ = args;
47 eval();
48 return *this;
49 }
50
52 vals_.clear();
53 fl_computed_ = false;
54 return *this;
55 }
56
57 double Parameterisation::F2(double xbj, double q2) { return operator()(xbj, q2).vals_.f2; }
58
59 double Parameterisation::FL(double xbj, double q2) {
60 if (!fl_computed_)
61 computeFL(xbj, q2);
62 return operator()(xbj, q2).vals_.fl;
63 }
64
65 double Parameterisation::W1(double xbj, double q2) { return operator()(xbj, q2).vals_.w1; }
66
67 double Parameterisation::W2(double xbj, double q2) { return operator()(xbj, q2).vals_.w2; }
68
69 double Parameterisation::FE(double xbj, double q2) { return operator()(xbj, q2).vals_.fe; }
70
71 double Parameterisation::FM(double xbj, double q2) { return operator()(xbj, q2).vals_.fm; }
72
73 double Parameterisation::F1(double xbj, double q2) {
74 return 0.5 * (gamma2(xbj, q2) * F2(xbj, q2) - FL(xbj, q2)) / xbj;
75 }
76
78 return (*this)
79 .setF2(f2) // trivial
80 .setFL(gamma2(args_.xbj, args_.q2) * vals_.f2 - 2. * f1 * args_.xbj);
81 }
82
84 vals_.f2 = f2;
85 return *this;
86 }
87
89 vals_.fl = fl;
90 fl_computed_ = true;
91 return *this;
92 }
93
95 vals_.w1 = w1;
96 return *this;
97 }
98
100 vals_.w2 = w2;
101 return *this;
102 }
103
105 vals_.fe = fe;
106 return *this;
107 }
108
110 vals_.fm = fm;
111 return *this;
112 }
113
114 double Parameterisation::tau(double xbj, double q2) const { return 4. * xbj * xbj * mp2_ / q2; }
115
116 double Parameterisation::gamma2(double xbj, double q2) const { return 1. + tau(xbj, q2); }
117
119 if (fl_computed_)
120 return *this;
121 if (!r_ratio_)
122 throw CG_FATAL("StructureFunctions:FL") << "Failed to retrieve a R-ratio calculator!";
123 double r_error; // so far, nothing is done with the error propagation
124 return computeFL(xbj, q2, (*r_ratio_)(xbj, q2, r_error));
125 }
126
127 Parameterisation& Parameterisation::computeFL(double xbj, double q2, double r) {
128 if (!fl_computed_)
129 setFL(vals_.f2 * gamma2(xbj, q2) * (r / (1. + r)));
130 return *this;
131 }
132
133 std::ostream& operator<<(std::ostream& os, const Parameterisation& sf) {
134 os << sf.description().description();
135 if (sf.args_.valid())
136 os << " at " << sf.args_ << ": " << sf.vals_;
137 return os;
138 }
139
140 std::ostream& operator<<(std::ostream& os, const Parameterisation::Arguments& args) {
141 return os << "(" << args.xbj << ", " << args.q2 << ")";
142 }
143
144 std::ostream& operator<<(std::ostream& os, const Parameterisation::Values& vals) {
145 return os << "F2 = " << vals.f2 << ", FL = " << vals.fl;
146 }
147
149 auto desc = ParametersDescription();
150 desc.setDescription("Unnamed structure functions parameterisation");
151 desc.add<ParametersDescription>("sigmaRatio", SigmaRatiosFactory::get().describeParameters("SibirtsevBlunden"))
152 .setDescription("Modelling for the sigma(L/T) ratio used in FL computation from F2");
153 return desc;
154 }
155 } // namespace strfun
156} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
#define CG_WARNING(mod)
Definition Message.h:228
#define CG_DEBUG(mod)
Definition Message.h:220
Base runtime module object.
Definition NamedModule.h:28
A singleton holding all physics constants associated to particles.
Definition PDG.h:28
A description object for parameters collection.
const std::string & description() const
Description of this parameter (or parameters collection)
std::string describe(size_t offset=0) const
Human-readable description of parameters and their default value.
ParametersList params_
Module parameters.
Definition Steerable.h:50
Base object for the parameterisation of nucleon structure functions.
double gamma2(double xbj, double q2) const
Dimensionless variable .
Parameterisation & setFE(double fe)
Parameterisation & clear()
Reset the structure functions values.
virtual Parameterisation & computeFL(double xbj, double q2)
Compute the longitudinal structure function for a given point.
Arguments args_
Last couple computed.
Parameterisation & setF2(double f2)
double tau(double xbj, double q2) const
Compute the dimensionless variable .
Parameterisation & setW2(double w2)
double W1(double xbj, double q2)
Longitudinal form factor.
const double mp2_
Squared proton mass, in GeV^2/c^4.
double W2(double xbj, double q2)
double FE(double xbj, double q2)
Electric proton form factor.
double F2(double xbj, double q2)
Transverse structure function.
virtual void eval()=0
Local structure functions evaluation method.
Parameterisation(const ParametersList &)
Parameterisation & setF1F2(double f1, double f2)
double F1(double xbj, double q2)
structure function
double FM(double xbj, double q2)
Magnetic proton form factor.
static ParametersDescription description()
Generic description for the structure functions.
Parameterisation & operator()(double, double)
Compute all relevant structure functions for a given couple.
Parameterisation & setFM(double fm)
Parameterisation & setFL(double fl)
Parameterisation & setW1(double w1)
double FL(double xbj, double q2)
Longitudinal structure function.
std::ostream & operator<<(std::ostream &os, const Parameterisation &sf)
Common namespace for this Monte Carlo generator.
double fe
Electric proton form factor.
double fm
Magnetic proton form factor.
double fl
Last computed longitudinal structure function value.
double f2
Last computed transverse structure function value.
double w1
Longitudinal form factor.