BOSS
7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
BesBdkRcRandom.cxx
Go to the documentation of this file.
1
#include "
BesBdkRc/BesBdkRcRandom.h
"
2
3
#include "CLHEP/Random/RanluxEngine.h"
4
#include <iostream>
5
using namespace
std
;
6
using namespace
CLHEP;
7
8
HepRandomEngine* BesBdkRcRandom::_randomEngine=0;
9
10
void
BesBdkRcRandom::setRandomEngine
(CLHEP::HepRandomEngine* randomEngine){
11
_randomEngine=randomEngine;
12
}
13
14
double
BesBdkRcRandom::random
(){
15
16
if
(_randomEngine==0){
17
cerr <<
"No random engine available in "
18
<<
"BesBdkRcRandom::random()."
<<endl;
19
}
20
return
_randomEngine->flat();
21
}
22
23
24
25
double
BesBdkRcRandom::Flat
(
double
min
,
double
max
){
26
27
if
(
min
>
max
) {
28
cerr<<
"min>max in BesBdkRcRandom::Flat("
<<
min
<<
","
<<
max
<<
")"
<<endl;
29
}
30
31
return
BesBdkRcRandom::random
()*(
max
-
min
)+
min
;
32
33
}
34
35
double
BesBdkRcRandom::Flat
(
double
max
){
36
37
return
max
*
BesBdkRcRandom::random
();
38
39
}
40
41
double
BesBdkRcRandom::Flat
(){
42
43
return
BesBdkRcRandom::random
();
44
45
}
46
47
void
BesBdkRcRandom::FlatArray
(
double
* vect,
const
int
size){
48
if
(_randomEngine == 0) cout<<
"Can not get randomEngine pointer in BesBdkRcRandom::FlatArray"
<<endl;
49
else
_randomEngine->flatArray(size,vect);
50
}
51
52
53
BesBdkRcRandom.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
BesBdkRcRandom::random
static double random()
Definition
BesBdkRcRandom.cxx:14
BesBdkRcRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
BesBdkRcRandom.cxx:10
BesBdkRcRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
BesBdkRcRandom.cxx:47
BesBdkRcRandom::Flat
static double Flat()
Definition
BesBdkRcRandom.cxx:41
std
Definition
RootEventData/RootEventData_rootcint.cxx:38
7.1.1
Generator
BesBdkRc
BesBdkRc-00-01-00
src
BesBdkRcRandom.cxx
Generated by
1.12.0