BOSS
8.0.0
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 "
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
double
KKMCRandom::random
() {
37
38
if
( _randomEngine == 0 )
39
{
40
cerr <<
"No random engine available in "
41
<<
"KKMCRandom::random()."
<< endl;
42
}
43
44
return
_randomEngine->flat();
45
}
46
47
double
KKMCRandom::Flat
(
double
min
,
double
max
) {
48
49
if
(
min
>
max
)
50
{ cerr <<
"min>max in KKMCRandom::Flat("
<<
min
<<
","
<<
max
<<
")"
<< endl; }
51
52
return
KKMCRandom::random
() * (
max
-
min
) +
min
;
53
}
54
55
double
KKMCRandom::Flat
(
double
max
) {
return
max
*
KKMCRandom::random
(); }
56
57
double
KKMCRandom::Flat
() {
return
KKMCRandom::random
(); }
58
59
void
KKMCRandom::FlatArray
(
double
* vect,
const
int
size ) {
60
if
( _randomEngine == 0 )
61
cout <<
"Can not get randomEngine pointer in KKMCRandom::FlatArray"
<< endl;
62
else
_randomEngine->flatArray( size, vect );
63
}
64
65
//----------------
66
extern
"C"
{
67
extern
float
rlu_
(
int
* );
// jetset74
68
}
69
70
float
rlu_
(
int
* ) {
71
float
rdm =
KKMCRandom::Flat
();
72
// std::cout<<"rlu_ = "<<rdm<<std::endl;
73
return
rdm;
74
}
min
#define min(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:157
max
#define max(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:158
rlu_
float rlu_(int *)
Definition
KKMCRandom.cxx:70
KKMCRandom.h
KKMCRandom::Flat
static double Flat()
Definition
KKMCRandom.cxx:57
KKMCRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
KKMCRandom.cxx:59
KKMCRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
KKMCRandom.cxx:32
KKMCRandom::random
static double random()
Definition
KKMCRandom.cxx:36
std
Definition
x86_64-el9-gcc13-dbg/Event/RootEventData/RootEventDataDict.cxx:101
8.0.0
BOSS_Gen
KKMC
src
KKMCRandom.cxx
Generated by
1.16.1