cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PartonicParameterisation.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023 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
21
22namespace cepgen {
23 namespace strfun {
25
27 : Parameterisation(params), num_flavours_(steer<int>("numFlavours")), mode_(steerAs<int, Mode>("mode")) {
28 if (num_flavours_ == 0 || num_flavours_ > QUARK_PDGS.size())
29 throw CG_FATAL("Partonic") << "Invalid number of flavours (" << num_flavours_ << " selected.";
30 }
31
34 desc.setDescription("Partonic structure functions parameterisation");
35 desc.add<int>("numFlavours", 4).setDescription("Number of parton flavours to consider in summation");
36 desc.add<int>("mode", (int)Mode::full);
37 return desc;
38 }
39
41 double f2 = 0.;
42 for (int i = 0; i < num_flavours_; ++i) {
43 const double prefactor = 1. / 9. * Q_TIMES_3.at(i) * Q_TIMES_3.at(i);
44 const double xq = evalxQ2(QUARK_PDGS.at(i), args_.xbj, args_.q2),
45 xqbar = evalxQ2(-QUARK_PDGS.at(i), args_.xbj, args_.q2);
46 switch (mode_) {
47 case Mode::full:
48 f2 += prefactor * (xq + xqbar);
49 break;
50 case Mode::valence:
51 f2 += prefactor * (xq - xqbar);
52 break;
53 case Mode::sea:
54 f2 += prefactor * (2. * xqbar);
55 break;
56 }
57 }
58 setF2(f2);
59 }
60
61 std::ostream& operator<<(std::ostream& os, const strfun::PartonicParameterisation::Mode& mode) {
62 switch (mode) {
64 return os << "all quarks";
66 return os << "valence quarks";
68 return os << "sea quarks";
69 }
70 return os;
71 }
72 } // namespace strfun
73} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
A description object for parameters collection.
Base object for the parameterisation of nucleon structure functions.
Arguments args_
Last couple computed.
Parameterisation & setF2(double f2)
static ParametersDescription description()
Generic description for the structure functions.
void eval() override final
Local structure functions evaluation method.
static constexpr std::array< short, 6 > QUARK_PDGS
static constexpr std::array< short, 6 > Q_TIMES_3
const unsigned short num_flavours_
Number of quark flavours considered in the SF building.
virtual double evalxQ2(int flavour, double xbj, double q2)=0
const Mode mode_
Quarks types considered in the SF building.
std::ostream & operator<<(std::ostream &os, const Parameterisation &sf)
Common namespace for this Monte Carlo generator.