Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:03:29

0001 // $Id: RandBinomial.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
0002 // -*- C++ -*-
0003 // 
0004 // -----------------------------------------------------------------------
0005 //                             HEP Random
0006 //                        --- RandBinomial ---
0007 //                 inlined functions implementation file
0008 // -----------------------------------------------------------------------
0009  
0010 // =======================================================================
0011 // Gabriele Cosmo - Created: 18th August 1998
0012 // =======================================================================
0013 
0014 namespace CLHEP {
0015 
0016 inline RandBinomial::RandBinomial(HepRandomEngine & anEngine, long n,
0017                                                               double p )
0018 : HepRandom  ( ), localEngine( &anEngine, do_nothing_deleter() ),
0019   defaultN(n), defaultP(p) {}
0020 
0021 inline RandBinomial::RandBinomial(HepRandomEngine * anEngine, long n,
0022                                                               double p )
0023 : HepRandom  ( ), localEngine( anEngine),
0024   defaultN(n), defaultP(p) {}
0025 
0026 inline double RandBinomial::shoot() {
0027   return shoot( 1, 0.5 );
0028 }
0029 
0030 inline double RandBinomial::shoot( HepRandomEngine* anEngine ) {
0031   return shoot( anEngine, 1, 0.5 );
0032 }
0033 
0034 inline double RandBinomial::operator()() {
0035   return fire( defaultN, defaultP );
0036 }
0037 
0038 inline double RandBinomial::operator()( long n, double p ) {
0039   return fire( n, p );
0040 }
0041 
0042 inline double RandBinomial::fire() {
0043   return fire( defaultN, defaultP );
0044 }
0045 
0046 }  // namespace CLHEP