5#ifndef BMNPROFRAWTOOLS_H
6#define BMNPROFRAWTOOLS_H
23 return 6 * ASIC_channel;
73 static bool adc_num(
const bitset<32>& word);
74 static bool adc_num(
const uint32_t& word);
81 static bool fco(
const bitset<32>& word);
82 static bool fco(
const uint32_t& word);
88 static int adc_ch(vector<bitset < 32 >> &adc_word,
char channel_name);
89 static int adc_ch(vector<bitset < 32 >> &adc_word,
size_t start_index,
char channel_name);
92 template<
typename UIntType>
93 static int adc_ch(
UIntType * adc_word,
size_t start_index,
char channel_name) {
95 map<char, size_t> offsets{
104 for (
size_t i = 0;
i < 6;
i++) {
105 result += ((adc_word[start_index +
i] >> offsets[channel_name]) & 1) << (10 - 2 *
i + 1);
106 result += ((adc_word[start_index +
i] >> (offsets[channel_name] + 1)) & 1) << (10 - 2 *
i);
108 return result - 0x800;
112 template<
typename UIntType>
113 static int adc_ch(vector<UIntType> adc_word,
size_t start_index,
char channel_name) {
115 map<char, size_t> offsets{
124 for (
size_t i = 0;
i < 6;
i++) {
125 result += ((adc_word[start_index +
i] >> offsets[channel_name]) & 1) << (10 - 2 *
i + 1);
126 result += ((adc_word[start_index +
i] >> (offsets[channel_name] + 1)) & 1) << (10 - 2 *
i);
128 return result - 0x800;
157 vector<int> &chH, vector<int> &chG);
159 static const size_t ASIC_channel = 32;