9 #ifndef ICARUSALG_UTILITIES_NONRANDOMCOUNTER_H
10 #define ICARUSALG_UTILITIES_NONRANDOMCOUNTER_H
13 #include "CLHEP/Random/defs.h"
14 #include "CLHEP/Random/RandomEngine.h"
23 namespace util {
class NonRandomCounter; }
46 {
double*
end = vect +
size;
while (vect != end) *(vect++) =
doFlat(); }
49 {
count =
static_cast<unsigned long>(
seed); }
62 virtual std::string
name()
const override {
return "NonRandomCounter"; }
70 return static_cast<double>(++
count)
71 / std::numeric_limits<unsigned long>::max();
75 static long readLong(std::istream& is) {
unsigned long l; is >> l;
return l; }
88 #endif // ICARUSALG_UTILITIES_NONRANDOMCOUNTER_H
virtual void saveStatus(const char filename[]="NonRandomCounter.conf") const override
virtual void setSeeds(long const *seeds, int _) override
Fast random engine which returns sequential numbers.
static long readLong(std::istream &is)
BEGIN_PROLOG could also be dds filename
virtual void flatArray(const int size, double *vect) override
virtual void showStatus() const override
NonRandomCounter(std::istream &is)
virtual double flat() override
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
virtual void restoreStatus(const char filename[]="NonRandomCounter.conf") override
NonRandomCounter()=default
std::vector< TrajPoint > seeds
virtual std::string name() const override
virtual void setSeed(long seed, int) override
NonRandomCounter(long seed)