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

RandomEngine.cc
Go to the documentation of this file.
1 // $Id: RandomEngine.cc,v 1.7 2010/10/25 18:18:47 garren Exp $
2 // -*- C++ -*-
3 //
4 // ------------------------------------------------------------------------
5 // HEP Random
6 // --- HepRandomEngine ---
7 // class implementation file
8 // ------------------------------------------------------------------------
9 // This file is part of Geant4 (simulation toolkit for HEP).
10 
11 // ========================================================================
12 // Gabriele Cosmo - Created: 5th September 1995
13 // - Minor corrections: 31st October 1996
14 // - Moved table of seeds to HepRandom: 19th March 1998
15 // Ken Smith - Added conversion operators: 6th Aug 1998
16 // =======================================================================
17 
18 #include "CLHEP/Random/defs.h"
19 #include "CLHEP/Random/RandomEngine.h"
20 #include "CLHEP/Random/EngineFactory.h"
21 
22 //------------------------- HepRandomEngine ------------------------------
23 
24 namespace CLHEP {
25 
27 : theSeed (19780503L)
28 , theSeeds(&theSeed)
29 { }
30 
32 
33 HepRandomEngine::operator double() {
34  return flat();
35 }
36 
37 HepRandomEngine::operator float() {
38  return float( flat() );
39 }
40 
41 HepRandomEngine::operator unsigned int() {
42  return (unsigned int)( flat() * exponent_bit_32() );
43 }
44 
45 bool
46 HepRandomEngine::checkFile (std::istream & file,
47  const std::string & filename,
48  const std::string & classname,
49  const std::string & methodname) {
50  if (!file) {
51  std::cerr << "Failure to find or open file " << filename <<
52  " in " << classname << "::" << methodname << "()\n";
53  return false;
54  }
55  return true;
56 }
57 
58 std::ostream & HepRandomEngine::put (std::ostream & os) const {
59  std::cerr << "HepRandomEngine::put called -- no effect!\n";
60  return os;
61 }
62 std::istream & HepRandomEngine::get (std::istream & is) {
63  std::cerr << "HepRandomEngine::get called -- no effect!\n";
64  return is;
65 }
66 
67 std::string HepRandomEngine::beginTag ( ) {
68  return "HepRandomEngine-begin";
69 }
70 
71 std::istream & HepRandomEngine::getState ( std::istream & is ) {
72  std::cerr << "HepRandomEngine::getState called -- no effect!\n";
73  return is;
74 }
75 
76 std::vector<unsigned long> HepRandomEngine::put () const {
77  std::cerr << "v=HepRandomEngine::put() called -- no data!\n";
78  std::vector<unsigned long> v;
79  return v;
80 }
81 bool HepRandomEngine::get (const std::vector<unsigned long> & ) {
82  std::cerr << "HepRandomEngine::get(v) called -- no effect!\n";
83  return false;
84 }
85 bool HepRandomEngine::getState (const std::vector<unsigned long> & ) {
86  std::cerr << "HepRandomEngine::getState(v) called -- no effect!\n";
87  return false;
88 }
89 
92 }
93 
95 HepRandomEngine::newEngine(const std::vector<unsigned long> & v) {
97 }
98 
99 std::ostream & operator<< (std::ostream & os, const HepRandomEngine & e) {
100  return e.put(os);
101 }
102 
103 std::istream & operator>> (std::istream & is, HepRandomEngine & e) {
104  return e.get(is);
105 }
106 
107 
108 } // namespace CLHEP
CLHEP::HepRandomEngine::getState
virtual std::istream & getState(std::istream &is)
Definition: RandomEngine.cc:71
double
#define double(obj)
Definition: excDblThrow.cc:32
CLHEP::HepRandomEngine
Definition: Matrix/CLHEP/Random/RandomEngine.h:55
CLHEP::HepRandomEngine::newEngine
static HepRandomEngine * newEngine(std::istream &is)
Definition: RandomEngine.cc:90
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
theSeed
theSeed
Definition: JamesRandomSeeding.txt:32
CLHEP::HepRandomEngine::put
virtual std::vector< unsigned long > put() const
Definition: RandomEngine.cc:76
CLHEP::HepRandomEngine::get
virtual std::istream & get(std::istream &is)
Definition: RandomEngine.cc:62
CLHEP
Definition: ClhepVersion.h:13
CLHEP::HepRandomEngine::HepRandomEngine
HepRandomEngine()
Definition: RandomEngine.cc:26
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::operator>>
std::istream & operator>>(std::istream &is, HepAxisAngle &aa)
Definition: AxisAngle.cc:96
CLHEP::HepRandomEngine::~HepRandomEngine
virtual ~HepRandomEngine()
Definition: RandomEngine.cc:31
CLHEP::HepRandomEngine::beginTag
static std::string beginTag()
Definition: RandomEngine.cc:67
CLHEP::EngineFactory::newEngine
static HepRandomEngine * newEngine(std::istream &is)
Definition: EngineFactory.cc:58
CLHEP::HepRandomEngine::checkFile
static bool checkFile(std::istream &file, const std::string &filename, const std::string &classname, const std::string &methodname)
Definition: RandomEngine.cc:46
CLHEP::HepRandomEngine::put
virtual std::ostream & put(std::ostream &os) const
Definition: RandomEngine.cc:58
CLHEP::operator<<
std::ostream & operator<<(std::ostream &os, const HepAxisAngle &aa)
Definition: AxisAngle.cc:86