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
21
#include "
CepGen/FormFactors/Parameterisation.h
"
22
#include "
CepGen/Physics/PDG.h
"
23
24
namespace
cepgen
{
25
namespace
formfac {
26
Parameterisation::Parameterisation
(
const
ParametersList
& params)
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
35
const
FormFactors
&
Parameterisation::operator()
(
double
q2) {
36
if
(q2 < 0.)
37
ff_
=
FormFactors
{};
38
else
if
(q2 !=
q2_
) {
39
q2_
= q2;
40
eval
();
41
}
42
return
ff_
;
43
}
44
45
ParametersDescription
Parameterisation::description
() {
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
Parameterisation.h
PDG.h
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::NamedModule::name
const std::string & name() const
Module unique indexing name.
Definition
NamedModule.h:42
cepgen::PDG
A singleton holding all physics constants associated to particles.
Definition
PDG.h:28
cepgen::PDG::proton
@ proton
Definition
PDG.h:50
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::formfac::Parameterisation
Nucleon electromagnetic form factors parameterisation.
Definition
Parameterisation.h:29
cepgen::formfac::Parameterisation::tau
double tau(double q2) const
variable definition
Definition
Parameterisation.cpp:33
cepgen::formfac::Parameterisation::operator()
virtual const FormFactors & operator()(double)
Compute all form factors for a given value.
Definition
Parameterisation.cpp:35
cepgen::formfac::Parameterisation::setFEFM
void setFEFM(double fe, double fm)
Set the electromagnetic form factors.
Definition
Parameterisation.cpp:52
cepgen::formfac::Parameterisation::setGEGM
void setGEGM(double ge, double gm)
Set the Sachs form factors.
Definition
Parameterisation.cpp:60
cepgen::formfac::Parameterisation::eval
virtual void eval()=0
Local form factors evaluation method.
cepgen::formfac::Parameterisation::ff_
FormFactors ff_
Last form factors computed.
Definition
Parameterisation.h:56
cepgen::formfac::Parameterisation::Parameterisation
Parameterisation(const ParametersList &)
Definition
Parameterisation.cpp:26
cepgen::formfac::Parameterisation::description
static ParametersDescription description()
Definition
Parameterisation.cpp:45
cepgen::formfac::Parameterisation::mass2_
const double mass2_
Incoming beam squared mass.
Definition
Parameterisation.h:51
cepgen::formfac::Parameterisation::q2_
double q2_
Virtuality at which the form factors are evaluated.
Definition
Parameterisation.h:55
cepgen::formfac::FormFactors::GE
double GE
Sachs electric form factor.
Definition
FormFactors.h:29
cepgen::formfac::FormFactors::GM
double GM
Sachs magnetic form factor.
Definition
FormFactors.h:30
cepgen::formfac::operator<<
std::ostream & operator<<(std::ostream &os, const Parameterisation &ff)
Definition
Parameterisation.cpp:70
cepgen::formfac::FormFactors::FE
double FE
Electric form factor.
Definition
FormFactors.h:27
cepgen::formfac::FormFactors::FM
double FM
Magnetic form factor.
Definition
FormFactors.h:28
cepgen::formfac::FormFactors
Form factors values.
Definition
FormFactors.h:26
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::pdgid_t
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
Definition
ParticleProperties.h:26
CepGen
FormFactors
Parameterisation.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7