thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Repository
StandardRandom.h
1
// -*- C++ -*-
2
//
3
// StandardRandom.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_StandardRandom_H
10
#define ThePEG_StandardRandom_H
11
// This is the declaration of the StandardRandom class.
12
13
#include "RandomGenerator.h"
14
#include "ThePEG/Persistency/PersistentOStream.h"
15
#include "ThePEG/Persistency/PersistentIStream.h"
16
17
namespace
ThePEG
{
18
26
class
StandardRandom
:
public
RandomGenerator
{
27
28
public
:
29
35
StandardRandom
() :
u
() {
if
(
theSeed
!= 0 )
setSeed
(
theSeed
); }
37
38
public
:
39
44
virtual
void
setSeed
(
long
seed);
45
46
protected
:
47
51
virtual
void
fill
();
52
53
public
:
54
55
62
void
persistentOutput
(
PersistentOStream
& os)
const
;
63
69
void
persistentInput
(
PersistentIStream
& is,
int
version);
71
75
static
void
Init
();
76
77
protected
:
78
85
virtual
IBPtr
clone
()
const
;
86
91
virtual
IBPtr
fullclone
()
const
;
93
94
private
:
95
99
array<double,97>
u
;
100
104
double
c
;
105
109
double
cd
;
110
114
double
cm
;
115
119
int
i97
;
120
124
int
j97
;
125
126
private
:
127
131
static
ClassDescription<StandardRandom>
initStandardRandom
;
132
136
StandardRandom
&
operator=
(
const
StandardRandom
&) =
delete
;
137
138
};
139
144
template
<>
145
struct
BaseClassTrait
<
StandardRandom
,1>:
public
ClassTraitsType
{
147
typedef
RandomGenerator
NthBase
;
148
};
149
152
template
<>
153
struct
ClassTraits<StandardRandom>:
public
ClassTraitsBase<StandardRandom> {
155
static
string
className
() {
return
"ThePEG::StandardRandom"
; }
156
};
157
160
}
161
162
#endif
/* ThePEG_StandardRandom_H */
ThePEG::ClassDescription
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
Definition:
ClassDescription.h:333
ThePEG::PersistentIStream
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Definition:
PersistentIStream.h:48
ThePEG::PersistentOStream
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Definition:
PersistentOStream.h:51
ThePEG::Pointer::RCPtr
RCPtr is a reference counted (smart) pointer.
Definition:
RCPtr.h:60
ThePEG::RandomGenerator
RandomGenerator is an interface to the CLHEP::RandomEngine classes.
Definition:
RandomGenerator.h:37
ThePEG::RandomGenerator::theSeed
long theSeed
The seed to initialize the random generator with.
Definition:
RandomGenerator.h:435
ThePEG::StandardRandom
StandardRandom inherits from the RandomGenerator class and is an interface to the CLHEP::JamesRandom ...
Definition:
StandardRandom.h:26
ThePEG::StandardRandom::j97
int j97
Index for the internal state.
Definition:
StandardRandom.h:124
ThePEG::StandardRandom::fill
virtual void fill()
Fill the cache with random numbers.
ThePEG::StandardRandom::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG::StandardRandom::clone
virtual IBPtr clone() const
Make a simple clone of this object.
ThePEG::StandardRandom::initStandardRandom
static ClassDescription< StandardRandom > initStandardRandom
Describe a concrete class with persistent data.
Definition:
StandardRandom.h:131
ThePEG::StandardRandom::u
array< double, 97 > u
The internal state vector.
Definition:
StandardRandom.h:99
ThePEG::StandardRandom::setSeed
virtual void setSeed(long seed)
Reset the underlying random algorithm with the given seed.
ThePEG::StandardRandom::cd
double cd
Parameter for the internal state.
Definition:
StandardRandom.h:109
ThePEG::StandardRandom::i97
int i97
Index for the internal state.
Definition:
StandardRandom.h:119
ThePEG::StandardRandom::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
ThePEG::StandardRandom::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::StandardRandom::cm
double cm
Parameter for the internal state.
Definition:
StandardRandom.h:114
ThePEG::StandardRandom::c
double c
Parameter for the internal state.
Definition:
StandardRandom.h:104
ThePEG::StandardRandom::operator=
StandardRandom & operator=(const StandardRandom &)=delete
Private and non-existent assignment operator.
ThePEG::StandardRandom::StandardRandom
StandardRandom()
Default constructor.
Definition:
StandardRandom.h:35
ThePEG::StandardRandom::Init
static void Init()
Standard Init function used to initialize the interface.
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::BaseClassTrait
BaseClassTraits describes the base classes of the templated class.
Definition:
ClassTraits.h:156
ThePEG::BaseClassTrait::NthBase
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition:
ClassTraits.h:161
ThePEG::ClassTraitsBase::className
static string className()
Return the name of class T.
Definition:
ClassTraits.h:66
ThePEG::ClassTraitsType
ClassTraitsType is an empty, non-polymorphic, base class.
Definition:
ClassTraits.h:30
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6