cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
SuaveIntegrator.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2021-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/Core/Exception.h
"
20
#include "
CepGen/Integration/Integrand.h
"
21
#include "
CepGen/Modules/IntegratorFactory.h
"
22
#include "
CepGenAddOns/CubaWrapper/Integrator.h
"
23
#include "cuba.h"
24
25
namespace
cepgen
{
26
namespace
cuba {
28
class
SuaveIntegrator
:
public
Integrator
{
29
public
:
30
explicit
SuaveIntegrator
(
const
ParametersList
& params)
31
:
Integrator
(params),
32
nnew_(
steer
<int>(
"NNew"
)),
33
nmin_(
steer
<int>(
"NMin"
)),
34
flatness_(
steer
<double>(
"Flatness"
)) {
35
CG_DEBUG
(
"Integrator:build"
) <<
"Cuba-Suave integrator built."
;
36
}
37
38
static
ParametersDescription
description
() {
39
auto
desc =
Integrator::description
();
40
desc.setDescription(
"Cuba implementation of the Suave algorithm"
);
41
desc.add<
int
>(
"NNew"
, 1000).setDescription(
"number of new integrand evaluations in each subdivision"
);
42
desc.add<
int
>(
"NMin"
, 2).setDescription(
43
"minimum number of samples a former pass must contribute to a subregion to be considered in that region’s "
44
"compound integral value"
);
45
desc.add<
double
>(
"Flatness"
, 50.).setDescription(
"type of norm used to compute the fluctuation of a sample"
);
46
return
desc;
47
}
48
49
Value
integrate
()
override
{
50
int
neval, fail, nregions;
51
double
integral, error, prob;
52
53
Suave(
gIntegrand
->
size
(),
54
ncomp_
,
55
cuba_integrand
,
56
nullptr
,
57
nvec_
,
58
epsrel_
,
59
epsabs_
,
60
verbose_
,
61
rnd_gen_
->parameters().get<
unsigned
long
long
>(
"seed"
),
62
mineval_
,
63
maxeval_
,
64
nnew_,
65
nmin_,
66
flatness_,
67
nullptr
,
// const char* statefile
68
nullptr
,
// void* spin
69
&nregions,
70
&neval,
71
&fail,
72
&integral,
73
&error,
74
&prob);
75
return
Value
{integral, error};
76
}
77
78
private
:
79
const
int
nnew_, nmin_;
80
const
double
flatness_;
81
};
82
}
// namespace cuba
83
}
// namespace cepgen
84
using
SuaveIntegratorCuba
=
cepgen::cuba::SuaveIntegrator
;
85
REGISTER_INTEGRATOR
(
"cuba_suave"
,
SuaveIntegratorCuba
);
Exception.h
Integrand.h
IntegratorFactory.h
REGISTER_INTEGRATOR
#define REGISTER_INTEGRATOR(name, obj)
Add a generic process definition to the list of handled processes.
Definition
IntegratorFactory.h:25
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
cepgen::Integrand::size
virtual size_t size() const =0
Phase space dimension.
cepgen::Integrator::rnd_gen_
const std::unique_ptr< utils::RandomGenerator > rnd_gen_
Definition
Integrator.h:56
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::Value
A scalar value with its uncertainty.
Definition
Value.h:26
cepgen::cuba::Integrator
Cuba integration algorithm.
Definition
Integrator.h:29
cepgen::cuba::Integrator::mineval_
int mineval_
Definition
Integrator.h:43
cepgen::cuba::Integrator::nvec_
int nvec_
Definition
Integrator.h:41
cepgen::cuba::Integrator::maxeval_
int maxeval_
Definition
Integrator.h:43
cepgen::cuba::Integrator::ncomp_
int ncomp_
Definition
Integrator.h:41
cepgen::cuba::Integrator::verbose_
int verbose_
Definition
Integrator.h:44
cepgen::cuba::Integrator::epsrel_
double epsrel_
Definition
Integrator.h:42
cepgen::cuba::Integrator::description
static ParametersDescription description()
Definition
Integrator.cpp:42
cepgen::cuba::Integrator::gIntegrand
static Integrand * gIntegrand
Definition
Integrator.h:34
cepgen::cuba::Integrator::epsabs_
double epsabs_
Definition
Integrator.h:42
cepgen::cuba::SuaveIntegrator
Cuba implementation of the Suave integration algorithm.
Definition
SuaveIntegrator.cpp:28
cepgen::cuba::SuaveIntegrator::description
static ParametersDescription description()
Definition
SuaveIntegrator.cpp:38
cepgen::cuba::SuaveIntegrator::SuaveIntegrator
SuaveIntegrator(const ParametersList ¶ms)
Definition
SuaveIntegrator.cpp:30
cepgen::cuba::SuaveIntegrator::integrate
Value integrate() override
Definition
SuaveIntegrator.cpp:49
Integrator.h
cepgen::cuba::cuba_integrand
int cuba_integrand(const int *ndim, const double xx[], const int *, double ff[], void *)
Definition
Integrator.cpp:55
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGenAddOns
CubaWrapper
SuaveIntegrator.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7