CLHEP/Random/RandBreitWigner.h

// $Id: RandBreitWigner.h,v 1.7 2000/04/17 22:59:51 mf Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
//                             HEP Random
//                        --- RandBreitWigner ---
//                           class header file
// -----------------------------------------------------------------------
// This file is part of Geant4 (simulation toolkit for HEP).
//
// Class defining methods for shooting numbers according to the
// Breit-Wigner distribution algorithms (plain or mean^2).
// Default values are set: mean=1, gamma=.2, cut=1.
// Plain algorithm is used for shootArray() and fireArray().
// Plain algorithm with default values is used for operator()(). 

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

#ifndef RandBreitWigner_h
#define RandBreitWigner_h 1

#include "CLHEP/Random/RandFlat.h"

class RandBreitWigner : public HepRandom {

public:

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

  virtual ~RandBreitWigner();
  // Destructor

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

  static  HepDouble shoot( HepDouble a=1.0, HepDouble b=0.2 );

  static  HepDouble shoot( HepDouble a, HepDouble b, HepDouble c );

  static  HepDouble shootM2( HepDouble a=1.0, HepDouble b=0.2 );

  static  HepDouble shootM2( HepDouble a, HepDouble b, HepDouble c );

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

  static  void shootArray ( const HepInt size, HepDouble* vect,
                            HepDouble a, HepDouble b );

  static  void shootArray ( const HepInt size, HepDouble* vect,
                            HepDouble a, HepDouble b, HepDouble c );
                           
  //  Static methods to shoot random values using a given engine
  //  by-passing the static generator.

  static  HepDouble shoot( HepRandomEngine* anEngine, HepDouble a=1.0,
                           HepDouble b=0.2 );
  static  HepDouble shoot( HepRandomEngine* anEngine, HepDouble a,
                           HepDouble b, HepDouble c );
  static  HepDouble shootM2( HepRandomEngine* anEngine, HepDouble a=1.0,
                             HepDouble b=0.2 );
  static  HepDouble shootM2( HepRandomEngine* anEngine, HepDouble a,
                             HepDouble b, HepDouble c );
  static  void shootArray ( HepRandomEngine* anEngine,
                            const HepInt size, HepDouble* vect );
  static  void shootArray ( HepRandomEngine* anEngine,
                            const HepInt size, HepDouble* vect,
                            HepDouble a, HepDouble b );
  static  void shootArray ( HepRandomEngine* anEngine,
                            const HepInt size, HepDouble* vect,
                            HepDouble a, HepDouble b, HepDouble c );

  //  Methods using the localEngine to shoot random values, by-passing
  //  the static generator. These methods respect distribution parameters
  //  passed by the user at instantiation unless superseded by actual
  //  arguments in the call.

  HepDouble fire();

  HepDouble fire( HepDouble a, HepDouble b );

  HepDouble fire( HepDouble a, HepDouble b, HepDouble c );

  HepDouble fireM2();

  HepDouble fireM2( HepDouble a, HepDouble b );

  HepDouble fireM2( HepDouble a, HepDouble b, HepDouble c );

  void fireArray ( const HepInt size, HepDouble* vect);

  void fireArray ( const HepInt size, HepDouble* vect,
                   HepDouble a, HepDouble b );

  void fireArray ( const HepInt size, HepDouble* vect,
                   HepDouble a, HepDouble b, HepDouble c );
  HepDouble operator()();
  HepDouble operator()( HepDouble a, HepDouble b );
  HepDouble operator()( HepDouble a, HepDouble b, HepDouble c );
  
private:

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

  HepRandomEngine* localEngine;
  HepBoolean deleteEngine;
  const HepDouble defaultA;
  const HepDouble defaultB;

};

#include "CLHEP/Random/RandBreitWigner.icc"

#endif

Generated by GNU enscript 1.6.1.