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