BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
TrigCondition.cxx
Go to the documentation of this file.
1#include <iostream>
2#include "TrigEvent/TrigCondition.h"
3
4const std::string TrigCondition::s_CONDITIONS[] = {
5 "00: NCluster >= 1",
6 "01: NCluster >= 2",
7 "02: Barrel Cluster back to back",
8 "03: Endcap Cluster back to back",
9 "04: Cluster Balance in Z direction",
10 "05: Barrel Cluster Balance in Phi direction",
11 "06: Endcap Cluster phi Balance",
12 "07: Barrel total Energy Higher threshold",
13 "08: Endcap total Energy Higher threshold",
14 "09: Total Energy Lower threshold",
15 "10: Total Energy Middle threshold",
16 "11: Energy Balance in \"Z\" direction",
17 "12: Barrel Energy difference Balance",
18 "13: Endcap Energy difference Balance",
19 "14: Energy Block Balance",
20 "15: Endcap Energy Balance",
21 "16: Endcap TOF back to back",
22 "17: Barrel TOF back to back",
23 "18: NETOF >= 2",
24 "19: NETOF >= 1",
25 "20: NBTOF >= 2",
26 "21: NBTOF >= 1",
27 "22: Not defined yet",
28 "23: Not defined yet",
29 "24: Not defined yet",
30 "25: Not defined yet",
31 "26: Not defined yet",
32 "27: Not defined yet",
33 "28: Not defined yet",
34 "29: Not defined yet",
35 "30: Not defined yet",
36 "31: Not defined yet",
37 "32: MUON Back to Back 3478",
38 "33: MUON Back to Back 37",
39 "34: Not defined yet",
40 "35: Not defined yet",
41 "36: Not defined yet",
42 "37: Not defined yet",
43 "38: Short Track back to back",
44 "39: NStrk >= N",
45 "40: NStrk >= 2",
46 "41: NStrk >= 1",
47 "42: Long Track back to back",
48 "43: NLtrk >= N",
49 "44: NLtrk >= 2",
50 "45: NLtrk >= 1",
51 "46: NItrk >= 1",
52 "47: NItrk >= 2"
53};
54
55TrigCondition::TrigCondition(char* name, uint32_t window, const uint32_t* data) :
56 m_name(name)
57{
58 for (uint32_t group = 0; group < 2; group++) {
59 uint32_t iBegin = group * 24;
60 uint32_t iEnd = (group + 1) * 24;
61 uint32_t jBegin = group * window;
62 uint32_t jEnd = (group + 1) * window;
63 for (uint32_t i = iBegin, mask = 1; i < iEnd; i++, mask <<= 1) {
64 uint32_t num_One = 0, num_Zero = 0;
65 for (uint32_t j = jBegin; j < jEnd; j++) {
66 if ((data[j] & mask) != 0) {
67 num_One++;
68 }
69 else {
70 if (num_One == 0) num_Zero++;
71 }
72 }
73 m_num_One[i] = num_One;
74 m_num_Zero[i] = num_Zero;
75 }
76 }
77
78 for (uint32_t i = 0; i < 48; i++) {
79 if (m_num_One[i] != 0) m_condList.push_back(i);
80 }
81}
82
84 int size = m_condList.size();
85 std::cout << "TrigCondition-" << m_name << " contains the following conditions:" << std::endl;
86 for (int i = 0; i < size; i++) {
87 std::cout << '\t' << s_CONDITIONS[m_condList[i]] << std::endl;
88 }
89}
TTree * data
void print() const
TrigCondition(char *name, uint32_t window, const uint32_t *data)