CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP::EngineFactory Class Reference

#include <EngineFactory.h>

Static Public Member Functions

static HepRandomEnginenewEngine (std::istream &is)
 
static HepRandomEnginenewEngine (std::vector< unsigned long > const &v)
 

Detailed Description

Definition at line 24 of file EngineFactory.h.

Member Function Documentation

◆ newEngine() [1/2]

HepRandomEngine * CLHEP::EngineFactory::newEngine ( std::istream &  is)
static

Definition at line 61 of file EngineFactory.cc.

61 {
62 HepRandomEngine* eptr;
63 std::string tag;
64 is >> tag;
65 eptr = makeAnEngine <HepJamesRandom> (tag, is); if (eptr) return eptr;
66 eptr = makeAnEngine <RanecuEngine> (tag, is); if (eptr) return eptr;
67 eptr = makeAnEngine <Ranlux64Engine> (tag, is); if (eptr) return eptr;
68 eptr = makeAnEngine <RanluxppEngine> (tag, is); if (eptr) return eptr;
69 eptr = makeAnEngine <MixMaxRng> (tag, is); if (eptr) return eptr;
70 eptr = makeAnEngine <MTwistEngine> (tag, is); if (eptr) return eptr;
71 eptr = makeAnEngine <DRand48Engine> (tag, is); if (eptr) return eptr;
72 eptr = makeAnEngine <TripleRand> (tag, is); if (eptr) return eptr;
73 eptr = makeAnEngine <DualRand> (tag, is); if (eptr) return eptr;
74 eptr = makeAnEngine <Hurd160Engine> (tag, is); if (eptr) return eptr;
75 eptr = makeAnEngine <Hurd288Engine> (tag, is); if (eptr) return eptr;
76 eptr = makeAnEngine <RandEngine> (tag, is); if (eptr) return eptr;
77 eptr = makeAnEngine <RanluxEngine> (tag, is); if (eptr) return eptr;
78 eptr = makeAnEngine <RanshiEngine> (tag, is); if (eptr) return eptr;
79 eptr = makeAnEngine <NonRandomEngine> (tag, is); if (eptr) return eptr;
80 is.clear(std::ios::badbit | is.rdstate());
81 std::cerr <<
82 "Input mispositioned or bad in reading anonymous engine\n"
83 << "\nBegin-tag read was: " << tag
84 << "\nInput stream is probably fouled up\n";
85 return eptr;
86}

Referenced by CLHEP::HepRandomEngine::newEngine().

◆ newEngine() [2/2]

HepRandomEngine * CLHEP::EngineFactory::newEngine ( std::vector< unsigned long > const &  v)
static

Definition at line 89 of file EngineFactory.cc.

89 {
90 HepRandomEngine* eptr;
91 eptr = makeAnEngine <HepJamesRandom> (v); if (eptr) return eptr;
92 eptr = makeAnEngine <RanecuEngine> (v); if (eptr) return eptr;
93 eptr = makeAnEngine <Ranlux64Engine> (v); if (eptr) return eptr;
94 eptr = makeAnEngine <RanluxppEngine> (v); if (eptr) return eptr;
95 eptr = makeAnEngine <MixMaxRng> (v); if (eptr) return eptr;
96 eptr = makeAnEngine <MTwistEngine> (v); if (eptr) return eptr;
97 eptr = makeAnEngine <DRand48Engine> (v); if (eptr) return eptr;
98 eptr = makeAnEngine <TripleRand> (v); if (eptr) return eptr;
99 eptr = makeAnEngine <DualRand> (v); if (eptr) return eptr;
100 eptr = makeAnEngine <Hurd160Engine> (v); if (eptr) return eptr;
101 eptr = makeAnEngine <Hurd288Engine> (v); if (eptr) return eptr;
102 eptr = makeAnEngine <RandEngine> (v); if (eptr) return eptr;
103 eptr = makeAnEngine <RanluxEngine> (v); if (eptr) return eptr;
104 eptr = makeAnEngine <RanshiEngine> (v); if (eptr) return eptr;
105 eptr = makeAnEngine <NonRandomEngine> (v); if (eptr) return eptr;
106 std::cerr <<
107 "Cannot correctly get anonymous engine from vector\n"
108 << "First unsigned long was: " << v[0]
109 << " Vector size was: " << v.size() <<"\n";
110 return eptr;
111}

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