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
19
#include "
CepGen/Core/Exception.h
"
20
#include "
CepGen/Utils/RandomGenerator.h
"
21
22
namespace
cepgen
{
23
namespace
utils {
24
RandomGenerator::RandomGenerator
(
const
ParametersList
& params)
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
49
void
*
RandomGenerator::enginePtr
() {
50
throw
CG_FATAL
(
"RandomGenerator:enginePtr"
) <<
"No engine object declared for this random generator."
;
51
}
52
53
ParametersDescription
RandomGenerator::description
() {
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
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
CG_WARNING
#define CG_WARNING(mod)
Definition
Message.h:228
RandomGenerator.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::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::poisson
virtual int poisson(double mean=0.)
Definition
RandomGenerator.cpp:44
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::RandomGenerator
RandomGenerator(const ParametersList &)
Default constructor.
Definition
RandomGenerator.cpp:24
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
Utils
RandomGenerator.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7