CLHEP/Random/RandExponential.h

// $Id: RandExponential.h,v 1.8 2000/04/17 23:00:00 mf Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
//                             HEP Random
//                        --- RandExponential ---
//                          class header file
// -----------------------------------------------------------------------
// This file is part of Geant4 (simulation toolkit for HEP).
//
// Class defining methods for shooting exponential distributed random
// values, given a mean (default mean = 1).
// Default mean is used for operator()().

// =======================================================================
// Gabriele Cosmo - Created: 5th September 1995
//                - Added methods to shoot arrays: 28th July 1997
// J.Marraffino   - Added default mean as attribute and
//                  operator() with mean: 16th Feb 1998
// =======================================================================

#ifndef RandExponential_h
#define RandExponential_h 1

#include "CLHEP/Random/Random.h"

class RandExponential : public HepRandom {

public:

  inline RandExponential ( HepRandomEngine& anEngine, HepDouble mean=1.0 );
  inline RandExponential ( HepRandomEngine* anEngine, HepDouble mean=1.0 );
  // These constructors should be used to instantiate a RandExponential
  // distribution object defining a local engine for it.
  // The static generator will be skipped using the non-static methods
  // defined below.
  // If the engine is passed by pointer the corresponding engine object
  // will be deleted by the RandExponential destructor.
  // If the engine is passed by reference the corresponding engine object
  // will not be deleted by the RandExponential destructor.

  virtual ~RandExponential();
  // Destructor

  // Static methods to shoot random values using the static generator

  static  HepDouble shoot();

  static  HepDouble shoot( HepDouble mean );

  static  void shootArray ( const HepInt size, HepDouble* vect,
                            HepDouble mean=1.0 );

  //  Static methods to shoot random values using a given engine
  //  by-passing the static generator.

  static  inline HepDouble shoot( HepRandomEngine* anEngine );

  static  inline HepDouble shoot( HepRandomEngine* anEngine, HepDouble mean );

  static  void shootArray ( HepRandomEngine* anEngine, const HepInt size,
                            HepDouble* vect, HepDouble mean=1.0 );

  //  Methods using the localEngine to shoot random values, by-passing
  //  the static generator.

  inline HepDouble fire();

  inline HepDouble fire( HepDouble mean );

  void fireArray ( const HepInt size, HepDouble* vect );
  void fireArray ( const HepInt size, HepDouble* vect, HepDouble mean );
  
  HepDouble operator()();
  HepDouble operator()( HepDouble mean );
  
private:

  // Private copy constructor. Defining it here disallows use.
  RandExponential(const RandExponential& d);


  HepRandomEngine* localEngine;
  HepBoolean deleteEngine;
  const HepDouble defaultMean;

};

#include "CLHEP/Random/RandExponential.icc"

#endif

Generated by GNU enscript 1.6.1.