BOSS
6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSegPatterns.cxx
Go to the documentation of this file.
1
// MdcSegPatterns.cxx
2
//
3
4
// Interface Dependencies ----------------------------------------------
5
6
#include "
MdcTrkRecon/MdcSegPatterns.h
"
7
8
// Implementation Dependencies -----------------------------------------
9
10
#include <stdlib.h>
11
#include <iostream>
12
#include <assert.h>
13
#include "
MdcTrkRecon/countBits.h
"
14
15
// End Implementation Dependencies -------------------------------------
16
17
MdcSegPatterns::MdcSegPatterns
(
int
useAllAmbig) {
18
19
patt4
[0] = 0225;
20
patt4
[1] = 0125;
21
patt4
[2] = 0115;
22
patt4
[3] = 055;
23
patt4
[4] = 0226;
24
patt4
[5] = 0126;
25
patt4
[6] = 0116;
26
patt4
[7] = 056;
27
28
patt3
[0] = 0224;
29
patt3
[1] = 0221;
30
patt3
[2] = 0205;
31
patt3
[3] = 025;
32
patt3
[4] = 0124;
33
patt3
[5] = 0121;
34
patt3
[6] = 0105;
35
patt3
[7] = 0114;
36
patt3
[8] = 0111;
37
patt3
[9] = 015;
38
patt3
[10] = 054;
39
patt3
[11] = 051;
40
patt3
[12] = 045;
41
patt3
[13] = 0206;
42
patt3
[14] = 026;
43
patt3
[15] = 0106;
44
patt3
[16] = 0112;
45
patt3
[17] = 016;
46
patt3
[18] = 052;
47
patt3
[19] = 046;
48
ambigPatt4
=
new
int
*[8];
49
assert(
ambigPatt4
!= 0);
50
int
i;
51
for
(i = 0; i < 8; i++) {
52
ambigPatt4
[i] =
new
int
[16];
53
assert(
ambigPatt4
[i] != 0);
54
if
(useAllAmbig) {
55
for
(
int
j = 0; j < 16; j++)
ambigPatt4
[i][j] = 1;
56
}
else
{
57
for
(
int
j = 0; j < 16; j++)
ambigPatt4
[i][j] = 0;
58
}
59
}
60
ambigPatt3
=
new
int
*[20];
61
assert(
ambigPatt3
!= 0);
62
for
(i = 0; i < 20; i++) {
63
ambigPatt3
[i] =
new
int
[8];
64
assert(
ambigPatt3
[i] != 0);
65
if
(useAllAmbig) {
66
for
(
int
j = 0; j < 8; j++)
ambigPatt3
[i][j] = 1;
67
}
else
{
68
for
(
int
j = 0; j < 8; j++)
ambigPatt3
[i][j] = 0;
69
}
70
}
71
72
if
(!useAllAmbig) {
73
ambigPatt4
[0][0] =
ambigPatt4
[0][1] =
ambigPatt4
[0][3] =
74
ambigPatt4
[0][7] =
ambigPatt4
[0][8] =
ambigPatt4
[0][12] =
75
ambigPatt4
[0][14] =
ambigPatt4
[0][15] = 1;
76
ambigPatt4
[1][8] =
ambigPatt4
[1][9] =
ambigPatt4
[1][11] = 1;
77
ambigPatt4
[2][4] =
ambigPatt4
[2][5] =
ambigPatt4
[2][12] =
78
ambigPatt4
[2][13] = 1;
79
ambigPatt4
[3][1] =
ambigPatt4
[3][9] =
ambigPatt4
[3][13] = 1;
80
ambigPatt4
[4][2] =
ambigPatt4
[4][6] =
ambigPatt4
[4][14] = 1;
81
ambigPatt4
[5][2] =
ambigPatt4
[5][3] =
ambigPatt4
[5][10] =
82
ambigPatt4
[5][11] = 1;
83
ambigPatt4
[6][4] =
ambigPatt4
[6][6] =
ambigPatt4
[6][7] = 1;
84
ambigPatt4
[7][0] =
ambigPatt4
[7][1] =
ambigPatt4
[7][3] =
85
ambigPatt4
[7][7] =
ambigPatt4
[7][8] =
ambigPatt4
[7][12] =
86
ambigPatt4
[7][14] =
ambigPatt4
[7][15] = 1;
87
88
ambigPatt3
[0][0] =
ambigPatt3
[0][1] =
ambigPatt3
[0][3] =
89
ambigPatt3
[0][4] =
ambigPatt3
[0][6] =
ambigPatt3
[0][7] = 1;
90
ambigPatt3
[1][0] =
ambigPatt3
[1][1] =
ambigPatt3
[1][3] =
91
ambigPatt3
[1][4] =
ambigPatt3
[1][6] =
ambigPatt3
[1][7] = 1;
92
ambigPatt3
[2][0] =
ambigPatt3
[2][1] =
ambigPatt3
[2][3] =
93
ambigPatt3
[2][4] =
ambigPatt3
[2][6] =
ambigPatt3
[2][7] = 1;
94
ambigPatt3
[3][0] =
ambigPatt3
[3][1] =
ambigPatt3
[3][3] =
95
ambigPatt3
[3][4] =
ambigPatt3
[3][6] =
ambigPatt3
[3][7] = 1;
96
ambigPatt3
[4][1] =
ambigPatt3
[4][4] =
ambigPatt3
[4][5] = 1;
97
ambigPatt3
[5][4] =
ambigPatt3
[5][5] = 1;
98
ambigPatt3
[6][0] =
ambigPatt3
[6][1] =
ambigPatt3
[6][4] =
99
ambigPatt3
[6][5] =
ambigPatt3
[6][7] = 1;
100
ambigPatt3
[7][2] =
ambigPatt3
[7][3] =
ambigPatt3
[7][6] = 1;
101
ambigPatt3
[8][2] =
ambigPatt3
[8][3] =
ambigPatt3
[8][6] =
102
ambigPatt3
[8][7] =
ambigPatt3
[8][0] = 1;
103
ambigPatt3
[9][1] =
ambigPatt3
[9][4] =
ambigPatt3
[9][5] = 1;
104
ambigPatt3
[10][0] =
ambigPatt3
[10][1] =
ambigPatt3
[10][3] =
105
ambigPatt3
[10][4] =
ambigPatt3
[10][6] =
ambigPatt3
[10][7] = 1;
106
ambigPatt3
[11][1] =
ambigPatt3
[11][5] =
ambigPatt3
[11][7] =
107
ambigPatt3
[11][0] =
ambigPatt3
[11][4] = 1;
108
ambigPatt3
[12][4] =
ambigPatt3
[12][5] = 1;
109
ambigPatt3
[13][2] =
ambigPatt3
[13][6] = 1;
110
ambigPatt3
[14][2] =
ambigPatt3
[14][3] =
ambigPatt3
[14][6] = 1;
111
ambigPatt3
[15][0] =
ambigPatt3
[15][2] =
ambigPatt3
[15][3] =
112
ambigPatt3
[15][6] =
ambigPatt3
[15][7] = 1;
113
ambigPatt3
[16][2] =
ambigPatt3
[16][3] = 1;
114
ambigPatt3
[17][0] =
ambigPatt3
[17][1] =
ambigPatt3
[17][3] =
115
ambigPatt3
[17][4] =
ambigPatt3
[17][6] =
ambigPatt3
[17][7] = 1;
116
ambigPatt3
[18][0] =
ambigPatt3
[18][1] =
ambigPatt3
[18][3] =
117
ambigPatt3
[18][4] =
ambigPatt3
[18][6] =
ambigPatt3
[18][7] = 1;
118
ambigPatt3
[19][0] =
ambigPatt3
[19][1] =
ambigPatt3
[19][3] =
119
ambigPatt3
[19][4] =
ambigPatt3
[19][6] =
ambigPatt3
[19][7] = 1;
120
}
121
122
// For hit combos with allowed patterns; allocate space for list of
123
// patterns, fill list and record number in npattx[i]
124
int
j, nbit;
125
unsigned
match;
126
for
(i = 0; i < 256; i++) {
127
npatt4
[i] = 0;
128
npatt3
[i] = 0;
129
// loop through the 8 patterns, seeing how many match
130
for
(j = 0; j < 8; j++) {
131
match = i &
patt4
[j];
132
nbit =
countbits
(match);
133
if
(nbit == 4)
npatt4
[i]++;
134
}
135
allowedPatt4
[i] =
new
int
[
npatt4
[i]];
136
// Add the allowed patterns to the list for this hit combination
137
int
nstored = 0;
138
for
(j = 0; j < 8; j++) {
139
match = i &
patt4
[j];
140
nbit =
countbits
(match);
141
if
(nbit == 4) {
142
allowedPatt4
[i][nstored] = j;
143
nstored++;
144
}
145
}
146
147
// Repeat for 3-hit patterns
148
149
for
(j = 0; j < 20; j++) {
150
match = i &
patt3
[j];
151
nbit =
countbits
(match);
152
if
(nbit == 3)
npatt3
[i]++;
153
}
154
allowedPatt3
[i] =
new
int
[
npatt3
[i]];
155
// Add the allowed patterns to the list for this hit combination
156
nstored = 0;
157
for
(j = 0; j < 20; j++) {
158
match = i &
patt3
[j];
159
nbit =
countbits
(match);
160
if
(nbit == 3) {
161
allowedPatt3
[i][nstored] = j;
162
nstored++;
163
}
164
}
165
}
166
167
return
;
168
}
169
170
MdcSegPatterns::~MdcSegPatterns
() {
171
int
i;
172
for
(i = 0; i < 256; i++) {
173
delete
[]
allowedPatt4
[i];
174
delete
[]
allowedPatt3
[i];
175
}
176
for
(i = 0; i < 8; i++)
delete
[]
ambigPatt4
[i];
177
for
(i = 0; i < 20; i++)
delete
[]
ambigPatt3
[i];
178
delete
[]
ambigPatt4
;
179
delete
[]
ambigPatt3
;
180
}
181
182
183
184
185
186
MdcSegPatterns.h
MdcSegPatterns::ambigPatt3
int ** ambigPatt3
Definition:
MdcSegPatterns.h:45
MdcSegPatterns::patt4
unsigned patt4[8]
Definition:
MdcSegPatterns.h:38
MdcSegPatterns::npatt4
int npatt4[256]
Definition:
MdcSegPatterns.h:40
MdcSegPatterns::allowedPatt3
int * allowedPatt3[256]
Definition:
MdcSegPatterns.h:43
MdcSegPatterns::allowedPatt4
int * allowedPatt4[256]
Definition:
MdcSegPatterns.h:42
MdcSegPatterns::MdcSegPatterns
MdcSegPatterns(int useAllAmbig)
Definition:
MdcSegPatterns.cxx:17
MdcSegPatterns::ambigPatt4
int ** ambigPatt4
Definition:
MdcSegPatterns.h:44
MdcSegPatterns::~MdcSegPatterns
~MdcSegPatterns()
Definition:
MdcSegPatterns.cxx:170
MdcSegPatterns::npatt3
int npatt3[256]
Definition:
MdcSegPatterns.h:41
MdcSegPatterns::patt3
unsigned patt3[20]
Definition:
MdcSegPatterns.h:39
countBits.h
countbits
int countbits(unsigned word)
Definition:
countBits.h:5
source
Reconstruction
MdcPatRec
MdcTrkRecon
MdcTrkRecon-00-03-44
src
MdcSegPatterns.cxx
Generated by
1.9.6