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
24
#include "
CepGen/Modules/NamedModule.h
"
25
26
namespace
cepgen
{
27
namespace
utils {
31
class
RandomGenerator
:
public
NamedModule
<RandomGenerator> {
32
public
:
34
explicit
RandomGenerator
(
const
ParametersList
&);
35
36
static
ParametersDescription
description
();
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
NamedModule.h
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::utils::RandomGenerator
A random number generator.
Definition
RandomGenerator.h:31
cepgen::utils::RandomGenerator::engine
T * engine()
Retrieve the engine object.
Definition
RandomGenerator.h:51
cepgen::utils::RandomGenerator::landau
virtual double landau(double location=0., double width=1.)
Definition
RandomGenerator.cpp:39
cepgen::utils::RandomGenerator::enginePtr
virtual void * enginePtr()
engine object
Definition
RandomGenerator.cpp:49
cepgen::utils::RandomGenerator::exponential
virtual double exponential(double exponent=1.)
Definition
RandomGenerator.cpp:27
cepgen::utils::RandomGenerator::uniform
virtual double uniform(double min=0., double max=1.)=0
cepgen::utils::RandomGenerator::uniformInt
virtual int uniformInt(int min, int max)=0
cepgen::utils::RandomGenerator::poisson
virtual int poisson(double mean=0.)
Definition
RandomGenerator.cpp:44
cepgen::utils::RandomGenerator::normal
virtual double normal(double mean=0., double rms=1.)=0
cepgen::utils::RandomGenerator::description
static ParametersDescription description()
Definition
RandomGenerator.cpp:53
cepgen::utils::RandomGenerator::breitWigner
virtual double breitWigner(double mean=0., double scale=1.)
Definition
RandomGenerator.cpp:33
cepgen::utils::RandomGenerator::seed_
unsigned long long seed_
Definition
RandomGenerator.h:56
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
Utils
RandomGenerator.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7