cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
RandomGenerator.h
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
19#ifndef CepGen_Utils_RandomGenerator_h
20#define CepGen_Utils_RandomGenerator_h
21
22#include <array>
23
25
26namespace cepgen {
27 namespace utils {
31 class RandomGenerator : public NamedModule<RandomGenerator> {
32 public:
34 explicit RandomGenerator(const ParametersList&);
35
37
38 // base distributions
39 virtual int uniformInt(int min, int max) = 0;
40 virtual double uniform(double min = 0., double max = 1.) = 0;
41 virtual double normal(double mean = 0., double rms = 1.) = 0;
42
43 // specialised distributions
44 virtual double exponential(double exponent = 1.);
45 virtual double breitWigner(double mean = 0., double scale = 1.);
46 virtual double landau(double location = 0., double width = 1.);
47 virtual int poisson(double mean = 0.);
48
50 template <typename T>
51 T* engine() {
52 return static_cast<T*>(enginePtr());
53 }
54
55 protected:
56 unsigned long long seed_;
57 virtual void* enginePtr();
58 };
59 } // namespace utils
60} // namespace cepgen
61
62#endif
Base runtime module object.
Definition NamedModule.h:28
A description object for parameters collection.
A random number generator.
T * engine()
Retrieve the engine object.
virtual double landau(double location=0., double width=1.)
virtual void * enginePtr()
engine object
virtual double exponential(double exponent=1.)
virtual double uniform(double min=0., double max=1.)=0
virtual int uniformInt(int min, int max)=0
virtual int poisson(double mean=0.)
virtual double normal(double mean=0., double rms=1.)=0
static ParametersDescription description()
virtual double breitWigner(double mean=0., double scale=1.)
Common namespace for this Monte Carlo generator.