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