cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
RandomGenerator.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023-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 {
23 namespace utils {
25 : NamedModule(params), seed_(steer<unsigned long long>("seed")) {}
26
27 double RandomGenerator::exponential(double /*exponent*/) {
28 CG_WARNING("RandomGenerator:exponential")
29 << "Exponential distribution not implemented for this random number generator.";
30 return 0.;
31 }
32
33 double RandomGenerator::breitWigner(double /*mean*/, double /*scale*/) {
34 CG_WARNING("RandomGenerator:breitWigner")
35 << "Breit-Wigner/Cauchy distribution not implemented for this random number generator.";
36 return 0.;
37 }
38
39 double RandomGenerator::landau(double /*location*/, double /*width*/) {
40 CG_WARNING("RandomGenerator:landau") << "Landau distribution not implemented for this random number generator.";
41 return 0.;
42 }
43
44 int RandomGenerator::poisson(double /*mean*/) {
45 CG_WARNING("RandomGenerator:poisson") << "Poisson distribution not implemented for this random number generator.";
46 return 0;
47 }
48
50 throw CG_FATAL("RandomGenerator:enginePtr") << "No engine object declared for this random generator.";
51 }
52
54 auto desc = ParametersDescription();
55 desc.setDescription("unnamed random generator");
56 desc.add<unsigned long long>("seed", time(nullptr)).setDescription("Random number generator seed");
57 return desc;
58 }
59 } // namespace utils
60} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
#define CG_WARNING(mod)
Definition Message.h:228
Base runtime module object.
Definition NamedModule.h:28
A description object for parameters collection.
virtual double landau(double location=0., double width=1.)
virtual void * enginePtr()
engine object
virtual double exponential(double exponent=1.)
virtual int poisson(double mean=0.)
static ParametersDescription description()
virtual double breitWigner(double mean=0., double scale=1.)
RandomGenerator(const ParametersList &)
Default constructor.
Common namespace for this Monte Carlo generator.