BOSS
7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
KKMCRandom.cxx
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Environment:
4
// This software is part of the EvtGen package developed jointly
5
// for the BaBar and CLEO collaborations. If you use all or part
6
// of it, please give an appropriate acknowledgement.
7
//
8
// Copyright Information: See EvtGen/COPYRIGHT
9
// Copyright (C) 1998 Caltech, UCSB
10
//
11
// Module: EvtRandom.cc
12
//
13
// Description: routines to get random numbers from
14
// random number generator.
15
//
16
// Modification history:
17
//
18
// DJL/RYD September 25, 1996 Module created
19
//
20
//------------------------------------------------------------------------
21
//
22
23
#include "
KKMC/KKMCRandom.h
"
24
25
#include "CLHEP/Random/RanluxEngine.h"
26
#include <iostream>
27
using namespace
std
;
28
using namespace
CLHEP;
29
30
HepRandomEngine* KKMCRandom::_randomEngine=0;
31
32
void
KKMCRandom::setRandomEngine
(CLHEP::HepRandomEngine* randomEngine){
33
_randomEngine=randomEngine;
34
}
35
36
37
double
KKMCRandom::random
(){
38
39
if
(_randomEngine==0){
40
cerr <<
"No random engine available in "
41
<<
"KKMCRandom::random()."
<<endl;
42
}
43
44
return
_randomEngine->flat();
45
}
46
47
48
49
double
KKMCRandom::Flat
(
double
min
,
double
max
){
50
51
if
(
min
>
max
) {
52
cerr<<
"min>max in KKMCRandom::Flat("
<<
min
<<
","
<<
max
<<
")"
<<endl;
53
}
54
55
return
KKMCRandom::random
()*(
max
-
min
)+
min
;
56
57
}
58
59
double
KKMCRandom::Flat
(
double
max
){
60
61
return
max
*
KKMCRandom::random
();
62
63
}
64
65
double
KKMCRandom::Flat
(){
66
67
return
KKMCRandom::random
();
68
69
}
70
71
void
KKMCRandom::FlatArray
(
double
* vect,
const
int
size){
72
if
(_randomEngine == 0) cout<<
"Can not get randomEngine pointer in KKMCRandom::FlatArray"
<<endl;
73
else
_randomEngine->flatArray(size,vect);
74
}
75
76
77
//----------------
78
extern
"C"
{
79
extern
double
rlu_
(
int
*);
//jetset74
80
}
81
82
83
double
rlu_
(
int
*){
84
double
rdm=
KKMCRandom::Flat
();
85
// std::cout<<"rlu_ = "<<rdm<<std::endl;
86
return
rdm;
87
}
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
rlu_
double rlu_(int *)
Definition
KKMCRandom.cxx:83
KKMCRandom.h
KKMCRandom::Flat
static double Flat()
Definition
KKMCRandom.cxx:65
KKMCRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
KKMCRandom.cxx:71
KKMCRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
KKMCRandom.cxx:32
KKMCRandom::random
static double random()
Definition
KKMCRandom.cxx:37
std
Definition
RootEventData/RootEventData_rootcint.cxx:38
7.1.2
Generator
KKMC
KKMC-00-01-02
src
KKMCRandom.cxx
Generated by
1.12.0