cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
DocumentationGenerator.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 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/Utils/Collections.h
"
20
#include "
CepGen/Utils/DocumentationGenerator.h
"
21
#include "
CepGen/Utils/String.h
"
22
23
// list of factories documented
24
#include "
CepGen/Modules/CardsHandlerFactory.h
"
25
#include "
CepGen/Modules/CouplingFactory.h
"
26
#include "
CepGen/Modules/DocumentationGeneratorFactory.h
"
27
#include "
CepGen/Modules/DrawerFactory.h
"
28
#include "
CepGen/Modules/EventExporterFactory.h
"
29
#include "
CepGen/Modules/EventImporterFactory.h
"
30
#include "
CepGen/Modules/EventModifierFactory.h
"
31
#include "
CepGen/Modules/FormFactorsFactory.h
"
32
#include "
CepGen/Modules/FunctionalFactory.h
"
33
#include "
CepGen/Modules/GeneratorWorkerFactory.h
"
34
#include "
CepGen/Modules/IntegratorFactory.h
"
35
#include "
CepGen/Modules/PartonFluxFactory.h
"
36
#include "
CepGen/Modules/PhaseSpaceGeneratorFactory.h
"
37
#include "
CepGen/Modules/ProcessFactory.h
"
38
#include "
CepGen/Modules/RandomGeneratorFactory.h
"
39
#include "
CepGen/Modules/StructureFunctionsFactory.h
"
40
41
namespace
cepgen
{
42
namespace
utils {
43
DocumentationGenerator::DocumentationGenerator
(
const
ParametersList
& params) :
NamedModule
(params) {
44
const
auto
categories = steer<std::vector<std::string> >(
"categories"
),
45
mod_names =
steer
<std::vector<std::string> >(
"modules"
);
46
const
auto
add_category = [&categories, &mod_names,
this
](
const
std::string&
name
,
47
const
std::string& title,
48
const
std::string&
description
,
49
auto
& factory) ->
void
{
50
if
(!categories.empty() && !
contains
(categories,
name
))
51
return
;
52
category_t
cat;
53
cat.
name
=
name
;
54
cat.
title
= title;
55
cat.
description
=
description
;
56
for
(
const
auto
& mod : factory.modules())
57
if
(mod_names.empty() ||
contains
(mod_names,
utils::toString
(mod)) ||
58
contains
(mod_names,
utils::toCamelCase
(
utils::toString
(mod)))) {
59
cat.
modules
[mod] = factory.describeParameters(mod).setKey(mod);
60
for
(
const
auto
& index_vs_modname : factory.indices())
61
if
(index_vs_modname.second == mod)
62
cat.
modules_indices
[mod] = index_vs_modname.first;
63
}
64
categories_
.emplace_back(std::make_pair(
name
, cat));
65
};
66
add_category(
"proc"
,
"Processes"
,
""
, cepgen::ProcessFactory::get());
67
add_category(
"cards"
,
"Cards handler"
,
""
,
cepgen::CardsHandlerFactory::get
());
68
add_category(
"formfac"
,
"Form factors"
,
""
, cepgen::FormFactorsFactory::get());
69
add_category(
"strfun"
,
"Structure functions"
,
""
, cepgen::StructureFunctionsFactory::get());
70
add_category(
"sigrat"
,
71
"Longitudinal/transverse cross section ratio parameterisations"
,
72
""
,
73
cepgen::SigmaRatiosFactory::get());
74
add_category(
"psmap"
,
"Phase space mapper"
,
""
, cepgen::PhaseSpaceGeneratorFactory::get());
75
add_category(
"collflux"
,
"Collinear parton flux modelling"
,
""
, cepgen::CollinearFluxFactory::get());
76
add_category(
"ktflux"
,
"KT-factorised parton flux modelling"
,
""
, cepgen::KTFluxFactory::get());
77
add_category(
"alphaem"
,
"Electromagnetic coupling evolution"
,
""
, cepgen::AlphaEMFactory::get());
78
add_category(
"alphas"
,
"Strong coupling evolution"
,
""
, cepgen::AlphaSFactory::get());
79
add_category(
"integr"
,
"Integrator algorithms"
,
""
, cepgen::IntegratorFactory::get());
80
add_category(
"func"
,
"Functional parsers"
,
""
, cepgen::FunctionalFactory::get());
81
add_category(
"rndgen"
,
"Random number generators"
,
""
, cepgen::RandomGeneratorFactory::get());
82
add_category(
"drawer"
,
"Drawing tools"
,
""
, cepgen::DrawerFactory::get());
83
add_category(
"evtgen"
,
"Event generation algorithms"
,
""
, cepgen::GeneratorWorkerFactory::get());
84
add_category(
"evtimp"
,
"Event import algorithms"
,
""
, cepgen::EventImporterFactory::get());
85
add_category(
"evtmod"
,
"Event modification algorithms"
,
""
, cepgen::EventModifierFactory::get());
86
add_category(
"evtout"
,
"Event export modules"
,
""
, cepgen::EventExporterFactory::get());
87
add_category(
"docs"
,
"Documentation generator modules"
,
""
, cepgen::DocumentationGeneratorFactory::get());
88
}
89
90
ParametersDescription
DocumentationGenerator::description
() {
91
auto
desc =
ParametersDescription
();
92
return
desc;
93
}
94
}
// namespace utils
95
}
// namespace cepgen
CardsHandlerFactory.h
Collections.h
CouplingFactory.h
DocumentationGeneratorFactory.h
DocumentationGenerator.h
DrawerFactory.h
EventExporterFactory.h
EventImporterFactory.h
EventModifierFactory.h
FormFactorsFactory.h
FunctionalFactory.h
GeneratorWorkerFactory.h
IntegratorFactory.h
PartonFluxFactory.h
PhaseSpaceGeneratorFactory.h
ProcessFactory.h
RandomGeneratorFactory.h
String.h
StructureFunctionsFactory.h
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::NamedModule< DocumentationGenerator >::name
const std::string & name() const
Module unique indexing name.
Definition
NamedModule.h:42
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::Steerable::steer
T steer(const std::string &key) const
Retrieve a parameters as previously steered.
Definition
Steerable.h:39
cepgen::utils::DocumentationGenerator::category_t::description
std::string description
Definition
DocumentationGenerator.h:40
cepgen::utils::DocumentationGenerator::DocumentationGenerator
DocumentationGenerator(const ParametersList &)
Definition
DocumentationGenerator.cpp:43
cepgen::utils::DocumentationGenerator::category_t::modules
std::map< std::string, ParametersDescription > modules
Definition
DocumentationGenerator.h:41
cepgen::utils::DocumentationGenerator::category_t::name
std::string name
Definition
DocumentationGenerator.h:40
cepgen::utils::DocumentationGenerator::category_t::title
std::string title
Definition
DocumentationGenerator.h:40
cepgen::utils::DocumentationGenerator::description
static ParametersDescription description()
Definition
DocumentationGenerator.cpp:90
cepgen::utils::DocumentationGenerator::categories_
std::vector< std::pair< std::string, category_t > > categories_
Definition
DocumentationGenerator.h:44
cepgen::utils::DocumentationGenerator::category_t::modules_indices
std::map< std::string, int > modules_indices
Definition
DocumentationGenerator.h:42
cepgen::utils::DocumentationGenerator::category_t
Definition
DocumentationGenerator.h:39
cepgen::utils::toString
std::string toString(const std::wstring &str)
Convert a wide characters to a standard characters string.
Definition
String.cpp:151
cepgen::utils::toCamelCase
std::string toCamelCase(const std::string &in, bool lower)
Convert any case into a camelCase string.
Definition
String.cpp:186
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::CardsHandlerFactory::get
static CardsHandlerFactory & get()
Definition
CardsHandlerFactory.cpp:25
CepGen
Utils
DocumentationGenerator.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7