cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
AnalyticIntegrator.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 "
CepGen/Integration/AnalyticIntegrator.h
"
20
#include "
CepGen/Utils/FunctionsWrappers.h
"
21
22
namespace
cepgen
{
23
AnalyticIntegrator::AnalyticIntegrator
(
const
ParametersList
& params)
24
:
NamedModule
(params),
25
range_(steer<
Limits
>(
"range"
)),
26
func_params_(steer<
ParametersList
>(
"params"
)),
27
verbosity_(steer<int>(
"verbosity"
)) {}
28
29
double
AnalyticIntegrator::integrate
(
const
std::function<
double
(
double
)>& func,
const
Limits
& lim)
const
{
30
return
integrate
(
utils::Function1D
(func),
nullptr
, lim);
31
}
32
33
ParametersDescription
AnalyticIntegrator::description
() {
34
auto
desc =
ParametersDescription
();
35
desc.add<
Limits
>(
"range"
,
Limits
{0., 1.}).setDescription(
"integration range"
);
36
desc.add<
ParametersDescription
>(
"params"
,
ParametersDescription
())
37
.setDescription(
"parameters for the function to be integrated"
);
38
desc.add<
int
>(
"verbosity"
, 0).setDescription(
"integrator verbosity"
);
39
return
desc;
40
}
41
}
// namespace cepgen
AnalyticIntegrator.h
FunctionsWrappers.h
cepgen::AnalyticIntegrator::description
static ParametersDescription description()
Definition
AnalyticIntegrator.cpp:33
cepgen::AnalyticIntegrator::integrate
double integrate(const std::function< double(double)> &func, const Limits &range={}) const
Evaluate the integral of a function at a given value.
Definition
AnalyticIntegrator.cpp:29
cepgen::AnalyticIntegrator::AnalyticIntegrator
AnalyticIntegrator(const ParametersList ¶ms)
Integrator algorithm constructor.
Definition
AnalyticIntegrator.cpp:23
cepgen::Limits
Validity interval for a variable.
Definition
Limits.h:28
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::utils::Function1D
Wrapper to a 1-dimensional function with optional parameters.
Definition
FunctionsWrappers.h:29
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
Integration
AnalyticIntegrator.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7