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
21
22namespace cepgen {
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
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
static ParametersDescription description()
double integrate(const std::function< double(double)> &func, const Limits &range={}) const
Evaluate the integral of a function at a given value.
AnalyticIntegrator(const ParametersList &params)
Integrator algorithm constructor.
Validity interval for a variable.
Definition Limits.h:28
Base runtime module object.
Definition NamedModule.h:28
A description object for parameters collection.
Wrapper to a 1-dimensional function with optional parameters.
Common namespace for this Monte Carlo generator.