BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EeTo4eRandom.cxx
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Module: EeTo4eRandom.h
4
//
5
// Description: routines to unify random numbers using Bes random service
6
//
7
// Modification history:
8
//
9
// Ping RG Feb. 16, 2009 Module created
10
//
11
//------------------------------------------------------------------------
12
//
13
14
#include "
EeTo4eRandom.h
"
15
16
#include "CLHEP/Random/RanluxEngine.h"
17
#include <iostream>
18
using namespace
std
;
19
using namespace
CLHEP;
20
21
HepRandomEngine* EeTo4eRandom::_randomEngine = 0;
22
23
void
EeTo4eRandom::setRandomEngine
( CLHEP::HepRandomEngine* randomEngine ) {
24
_randomEngine = randomEngine;
25
}
26
27
double
EeTo4eRandom::random
() {
28
29
if
( _randomEngine == 0 )
30
{
31
cerr <<
"No random engine available in "
32
<<
"EeTo4eRandom::random()."
<< endl;
33
}
34
return
_randomEngine->flat();
35
}
36
37
double
EeTo4eRandom::Flat
(
double
min
,
double
max
) {
38
39
if
(
min
>
max
)
40
{ cerr <<
"min>max in EeTo4eRandom::Flat("
<<
min
<<
","
<<
max
<<
")"
<< endl; }
41
42
return
EeTo4eRandom::random
() * (
max
-
min
) +
min
;
43
}
44
45
double
EeTo4eRandom::Flat
(
double
max
) {
return
max
*
EeTo4eRandom::random
(); }
46
47
double
EeTo4eRandom::Flat
() {
return
EeTo4eRandom::random
(); }
48
49
void
EeTo4eRandom::FlatArray
(
double
* vect,
const
int
size ) {
50
if
( _randomEngine == 0 )
51
cout <<
"Can not get randomEngine pointer in EeTo4eRandom::FlatArray"
<< endl;
52
else
_randomEngine->flatArray( size, vect );
53
}
EeTo4eRandom.h
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
EeTo4eRandom::setRandomEngine
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
Definition
EeTo4eRandom.cxx:23
EeTo4eRandom::FlatArray
static void FlatArray(double *vect, const int size)
Definition
EeTo4eRandom.cxx:49
EeTo4eRandom::Flat
static double Flat()
Definition
EeTo4eRandom.cxx:47
EeTo4eRandom::random
static double random()
Definition
EeTo4eRandom.cxx:27
std
Definition
x86_64-el9-gcc13-dbg/Event/RootEventData/RootEventDataDict.cxx:101
8.0.0
BOSS_Gen
EeTo4e
src
EeTo4eRandom.cxx
Generated by
1.16.1