CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
RandBinomial.icc
Go to the documentation of this file.
1// $Id: RandBinomial.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
2// -*- C++ -*-
3//
4// -----------------------------------------------------------------------
5// HEP Random
6// --- RandBinomial ---
7// inlined functions implementation file
8// -----------------------------------------------------------------------
9
10// =======================================================================
11// Gabriele Cosmo - Created: 18th August 1998
12// =======================================================================
13
14namespace CLHEP {
15
17 double p )
18: HepRandom ( ), localEngine( &anEngine, do_nothing_deleter() ),
19 defaultN(n), defaultP(p) {}
20
22 double p )
23: HepRandom ( ), localEngine( anEngine),
24 defaultN(n), defaultP(p) {}
25
26inline double RandBinomial::shoot() {
27 return shoot( 1, 0.5 );
28}
29
30inline double RandBinomial::shoot( HepRandomEngine* anEngine ) {
31 return shoot( anEngine, 1, 0.5 );
32}
33
34inline double RandBinomial::operator()() {
35 return fire( defaultN, defaultP );
36}
37
38inline double RandBinomial::operator()( long n, double p ) {
39 return fire( n, p );
40}
41
42inline double RandBinomial::fire() {
43 return fire( defaultN, defaultP );
44}
45
46} // namespace CLHEP
RandBinomial(HepRandomEngine &anEngine, long n=1, double p=0.5)
static double shoot()