70 double lx,
double dx )
74 for (i=0; i<size; ++i)
75 vect[i] =
shoot(lx,dx);
79 const int size,
double* vect,
80 double lx,
double dx )
84 for (i=0; i<size; ++i)
85 vect[i] =
shoot(anEngine,lx,dx);
92 for (i=0; i<size; ++i)
97 double lx,
double dx )
101 for (i=0; i<size; ++i)
102 vect[i] =
fire( lx, dx );
127 std::ifstream infile ( filename, std::ios::in );
129 char inputword[] =
"NO_KEYWORD ";
133 if (strcmp(inputword,
"RANDFLAT")==0)
break;
134 if (infile.eof())
break;
143 if (strcmp(inputword,
"RANDFLAT")==0) {
158 int pr=os.precision(20);
159 std::vector<unsigned long> t(2);
160 os <<
" " <<
name() <<
"\n";
161 os <<
"Uvec" <<
"\n";
164 os <<
defaultWidth <<
" " << t[0] <<
" " << t[1] <<
"\n";
166 os <<
defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
168 os <<
defaultB <<
" " << t[0] <<
" " << t[1] <<
"\n";
176 if (inName !=
name()) {
177 is.clear(std::ios::badbit | is.rdstate());
178 std::cerr <<
"Mismatch when expecting to read state of a "
179 <<
name() <<
" distribution\n"
180 <<
"Name found was " << inName
181 <<
"\nistream is left in the badbit state\n";
185 std::vector<unsigned long> t(2);
191 is.clear(std::ios::badbit | is.rdstate());
192 std::cerr <<
"\nRandFlat input failed"
193 <<
"\nInput stream is probably mispositioned now." << std::endl;
206 int prec = os.precision(20);
217 is.clear(std::ios::badbit | is.rdstate());
218 std::cerr <<
"Mismatch when expecting to read static state of a "
220 <<
"Name found was " << inName
221 <<
"\nistream is left in the badbit state\n";
228 if (keyword!=
"RANDFLAT") {
229 is.clear(std::ios::badbit | is.rdstate());
230 std::cerr <<
"Mismatch when expecting to read RANDFLAT bit cache info: "
static double longs2double(const std::vector< unsigned long > &v)
static std::vector< unsigned long > dto2longs(double d)
virtual void restoreStatus(const char filename[]="Config.conf")=0
virtual void saveStatus(const char filename[]="Config.conf") const =0
virtual void flatArray(const int size, double *vect)=0
static HepRandomEngine * getTheEngine()
static std::ostream & saveFullState(std::ostream &os)
static std::istream & restoreFullState(std::istream &is)
static CLHEP_THREAD_LOCAL unsigned long staticRandomInt
static std::ostream & saveFullState(std::ostream &os)
std::ostream & put(std::ostream &os) const
std::shared_ptr< HepRandomEngine > localEngine
unsigned long firstUnusedBit
static const unsigned long MSB
static CLHEP_THREAD_LOCAL unsigned long staticFirstUnusedBit
static void restoreEngineStatus(const char filename[]="Config.conf")
void fireArray(const int size, double *vect)
static std::string distributionName()
static void saveEngineStatus(const char filename[]="Config.conf")
static std::ostream & saveDistState(std::ostream &os)
static std::istream & restoreDistState(std::istream &is)
static void shootArray(const int size, double *vect)
static std::istream & restoreFullState(std::istream &is)
std::istream & get(std::istream &is)
HepRandomEngine & engine()
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
#define CLHEP_THREAD_LOCAL