68 double lx,
double dx )
72 for (i=0; i<size; ++i)
73 vect[i] =
shoot(lx,dx);
77 const int size,
double* vect,
78 double lx,
double dx )
82 for (i=0; i<size; ++i)
83 vect[i] =
shoot(anEngine,lx,dx);
90 for (i=0; i<size; ++i)
95 double lx,
double dx )
99 for (i=0; i<size; ++i)
100 vect[i] =
fire( lx, dx );
110 std::ofstream outfile ( filename, std::ios::app );
127 char inputword[] =
"NO_KEYWORD ";
131 if (strcmp(inputword,
"RANDFLAT")==0)
break;
132 if (infile.eof())
break;
141 if (strcmp(inputword,
"RANDFLAT")==0) {
156 int pr=os.precision(20);
157 std::vector<unsigned long> t(2);
158 os <<
" " <<
name() <<
"\n";
159 os <<
"Uvec" <<
"\n";
162 os <<
defaultWidth <<
" " << t[0] <<
" " << t[1] <<
"\n";
164 os <<
defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
166 os <<
defaultB <<
" " << t[0] <<
" " << t[1] <<
"\n";
174 if (inName !=
name()) {
175 is.clear(std::ios::badbit | is.rdstate());
176 std::cerr <<
"Mismatch when expecting to read state of a "
177 <<
name() <<
" distribution\n"
178 <<
"Name found was " << inName
179 <<
"\nistream is left in the badbit state\n";
183 std::vector<unsigned long> t(2);
189 is.clear(std::ios::badbit | is.rdstate());
190 std::cerr <<
"\nRandFlat input failed"
191 <<
"\nInput stream is probably mispositioned now." << std::endl;
204 int prec = os.precision(20);
215 is.clear(std::ios::badbit | is.rdstate());
216 std::cerr <<
"Mismatch when expecting to read static state of a "
218 <<
"Name found was " << inName
219 <<
"\nistream is left in the badbit state\n";
226 if (keyword!=
"RANDFLAT") {
227 is.clear(std::ios::badbit | is.rdstate());
228 std::cerr <<
"Mismatch when expecting to read RANDFLAT bit cache info: "
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
std::istream & get(std::istream &is)
static std::ostream & saveFullState(std::ostream &os)
std::vector< ExP01TrackerHit * > a
static HepRandomEngine * getTheEngine()
static std::ostream & saveFullState(std::ostream &os)
static CLHEP_THREAD_LOCAL unsigned long staticFirstUnusedBit
std::shared_ptr< HepRandomEngine > localEngine
virtual void flatArray(const int size, double *vect)=0
void fireArray(const int size, double *vect)
static const unsigned long MSB
static std::istream & restoreDistState(std::istream &is)
static CLHEP_THREAD_LOCAL unsigned long staticRandomInt
HepRandomEngine & engine()
static double longs2double(const std::vector< unsigned long > &v)
static std::string distributionName()
virtual void saveStatus(const char filename[]="Config.conf") const =0
static std::istream & restoreFullState(std::istream &is)
static std::vector< unsigned long > dto2longs(double d)
#define CLHEP_THREAD_LOCAL
static void restoreEngineStatus(const char filename[]="Config.conf")
static void saveEngineStatus(const char filename[]="Config.conf")
static std::istream & restoreFullState(std::istream &is)
static std::ostream & saveDistState(std::ostream &os)
static void shootArray(const int size, double *vect)
unsigned long firstUnusedBit
virtual void restoreStatus(const char filename[]="Config.conf")=0
std::ostream & put(std::ostream &os) const