BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EkharaRandom.cxx
Go to the documentation of this file.
2#include "Ekhara/cfortran.h"
3
4#include "CLHEP/Random/RanluxEngine.h"
5#include <iostream>
6using namespace std;
7using namespace CLHEP;
8
9HepRandomEngine* EkharaRandom::_randomEngine=0;
10
11void EkharaRandom::setRandomEngine(CLHEP::HepRandomEngine* randomEngine){
12 _randomEngine=randomEngine;
13}
14
15
17
18 if (_randomEngine==0){
19 cerr <<"No random engine available in "
20 <<"EkharaRandom::random()."<<endl;
21 }
22
23 return _randomEngine->flat();
24 }
25
26
27
28double EkharaRandom::Flat( double min, double max){
29
30 if ( min > max ) {
31 cerr<< "min>max in EkharaRandom::Flat(" << min << "," << max << ")" <<endl;
32 }
33
34 return EkharaRandom::random()*( max - min )+min;
35
36}
37
38double EkharaRandom::Flat(double max){
39
41
42}
43
45
46 return EkharaRandom::random();
47
48 }
49
50void EkharaRandom::FlatArray(double* vect, const int size){
51 if(_randomEngine == 0)
52 cout<<"Can not get randomEngine pointer in EkharaRandom::FlatArray"<<endl;
53 else {
54 _randomEngine->flatArray(size,vect);
55 }
56}
57
#define RANLXDF(AR, VAL)
#define FCALLSCSUB2(CN, UN, LN, T1, T2)
Definition: cfortran.h:2200
static double random()
static double Flat()
static void FlatArray(double *vect, const int size)
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)