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