// $Id: RandExponential.cc,v 1.12 2002/05/07 16:47:29 mf Exp $ // -*- C++ -*- // // ----------------------------------------------------------------------- // HEP Random // --- RandExponential --- // class implementation file // ----------------------------------------------------------------------- // This file is part of Geant4 (simulation toolkit for HEP). // ======================================================================= // Gabriele Cosmo - Created: 17th May 1996 // - Added methods to shoot arrays: 28th July 1997 // J.Marraffino - Added default mean as attribute and // operator() with mean: 16th Feb 1998 // ======================================================================= #include "CLHEP/Random/RandExponential.h" RandExponential::~RandExponential() { if ( deleteEngine ) delete localEngine; } RandExponential::RandExponential(const RandExponential& right) : defaultMean(right.defaultMean) {;} double RandExponential::operator()() { return fire( defaultMean ); } double RandExponential::operator()( double mean ) { return fire( mean ); } double RandExponential::shoot() { return -log(HepRandom::getTheEngine()->flat()); } double RandExponential::shoot(double mean) { return -log(HepRandom::getTheEngine()->flat())*mean; } void RandExponential::shootArray( const int size, double* vect, double mean ) { int i; for (i=0; i