BOSS
7.1.2
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 "
../EeToeeV/EeToeeVRandom.h
"
15
16
#include "CLHEP/Random/RanluxEngine.h"
17
#include <iostream>
18
using namespace
std
;
19
using namespace
CLHEP;
20
21
HepRandomEngine* EeToeeVRandom::_randomEngine=0;
22
23
void
EeToeeVRandom::setRandomEngine
(CLHEP::HepRandomEngine* randomEngine){
24
_randomEngine=randomEngine;
25
}
26
27
28
double
EeToeeVRandom::random
(){
29
30
if
(_randomEngine==0){
31
cerr <<
"No random engine available in "
32
<<
"EeToeeVRandom::random()."
<<endl;
33
}
34
return
_randomEngine->flat();
35
}
36
37
38
39
double
EeToeeVRandom::Flat
(
double
min
,
double
max
){
40
41
if
(
min
>
max
) {
42
cerr<<
"min>max in EeToeeVRandom::Flat("
<<
min
<<
","
<<
max
<<
")"
<<endl;
43
}
44
45
return
EeToeeVRandom::random
()*(
max
-
min
)+
min
;
46
47
}
48
49
double
EeToeeVRandom::Flat
(
double
max
){
50
51
return
max
*
EeToeeVRandom::random
();
52
53
}
54
55
double
EeToeeVRandom::Flat
(){
56
57
return
EeToeeVRandom::random
();
58
59
}
60
61
void
EeToeeVRandom::FlatArray
(
double
* vect,
const
int
size){
62
if
(_randomEngine == 0) cout<<
"Can not get randomEngine pointer in EeToeeVRandom::FlatArray"
<<endl;
63
else
_randomEngine->flatArray(size,vect);
64
}
65
66
67
EeToeeVRandom.h
min
#define min(a, b)
Definition
Eepipi/Eepipi-00-01-00/src/ee2eepp/basesv5.1/f2c.h:153
max
#define max(a, b)
Definition
Eepipi/Eepipi-00-01-00/src/ee2eepp/basesv5.1/f2c.h:154
EeToeeVRandom::random
static double random()
Definition
EeToeeVRandom.cxx:28
EeToeeVRandom::Flat
static double Flat()
Definition
EeToeeVRandom.cxx:55
EeToeeVRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
EeToeeVRandom.cxx:61
EeToeeVRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
EeToeeVRandom.cxx:23
std
Definition
RootEventData/RootEventData_rootcint.cxx:38
7.1.2
Generator
EeToeeV
EeToeeV-00-01-00
src
EeToeeVRandom.cxx
Generated by
1.12.0