CLHEP/Random/RandGaussQ.h

// $Id: RandGaussQ.h,v 1.2 2000/04/25 14:50:20 evc Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
//                             HEP Random
//                          --- RandGaussQ ---
//                          class header file
// -----------------------------------------------------------------------

// Class defining methods RandGaussQ, which is derived from RandGauss.
// The user interface is identical; but RandGaussQ is faster and a bit less
// accurate.

// =======================================================================
// M. Fischler - Created: 24th Jan 2000
//
// =======================================================================

#ifndef RandGaussQ_h
#define RandGaussQ_h 1

#include "CLHEP/Random/RandGauss.h"

class RandGaussQ : public RandGauss {

public:

  inline RandGaussQ ( HepRandomEngine& anEngine, HepDouble mean=0.0,
                                                HepDouble stdDev=1.0 );
  inline RandGaussQ ( HepRandomEngine* anEngine, HepDouble mean=0.0,
                                                HepDouble stdDev=1.0 );
  // These constructors should be used to instantiate a RandGaussQ
  // 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 RandGaussQ destructor.
  // If the engine is passed by reference the corresponding engine object
  // will not be deleted by the RandGaussQ destructor.

  // Destructor
  virtual ~RandGaussQ();

  //
  // Methods to generate Gaussian-distributed random deviates:
  //
  //   If a fast good engine takes 1 usec, RandGauss::fire() adds 1 usec while 
  //   RandGaussQ::fire() adds only .4 usec.
  //

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

  static  inline HepDouble shoot();

  static  inline HepDouble shoot( HepDouble mean, HepDouble stdDev );

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

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

  static  inline HepDouble shoot( HepRandomEngine* anotherEngine );

  static  inline HepDouble shoot( HepRandomEngine* anotherEngine, 
                                  HepDouble mean, HepDouble stdDev );


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

  //  Instance methods using the localEngine to instead of the static 
  //  generator, and the default mean and stdDev established at construction

  inline HepDouble fire();

  inline HepDouble fire ( HepDouble mean, HepDouble stdDev );
  
  void fireArray  ( const HepInt size, HepDouble* vect);
  void fireArray  ( const HepInt size, HepDouble* vect,
                    HepDouble mean, HepDouble stdDev );

  virtual HepDouble operator()();
  virtual HepDouble operator()( HepDouble mean, HepDouble stdDev );

protected:

  static HepDouble transformQuick (HepDouble r);
  static HepDouble transformSmall (HepDouble r);

private:

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

  // All the engine info, and the default mean and sigma, are in the RandGauss
  // base class.

};

#include "CLHEP/Random/RandGaussQ.icc"

#endif

Generated by GNU enscript 1.6.1.