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
25#include "CepGen/Utils/Limits.h"
26
27namespace cepgen {
28 namespace utils {
29 class Function1D;
30 }
32 class AnalyticIntegrator : public NamedModule<AnalyticIntegrator> {
33 public:
34 explicit AnalyticIntegrator(const ParametersList& params);
35
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:
59 const int verbosity_;
60 };
61} // namespace cepgen
62
63#endif
Analytic (functional) integration algorithm.
double integrate(const utils::Function1D &func, const T &obj, const Limits &range={}) const
Evaluate the integral of a function at a given value.
const int verbosity_
Integrator verbosity.
const ParametersList func_params_
static ParametersDescription description()
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.
double integrate(const std::function< double(double)> &func, const Limits &range={}) const
Evaluate the integral of a function at a given value.
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.