cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
CollinearFlux.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2022-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 <LHAPDF/LHAPDF.h>
20
21
#include <numeric>
22
23
#include "
CepGen/CollinearFluxes/CollinearFlux.h
"
24
#include "
CepGen/Core/Exception.h
"
25
#include "
CepGen/Modules/PartonFluxFactory.h
"
26
#include "
CepGen/Physics/PDG.h
"
27
28
namespace
cepgen
{
29
namespace
lhapdf
{
30
class
CollinearFlux
final :
public
cepgen::CollinearFlux
{
31
public
:
32
explicit
CollinearFlux
(
const
ParametersList
& params)
33
:
cepgen
::
CollinearFlux
(params),
34
pdf_(LHAPDF::mkPDF(
steer
<std::string>(
"set"
),
steer
<int>(
"member"
))),
35
pdgid_(
steerAs
<int,
pdgid_t
>(
"partonPdgId"
)),
36
extrapolate_pdf_(
steer
<bool>(
"extrapolatePDF"
)) {
37
const
auto
& pdf_set = steer<std::string>(
"set"
);
38
if
(!pdf_)
39
throw
CG_FATAL
(
"lhapdf:CollinearFlux"
) <<
"Failed to initialise the LHAPDF evaluator!\n"
40
<<
"Parameters: "
<<
params_
;
41
if
(extrapolate_pdf_ && pdf_->hasFlavor(pdgid_))
42
CG_WARNING
(
"lhapdf:CollinearFlux"
) <<
"Asked to retrieve distribution from sum imbalance of other "
43
"contributions although the distribution is present in the '"
44
<< pdf_set <<
"' PDF set.\n\t"
45
<<
"You may want to steer the 'extrapolatePDF' parameter to 'false'?"
;
46
if
(!extrapolate_pdf_ && !pdf_->hasFlavor(pdgid_))
47
throw
CG_FATAL
(
"lhapdf:CollinearFlux"
)
48
<<
"PDF set '"
<< pdf_set <<
"' does not contain parton with PDG identifier="
<< pdgid_ <<
"!\n"
49
<<
"PDGs handled: "
<< pdf_->flavors() <<
"."
;
50
51
CG_INFO
(
"lhapdf:CollinearFlux"
) <<
"LHAPDF evaluator for collinear parton ("
<< (
PDG::Id
)pdgid_
52
<<
") flux initialised.\n\t"
53
<<
"PDF set: "
<< steer<std::string>(
"set"
) <<
" (flavours: "
<< pdf_->flavors()
54
<<
"), member: "
<< steer<int>(
"member"
) <<
".\n\t"
55
<<
"x range: "
<<
Limits
{pdf_->xMin(), pdf_->xMax()} <<
", "
56
<<
"Q^2 range: "
<<
Limits
{pdf_->q2Min(), pdf_->q2Max()} <<
" GeV^2.\n\t"
57
<<
"Extrapolated from other flavours? "
<< extrapolate_pdf_ <<
"."
;
58
}
59
60
static
ParametersDescription
description
() {
61
auto
desc =
cepgen::CollinearFlux::description
();
62
desc.setDescription(
"LHAPDF coll.flux"
);
63
desc.add<std::string>(
"set"
,
"LUXqed17_plus_PDF4LHC15_nnlo_100"
).setDescription(
"PDFset to use"
);
64
desc.add<
int
>(
"member"
, 0).setDescription(
"PDF member"
);
65
desc.addAs<int,
pdgid_t
>(
"partonPdgId"
,
PDG::photon
).setDescription(
"parton PDG identifier"
);
66
desc.add<
bool
>(
"extrapolatePDF"
,
false
)
67
.setDescription(
"has the PDF? or extrapolate distribution from sum imbalance of other contributions?"
);
68
return
desc;
69
}
70
71
pdgid_t
partonPdgId
()
const override
{
return
pdgid_; }
72
bool
fragmenting
()
const override
{
return
true
; }
73
double
mass2
()
const override
{
return
mp2_
; }
74
75
double
fluxQ2
(
double
x,
double
q2)
const override
{
76
if
(x == 0. || !pdf_->inPhysicalRangeXQ2(x, q2))
77
return
0.;
78
if
(!extrapolate_pdf_)
// has parton PDF
79
return
pdf_->xfxQ2((
int
)pdgid_, x, q2);
80
// extrapolate from other flavours imbalance
81
double
xf = 1.;
82
for
(
const
auto
& flav : pdf_->xfxQ2(x, q2))
83
if
(flav.first != (
int
)pdgid_)
84
xf -= flav.second;
85
return
xf;
86
}
87
88
private
:
89
const
std::unique_ptr<LHAPDF::PDF> pdf_;
90
const
pdgid_t
pdgid_;
91
const
bool
extrapolate_pdf_;
92
};
93
}
// namespace lhapdf
94
}
// namespace cepgen
95
using
LHAPDFCollinearFlux
=
cepgen::lhapdf::CollinearFlux
;
96
REGISTER_COLLINEAR_FLUX
(
"lhapdf"
,
LHAPDFCollinearFlux
);
CollinearFlux.h
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
CG_WARNING
#define CG_WARNING(mod)
Definition
Message.h:228
CG_INFO
#define CG_INFO(mod)
Definition
Message.h:216
PDG.h
PartonFluxFactory.h
REGISTER_COLLINEAR_FLUX
#define REGISTER_COLLINEAR_FLUX(name, obj)
Add a generic collinear parton flux evaluator builder definition.
Definition
PartonFluxFactory.h:25
cepgen::CollinearFlux
Definition
CollinearFlux.h:25
cepgen::CollinearFlux::description
static ParametersDescription description()
Definition
CollinearFlux.cpp:25
cepgen::Limits
Validity interval for a variable.
Definition
Limits.h:28
cepgen::PDG::Id
A class-in-the-middle PDG identifier for printout operations.
Definition
PDG.h:55
cepgen::PDG::photon
@ photon
Definition
PDG.h:41
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::PartonFlux::mp2_
const double mp2_
Definition
PartonFlux.h:39
cepgen::Steerable::steerAs
U steerAs(const std::string &key) const
Retrieve a recasted parameters as previously steered.
Definition
Steerable.h:44
cepgen::Steerable::params_
ParametersList params_
Module parameters.
Definition
Steerable.h:50
cepgen::Steerable::steer
T steer(const std::string &key) const
Retrieve a parameters as previously steered.
Definition
Steerable.h:39
cepgen::lhapdf::CollinearFlux
Definition
CollinearFlux.cpp:30
cepgen::lhapdf::CollinearFlux::fragmenting
bool fragmenting() const override
Is initiator particle fragmenting after parton emission?
Definition
CollinearFlux.cpp:72
cepgen::lhapdf::CollinearFlux::fluxQ2
double fluxQ2(double x, double q2) const override
Compute the collinear flux for this x value and virtuality.
Definition
CollinearFlux.cpp:75
cepgen::lhapdf::CollinearFlux::description
static ParametersDescription description()
Definition
CollinearFlux.cpp:60
cepgen::lhapdf::CollinearFlux::CollinearFlux
CollinearFlux(const ParametersList ¶ms)
Definition
CollinearFlux.cpp:32
cepgen::lhapdf::CollinearFlux::partonPdgId
pdgid_t partonPdgId() const override
Parton PDG identifier.
Definition
CollinearFlux.cpp:71
cepgen::lhapdf::CollinearFlux::mass2
double mass2() const override
Initiator particle squared mass (in )
Definition
CollinearFlux.cpp:73
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
output.lhapdf
lhapdf
Definition
output.py:3
CepGenAddOns
LHAPDFWrapper
CollinearFlux.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7