BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
TrigGTL.cxx
Go to the documentation of this file.
1#include <iostream>
2#include "TrigEvent/TrigGTL.h"
3
4TrigGTL::TrigGTL(char* name)
5{
6 m_name = name;
7}
8
10{
11 for(int i = 0; i < 48; i++)
12 {
13 m_dataGroup12_One[i] = 0;
14 m_dataGroup12_Zero[i] = 0;
15 m_dataGroup34_One[i] = 0;
16 m_dataGroup34_Zero[i] = 0;
17 if(i < 24) {
18 m_dataGroup5_One[i] = 0;
19 m_dataGroup5_Zero[i] = 0;
20 }
21 }
22}
23
24void TrigGTL::setGTLTrigData( uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t* data) {
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}
TTree * data
void initialize()
Definition TrigGTL.cxx:9
void setGTLTrigData(uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t *data)
Definition TrigGTL.cxx:24
TrigGTL(char *name)
Definition TrigGTL.cxx:4