13 #include "cetlib_except/exception.h" 24 unsigned int zerothreshold = 5;
29 unsigned int zerothreshold = 5;
44 unsigned int zerothreshold = 5;
49 unsigned int zerothreshold = 5;
80 unsigned int& zerothreshold,
99 void Compress(
const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
100 std::vector<short>& adc,
102 unsigned int& zerothreshold,
103 int& nearestneighbor)
108 ZeroSuppression(adcvec_neighbors, adc, zerothreshold, nearestneighbor);
110 ZeroSuppression(adcvec_neighbors, adc, zerothreshold, nearestneighbor);
123 unsigned int& zerothreshold,
125 int& nearestneighbor,
126 bool fADCStickyCodeFeature)
131 ZeroSuppression(adc, zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
133 ZeroSuppression(adc, zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
144 void Compress(
const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
145 std::vector<short>& adc,
147 unsigned int& zerothreshold,
149 int& nearestneighbor,
150 bool fADCStickyCodeFeature)
156 adcvec_neighbors, adc, zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
159 adcvec_neighbors, adc, zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
173 const int adcsize = adc.size();
174 const int zerothresholdsigned = zerothreshold;
176 std::vector<short> zerosuppressed(adc.size());
177 int maxblocks = adcsize / 2 + 1;
178 std::vector<short> blockbegin(maxblocks);
179 std::vector<short> blocksize(maxblocks);
181 unsigned int nblocks = 0;
182 unsigned int zerosuppressedsize = 0;
186 for (
int i = 0; i < adcsize; ++i) {
187 int adc_current_value =
std::abs(adc[i]);
189 if (adc_current_value > zerothresholdsigned) {
191 if (blockcheck == 0) {
193 blockbegin[nblocks] = i;
194 blocksize[nblocks] = 0;
198 zerosuppressed[zerosuppressedsize] = adc[i];
199 zerosuppressedsize++;
200 blocksize[nblocks]++;
202 if (i == adcsize - 1) nblocks++;
205 if (adc_current_value <= zerothresholdsigned && blockcheck == 1) {
206 zerosuppressed[zerosuppressedsize] = adc[i];
207 zerosuppressedsize++;
208 blocksize[nblocks]++;
214 adc.resize(2 + nblocks + nblocks + zerosuppressedsize);
219 for (
unsigned int i = 0; i < nblocks; ++i)
220 adc[i + 2] = blockbegin[i];
222 for (
unsigned int i = 0; i < nblocks; ++i)
223 adc[i + nblocks + 2] = blocksize[i];
225 for (
unsigned int i = 0; i < zerosuppressedsize; ++i)
226 adc[i + nblocks + nblocks + 2] = zerosuppressed[i];
232 void ZeroSuppression(std::vector<short>& adc,
unsigned int& zerothreshold,
int& nearestneighbor)
235 const int adcsize = adc.size();
236 const int zerothresholdsigned = zerothreshold;
238 std::vector<short> zerosuppressed(adcsize);
239 int maxblocks = adcsize / 2 + 1;
240 std::vector<short> blockbegin(maxblocks);
241 std::vector<short> blocksize(maxblocks);
244 int zerosuppressedsize = 0;
246 int blockstartcheck = 0;
247 int endofblockcheck = 0;
249 for (
int i = 0; i < adcsize; ++i) {
250 int adc_current_value =
std::abs(adc[i]);
252 if (blockstartcheck == 0) {
253 if (adc_current_value > zerothresholdsigned) {
255 if ((i - nearestneighbor) <= (blockbegin[nblocks - 1] + blocksize[nblocks - 1] + 1)) {
258 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
262 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
263 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
268 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
269 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
274 else if (blockstartcheck == 1) {
275 if (adc_current_value > zerothresholdsigned) {
276 blocksize[nblocks]++;
280 if (endofblockcheck < nearestneighbor) {
282 blocksize[nblocks]++;
285 else if (i + 2 < adcsize) {
286 if (
std::abs(adc[i + 1]) <= zerothresholdsigned &&
287 std::abs(adc[i + 2]) <= zerothresholdsigned) {
298 if (blockstartcheck == 1) {
302 for (
int i = 0; i < nblocks; ++i)
303 zerosuppressedsize += blocksize[i];
305 adc.resize(2 + nblocks + nblocks + zerosuppressedsize);
306 zerosuppressed.resize(2 + nblocks + nblocks + zerosuppressedsize);
308 int zerosuppressedcount = 0;
309 for (
int i = 0; i < nblocks; ++i) {
311 for (
int j = 0; j < blocksize[i]; ++j) {
312 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
313 zerosuppressedcount++;
319 for (
int i = 0; i < nblocks; ++i) {
320 adc[i + 2] = blockbegin[i];
321 adc[i + nblocks + 2] = blocksize[i];
324 for (
int i = 0; i < zerosuppressedsize; ++i)
325 adc[i + nblocks + nblocks + 2] = zerosuppressed[i];
337 unsigned int& zerothreshold,
339 int& nearestneighbor,
340 bool fADCStickyCodeFeature)
343 const int adcsize = adc.size();
344 const int zerothresholdsigned = zerothreshold;
346 std::vector<short> zerosuppressed(adcsize);
347 int maxblocks = adcsize / 2 + 1;
348 std::vector<short> blockbegin(maxblocks);
349 std::vector<short> blocksize(maxblocks);
352 int zerosuppressedsize = 0;
354 int blockstartcheck = 0;
355 int endofblockcheck = 0;
357 for (
int i = 0; i < adcsize; ++i) {
360 if (blockstartcheck == 0) {
361 if (adc_current_value > zerothresholdsigned) {
363 if (i - nearestneighbor <= blockbegin[nblocks - 1] + blocksize[nblocks - 1] + 1) {
365 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
369 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
370 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
375 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
376 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
381 else if (blockstartcheck == 1) {
382 if (adc_current_value > zerothresholdsigned) {
383 blocksize[nblocks]++;
387 if (endofblockcheck < nearestneighbor) {
389 blocksize[nblocks]++;
392 else if (i + 2 < adcsize) {
394 zerothresholdsigned &&
396 zerothresholdsigned) {
406 if (blockstartcheck == 1) {
410 for (
int i = 0; i < nblocks; ++i)
411 zerosuppressedsize += blocksize[i];
413 adc.resize(2 + nblocks + nblocks + zerosuppressedsize);
414 zerosuppressed.resize(2 + nblocks + nblocks + zerosuppressedsize);
416 int zerosuppressedcount = 0;
417 for (
int i = 0; i < nblocks; ++i) {
419 for (
int j = 0; j < blocksize[i]; ++j) {
420 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
421 zerosuppressedcount++;
427 for (
int i = 0; i < nblocks; ++i) {
428 adc[i + 2] = blockbegin[i];
429 adc[i + nblocks + 2] = blocksize[i];
432 for (
int i = 0; i < zerosuppressedsize; ++i)
433 adc[i + nblocks + nblocks + 2] = zerosuppressed[i];
444 void ZeroSuppression(
const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
445 std::vector<short>& adc,
446 unsigned int& zerothreshold,
447 int& nearestneighbor)
450 const int adcsize = adc.size();
451 const int zerothresholdsigned = zerothreshold;
453 std::vector<short> zerosuppressed(adcsize);
454 const int maxblocks = adcsize / 2 + 1;
455 std::vector<short> blockbegin(maxblocks);
456 std::vector<short> blocksize(maxblocks);
459 int zerosuppressedsize = 0;
461 int blockstartcheck = 0;
462 int endofblockcheck = 0;
464 for (
int i = 0; i < adcsize; ++i) {
468 int adc_current_value = 0;
470 for (boost::circular_buffer<std::vector<short>>::
const_iterator adcveciter =
471 adcvec_neighbors.begin();
472 adcveciter != adcvec_neighbors.end();
474 const std::vector<short>& adcvec_current = *adcveciter;
475 const int adcvec_current_single =
std::abs(adcvec_current[i]);
477 if (adc_current_value < adcvec_current_single) {
478 adc_current_value = adcvec_current_single;
481 if (blockstartcheck == 0) {
482 if (adc_current_value > zerothresholdsigned) {
484 if (i - nearestneighbor <= blockbegin[nblocks - 1] + blocksize[nblocks - 1] + 1) {
486 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
490 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
491 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
496 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
497 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
502 else if (blockstartcheck == 1) {
503 if (adc_current_value > zerothresholdsigned) {
504 blocksize[nblocks]++;
508 if (endofblockcheck < nearestneighbor) {
510 blocksize[nblocks]++;
513 else if (i + 2 < adcsize) {
514 if (
std::abs(adc[i + 1]) <= zerothresholdsigned &&
515 std::abs(adc[i + 2]) <= zerothresholdsigned) {
526 if (blockstartcheck == 1) {
530 for (
int i = 0; i < nblocks; ++i)
531 zerosuppressedsize += blocksize[i];
533 adc.resize(2 + nblocks + nblocks + zerosuppressedsize);
534 zerosuppressed.resize(2 + nblocks + nblocks + zerosuppressedsize);
536 int zerosuppressedcount = 0;
537 for (
int i = 0; i < nblocks; ++i) {
539 for (
int j = 0; j < blocksize[i]; ++j) {
540 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
541 zerosuppressedcount++;
547 for (
int i = 0; i < nblocks; ++i) {
548 adc[i + 2] = blockbegin[i];
549 adc[i + nblocks + 2] = blocksize[i];
552 for (
int i = 0; i < zerosuppressedsize; ++i)
553 adc[i + nblocks + nblocks + 2] = zerosuppressed[i];
565 void ZeroSuppression(
const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
566 std::vector<short>& adc,
567 unsigned int& zerothreshold,
569 int& nearestneighbor,
570 bool fADCStickyCodeFeature)
573 const int adcsize = adc.size();
574 const int zerothresholdsigned = zerothreshold;
576 std::vector<short> zerosuppressed(adcsize);
577 const int maxblocks = adcsize / 2 + 1;
578 std::vector<short> blockbegin(maxblocks);
579 std::vector<short> blocksize(maxblocks);
582 int zerosuppressedsize = 0;
584 int blockstartcheck = 0;
585 int endofblockcheck = 0;
587 for (
int i = 0; i < adcsize; ++i) {
593 for (boost::circular_buffer<std::vector<short>>::
const_iterator adcveciter =
594 adcvec_neighbors.begin();
595 adcveciter != adcvec_neighbors.end();
597 const std::vector<short>& adcvec_current = *adcveciter;
598 const int adcvec_current_single =
std::abs(adcvec_current[i] - pedestal);
600 if (adc_current_value < adcvec_current_single) {
601 adc_current_value = adcvec_current_single;
604 if (blockstartcheck == 0) {
605 if (adc_current_value > zerothresholdsigned) {
607 if (i - nearestneighbor <= blockbegin[nblocks - 1] + blocksize[nblocks - 1] + 1) {
609 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
613 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
614 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
619 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
620 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
625 else if (blockstartcheck == 1) {
626 if (adc_current_value > zerothresholdsigned) {
627 blocksize[nblocks]++;
631 if (endofblockcheck < nearestneighbor) {
633 blocksize[nblocks]++;
637 else if (i + 2 < adcsize) {
639 zerothresholdsigned &&
641 zerothresholdsigned) {
652 if (blockstartcheck == 1) {
656 for (
int i = 0; i < nblocks; ++i)
657 zerosuppressedsize += blocksize[i];
659 adc.resize(2 + nblocks + nblocks + zerosuppressedsize);
660 zerosuppressed.resize(2 + nblocks + nblocks + zerosuppressedsize);
662 int zerosuppressedcount = 0;
663 for (
int i = 0; i < nblocks; ++i) {
665 for (
int j = 0; j < blocksize[i]; ++j) {
666 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
667 zerosuppressedcount++;
673 for (
int i = 0; i < nblocks; ++i) {
674 adc[i + 2] = blockbegin[i];
675 adc[i + nblocks + 2] = blocksize[i];
678 for (
int i = 0; i < zerosuppressedsize; ++i)
679 adc[i + nblocks + nblocks + 2] = zerosuppressed[i];
690 const int lengthofadc = adc[0];
691 const int nblocks = adc[1];
693 uncompressed.resize(lengthofadc);
694 for (
int i = 0; i < lengthofadc; ++i) {
698 int zerosuppressedindex = nblocks * 2 + 2;
700 for (
int i = 0; i < nblocks; ++i) {
702 for (
int j = 0; j < adc[2 + nblocks + i]; ++j) {
705 uncompressed[adc[2 + i] + j] = adc[zerosuppressedindex];
706 zerosuppressedindex++;
716 std::vector<short>& uncompressed,
719 const int lengthofadc = adc[0];
720 const int nblocks = adc[1];
722 uncompressed.resize(lengthofadc);
723 for (
int i = 0; i < lengthofadc; ++i) {
724 uncompressed[i] = pedestal;
727 int zerosuppressedindex = nblocks * 2 + 2;
729 for (
int i = 0; i < nblocks; ++i) {
731 for (
int j = 0; j < adc[2 + nblocks + i]; ++j) {
734 uncompressed[adc[2 + i] + j] = adc[zerosuppressedindex];
735 zerosuppressedindex++;
745 std::vector<short>& uncompressed,
754 std::vector<short>
tmp(2 * adc[0]);
759 for (
unsigned int i = 0; i < adc.size(); ++i)
760 uncompressed[i] = adc[i];
766 throw cet::exception(
"raw") <<
"raw::Uncompress() does not support compression #" 775 std::vector<short>& uncompressed,
785 std::vector<short>
tmp(2 * adc[0]);
790 for (
unsigned int i = 0; i < adc.size(); ++i)
791 uncompressed[i] = adc[i];
797 throw cet::exception(
"raw") <<
"raw::Uncompress() does not support compression #" 820 std::vector<short>
const orig_adc(std::move(adc));
824 std::vector<short> diffs;
825 diffs.reserve(orig_adc.size());
826 std::adjacent_difference(orig_adc.begin(), orig_adc.end(), std::back_inserter(diffs));
831 adc.reserve(orig_adc.size());
833 adc.push_back(orig_adc.front());
834 unsigned int curb = 15U;
836 std::bitset<16> bset;
839 for (
size_t i = 1U; i < diffs.size(); ++i) {
844 if (i < diffs.size() - 3) {
846 if (diffs[i + 1] == 0 && diffs[i + 2] == 0 && diffs[i + 3] == 0) {
854 adc.push_back(bset.to_ulong());
873 adc.push_back(bset.to_ulong());
891 adc.push_back(bset.to_ulong());
908 adc.push_back(bset.to_ulong());
923 adc.push_back(bset.to_ulong());
938 adc.push_back(bset.to_ulong());
953 adc.push_back(bset.to_ulong());
968 adc.push_back(bset.to_ulong());
983 adc.push_back(bset.to_ulong());
996 if (curb != 15) { adc.push_back(bset.to_ulong()); }
1003 if (orig_adc[i] > 0)
1004 adc.push_back(orig_adc[i]);
1006 std::bitset<16> tbit(-orig_adc[i]);
1008 adc.push_back(tbit.to_ulong());
1016 adc.push_back(bset.to_ulong());
1030 uncompressed[0] = adc[0];
1032 unsigned int curu = 1;
1033 short curADC = uncompressed[0];
1037 for (
unsigned int i = 1; i < adc.size() && curu < uncompressed.size(); ++i) {
1039 std::bitset<16> bset(adc[i]);
1044 if (!bset.test(15)) {
1046 if (bset.test(14)) {
1047 bset.set(14,
false);
1048 curADC = -1 * bset.to_ulong();
1050 uncompressed[curu] = curADC;
1060 while (!bset.test(lowestb) && lowestb < 15)
1065 <<
"encoded entry has no set bits!!! " << i <<
" " 1066 << bset.to_string<char, std::char_traits<char>, std::allocator<char>>();
1070 while (b >= lowestb) {
1074 while (!bset.test(b - zerocnt) && b - zerocnt > lowestb)
1080 for (
int s = 0; s < 4; ++s) {
1081 uncompressed[curu] = curADC;
1084 if (curu > uncompressed.size() - 1)
break;
1088 else if (zerocnt == 1) {
1089 uncompressed[curu] = curADC;
1094 else if (zerocnt == 2) {
1096 uncompressed[curu] = curADC;
1101 else if (zerocnt == 3) {
1103 uncompressed[curu] = curADC;
1108 else if (zerocnt == 4) {
1110 uncompressed[curu] = curADC;
1115 else if (zerocnt == 5) {
1117 uncompressed[curu] = curADC;
1122 else if (zerocnt == 6) {
1124 uncompressed[curu] = curADC;
1129 else if (zerocnt == 7) {
1131 uncompressed[curu] = curADC;
1137 if (curu > uncompressed.size() - 1)
break;
1141 if (curu > uncompressed.size() - 1)
break;
1156 int adc_return_value =
std::abs(adc_value - pedestal);
1158 if (!fADCStickyCodeFeature) {
return adc_return_value; }
1160 unsigned int sixlsbs = adc_value &
onemask;
1162 if ((sixlsbs == onemask || sixlsbs == 0) &&
std::abs(adc_value - pedestal) < 64) {
1166 return adc_return_value;
1171 cmp.insert(cmp.end(), array.begin(), array.end());
1176 std::function<
void(
int,
std::vector<std::vector<bool>>&)> add_to_table)
1179 std::vector<std::vector<bool>> table;
1180 add_to_table(100, table);
1182 std::vector<short> comp_short;
1184 assert(not
empty(wf));
1186 unsigned int size_short =
sizeof(wf[0]) * 8 - 1;
1187 unsigned int max_2_short =
1190 size_t wf_size = wf.size();
1192 if (wf_size > max_2_short) {
1194 <<
"WOW! You are trying to compress a " << wf_size <<
" long waveform" 1195 <<
" in a vector of shorts.\nUnfortunately, the encoded waveform needs to store the size" 1196 <<
" of the wavefom (in its first number) and " << wf_size
1197 <<
" is bigger than the maximum\n" 1198 <<
" number you can encode with 2 shorts (" << max_2_short <<
").\n" 1199 <<
" Bailing out disgracefully to avoid massive trouble.\n";
1202 short high = (wf_size >> (
sizeof(short) * 8 - 1));
1203 short low = wf_size % ((std::numeric_limits<short>::max() + 1));
1204 comp_short.push_back(high);
1205 comp_short.push_back(low);
1206 comp_short.push_back(*wf.begin());
1209 std::vector<bool> cmp;
1210 cmp.reserve(wf.size() *
sizeof(wf[0]) * 8);
1213 std::vector<short> diff;
1214 diff.reserve(wf.size());
1217 std::adjacent_difference(
1218 wf.begin(), wf.end(), std::back_inserter(diff), [](
const short& it1,
const short& it2) {
1219 short d = it1 - it2;
1228 for (
size_t iSample = 1; iSample < diff.size(); ++iSample) {
1230 short d = diff[iSample];
1235 add_to_table(end, table);
1242 size_t n_vector = cmp.size();
1245 std::bitset<8 * sizeof(short)> this_encoded;
1247 size_t bit_counter = 0;
1249 for (
size_t it = 0; it < n_vector; ++it) {
1251 if (bit_counter >= 8 *
sizeof(
short)) {
1252 short comp_s = (short)this_encoded.to_ulong();
1253 comp_short.push_back(comp_s);
1255 this_encoded.reset();
1258 if (cmp[it]) this_encoded.set(bit_counter);
1264 short comp_s = (short)this_encoded.to_ulong();
1265 comp_short.push_back(comp_s);
1273 std::vector<short>& uncompressed,
1274 std::function<
int(std::vector<bool>&)> decode_table_chunk)
1278 size_t n_samples = (adc[0] << (
sizeof(short) * 8 - 1)) + adc[1];
1280 uncompressed.push_back(adc[2]);
1283 std::vector<bool> comp;
1285 for (
size_t i = 3; i < adc.size(); ++i) {
1287 std::bitset<8 * sizeof(short)> this_encoded(adc[i]);
1288 for (
size_t i2 = 0; i2 < this_encoded.size(); ++i2) {
1289 comp.push_back(this_encoded[i2]);
1294 std::vector<bool> current_number;
1295 for (
size_t it = 0; it < comp.size(); ++it) {
1296 current_number.push_back(comp[it]);
1300 if ((current_number.size() >= 2 && it >= 1 && comp[it - 1] == 1 && comp[it] == 1) ||
1301 it == comp.size() - 1) {
1302 current_number.pop_back();
1303 short zigzag_number = decode_table_chunk(current_number);
1306 if (zigzag_number % 2 == 0)
1307 decoded = zigzag_number / 2;
1309 decoded = -(zigzag_number - 1) / 2;
1310 short baseline = uncompressed.back();
1312 uncompressed.push_back(baseline + decoded);
1314 current_number.clear();
1315 if (uncompressed.size() == n_samples)
break;
1323 if ((
int)table.size() >
end)
return;
1325 std::map<int, int> fibn;
1335 table.push_back({
true});
1336 table.push_back({
false,
true});
1339 if ((
int)table.size() >
end)
return;
1342 for (
int i = 2; fibn.rbegin()->second <
end; ++i) {
1343 fibn[i] = fibn[i - 1] + fibn[i - 2];
1346 for (
int i = table.size(); i <=
end; ++i) {
1347 int current_number = i;
1348 std::vector<bool> seq;
1349 while (current_number > 0) {
1351 for (
auto fib = fibn.rbegin(); fib != fibn.rend(); ++fib) {
1352 if (fib->second <= current_number) {
1354 if (!seq.size()) seq = std::vector<bool>(fib->first - 1,
false);
1356 seq[fib->first - 2] =
true;
1358 current_number -= fib->second;
1364 table.push_back(seq);
1370 std::vector<int> FibNumbers = {1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987};
1372 if (chunk.size() > FibNumbers.size()) {
1373 for (
int i = FibNumbers.size(); i <= (int)chunk.size(); ++i) {
1374 FibNumbers.push_back(FibNumbers.at(i - 1) + FibNumbers.at(i - 2));
1378 for (
size_t it = 0; it < chunk.size(); ++it) {
1379 if (chunk[it]) decoded += FibNumbers[it];
void CompressHuffman(std::vector< short > &adc)
enum raw::_compress Compress_t
void UncompressHuffman(const std::vector< short > &adc, std::vector< short > &uncompressed)
constexpr auto abs(T v)
Returns the absolute value of the argument.
const unsigned int onemask
Zero Suppression followed by Huffman Encoding.
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Zero Suppression algorithm.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
int ADCStickyCodeCheck(const short adc_value, const int pedestal, bool fADCStickyCodeFeature)
auto array(Array const &a)
Returns a manipulator which will print the specified array.
void fibonacci_encode_table(int end, std::vector< std::vector< bool >> &table)
Collect all the RawData header files together.
void ZeroUnsuppression(const std::vector< short > &adc, std::vector< short > &uncompressed)
void add_to_sequence_terminate(std::vector< bool > array, std::vector< bool > &cmp)
void UncompressFibonacci(const std::vector< short > &adc, std::vector< short > &uncompressed, std::function< int(std::vector< bool > &)> decode_table_chunk)
void CompressFibonacci(std::vector< short > &wf, std::function< void(int, std::vector< std::vector< bool >> &)> add_to_table)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
void ZeroSuppression(std::vector< short > &adc, unsigned int &zerothreshold)
cet::coded_exception< error, detail::translate > exception
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
short fibonacci_decode(std::vector< bool > &chunk)