cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
InelasticNucleon.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
29
30namespace cepgen {
31 namespace formfac {
33 public:
34 explicit InelasticNucleon(const ParametersList& params)
35 : Parameterisation(params),
36 sf_(StructureFunctionsFactory::get().build(steer<ParametersList>("structureFunctions"))),
37 integr_(AnalyticIntegratorFactory::get().build(steer<ParametersList>("integrator"))),
38 compute_fm_(steer<bool>("computeFM")),
39 mx_range_(steer<Limits>("mxRange")),
40 mx2_range_{mx_range_.min() * mx_range_.min(), mx_range_.max() * mx_range_.max()},
41 dm2_range_{mx2_range_.min() - mp2_, mx2_range_.max() - mp2_},
42 eval_fe_([this](double mx2) {
43 const auto xbj = utils::xBj(q2_, mp2_, mx2);
44 return sf_->F2(xbj, q2_) * xbj;
45 }),
46 eval_fm_([this](double mx2) {
47 const auto xbj = utils::xBj(q2_, mp2_, mx2);
48 return sf_->F2(xbj, q2_) / xbj;
49 }) {
50 CG_INFO("InelasticNucleon") << "Inelastic nucleon form factors parameterisation built with:\n"
51 << " * structure functions modelling: "
52 << steer<ParametersList>("structureFunctions") << "\n"
53 << " * integrator algorithm: " << steer<ParametersList>("integrator") << "\n"
54 << " * diffractive mass range: " << steer<Limits>("mxRange") << " GeV^2.";
55 }
56
59 desc.setDescription("Proton inelastic (SF)");
60 desc.add<ParametersDescription>("structureFunctions",
61 StructureFunctionsFactory::get().describeParameters("LUXLike"))
62 .setDescription("type of structure functions parameterisation for the dissociative emission");
63 desc.add<ParametersDescription>("integrator", AnalyticIntegratorFactory::get().describeParameters("gsl"))
64 .setDescription("type of numerical integrator algorithm to use");
65 desc.add<bool>("computeFM", false).setDescription("compute, or neglect the F2/xbj^3 term");
66 desc.add<Limits>("mxRange", Limits{1.0732 /* mp + mpi0 */, 20.})
67 .setDescription("diffractive mass range (in GeV/c^2)");
68 return desc;
69 }
70
71 protected:
72 void eval() override {
73 const auto inv_q2 = 1. / q2_;
74 const auto fe = integr_->integrate(eval_fe_, mx2_range_) * inv_q2;
75 const auto fm = compute_fm_ ? integr_->integrate(eval_fm_, mx2_range_) * inv_q2 : 0.;
76 setFEFM(fe, fm);
77 }
78 bool fragmenting() const override { return true; }
79
80 private:
81 const std::unique_ptr<strfun::Parameterisation> sf_;
82 const std::unique_ptr<AnalyticIntegrator> integr_;
83 const double compute_fm_;
84 const Limits mx_range_, mx2_range_, dm2_range_;
85 const std::function<double(double)> eval_fe_, eval_fm_;
86 };
87 } // namespace formfac
88} // namespace cepgen
#define REGISTER_FORMFACTORS(name, obj)
Add a form factors definition to the list of handled parameterisation.
#define CG_INFO(mod)
Definition Message.h:216
Validity interval for a variable.
Definition Limits.h:28
A description object for parameters collection.
T steer(const std::string &key) const
Retrieve a parameters as previously steered.
Definition Steerable.h:39
bool fragmenting() const override
Is the nucleon surviving the exchange?
InelasticNucleon(const ParametersList &params)
static ParametersDescription description()
void eval() override
Local form factors evaluation method.
Nucleon electromagnetic form factors parameterisation.
const double mp2_
Squared proton mass, in GeV /c .
void setFEFM(double fe, double fm)
Set the electromagnetic form factors.
static ParametersDescription description()
double q2_
Virtuality at which the form factors are evaluated.
double xBj(double q2, double mp2, double mx2)
Compute Bjorken x from virtuality/diffractive mass.
Definition Utils.cpp:41
Common namespace for this Monte Carlo generator.