cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
BodekKangXu.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 <cmath>
20
25
26namespace cepgen {
27 namespace strfun {
30 public:
31 explicit BodekKangXu(const ParametersList& params)
32 : Parameterisation(params),
33 constants_(steer<std::vector<double> >("constants")),
34 pi_em_sq_(constants_.empty() ? 0. : std::pow(constants_.at(0) - mp_, 2.)),
35 spins_(steer<std::vector<int> >("spins")),
36 r_(steer<double>("r")) {
37 if (constants_.size() != 24)
38 throw CG_FATAL("BodekKangXu") << "Invalid parameters multiplicity given. Should have size 24, has size "
39 << constants_.size() << ".";
40 }
41
44 desc.setDescription("Bodek, Kang, and Xu");
45 desc.add<std::vector<double> >(
46 "constants",
47 {1.0741163, 0.75531124, 3.3506491, 1.7447015, 3.5102405, 1.040004, 1.2299128, 0.10625394,
48 0.48132786, 1.5101467, 0.081661975, 0.65587179, 1.7176216, 0.12551987, 0.7473379, 1.953819,
49 0.19891522, -0.17498537, 0.0096701919, -0.035256748, 3.5185207, -0.59993696, 4.7615828, 0.41167589});
50 desc.add<std::vector<int> >("spins", {1, 2, 3, 2});
51 desc.add<double>("r", 0.18);
52 desc.add<double>("q0", 1.);
53 return desc;
54 }
55
56 void eval() override {
57 const auto mx2 = utils::mX2(args_.xbj, args_.q2, mp2_);
58 if (mx2 < mp2_) {
59 setF1F2(0., 0.);
60 return;
61 }
62 const auto q0 = 0.5 * args_.q2 / mp_ / args_.xbj;
63 const auto w2h = gp_h(q0, args_.q2) * bodek(std::sqrt(mx2), args_.q2) / q0,
64 w1h = (1. + q0 * q0 / args_.q2) / (1. + r_) * w2h;
65 setF1F2(mp_ * w1h, q0 * w2h);
66 }
67
68 private:
69 double gp_h(float q0, float q2) const {
70 const auto gi = 2. * mp_ * q0;
71 const auto ww = (gi + 1.642) / (q2 + 0.376), t = 1. - 1. / ww;
72 const auto wp = 0.256 * std::pow(t, 3.) + 2.178 * std::pow(t, 4.) + 0.898 * std::pow(t, 5.) -
73 6.716 * std::pow(t, 6.) + 3.756 * std::pow(t, 7.);
74 return wp * ww * q2 / gi;
75 }
76 double bodek(double w, double q2) const {
77 const size_t NRES = 4, NBKG = 5;
78
79 if (w <= mp_)
80 return 0.;
81 const auto w2 = w * w;
82 const auto omega = 1. + (w2 - mp2_) / q2, x = 1. / omega;
83 const auto xpx = constants_.at(21) + constants_.at(22) * std::pow(x - constants_.at(23), 2.);
84
85 auto b1 = 0., b2 = 0.;
86 if (w != constants_.at(0))
87 b1 = std::max(0., w - constants_.at(0)) / (w - constants_.at(0)) * constants_.at(1);
88 const auto eb1 = constants_.at(2) * (w - constants_.at(0));
89
90 if (eb1 <= 25.) {
91 b1 *= (1. - exp(-eb1));
92 b2 = 0.;
93 }
94 if (w != constants_.at(3))
95 b2 = std::max(0., w - constants_.at(3)) / (w - constants_.at(3)) * (1. - constants_.at(1));
96
97 const auto eb2 = constants_.at(4) * (w2 - std::pow(constants_.at(3), 2.));
98
99 if (eb2 <= 25.)
100 b2 *= (1. - exp(-eb2));
101
102 const auto BBKG = b1 + b2, BRES = constants_.at(1) + b2;
103
104 auto ressum = 0.;
105 for (size_t i = 0; i < NRES; ++i) {
106 const size_t index = i * 3 + 1 + NBKG;
107 auto ram = constants_.at(index), rma = constants_.at(index + 1), rwd = constants_.at(index + 2);
108 if (i == 0)
109 ram += constants_.at(17) * q2 + constants_.at(18) * q2 * q2;
110 if (i == 2)
111 rma *= (1. + constants_.at(19) / (1. + constants_.at(20) * q2));
112 const auto qstarn = std::sqrt(std::max(0., std::pow((w2 + mp2_ - pi_em_sq_) / (2. * w), 2.) - mp2_));
113 const auto qstar0 =
114 std::sqrt(std::max(0., std::pow((rma * rma - mp2_ + pi_em_sq_) / (2. * rma), 2.) - pi_em_sq_));
115 if (qstar0 <= 1.e-10)
116 continue;
117
118 const auto term = prefactor_ * qstarn, term0 = prefactor_ * qstar0;
119 const size_t j = 2 * spins_.at(i);
120 const auto gamres =
121 0.5 * (rwd * std::pow(term / term0, j + 1) * (1. + std::pow(term0, j)) / (1. + std::pow(term, j)));
122 const auto brwig = M_1_PI * gamres / (std::pow(w - rma, 2.) + std::pow(gamres, 2.));
123 ressum += ram * brwig / 2. / mp_;
124 }
125
126 return BBKG * (1. + (1. - BBKG) * xpx) + ressum * (1. - BRES);
127 }
128 const std::vector<double> constants_;
129 const double pi_em_sq_;
130 const std::vector<int> spins_;
131 const double r_;
132 static constexpr double prefactor_ = 6.08974;
133 };
134 } // namespace strfun
135} // namespace cepgen
137REGISTER_STRFUN("BodekKangXu", 304, BodekKangXu);
#define CG_FATAL(mod)
Definition Exception.h:61
#define REGISTER_STRFUN(name, id, obj)
Add a structure functions 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
modelling by Bodek, Kang, and Xu
static ParametersDescription description()
BodekKangXu(const ParametersList &params)
void eval() override
Local structure functions evaluation method.
Base object for the parameterisation of nucleon structure functions.
Arguments args_
Last couple computed.
const double mp2_
Squared proton mass, in GeV^2/c^4.
Parameterisation & setF1F2(double f1, double f2)
static ParametersDescription description()
Generic description for the structure functions.
const double mp_
Proton mass, in GeV/c^2.
double mX2(double xbj, double q2, double mp2)
Compute the diffractive mass from virtuality/Bjorken x.
Definition Utils.cpp:29
Common namespace for this Monte Carlo generator.