cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Kelly.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023 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 <cmath>
20
23
24namespace cepgen {
25 namespace formfac {
27 class Kelly final : public Parameterisation {
28 public:
29 explicit Kelly(const ParametersList& params)
30 : Parameterisation(params),
31 ae_(steer<std::vector<double> >("aE")),
32 be_(steer<std::vector<double> >("bE")),
33 am_(steer<std::vector<double> >("aM")),
34 bm_(steer<std::vector<double> >("bM")) {}
35
38 desc.setDescription("Kelly");
39 desc.add<std::vector<double> >("aE", {1., -0.24});
40 desc.add<std::vector<double> >("bE", {10.98, 12.82, 21.97});
41 desc.add<std::vector<double> >("aM", {1., 0.12});
42 desc.add<std::vector<double> >("bM", {10.97, 18.86, 6.55});
43 return desc;
44 }
45
46 private:
47 double computeFF(double tau, const std::vector<double>& as, const std::vector<double>& bs) const {
48 double num{0.}, den{1.};
49 for (size_t i = 0; i < as.size(); ++i)
50 num += as.at(i) * std::pow(tau, i);
51 for (size_t i = 0; i < bs.size(); ++i)
52 den += bs.at(i) * std::pow(tau, i + 1);
53 return num / den;
54 }
55 void eval() override {
56 const auto ta = tau(q2_);
57 setGEGM(computeFF(ta, ae_, be_), MU * computeFF(ta, am_, bm_));
58 }
59
60 const std::vector<double> ae_, be_, am_, bm_;
61 };
62 } // namespace formfac
63} // namespace cepgen
#define REGISTER_FORMFACTORS(name, obj)
Add a form factors definition to the list of handled parameterisation.
A description object for parameters collection.
T steer(const std::string &key) const
Retrieve a parameters as previously steered.
Definition Steerable.h:39
static ParametersDescription description()
Definition Kelly.cpp:36
Kelly(const ParametersList &params)
Definition Kelly.cpp:29
Nucleon electromagnetic form factors parameterisation.
double tau(double q2) const
variable definition
static constexpr double MU
Proton magnetic moment.
void setGEGM(double ge, double gm)
Set the Sachs form factors.
static ParametersDescription description()
double q2_
Virtuality at which the form factors are evaluated.
Common namespace for this Monte Carlo generator.