1 #ifndef G4EVAL_DSTCOMPRESSOR_H
2 #define G4EVAL_DSTCOMPRESSOR_H
4 #include "RtypesCore.h"
23 using bit5 = std::bitset<5>;
24 using bit8 = std::bitset<8>;
27 using Dict = std::vector<float>;
31 using Pars = std::array<double, 4>;
37 float phiSigma = 0.015,
38 float zMean = -0.00063,
39 float zSigma = 0.07036,
45 int numPoints = 1000000;
53 int numPoints,
int numBits)
55 std::vector<ushort> order;
56 std::vector<float> dict;
57 std::vector<unsigned long> cnt;
59 std::normal_distribution<double> distribution(mean, stddev);
60 float maxAbsError =
approx(&order, &dict, &cnt, numPoints, generator,
61 distribution, (
size_t) pow(2, numBits));
62 std::cout <<
"Compressing with " << numBits <<
" bits" << std::endl;
63 std::cout <<
"Number of clusters = " << dict.size() << std::endl;
64 std::cout <<
"Maximum absolute error = " << maxAbsError << std::endl;
89 #endif // G4EVAL_DSTCOMPRESSOR_H