73 int getSize() {
return mGBTFrames.size(); };
88 void addGBTFrame(
unsigned word3,
unsigned word2,
unsigned word1,
unsigned word0);
115 void addGBTFrame(
short s0hw0l,
short s0hw1l,
short s0hw2l,
short s0hw3l,
short s0hw0h,
short s0hw1h,
short s0hw2h,
116 short s0hw3h,
short s1hw0l,
short s1hw1l,
short s1hw2l,
short s1hw3l,
short s1hw0h,
short s1hw1h,
117 short s1hw2h,
short s1hw3h,
short s2hw0,
short s2hw1,
short s2hw2,
short s2hw3,
short s0adc,
118 short s1adc,
short s2adc,
unsigned marker = 0);
150 mEnableStoreGBTFrames =
val;
151 if (!mEnableStoreGBTFrames) {
152 mGBTFrames.resize(2);
159 bool getData(std::vector<Digit>& container);
161 bool getData(std::vector<HalfSAMPAData>& container);
172 std::vector<GBTFrame>::iterator
begin() {
return mGBTFrames.begin(); };
173 std::vector<GBTFrame>::const_iterator
begin()
const {
return mGBTFrames.begin(); };
174 std::vector<GBTFrame>::const_iterator
cbegin()
const {
return mGBTFrames.cbegin(); };
175 std::vector<GBTFrame>::iterator
end() {
return mGBTFrames.end(); };
176 std::vector<GBTFrame>::const_iterator
end()
const {
return mGBTFrames.end(); };
177 std::vector<GBTFrame>::const_iterator
cend()
const {
return mGBTFrames.cend(); };
179 std::vector<GBTFrame>::reverse_iterator
rbegin() {
return mGBTFrames.rbegin(); };
180 std::vector<GBTFrame>::const_reverse_iterator
rbegin()
const {
return mGBTFrames.rbegin(); };
181 std::vector<GBTFrame>::const_reverse_iterator
crbegin()
const {
return mGBTFrames.crbegin(); };
182 std::vector<GBTFrame>::reverse_iterator
rend() {
return mGBTFrames.rend(); };
183 std::vector<GBTFrame>::const_reverse_iterator
rend()
const {
return mGBTFrames.rend(); };
184 std::vector<GBTFrame>::const_reverse_iterator
crend()
const {
return mGBTFrames.crend(); };
204 void processAllFrames();
208 void processFrame(std::vector<GBTFrame>::iterator iFrame);
212 void checkAdcClock(std::vector<GBTFrame>::iterator iFrame);
216 void searchSyncPattern(std::vector<GBTFrame>::iterator iFrame);
220 void compileAdcValues(std::vector<GBTFrame>::iterator iFrame);
222 void resetAdcClock();
223 void resetSyncPattern();
224 void resetAdcValues();
226 std::mutex mAdcMutex;
228 std::vector<GBTFrame> mGBTFrames;
229 std::array<AdcClockMonitor, 3> mAdcClock;
230 std::array<SyncPatternMonitor, 5> mSyncPattern;
231 std::array<short, 10> mPositionForHalfSampa;
232 std::array<std::queue<short>*, 5> mAdcValues;
234 bool mEnableAdcClockWarning;
235 bool mEnableSyncPatternWarning;
236 bool mEnableStoreGBTFrames;
237 bool mEnableCompileAdcValues;
242 int mGBTFramesAnalyzed;
244 std::array<std::array<short, 16>, 5> mTmpData;
262 if (!mEnableStoreGBTFrames && (mGBTFrames.size() > 1)) {
263 mGBTFrames[0] = mGBTFrames[1];
264 mGBTFrames[1].setData(word3, word2, word1, word0);
266 mGBTFrames.emplace_back(word3, word2, word1, word0);
268 processFrame(mGBTFrames.end() - 1);
272 short s0hw1h,
short s0hw2h,
short s0hw3h,
short s1hw0l,
short s1hw1l,
273 short s1hw2l,
short s1hw3l,
short s1hw0h,
short s1hw1h,
short s1hw2h,
274 short s1hw3h,
short s2hw0,
short s2hw1,
short s2hw2,
short s2hw3,
275 short s0adc,
short s1adc,
short s2adc,
unsigned marker)
277 if (!mEnableStoreGBTFrames && (mGBTFrames.size() > 1)) {
278 mGBTFrames[0] = mGBTFrames[1];
279 mGBTFrames[1].setData(s0hw0l, s0hw1l, s0hw2l, s0hw3l, s0hw0h, s0hw1h, s0hw2h, s0hw3h,
280 s1hw0l, s1hw1l, s1hw2l, s1hw3l, s1hw0h, s1hw1h, s1hw2h, s1hw3h,
281 s2hw0, s2hw1, s2hw2, s2hw3, s0adc, s1adc, s2adc,
marker);
283 mGBTFrames.emplace_back(s0hw0l, s0hw1l, s0hw2l, s0hw3l, s0hw0h, s0hw1h, s0hw2h, s0hw3h,
284 s1hw0l, s1hw1l, s1hw2l, s1hw3l, s1hw0h, s1hw1h, s1hw2h, s1hw3h,
285 s2hw0, s2hw1, s2hw2, s2hw3, s0adc, s1adc, s2adc,
marker);
287 processFrame(mGBTFrames.end() - 1);