24 {
25
26 if(boardId != 0xD3) std::cerr << "ERROR: You set the wrong board data to TrigGTL!!!" << std::endl;
27 if(datasize%window != 0) std::cerr << "WARNING: The data in GTL maybe not complete!!!" << std::endl;
28
29 for(uint32_t i = 0; i < datasize; i++) {
30 uint32_t dataId = ((
data[i] >> 24) & 0x7);
31 for(uint32_t j = 0, mask = 1; j < 24; j++, mask <<= 1) {
32 if(dataId == 1) {
33 if((
data[i] & mask) != 0) {
34 m_dataGroup12_One[j] += 1;
35 }
36 if(m_dataGroup12_One[j] == 0) m_dataGroup12_Zero[j] += 1;
37 }
38 if(dataId == 2) {
39 if((
data[i] & mask) != 0) {
40 m_dataGroup12_One[j+24] += 1;
41 }
42 if(m_dataGroup12_One[j+24] == 0) m_dataGroup12_Zero[j+24] += 1;
43 }
44 if(dataId == 3) {
45 if((
data[i] & mask) != 0) {
46 m_dataGroup34_One[j] += 1;
47 }
48 if(m_dataGroup34_One[j] == 0) m_dataGroup34_Zero[j] += 1;
49 }
50 if(dataId == 4) {
51 if((
data[i] & mask) != 0) {
52 m_dataGroup34_One[j+24] += 1;
53 }
54 if(m_dataGroup34_One[j+24] == 0) m_dataGroup34_Zero[j+24] += 1;
55 }
56 if(dataId == 5) {
57 if((
data[i] & mask) != 0) {
58 m_dataGroup5_One[j] += 1;
59 }
60 if(m_dataGroup5_One[j] == 0) m_dataGroup5_Zero[j] += 1;
61 }
62 }
63 }
64}