CbmRoot
Loading...
Searching...
No Matches
PsdGbtReader-v1.00.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 Institute for Nuclear Research, Moscow
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Nikolay Karpushkin [committer]*/
4
5#ifndef PSD_GBT_READER_V100_H
6#define PSD_GBT_READER_V100_H
7
8#include <cstdint>
9#include <iomanip> // for setw, setfill
10#include <sstream> // for sstream
11#include <string> // for string
12#include <vector> // for vector
13
15namespace PsdDataV100
16{
17
19 public:
21 PsdGbtReader(const uint64_t* input)
22 {
23 buffer = input;
24 word_index = 0;
25 }
26
27 void SetInput(const uint64_t* input)
28 {
29 buffer = input;
30 word_index = 0;
31 }
32 std::stringstream save_buffer;
33
39
40 std::vector<struct PsdPackHeader> VectPackHdr;
41 std::vector<struct PsdHitHeader> VectHitHdr;
42 std::vector<struct PsdHitData> VectHitData;
43
44 void ReadMsHeader();
45 void ReadPackHeader();
46 void ReadHitHeader();
47 void ReadHitData();
48 void ReadMsTrailer();
49 int ReadMs();
50
51 void PrintSaveBuff();
52 void PrintOut();
53
54 //Getters
55 uint32_t GetTotalGbtWordsRead() { return word_index; }
56
57 void SetPrintOutMode(bool mode) { print = mode; }
59
60 int word_index = 0;
61 int words_missed = 0;
62 int ms_hdrs_read = 0;
63 int ms_ends_read = 0;
64
65 private:
66 const uint64_t* buffer;
67
68 bool print = false;
69 int buffer_shift = 0;
70 };
71} // namespace PsdDataV100
72
73#endif // PSD_GBT_READER_V100_H
std::vector< struct PsdPackHeader > VectPackHdr
void SetInput(const uint64_t *input)
std::vector< struct PsdHitData > VectHitData
struct PsdPackHeader PackHdr
std::vector< struct PsdHitHeader > VectHitHdr
PsdGbtReader(const uint64_t *input)