CLHEP
2.4.7.1
C++ Class Library for High Energy Physics
CLHEP
Random
RandBit.icc
Go to the documentation of this file.
1
// $Id: RandBit.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
2
// -*- C++ -*-
3
//
4
// -----------------------------------------------------------------------
5
// HEP Random
6
// --- RandBit ---
7
// inlined functions implementation file
8
// -----------------------------------------------------------------------
9
10
// =======================================================================
11
// M.Fischler - Created, along same lines as RandGaussQ.icc
12
// =======================================================================
13
14
namespace
CLHEP
{
15
16
inline
RandBit::RandBit
(
HepRandomEngine
& anEngine)
17
:
RandFlat
(anEngine)
18
{}
19
20
inline
RandBit::RandBit
(
HepRandomEngine
& anEngine,
double
width )
21
:
RandFlat
(anEngine, width)
22
{}
23
24
inline
RandBit::RandBit
(
HepRandomEngine
& anEngine,
double
a,
25
double
b )
26
:
RandFlat
(anEngine, a, b)
27
{}
28
29
inline
RandBit::RandBit
(
HepRandomEngine
* anEngine)
30
:
RandFlat
(anEngine)
31
{}
32
33
inline
RandBit::RandBit
(
HepRandomEngine
* anEngine,
double
width )
34
:
RandFlat
(anEngine, width)
35
{}
36
37
inline
RandBit::RandBit
(
HepRandomEngine
* anEngine,
double
a,
38
double
b )
39
:
RandFlat
(anEngine, a, b)
40
{}
41
42
//---------------------
43
44
inline
int
RandBit::shootBit
() {
45
double
x =
shoot
();
46
return
(x > .5) ? 1 : 0;
47
}
48
49
//---------------------
50
51
52
inline
int
RandBit::shootBit
(
HepRandomEngine
*
engine
) {
53
double
x =
shoot
(
engine
);
54
return
(x > .5) ? 1 : 0;
55
}
56
57
//---------------------
58
59
60
inline
int
RandBit::fireBit
() {
61
double
x =
fire
(0,1);
62
return
(x > .5) ? 1 : 0;
63
}
64
65
}
// namespace CLHEP
CLHEP::HepRandomEngine
Definition
RandomEngine.h:55
CLHEP::RandBit::shootBit
static int shootBit()
Definition
RandBit.icc:44
CLHEP::RandBit::RandBit
RandBit(HepRandomEngine &anEngine)
Definition
RandBit.icc:16
CLHEP::RandBit::fireBit
int fireBit()
Definition
RandBit.icc:60
CLHEP::RandFlat::shoot
static double shoot()
CLHEP::RandFlat::RandFlat
RandFlat(HepRandomEngine &anEngine)
Definition
RandFlat.icc:24
CLHEP::RandFlat::fire
double fire()
Definition
RandFlat.icc:128
CLHEP::RandFlat::engine
HepRandomEngine & engine()
CLHEP
Definition
ClhepVersion.h:13
Generated by
1.14.0