BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TrigTOFT.cxx
Go to the documentation of this file.
1#include <iostream>
3
5{
6 m_name = name;
7}
8
10{
11 for(int i = 0; i < 176; i++)
12 for(int j = 0; j < 21; j++) {
13 if(i < 6) m_tofTrigCondi[i][j] = 0;
14 if(i < 48) {
15 m_wetofHitMap[i][j] = 0;
16 m_eetofHitMap[i][j] = 0;
17 }
18 m_btofHitMap[i][j] = 0;
19 }
20}
21
22void TrigTOFT::setTOFTTrigData( uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t* data) {
23
24 if(boardId != 0xDA) std::cerr << "ERROR: You set the wrong board data to TrigTOFT!!!" << std::endl;
25
26 m_window = window;
27
28 for (uint32_t i = 0; i < datasize; i++) {
29 int winId = int (i/14);
30 //int id = (i-winId*14)%14;
31 //DW4 trigger conditions
32 if(i==(1+winId*14)) {
33 for(uint32_t condId = 1,loop = 0; loop < 6; condId <<=1,loop++) {
34 if(data[i] & condId) m_tofTrigCondi[loop][winId] = 1;
35 }
36 }
37
38 //DW9-DW12 for inner layer hit, DW13--DW16 outer layer hit
39 if(i >= (6+winId*14) && i <= (13+winId*14)) {
40 if(i == (6+winId*14) || i == (10+winId*14)) {
41 for(uint32_t btofId = 1,loop = 0; loop < 16; btofId <<=1,loop++) {
42 if(data[i] & btofId) {
43 if(i == (6+winId*14)) m_btofHitMap[loop+72][winId] = 1;
44 if(i == (10+winId*14)) m_btofHitMap[loop+72+88][winId] = 1;
45 }
46 }
47 }
48 else {
49 for(uint32_t btofId = 1,loop = 0; loop < 24; btofId <<=1,loop++) {
50 if(data[i] & btofId) {
51 if(i >= (7+winId*14) && i <= (9+winId*14)) m_btofHitMap[loop+(9+winId*14-i)*24][winId] = 1;
52 else m_btofHitMap[loop+(13+winId*14-i)*24+88][winId] = 1;
53 }
54 }
55 }
56 }
57
58 //DW7-DW8 for east end cap hits
59 if(i>=(4+winId*14) && i<=(5+winId*14)) {
60 for(uint32_t eetofId = 1,loop = 0; loop < 24; eetofId <<=1,loop++) {
61 if(data[i] & eetofId) m_eetofHitMap[loop+(5+winId*14-i)*24][winId] = 1;
62 }
63 }
64
65 //DW5-DW6 for east end cap hits
66 if(i>=(2+winId*14) && i<=(3+winId*14)) {
67 for(uint32_t wetofId = 1,loop = 0; loop < 24; wetofId <<=1,loop++) {
68 if(data[i] & wetofId) m_wetofHitMap[loop+(3+winId*14-i)*24][winId] = 1;
69 }
70 }
71 }
72}
TTree * data
void setTOFTTrigData(uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t *data)
Definition TrigTOFT.cxx:22
void initialize()
Definition TrigTOFT.cxx:9
TrigTOFT(char *name)
Definition TrigTOFT.cxx:4