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 "
CepGen/Core/Exception.h
"
20
#include "
CepGen/Core/ParametersList.h
"
21
#include "
CepGen/Modules/StructureFunctionsFactory.h
"
22
#include "
CepGen/Physics/PDG.h
"
23
#include "
CepGen/StructureFunctions/Parameterisation.h
"
24
25
namespace
cepgen
{
26
namespace
strfun {
27
Parameterisation::Parameterisation
(
const
ParametersList
& params)
28
:
NamedModule
(params),
29
r_ratio_(SigmaRatiosFactory::get().build(steer<
ParametersList
>(
"sigmaRatio"
))),
30
mp_(
PDG
::get().mass(
PDG
::proton)),
31
mp2_(mp_ * mp_),
32
mx_min_(mp_ +
PDG
::get().mass(
PDG
::piZero)) {
33
CG_DEBUG
(
"Parameterisation"
) <<
"Structure functions parameterisation to be built using following parameters:\n"
34
<<
ParametersDescription
(
params_
).
describe
(
true
);
35
}
36
37
Parameterisation
&
Parameterisation::operator()
(
double
xbj,
double
q2) {
38
const
auto
args =
Arguments
{xbj, q2};
39
if
(args ==
args_
)
40
return
*
this
;
41
clear
();
42
if
(!args.valid()) {
43
CG_WARNING
(
"StructureFunctions"
) <<
"Invalid range for Q² = "
<< q2 <<
" or xBj = "
<< xbj <<
"."
;
44
return
*
this
;
45
}
46
args_
= args;
47
eval
();
48
return
*
this
;
49
}
50
51
Parameterisation
&
Parameterisation::clear
() {
52
vals_.
clear
();
53
fl_computed_ =
false
;
54
return
*
this
;
55
}
56
57
double
Parameterisation::F2
(
double
xbj,
double
q2) {
return
operator()
(xbj, q2).vals_.
f2
; }
58
59
double
Parameterisation::FL
(
double
xbj,
double
q2) {
60
if
(!fl_computed_)
61
computeFL
(xbj, q2);
62
return
operator()
(xbj, q2).vals_.
fl
;
63
}
64
65
double
Parameterisation::W1
(
double
xbj,
double
q2) {
return
operator()
(xbj, q2).vals_.
w1
; }
66
67
double
Parameterisation::W2
(
double
xbj,
double
q2) {
return
operator()
(xbj, q2).vals_.
w2
; }
68
69
double
Parameterisation::FE
(
double
xbj,
double
q2) {
return
operator()
(xbj, q2).vals_.
fe
; }
70
71
double
Parameterisation::FM
(
double
xbj,
double
q2) {
return
operator()
(xbj, q2).vals_.
fm
; }
72
73
double
Parameterisation::F1
(
double
xbj,
double
q2) {
74
return
0.5 * (
gamma2
(xbj, q2) *
F2
(xbj, q2) -
FL
(xbj, q2)) / xbj;
75
}
76
77
Parameterisation
&
Parameterisation::setF1F2
(
double
f1,
double
f2) {
78
return
(*
this
)
79
.
setF2
(f2)
// trivial
80
.
setFL
(
gamma2
(
args_
.
xbj
,
args_
.
q2
) * vals_.
f2
- 2. * f1 *
args_
.
xbj
);
81
}
82
83
Parameterisation
&
Parameterisation::setF2
(
double
f2) {
84
vals_.
f2
= f2;
85
return
*
this
;
86
}
87
88
Parameterisation
&
Parameterisation::setFL
(
double
fl) {
89
vals_.
fl
= fl;
90
fl_computed_ =
true
;
91
return
*
this
;
92
}
93
94
Parameterisation
&
Parameterisation::setW1
(
double
w1) {
95
vals_.
w1
= w1;
96
return
*
this
;
97
}
98
99
Parameterisation
&
Parameterisation::setW2
(
double
w2) {
100
vals_.
w2
= w2;
101
return
*
this
;
102
}
103
104
Parameterisation
&
Parameterisation::setFE
(
double
fe) {
105
vals_.
fe
= fe;
106
return
*
this
;
107
}
108
109
Parameterisation
&
Parameterisation::setFM
(
double
fm) {
110
vals_.
fm
= fm;
111
return
*
this
;
112
}
113
114
double
Parameterisation::tau
(
double
xbj,
double
q2)
const
{
return
4. * xbj * xbj *
mp2_
/ q2; }
115
116
double
Parameterisation::gamma2
(
double
xbj,
double
q2)
const
{
return
1. +
tau
(xbj, q2); }
117
118
Parameterisation
&
Parameterisation::computeFL
(
double
xbj,
double
q2) {
119
if
(fl_computed_)
120
return
*
this
;
121
if
(!r_ratio_)
122
throw
CG_FATAL
(
"StructureFunctions:FL"
) <<
"Failed to retrieve a R-ratio calculator!"
;
123
double
r_error;
// so far, nothing is done with the error propagation
124
return
computeFL
(xbj, q2, (*r_ratio_)(xbj, q2, r_error));
125
}
126
127
Parameterisation
&
Parameterisation::computeFL
(
double
xbj,
double
q2,
double
r) {
128
if
(!fl_computed_)
129
setFL
(vals_.
f2
*
gamma2
(xbj, q2) * (r / (1. + r)));
130
return
*
this
;
131
}
132
133
std::ostream&
operator<<
(std::ostream& os,
const
Parameterisation
& sf) {
134
os << sf.
description
().
description
();
135
if
(sf.
args_
.
valid
())
136
os <<
" at "
<< sf.
args_
<<
": "
<< sf.vals_;
137
return
os;
138
}
139
140
std::ostream&
operator<<
(std::ostream& os,
const
Parameterisation::Arguments
& args) {
141
return
os <<
"("
<< args.
xbj
<<
", "
<< args.
q2
<<
")"
;
142
}
143
144
std::ostream&
operator<<
(std::ostream& os,
const
Parameterisation::Values
& vals) {
145
return
os <<
"F2 = "
<< vals.
f2
<<
", FL = "
<< vals.
fl
;
146
}
147
148
ParametersDescription
Parameterisation::description
() {
149
auto
desc =
ParametersDescription
();
150
desc.setDescription(
"Unnamed structure functions parameterisation"
);
151
desc.add<
ParametersDescription
>(
"sigmaRatio"
, SigmaRatiosFactory::get().describeParameters(
"SibirtsevBlunden"
))
152
.setDescription(
"Modelling for the sigma(L/T) ratio used in FL computation from F2"
);
153
return
desc;
154
}
155
}
// namespace strfun
156
}
// namespace cepgen
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
CG_WARNING
#define CG_WARNING(mod)
Definition
Message.h:228
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
PDG.h
ParametersList.h
StructureFunctionsFactory.h
Parameterisation.h
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::PDG
A singleton holding all physics constants associated to particles.
Definition
PDG.h:28
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersDescription::description
const std::string & description() const
Description of this parameter (or parameters collection)
Definition
ParametersDescription.h:51
cepgen::ParametersDescription::describe
std::string describe(size_t offset=0) const
Human-readable description of parameters and their default value.
Definition
ParametersDescription.cpp:96
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::Steerable::params_
ParametersList params_
Module parameters.
Definition
Steerable.h:50
cepgen::strfun::Parameterisation
Base object for the parameterisation of nucleon structure functions.
Definition
Parameterisation.h:30
cepgen::strfun::Parameterisation::gamma2
double gamma2(double xbj, double q2) const
Dimensionless variable .
Definition
Parameterisation.cpp:116
cepgen::strfun::Parameterisation::setFE
Parameterisation & setFE(double fe)
Definition
Parameterisation.cpp:104
cepgen::strfun::Parameterisation::clear
Parameterisation & clear()
Reset the structure functions values.
Definition
Parameterisation.cpp:51
cepgen::strfun::Parameterisation::computeFL
virtual Parameterisation & computeFL(double xbj, double q2)
Compute the longitudinal structure function for a given point.
Definition
Parameterisation.cpp:118
cepgen::strfun::Parameterisation::args_
Arguments args_
Last couple computed.
Definition
Parameterisation.h:109
cepgen::strfun::Parameterisation::setF2
Parameterisation & setF2(double f2)
Definition
Parameterisation.cpp:83
cepgen::strfun::Parameterisation::tau
double tau(double xbj, double q2) const
Compute the dimensionless variable .
Definition
Parameterisation.cpp:114
cepgen::strfun::Parameterisation::setW2
Parameterisation & setW2(double w2)
Definition
Parameterisation.cpp:99
cepgen::strfun::Parameterisation::W1
double W1(double xbj, double q2)
Longitudinal form factor.
Definition
Parameterisation.cpp:65
cepgen::strfun::Parameterisation::mp2_
const double mp2_
Squared proton mass, in GeV^2/c^4.
Definition
Parameterisation.h:106
cepgen::strfun::Parameterisation::W2
double W2(double xbj, double q2)
Definition
Parameterisation.cpp:67
cepgen::strfun::Parameterisation::FE
double FE(double xbj, double q2)
Electric proton form factor.
Definition
Parameterisation.cpp:69
cepgen::strfun::Parameterisation::F2
double F2(double xbj, double q2)
Transverse structure function.
Definition
Parameterisation.cpp:57
cepgen::strfun::Parameterisation::eval
virtual void eval()=0
Local structure functions evaluation method.
cepgen::strfun::Parameterisation::Parameterisation
Parameterisation(const ParametersList &)
Definition
Parameterisation.cpp:27
cepgen::strfun::Parameterisation::setF1F2
Parameterisation & setF1F2(double f1, double f2)
Definition
Parameterisation.cpp:77
cepgen::strfun::Parameterisation::F1
double F1(double xbj, double q2)
structure function
Definition
Parameterisation.cpp:73
cepgen::strfun::Parameterisation::FM
double FM(double xbj, double q2)
Magnetic proton form factor.
Definition
Parameterisation.cpp:71
cepgen::strfun::Parameterisation::description
static ParametersDescription description()
Generic description for the structure functions.
Definition
Parameterisation.cpp:148
cepgen::strfun::Parameterisation::operator()
Parameterisation & operator()(double, double)
Compute all relevant structure functions for a given couple.
Definition
Parameterisation.cpp:37
cepgen::strfun::Parameterisation::setFM
Parameterisation & setFM(double fm)
Definition
Parameterisation.cpp:109
cepgen::strfun::Parameterisation::setFL
Parameterisation & setFL(double fl)
Definition
Parameterisation.cpp:88
cepgen::strfun::Parameterisation::setW1
Parameterisation & setW1(double w1)
Definition
Parameterisation.cpp:94
cepgen::strfun::Parameterisation::FL
double FL(double xbj, double q2)
Longitudinal structure function.
Definition
Parameterisation.cpp:59
cepgen::strfun::operator<<
std::ostream & operator<<(std::ostream &os, const Parameterisation &sf)
Definition
Parameterisation.cpp:133
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::strfun::Parameterisation::Arguments
Definition
Parameterisation.h:56
cepgen::strfun::Parameterisation::Arguments::valid
bool valid() const
Definition
Parameterisation.h:58
cepgen::strfun::Parameterisation::Arguments::xbj
double xbj
Definition
Parameterisation.h:60
cepgen::strfun::Parameterisation::Arguments::q2
double q2
Definition
Parameterisation.h:60
cepgen::strfun::Parameterisation::Values
Definition
Parameterisation.h:62
cepgen::strfun::Parameterisation::Values::fe
double fe
Electric proton form factor.
Definition
Parameterisation.h:72
cepgen::strfun::Parameterisation::Values::fm
double fm
Magnetic proton form factor.
Definition
Parameterisation.h:73
cepgen::strfun::Parameterisation::Values::fl
double fl
Last computed longitudinal structure function value.
Definition
Parameterisation.h:67
cepgen::strfun::Parameterisation::Values::f2
double f2
Last computed transverse structure function value.
Definition
Parameterisation.h:66
cepgen::strfun::Parameterisation::Values::clear
void clear()
Definition
Parameterisation.h:63
cepgen::strfun::Parameterisation::Values::w1
double w1
Longitudinal form factor.
Definition
Parameterisation.h:70
cepgen::strfun::Parameterisation::Values::w2
double w2
Definition
Parameterisation.h:71
CepGen
StructureFunctions
Parameterisation.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7