cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PartonFluxFactory.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2023-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/CollinearFluxes/CollinearFlux.h
"
20
#include "
CepGen/Core/Exception.h
"
21
#include "
CepGen/KTFluxes/KTFlux.h
"
22
#include "
CepGen/Modules/PartonFluxFactory.h
"
23
#include "
CepGen/Utils/Collections.h
"
24
#include "
CepGen/Utils/String.h
"
25
26
namespace
cepgen
{
27
ParametersDescription
PartonFluxFactory::describeParameters
(
const
std::string& name,
28
const
ParametersList
& params)
const
{
29
if
(name.empty())
30
throw
CG_FATAL
(
"PartonFluxFactory:describeParameters"
) <<
"No name given to describe parton flux modelling."
;
31
if
(
utils::contains
(CollinearFluxFactory::get().modules(), name))
32
return
CollinearFluxFactory::get().describeParameters(name, params);
33
if
(
utils::contains
(KTFluxFactory::get().modules(), name))
34
return
KTFluxFactory::get().describeParameters(name, params);
35
return
ParametersDescription
().
setName
(name);
36
}
37
38
bool
PartonFluxFactory::elastic
(
const
ParametersList
& params)
const
{
39
const
auto
& name = params.
name
();
40
if
(name.empty())
41
throw
CG_FATAL
(
"PartonFluxFactory:elastic"
) <<
"No name given to get parton flux modelling elasticity."
;
42
if
(
utils::contains
(CollinearFluxFactory::get().modules(), name))
43
return
!CollinearFluxFactory::get().build(name, params)->fragmenting();
44
if
(
utils::contains
(KTFluxFactory::get().modules(), name))
45
return
!KTFluxFactory::get().build(name, params)->fragmenting();
46
throw
CG_FATAL
(
"PartonFluxFactory:elastic"
) <<
"Failed to find a parton flux with name '"
<< name <<
"'."
;
47
}
48
49
int
PartonFluxFactory::partonPdgId
(
const
ParametersList
& params)
const
{
50
const
auto
& name = params.
name
();
51
if
(name.empty())
52
throw
CG_FATAL
(
"PartonFluxFactory:partonPdgId"
) <<
"No name given to get parton flux modelling PDG id."
;
53
if
(
utils::contains
(CollinearFluxFactory::get().modules(), name))
54
return
CollinearFluxFactory::get().build(name, params)->partonPdgId();
55
if
(
utils::contains
(KTFluxFactory::get().modules(), name))
56
return
KTFluxFactory::get().build(name, params)->partonPdgId();
57
throw
CG_FATAL
(
"PartonFluxFactory:partonPdgId"
) <<
"Failed to find a parton flux with name '"
<< name <<
"'."
;
58
}
59
}
// namespace cepgen
Collections.h
CollinearFlux.h
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
KTFlux.h
PartonFluxFactory.h
String.h
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersDescription::setName
ParametersDescription & setName(const std::string &name)
Set the module name.
Definition
ParametersDescription.h:73
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::ParametersList::name
std::string name(const std::string &def="") const
Retrieve the module name if any.
Definition
ParametersList.cpp:294
cepgen::utils::contains
bool contains(const std::vector< T > &coll, const T &item)
Check if a vector contains an item.
Definition
Collections.h:47
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::PartonFluxFactory::partonPdgId
int partonPdgId(const ParametersList &) const
Type of parton exchanged.
Definition
PartonFluxFactory.cpp:49
cepgen::PartonFluxFactory::elastic
bool elastic(const ParametersList &) const
Is the beam modelling elastic?
Definition
PartonFluxFactory.cpp:38
cepgen::PartonFluxFactory::describeParameters
ParametersDescription describeParameters(const std::string &name, const ParametersList ¶ms=ParametersList()) const
Definition
PartonFluxFactory.cpp:27
CepGen
Modules
PartonFluxFactory.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7