BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EeToeeVRandom.cxx
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Module: EeToeeVRandom.h
4
//
5
// Description: routines to unify random numbers using Bes random service
6
//
7
// Modification history:
8
//
9
// Ping RG Feb. 16, 2009 Module created
10
//
11
//------------------------------------------------------------------------
12
//
13
14
#include "
EeToeeVRandom.h
"
15
16
#include <iostream>
17
using namespace
std
;
18
using namespace
CLHEP;
19
20
HepRandomEngine* EeToeeVRandom::_randomEngine = 0;
21
22
void
EeToeeVRandom::setRandomEngine
( CLHEP::HepRandomEngine* randomEngine ) {
23
_randomEngine = randomEngine;
24
}
25
26
double
EeToeeVRandom::random
() {
27
28
if
( _randomEngine == 0 )
29
{
30
cerr <<
"No random engine available in "
31
<<
"EeToeeVRandom::random()."
<< endl;
32
}
33
return
_randomEngine->flat();
34
}
35
36
double
EeToeeVRandom::Flat
(
double
min
,
double
max
) {
37
38
if
(
min
>
max
)
39
{ cerr <<
"min>max in EeToeeVRandom::Flat("
<<
min
<<
","
<<
max
<<
")"
<< endl; }
40
41
return
EeToeeVRandom::random
() * (
max
-
min
) +
min
;
42
}
43
44
double
EeToeeVRandom::Flat
(
double
max
) {
return
max
*
EeToeeVRandom::random
(); }
45
46
double
EeToeeVRandom::Flat
() {
return
EeToeeVRandom::random
(); }
47
48
void
EeToeeVRandom::FlatArray
(
double
* vect,
const
int
size ) {
49
if
( _randomEngine == 0 )
50
cout <<
"Can not get randomEngine pointer in EeToeeVRandom::FlatArray"
<< endl;
51
else
_randomEngine->flatArray( size, vect );
52
}
EeToeeVRandom.h
min
#define min(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:157
max
#define max(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:158
EeToeeVRandom::random
static double random()
Definition
EeToeeVRandom.cxx:26
EeToeeVRandom::Flat
static double Flat()
Definition
EeToeeVRandom.cxx:46
EeToeeVRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
EeToeeVRandom.cxx:48
EeToeeVRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
EeToeeVRandom.cxx:22
std
Definition
x86_64-el9-gcc13-dbg/Event/RootEventData/RootEventDataDict.cxx:101
8.0.0
BOSS_Gen
EeToeeV
src
EeToeeVRandom.cxx
Generated by
1.16.1