41 {
42 if(boardId != 0xd7) std::cerr << "ERROR: You set the wrong board data to TrigEACC!!!" << std::endl;
43
44 m_window = window;
45
46 uint32_t charge_mask = 0xFFFF;
47 uint32_t time_mask = 0xFF0000;
48 for(uint32_t i = 0; i < datasize; i++) {
49 if(i < 12) {
50 E_blk[i] = ((data[i]) & charge_mask);
51 T_blk[i] = ((data[i]) & time_mask) >> 16;
52 }
53 if(i >= 12 && i < 14) {
54 E_blkE[i-12] = ((data[i]) & charge_mask);
55 T_blkE[i-12] = ((data[i]) & time_mask) >> 16;
56 }
57 if(i >= 14 && i < 16) {
58 E_blkW[i-14] = ((data[i]) & charge_mask);
59 T_blkW[i-14] = ((data[i]) & time_mask) >> 16;
60 }
61 if(i >= 16 && i < 23) {
62 if(i == 16) { E_B_Etot = ((data[i]) & charge_mask); T_B_Etot = ((data[i]) & time_mask) >> 16; }
63 if(i == 17) { E_E_Etot = ((data[i]) & charge_mask); T_E_Etot = ((data[i]) & time_mask) >> 16; }
64 if(i == 18) { E_blkAll = ((data[i]) & charge_mask); T_blkAll = ((data[i]) & time_mask) >> 16; }
65 if(i == 19) { E_eastHalf = ((data[i]) & charge_mask); T_eastHalf = ((data[i]) & time_mask) >> 16; }
66 if(i == 20) { E_westHalf = ((data[i]) & charge_mask); T_westHalf = ((data[i]) & time_mask) >> 16; }
67 if(i == 21) { E_eastEndHalf = ((data[i]) & charge_mask); T_eastEndHalf = ((data[i]) & time_mask) >> 16; }
68 if(i == 22) { E_westEndHalf = ((data[i]) & charge_mask); T_westEndHalf = ((data[i]) & time_mask) >> 16; }
69 }
70 if(i == 23) {
71 for(uint32_t j = 0, mask = 1; j < 16; j++, mask <<= 1) {
72 if(data[i] & mask) midCondi[j] = 1;
73 }
74 }
75 if(i >= 24 && i < 24 + 20*window) {
76 uint32_t winId = uint32_t ((i-24)/20);
77 uint32_t id = i - (24+winId*20);
78 if(i >= (24+winId*20) && i < (39+winId*20)) {
79 for(uint32_t j = 0, mask = 1; j < 24; j++, mask <<= 1) {
80 if(j < 11) {
81 if(data[i] & mask) TC[j][2*id+1][winId] = 1;
82 }
83 if(j >= 12 && j < 23) {
84 if(data[i] & mask) TC[j-12][2*id][winId] = 1;
85 }
86 }
87 }
88 if(i == (39+winId*20)) {
89 for(uint32_t j = 0, mask = 1; j < 16; j++, mask <<= 1) {
90 if(data[i] & mask) TC_E[j][winId] = 1;
91 }
92 }
93 if(i == (40+winId*20)) {
94 for(uint32_t j = 0, mask = 1; j < 16; j++, mask <<= 1) {
95 if(data[i] & mask) TC_E[j+16][winId] = 1;
96 }
97 }
98 if(i == (41+winId*20)) {
99 for(uint32_t j = 0, mask = 1; j < 16; j++, mask <<= 1) {
100 if(data[i] & mask) TC_W[j][winId] = 1;
101 }
102 }
103 if(i == (42+winId*20)) {
104 for(uint32_t j = 0, mask = 1; j < 16; j++, mask <<= 1) {
105 if(data[i] & mask) TC_W[j+16][winId] = 1;
106 }
107 }
108 if(i == (43+winId*20)) {
109 for(uint32_t j = 0, mask = 1; j < 16; j++, mask <<= 1) {
110 if(data[i] & mask) emcTrigCondi[j][winId] = 1;
111 }
112 }
113 }
114 }
115 if(24 + 20*window != datasize) std::cerr << "ERROR: The data in EACC are not complete" << std::endl;
116}