CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

RandGaussT.cc
Go to the documentation of this file.
1 // $Id: RandGaussT.cc,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandGaussT ---
7 // class implementation file
8 // -----------------------------------------------------------------------
9 
10 // =======================================================================
11 // M Fischler - Created 04 Feb 2000
12 // M Fischler - put and get to/from streams 12/13/04
13 // M Fischler - operator() modified to use localEngine 12/13/04
14 // =======================================================================
15 
16 #include "CLHEP/Random/defs.h"
17 #include "CLHEP/Random/RandGaussT.h"
18 #include <iostream>
19 
20 namespace CLHEP {
21 
22 std::string RandGaussT::name() const {return "RandGaussT";}
24 
26 }
27 
30  + defaultMean;
31 }
32 
33 double RandGaussT::operator()( double mean, double stdDev ) {
34  return HepStat::flatToGaussian(localEngine->flat()) * stdDev + mean;
35 }
36 
37 void RandGaussT::shootArray( const int size, double* vect,
38  double mean, double stdDev )
39 {
40  for( double* v = vect; v != vect + size; ++v )
41  *v = shoot(mean,stdDev);
42 }
43 
45  const int size, double* vect,
46  double mean, double stdDev )
47 {
48  for( double* v = vect; v != vect + size; ++v )
49  *v = shoot(anEngine,mean,stdDev);
50 }
51 
52 void RandGaussT::fireArray( const int size, double* vect)
53 {
54  for( double* v = vect; v != vect + size; ++v )
56 }
57 
58 void RandGaussT::fireArray( const int size, double* vect,
59  double mean, double stdDev )
60 {
61  for( double* v = vect; v != vect + size; ++v )
62  *v = fire( mean, stdDev );
63 }
64 
65 std::ostream & RandGaussT::put ( std::ostream & os ) const {
66  int pr=os.precision(20);
67  os << " " << name() << "\n";
68  RandGauss::put(os);
69  os.precision(pr);
70  return os;
71 }
72 
73 std::istream & RandGaussT::get ( std::istream & is ) {
74  std::string inName;
75  is >> inName;
76  if (inName != name()) {
77  is.clear(std::ios::badbit | is.rdstate());
78  std::cerr << "Mismatch when expecting to read state of a "
79  << name() << " distribution\n"
80  << "Name found was " << inName
81  << "\nistream is left in the badbit state\n";
82  return is;
83  }
85  return is;
86 }
87 
88 } // namespace CLHEP
89 
CLHEP::RandGaussT::~RandGaussT
virtual ~RandGaussT()
Definition: RandGaussT.cc:25
CLHEP::RandGauss::engine
HepRandomEngine & engine()
Definition: RandGauss.cc:44
CLHEP::RandGaussT::engine
HepRandomEngine & engine()
Definition: RandGaussT.cc:23
CLHEP::HepRandomEngine
Definition: Matrix/CLHEP/Random/RandomEngine.h:55
CLHEP::RandGaussT::shoot
static double shoot()
CLHEP::HepStat::flatToGaussian
static double flatToGaussian(double r)
Definition: flatToGaussian.cc:92
CLHEP::RandGaussT::put
std::ostream & put(std::ostream &os) const
Definition: RandGaussT.cc:65
is
HepRotation and so forth isNear() norm2() rectify() static Rotation row1 row4(To avoid bloat in the code pulled in for programs which don 't use all these features, we split the implementation .cc files. Only isNear() goes into the original Rotation.cc) --------------------------------------- HepAxisAngle and HepEulerAngles classes --------------------------------------- These classes are very useful and simple structures for holding the result of a nice intuituve decomposition of a rotation there is no longer much content in the distinct ZOOM PhysicsVectors library The only content left in the library is the object files representing the various Exception objects When we build the CLHEP classes for the ZOOM we will set up so as to use ZOOM SpaceVector is(but we can disable namespace usage and most of our users do so at this point). What I do is leave Hep3Vector in the global namespace
CLHEP::RandGauss::get
std::istream & get(std::istream &is)
Definition: RandGauss.cc:262
CLHEP::RandGaussT::fire
double fire()
size
user code seldom needs to call this function directly ZMerrno whether or not they are still recorded ZMerrno size() Return the(integer) number of ZMthrow 'n exceptions currently recorded. 5) ZMerrno.clear() Set an internal counter to zero. This counter is available(see next function) to user code to track ZMthrow 'n exceptions that have occurred during any arbitrary time interval. 6) ZMerrno.countSinceCleared() Return the(integer) number of ZMthrow 'n exceptions that have been recorded via ZMerrno.write()
CLHEP::RandGaussT::fireArray
void fireArray(const int size, double *vect)
Definition: RandGaussT.cc:52
CLHEP::RandGauss::defaultStdDev
double defaultStdDev
Definition: Matrix/CLHEP/Random/RandGauss.h:153
CLHEP
Definition: ClhepVersion.h:13
CLHEP::RandGaussT::name
std::string name() const
Definition: RandGaussT.cc:22
v
they are gone ZOOM Features Discontinued The following features of the ZOOM package were felt to be extreme overkill These have been after checking that no existing user code was utilizing as in SpaceVector v
Definition: keyMergeIssues.doc:324
CLHEP::RandGauss::defaultMean
double defaultMean
Definition: Matrix/CLHEP/Random/RandGauss.h:152
CLHEP::RandGauss::put
std::ostream & put(std::ostream &os) const
Definition: RandGauss.cc:237
CLHEP::RandGaussT::shootArray
static void shootArray(const int size, double *vect, double mean=0.0, double stdDev=1.0)
Definition: RandGaussT.cc:37
CLHEP::RandGaussT::operator()
virtual double operator()()
Definition: RandGaussT.cc:28
CLHEP::RandGauss::localEngine
shared_ptr< HepRandomEngine > localEngine
Definition: Matrix/CLHEP/Random/RandGauss.h:155
CLHEP::RandGaussT::get
std::istream & get(std::istream &is)
Definition: RandGaussT.cc:73