BOSS 7.0.2
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>
5using namespace std;
6using namespace CLHEP;
7
8HepRandomEngine* BhlumiRandom::_randomEngine=0;
9
10void BhlumiRandom::setRandomEngine(CLHEP::HepRandomEngine* randomEngine){
11 _randomEngine=randomEngine;
12}
13
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
25double 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
35double BhlumiRandom::Flat(double max){
36
38
39}
40
42
43 return BhlumiRandom::random();
44
45 }
46
47void 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
static void FlatArray(double *vect, const int size)
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
static double random()
static double Flat()