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
19#include <cmath>
20
22#include "CepGen/Physics/PDG.h"
23
24namespace cepgen {
25 namespace formfac {
27 : NamedModule(params),
28 pdg_id_(steer<pdgid_t>("pdgId")),
29 mass2_(std::pow(PDG::get().mass(pdg_id_), 2)),
30 mp_(PDG::get().mass(PDG::proton)),
31 mp2_(mp_ * mp_) {}
32
33 double Parameterisation::tau(double q2) const { return 0.25 * q2 / mass2_; }
34
36 if (q2 < 0.)
37 ff_ = FormFactors{};
38 else if (q2 != q2_) {
39 q2_ = q2;
40 eval();
41 }
42 return ff_;
43 }
44
46 auto desc = ParametersDescription();
47 desc.setDescription("Unnamed form factors parameterisation");
48 desc.add<pdgid_t>("pdgId", PDG::proton);
49 return desc;
50 }
51
52 void Parameterisation::setFEFM(double fe, double fm) {
53 ff_.FE = fe;
54 ff_.FM = fm;
55 ff_.GM = std::sqrt(ff_.FM);
56 const auto ta = tau(q2_);
57 ff_.GE = std::sqrt((1. + ta) * ff_.FE - ta * ff_.FM);
58 }
59
60 void Parameterisation::setGEGM(double ge, double gm) {
61 ff_.GE = ge;
62 ff_.GM = gm;
63 ff_.FM = ff_.GM * ff_.GM;
64 const auto ta = tau(q2_);
65 ff_.FE = (ff_.GE * ff_.GE + ta * ff_.FM) / (1. + ta);
66 }
67
68 //------------------------------------------------------------------
69
70 std::ostream& operator<<(std::ostream& os, const Parameterisation& ff) {
71 os << ff.name();
72 if (ff.q2_ >= 0.)
73 os << "(Q^2=" << ff.q2_ << " GeV^2): " << ff.ff_;
74 return os;
75 }
76
77 std::ostream& operator<<(std::ostream& os, const FormFactors& ff) {
78 return os << "FE=" << ff.FE << ", FM=" << ff.FM << ", GE=" << ff.GE << ", GM=" << ff.GM;
79 }
80 } // namespace formfac
81} // namespace cepgen
Base runtime module object.
Definition NamedModule.h:28
const std::string & name() const
Module unique indexing name.
Definition NamedModule.h:42
A singleton holding all physics constants associated to particles.
Definition PDG.h:28
@ proton
Definition PDG.h:50
A description object for parameters collection.
Nucleon electromagnetic form factors parameterisation.
double tau(double q2) const
variable definition
virtual const FormFactors & operator()(double)
Compute all form factors for a given value.
void setFEFM(double fe, double fm)
Set the electromagnetic form factors.
void setGEGM(double ge, double gm)
Set the Sachs form factors.
virtual void eval()=0
Local form factors evaluation method.
FormFactors ff_
Last form factors computed.
Parameterisation(const ParametersList &)
static ParametersDescription description()
const double mass2_
Incoming beam squared mass.
double q2_
Virtuality at which the form factors are evaluated.
double GE
Sachs electric form factor.
Definition FormFactors.h:29
double GM
Sachs magnetic form factor.
Definition FormFactors.h:30
std::ostream & operator<<(std::ostream &os, const Parameterisation &ff)
double FE
Electric form factor.
Definition FormFactors.h:27
double FM
Magnetic form factor.
Definition FormFactors.h:28
Form factors values.
Definition FormFactors.h:26
Common namespace for this Monte Carlo generator.
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.