cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
AnalyticIntegrator.h
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
#ifndef CepGen_Integration_AnalyticIntegrator_h
20
#define CepGen_Integration_AnalyticIntegrator_h
21
22
#include <functional>
23
24
#include "
CepGen/Modules/NamedModule.h
"
25
#include "
CepGen/Utils/Limits.h
"
26
27
namespace
cepgen
{
28
namespace
utils {
29
class
Function1D;
30
}
32
class
AnalyticIntegrator
:
public
NamedModule
<AnalyticIntegrator> {
33
public
:
34
explicit
AnalyticIntegrator
(
const
ParametersList
& params);
35
36
static
ParametersDescription
description
();
37
41
double
integrate
(
const
std::function<
double
(
double
)>& func,
const
Limits
& range = {})
const
;
46
template
<
typename
T>
47
inline
double
integrate
(
const
utils::Function1D
& func,
const
T& obj,
const
Limits
& range = {})
const
{
48
return
integrate(func, (
void
*)&obj, range);
49
}
54
virtual
double
integrate
(
const
utils::Function1D
& func,
void
* obj =
nullptr
,
const
Limits
& range = {})
const
= 0;
55
56
protected
:
57
const
Limits
range_
;
58
const
ParametersList
func_params_
;
59
const
int
verbosity_
;
60
};
61
}
// namespace cepgen
62
63
#endif
Limits.h
NamedModule.h
cepgen::AnalyticIntegrator
Analytic (functional) integration algorithm.
Definition
AnalyticIntegrator.h:32
cepgen::AnalyticIntegrator::integrate
double integrate(const utils::Function1D &func, const T &obj, const Limits &range={}) const
Evaluate the integral of a function at a given value.
Definition
AnalyticIntegrator.h:47
cepgen::AnalyticIntegrator::range_
const Limits range_
Definition
AnalyticIntegrator.h:57
cepgen::AnalyticIntegrator::verbosity_
const int verbosity_
Integrator verbosity.
Definition
AnalyticIntegrator.h:59
cepgen::AnalyticIntegrator::func_params_
const ParametersList func_params_
Definition
AnalyticIntegrator.h:58
cepgen::AnalyticIntegrator::description
static ParametersDescription description()
Definition
AnalyticIntegrator.cpp:33
cepgen::AnalyticIntegrator::integrate
virtual double integrate(const utils::Function1D &func, void *obj=nullptr, const Limits &range={}) const =0
Evaluate the integral of a function at a given value.
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::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.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7