Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CLHEP::RandExponential Class Reference

#include <RandExponential.h>

Inheritance diagram for CLHEP::RandExponential:
Collaboration diagram for CLHEP::RandExponential:

Public Member Functions

 RandExponential (HepRandomEngine &anEngine, double mean=1.0)
 
 RandExponential (HepRandomEngine *anEngine, double mean=1.0)
 
virtual ~RandExponential ()
 
double fire ()
 
double fire (double mean)
 
void fireArray (const int size, double *vect)
 
void fireArray (const int size, double *vect, double mean)
 
double operator() ()
 
double operator() (double mean)
 
std::ostream & put (std::ostream &os) const
 
std::istream & get (std::istream &is)
 
std::string name () const
 
HepRandomEngineengine ()
 
- Public Member Functions inherited from CLHEP::HepRandom
 HepRandom ()
 
 HepRandom (long seed)
 
 HepRandom (HepRandomEngine &algorithm)
 
 HepRandom (HepRandomEngine *algorithm)
 
virtual ~HepRandom ()
 
double flat ()
 
void flatArray (const int size, double *vect)
 
double flat (HepRandomEngine *theNewEngine)
 
void flatArray (HepRandomEngine *theNewEngine, const int size, double *vect)
 

Static Public Member Functions

static double shoot ()
 
static double shoot (double mean)
 
static void shootArray (const int size, double *vect, double mean=1.0)
 
static double shoot (HepRandomEngine *anEngine)
 
static double shoot (HepRandomEngine *anEngine, double mean)
 
static void shootArray (HepRandomEngine *anEngine, const int size, double *vect, double mean=1.0)
 
static std::string distributionName ()
 
- Static Public Member Functions inherited from CLHEP::HepRandom
static void setTheSeed (long seed, int lux=3)
 
static long getTheSeed ()
 
static void setTheSeeds (const long *seeds, int aux=-1)
 
static const long * getTheSeeds ()
 
static void getTheTableSeeds (long *seeds, int index)
 
static HepRandomgetTheGenerator ()
 
static void setTheEngine (HepRandomEngine *theNewEngine)
 
static HepRandomEnginegetTheEngine ()
 
static void saveEngineStatus (const char filename[]="Config.conf")
 
static void restoreEngineStatus (const char filename[]="Config.conf")
 
static std::ostream & saveFullState (std::ostream &os)
 
static std::istream & restoreFullState (std::istream &is)
 
static std::ostream & saveDistState (std::ostream &os)
 
static std::istream & restoreDistState (std::istream &is)
 
static std::ostream & saveStaticRandomStates (std::ostream &os)
 
static std::istream & restoreStaticRandomStates (std::istream &is)
 
static void showEngineStatus ()
 
static int createInstance ()
 
static std::string distributionName ()
 

Additional Inherited Members

- Static Protected Attributes inherited from CLHEP::HepRandom
static const long seedTable [215][2]
 

Detailed Description

Constructor & Destructor Documentation

CLHEP::RandExponential::RandExponential ( HepRandomEngine anEngine,
double  mean = 1.0 
)
inline
CLHEP::RandExponential::RandExponential ( HepRandomEngine anEngine,
double  mean = 1.0 
)
inline
CLHEP::RandExponential::~RandExponential ( )
virtual

Definition at line 30 of file RandExponential.cc.

30  {
31 }

Member Function Documentation

static std::string CLHEP::RandExponential::distributionName ( )
inlinestatic

Definition at line 93 of file RandExponential.h.

93 {return "RandExponential";}
HepRandomEngine & CLHEP::RandExponential::engine ( )
virtual

Reimplemented from CLHEP::HepRandom.

Definition at line 28 of file RandExponential.cc.

28 {return *localEngine;}
double CLHEP::RandExponential::fire ( )
inline

Here is the caller graph for this function:

double CLHEP::RandExponential::fire ( double  mean)
inline
void CLHEP::RandExponential::fireArray ( const int  size,
double *  vect 
)

Definition at line 63 of file RandExponential.cc.

64 {
65  for( double* v = vect; v != vect+size; ++v )
66  *v = fire( defaultMean );
67 }

Here is the call graph for this function:

void CLHEP::RandExponential::fireArray ( const int  size,
double *  vect,
double  mean 
)

Definition at line 69 of file RandExponential.cc.

71 {
72  for( double* v = vect; v != vect+size; ++v )
73  *v = fire( mean );
74 }

Here is the call graph for this function:

std::istream & CLHEP::RandExponential::get ( std::istream &  is)
virtual

Reimplemented from CLHEP::HepRandom.

Definition at line 87 of file RandExponential.cc.

87  {
88  std::string inName;
89  is >> inName;
90  if (inName != name()) {
91  is.clear(std::ios::badbit | is.rdstate());
92  std::cerr << "Mismatch when expecting to read state of a "
93  << name() << " distribution\n"
94  << "Name found was " << inName
95  << "\nistream is left in the badbit state\n";
96  return is;
97  }
98  if (possibleKeywordInput(is, "Uvec", defaultMean)) {
99  std::vector<unsigned long> t(2);
100  is >> defaultMean >> t[0] >> t[1]; defaultMean = DoubConv::longs2double(t);
101  return is;
102  }
103  // is >> defaultMean encompassed by possibleKeywordInput
104  return is;
105 }
std::string name() const
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
Definition: RandomEngine.h:167
static double longs2double(const std::vector< unsigned long > &v)
Definition: DoubConv.cc:114

Here is the call graph for this function:

std::string CLHEP::RandExponential::name ( ) const
virtual

Reimplemented from CLHEP::HepRandom.

Definition at line 27 of file RandExponential.cc.

27 {return "RandExponential";}

Here is the caller graph for this function:

double CLHEP::RandExponential::operator() ( )
virtual

Reimplemented from CLHEP::HepRandom.

Definition at line 33 of file RandExponential.cc.

33  {
34  return fire( defaultMean );
35 }

Here is the call graph for this function:

double CLHEP::RandExponential::operator() ( double  mean)

Definition at line 37 of file RandExponential.cc.

37  {
38  return fire( mean );
39 }

Here is the call graph for this function:

std::ostream & CLHEP::RandExponential::put ( std::ostream &  os) const
virtual

Reimplemented from CLHEP::HepRandom.

Definition at line 76 of file RandExponential.cc.

76  {
77  int pr=os.precision(20);
78  std::vector<unsigned long> t(2);
79  os << " " << name() << "\n";
80  os << "Uvec" << "\n";
81  t = DoubConv::dto2longs(defaultMean);
82  os << defaultMean << " " << t[0] << " " << t[1] << "\n";
83  os.precision(pr);
84  return os;
85 }
std::string name() const
static std::vector< unsigned long > dto2longs(double d)
Definition: DoubConv.cc:98

Here is the call graph for this function:

double CLHEP::RandExponential::shoot ( )
static

Definition at line 41 of file RandExponential.cc.

41  {
42  return -std::log(HepRandom::getTheEngine()->flat());
43 }
static HepRandomEngine * getTheEngine()
Definition: Random.cc:265
double flat()
Definition: Random.cc:196

Here is the call graph for this function:

Here is the caller graph for this function:

double CLHEP::RandExponential::shoot ( double  mean)
static

Definition at line 45 of file RandExponential.cc.

45  {
46  return -std::log(HepRandom::getTheEngine()->flat())*mean;
47 }
static HepRandomEngine * getTheEngine()
Definition: Random.cc:265
double flat()
Definition: Random.cc:196

Here is the call graph for this function:

static double CLHEP::RandExponential::shoot ( HepRandomEngine anEngine)
inlinestatic
static double CLHEP::RandExponential::shoot ( HepRandomEngine anEngine,
double  mean 
)
inlinestatic
void CLHEP::RandExponential::shootArray ( const int  size,
double *  vect,
double  mean = 1.0 
)
static

Definition at line 49 of file RandExponential.cc.

51 {
52  for( double* v = vect; v != vect+size; ++v )
53  *v = shoot(mean);
54 }

Here is the call graph for this function:

void CLHEP::RandExponential::shootArray ( HepRandomEngine anEngine,
const int  size,
double *  vect,
double  mean = 1.0 
)
static

Definition at line 56 of file RandExponential.cc.

58 {
59  for( double* v = vect; v != vect+size; ++v )
60  *v = shoot(anEngine, mean);
61 }

Here is the call graph for this function:


The documentation for this class was generated from the following files: