BOSS
7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EkharaRandom.cxx
Go to the documentation of this file.
1
#include "
Ekhara/EkharaRandom.h
"
2
#include "cfortran/cfortran.h"
3
4
#include "CLHEP/Random/RanluxEngine.h"
5
#include <iostream>
6
using namespace
std
;
7
using namespace
CLHEP;
8
9
HepRandomEngine* EkharaRandom::_randomEngine=0;
10
11
void
EkharaRandom::setRandomEngine
(CLHEP::HepRandomEngine* randomEngine){
12
_randomEngine=randomEngine;
13
}
14
15
16
double
EkharaRandom::random
(){
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
28
double
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
38
double
EkharaRandom::Flat
(
double
max
){
39
40
return
max
*
EkharaRandom::random
();
41
42
}
43
44
double
EkharaRandom::Flat
(){
45
46
return
EkharaRandom::random
();
47
48
}
49
50
void
EkharaRandom::FlatArray
(
double
* vect,
const
int
size){
51
if
(_randomEngine == 0)
52
cout<<
"Cannot get randomEngine pointer in EkharaRandom::FlatArray"
<<endl;
53
else
{
54
_randomEngine->flatArray(size,vect);
55
}
56
}
57
58
FCALLSCSUB2
(
EkharaRandom::FlatArray
,
RANLXDF
,ranlxdf,DOUBLEV,INT)
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
EkharaRandom.h
RANLXDF
#define RANLXDF(AR, VAL)
Definition
EvtPhokharaDef.hh:113
FCALLSCSUB2
#define FCALLSCSUB2(CN, UN, LN, T1, T2)
Definition
cfortran.h:2200
EkharaRandom::random
static double random()
Definition
EkharaRandom.cxx:16
EkharaRandom::Flat
static double Flat()
Definition
EkharaRandom.cxx:44
EkharaRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
EkharaRandom.cxx:50
EkharaRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
EkharaRandom.cxx:11
std
Definition
RootEventData/RootEventData_rootcint.cxx:38
7.1.2
Generator
Ekhara
Ekhara-00-01-02
src
EkharaRandom.cxx
Generated by
1.12.0