EventFilter
Utilities
src
DTCRC.cc
Go to the documentation of this file.
1
#include "
EventFilter/Utilities/interface/DTCRC.h
"
2
3
void
dt_crc::calcCRC
(
long
word
,
int
& myC) {
4
int
myCRC[16],
D
[64],
C
[16];
5
6
for
(
int
i
= 0;
i
< 64; ++
i
) {
7
D
[
i
] = (
word
>>
i
) & 0
x1
;
8
}
9
for
(
int
i
= 0;
i
< 16; ++
i
) {
10
C
[
i
] = (myC >>
i
) & 0
x1
;
11
}
12
13
myCRC[0] = (
D
[63] +
D
[62] +
D
[61] +
D
[60] +
D
[55] +
D
[54] +
D
[53] +
D
[52] +
D
[51] +
D
[50] +
D
[49] +
D
[48] +
D
[47] +
14
D
[46] +
D
[45] +
D
[43] +
D
[41] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
15
D
[31] +
D
[30] +
D
[27] +
D
[26] +
D
[25] +
D
[24] +
D
[23] +
D
[22] +
D
[21] +
D
[20] +
D
[19] +
D
[18] +
D
[17] +
16
D
[16] +
D
[15] +
D
[13] +
D
[12] +
D
[11] +
D
[10] +
D
[9] +
D
[8] +
D
[7] +
D
[6] +
D
[5] +
D
[4] +
D
[3] +
D
[2] +
17
D
[1] +
D
[0] +
C
[0] +
C
[1] +
C
[2] +
C
[3] +
C
[4] +
C
[5] +
C
[6] +
C
[7] +
C
[12] +
C
[13] +
C
[14] +
C
[15]) %
18
2;
19
20
myCRC[1] = (
D
[63] +
D
[62] +
D
[61] +
D
[56] +
D
[55] +
D
[54] +
D
[53] +
D
[52] +
D
[51] +
D
[50] +
D
[49] +
D
[48] +
D
[47] +
21
D
[46] +
D
[44] +
D
[42] +
D
[41] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
22
D
[31] +
D
[28] +
D
[27] +
D
[26] +
D
[25] +
D
[24] +
D
[23] +
D
[22] +
D
[21] +
D
[20] +
D
[19] +
D
[18] +
D
[17] +
23
D
[16] +
D
[14] +
D
[13] +
D
[12] +
D
[11] +
D
[10] +
D
[9] +
D
[8] +
D
[7] +
D
[6] +
D
[5] +
D
[4] +
D
[3] +
D
[2] +
24
D
[1] +
C
[0] +
C
[1] +
C
[2] +
C
[3] +
C
[4] +
C
[5] +
C
[6] +
C
[7] +
C
[8] +
C
[13] +
C
[14] +
C
[15]) %
25
2;
26
27
myCRC[2] = (
D
[61] +
D
[60] +
D
[57] +
D
[56] +
D
[46] +
D
[42] +
D
[31] +
D
[30] +
D
[29] +
D
[28] +
D
[16] +
D
[14] +
D
[1] +
28
D
[0] +
C
[8] +
C
[9] +
C
[12] +
C
[13]) %
29
2;
30
31
myCRC[3] = (
D
[62] +
D
[61] +
D
[58] +
D
[57] +
D
[47] +
D
[43] +
D
[32] +
D
[31] +
D
[30] +
D
[29] +
D
[17] +
D
[15] +
D
[2] +
32
D
[1] +
C
[9] +
C
[10] +
C
[13] +
C
[14]) %
33
2;
34
35
myCRC[4] = (
D
[63] +
D
[62] +
D
[59] +
D
[58] +
D
[48] +
D
[44] +
D
[33] +
D
[32] +
D
[31] +
D
[30] +
D
[18] +
D
[16] +
D
[3] +
36
D
[2] +
C
[0] +
C
[10] +
C
[11] +
C
[14] +
C
[15]) %
37
2;
38
39
myCRC[5] = (
D
[63] +
D
[60] +
D
[59] +
D
[49] +
D
[45] +
D
[34] +
D
[33] +
D
[32] +
D
[31] +
D
[19] +
D
[17] +
D
[4] +
D
[3] +
40
C
[1] +
C
[11] +
C
[12] +
C
[15]) %
41
2;
42
43
myCRC[6] = (
D
[61] +
D
[60] +
D
[50] +
D
[46] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
D
[20] +
D
[18] +
D
[5] +
D
[4] +
C
[2] +
44
C
[12] +
C
[13]) %
45
2;
46
47
myCRC[7] = (
D
[62] +
D
[61] +
D
[51] +
D
[47] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[21] +
D
[19] +
D
[6] +
D
[5] +
C
[3] +
48
C
[13] +
C
[14]) %
49
2;
50
51
myCRC[8] = (
D
[63] +
D
[62] +
D
[52] +
D
[48] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[22] +
D
[20] +
D
[7] +
D
[6] +
C
[0] +
52
C
[4] +
C
[14] +
C
[15]) %
53
2;
54
55
myCRC[9] =
56
(
D
[63] +
D
[53] +
D
[49] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[23] +
D
[21] +
D
[8] +
D
[7] +
C
[1] +
C
[5] +
C
[15]) % 2;
57
58
myCRC[10] = (
D
[54] +
D
[50] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[24] +
D
[22] +
D
[9] +
D
[8] +
C
[2] +
C
[6]) % 2;
59
60
myCRC[11] = (
D
[55] +
D
[51] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[25] +
D
[23] +
D
[10] +
D
[9] +
C
[3] +
C
[7]) % 2;
61
62
myCRC[12] = (
D
[56] +
D
[52] +
D
[41] +
D
[40] +
D
[39] +
D
[38] +
D
[26] +
D
[24] +
D
[11] +
D
[10] +
C
[4] +
C
[8]) % 2;
63
64
myCRC[13] = (
D
[57] +
D
[53] +
D
[42] +
D
[41] +
D
[40] +
D
[39] +
D
[27] +
D
[25] +
D
[12] +
D
[11] +
C
[5] +
C
[9]) % 2;
65
66
myCRC[14] = (
D
[58] +
D
[54] +
D
[43] +
D
[42] +
D
[41] +
D
[40] +
D
[28] +
D
[26] +
D
[13] +
D
[12] +
C
[6] +
C
[10]) % 2;
67
68
myCRC[15] = (
D
[63] +
D
[62] +
D
[61] +
D
[60] +
D
[59] +
D
[54] +
D
[53] +
D
[52] +
D
[51] +
D
[50] +
D
[49] +
D
[48] +
D
[47] +
69
D
[46] +
D
[45] +
D
[44] +
D
[42] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
70
D
[31] +
D
[30] +
D
[29] +
D
[26] +
D
[25] +
D
[24] +
D
[23] +
D
[22] +
D
[21] +
D
[20] +
D
[19] +
D
[18] +
D
[17] +
71
D
[16] +
D
[15] +
D
[14] +
D
[12] +
D
[11] +
D
[10] +
D
[9] +
D
[8] +
D
[7] +
D
[6] +
D
[5] +
D
[4] +
D
[3] +
D
[2] +
72
D
[1] +
D
[0] +
C
[0] +
C
[1] +
C
[2] +
C
[3] +
C
[4] +
C
[5] +
C
[6] +
C
[11] +
C
[12] +
C
[13] +
C
[14] +
C
[15]) %
73
2;
74
75
int
tempC = 0x0;
76
for
(
int
i
= 0;
i
< 16; ++
i
) {
77
tempC = tempC + (myCRC[
i
] <<
i
);
78
}
79
myC = tempC;
80
81
return
;
82
}
83
84
void
dt_crc::calcCRC
(
int
myD1,
int
myD2,
int
& myC) {
85
int
myCRC[16],
D
[64],
C
[16];
86
87
for
(
int
i
= 0;
i
< 32; ++
i
) {
88
D
[
i
] = (myD2 >>
i
) & 0
x1
;
89
}
90
for
(
int
i
= 0;
i
< 32; ++
i
) {
91
D
[
i
+ 32] = (myD1 >>
i
) & 0
x1
;
92
}
93
for
(
int
i
= 0;
i
< 16; ++
i
) {
94
C
[
i
] = (myC >>
i
) & 0
x1
;
95
}
96
97
myCRC[0] = (
D
[63] +
D
[62] +
D
[61] +
D
[60] +
D
[55] +
D
[54] +
D
[53] +
D
[52] +
D
[51] +
D
[50] +
D
[49] +
D
[48] +
D
[47] +
98
D
[46] +
D
[45] +
D
[43] +
D
[41] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
99
D
[31] +
D
[30] +
D
[27] +
D
[26] +
D
[25] +
D
[24] +
D
[23] +
D
[22] +
D
[21] +
D
[20] +
D
[19] +
D
[18] +
D
[17] +
100
D
[16] +
D
[15] +
D
[13] +
D
[12] +
D
[11] +
D
[10] +
D
[9] +
D
[8] +
D
[7] +
D
[6] +
D
[5] +
D
[4] +
D
[3] +
D
[2] +
101
D
[1] +
D
[0] +
C
[0] +
C
[1] +
C
[2] +
C
[3] +
C
[4] +
C
[5] +
C
[6] +
C
[7] +
C
[12] +
C
[13] +
C
[14] +
C
[15]) %
102
2;
103
104
myCRC[1] = (
D
[63] +
D
[62] +
D
[61] +
D
[56] +
D
[55] +
D
[54] +
D
[53] +
D
[52] +
D
[51] +
D
[50] +
D
[49] +
D
[48] +
D
[47] +
105
D
[46] +
D
[44] +
D
[42] +
D
[41] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
106
D
[31] +
D
[28] +
D
[27] +
D
[26] +
D
[25] +
D
[24] +
D
[23] +
D
[22] +
D
[21] +
D
[20] +
D
[19] +
D
[18] +
D
[17] +
107
D
[16] +
D
[14] +
D
[13] +
D
[12] +
D
[11] +
D
[10] +
D
[9] +
D
[8] +
D
[7] +
D
[6] +
D
[5] +
D
[4] +
D
[3] +
D
[2] +
108
D
[1] +
C
[0] +
C
[1] +
C
[2] +
C
[3] +
C
[4] +
C
[5] +
C
[6] +
C
[7] +
C
[8] +
C
[13] +
C
[14] +
C
[15]) %
109
2;
110
111
myCRC[2] = (
D
[61] +
D
[60] +
D
[57] +
D
[56] +
D
[46] +
D
[42] +
D
[31] +
D
[30] +
D
[29] +
D
[28] +
D
[16] +
D
[14] +
D
[1] +
112
D
[0] +
C
[8] +
C
[9] +
C
[12] +
C
[13]) %
113
2;
114
115
myCRC[3] = (
D
[62] +
D
[61] +
D
[58] +
D
[57] +
D
[47] +
D
[43] +
D
[32] +
D
[31] +
D
[30] +
D
[29] +
D
[17] +
D
[15] +
D
[2] +
116
D
[1] +
C
[9] +
C
[10] +
C
[13] +
C
[14]) %
117
2;
118
119
myCRC[4] = (
D
[63] +
D
[62] +
D
[59] +
D
[58] +
D
[48] +
D
[44] +
D
[33] +
D
[32] +
D
[31] +
D
[30] +
D
[18] +
D
[16] +
D
[3] +
120
D
[2] +
C
[0] +
C
[10] +
C
[11] +
C
[14] +
C
[15]) %
121
2;
122
123
myCRC[5] = (
D
[63] +
D
[60] +
D
[59] +
D
[49] +
D
[45] +
D
[34] +
D
[33] +
D
[32] +
D
[31] +
D
[19] +
D
[17] +
D
[4] +
D
[3] +
124
C
[1] +
C
[11] +
C
[12] +
C
[15]) %
125
2;
126
127
myCRC[6] = (
D
[61] +
D
[60] +
D
[50] +
D
[46] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
D
[20] +
D
[18] +
D
[5] +
D
[4] +
C
[2] +
128
C
[12] +
C
[13]) %
129
2;
130
131
myCRC[7] = (
D
[62] +
D
[61] +
D
[51] +
D
[47] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[21] +
D
[19] +
D
[6] +
D
[5] +
C
[3] +
132
C
[13] +
C
[14]) %
133
2;
134
135
myCRC[8] = (
D
[63] +
D
[62] +
D
[52] +
D
[48] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[22] +
D
[20] +
D
[7] +
D
[6] +
C
[0] +
136
C
[4] +
C
[14] +
C
[15]) %
137
2;
138
139
myCRC[9] =
140
(
D
[63] +
D
[53] +
D
[49] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[23] +
D
[21] +
D
[8] +
D
[7] +
C
[1] +
C
[5] +
C
[15]) % 2;
141
142
myCRC[10] = (
D
[54] +
D
[50] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[24] +
D
[22] +
D
[9] +
D
[8] +
C
[2] +
C
[6]) % 2;
143
144
myCRC[11] = (
D
[55] +
D
[51] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[25] +
D
[23] +
D
[10] +
D
[9] +
C
[3] +
C
[7]) % 2;
145
146
myCRC[12] = (
D
[56] +
D
[52] +
D
[41] +
D
[40] +
D
[39] +
D
[38] +
D
[26] +
D
[24] +
D
[11] +
D
[10] +
C
[4] +
C
[8]) % 2;
147
148
myCRC[13] = (
D
[57] +
D
[53] +
D
[42] +
D
[41] +
D
[40] +
D
[39] +
D
[27] +
D
[25] +
D
[12] +
D
[11] +
C
[5] +
C
[9]) % 2;
149
150
myCRC[14] = (
D
[58] +
D
[54] +
D
[43] +
D
[42] +
D
[41] +
D
[40] +
D
[28] +
D
[26] +
D
[13] +
D
[12] +
C
[6] +
C
[10]) % 2;
151
152
myCRC[15] = (
D
[63] +
D
[62] +
D
[61] +
D
[60] +
D
[59] +
D
[54] +
D
[53] +
D
[52] +
D
[51] +
D
[50] +
D
[49] +
D
[48] +
D
[47] +
153
D
[46] +
D
[45] +
D
[44] +
D
[42] +
D
[40] +
D
[39] +
D
[38] +
D
[37] +
D
[36] +
D
[35] +
D
[34] +
D
[33] +
D
[32] +
154
D
[31] +
D
[30] +
D
[29] +
D
[26] +
D
[25] +
D
[24] +
D
[23] +
D
[22] +
D
[21] +
D
[20] +
D
[19] +
D
[18] +
D
[17] +
155
D
[16] +
D
[15] +
D
[14] +
D
[12] +
D
[11] +
D
[10] +
D
[9] +
D
[8] +
D
[7] +
D
[6] +
D
[5] +
D
[4] +
D
[3] +
D
[2] +
156
D
[1] +
D
[0] +
C
[0] +
C
[1] +
C
[2] +
C
[3] +
C
[4] +
C
[5] +
C
[6] +
C
[11] +
C
[12] +
C
[13] +
C
[14] +
C
[15]) %
157
2;
158
159
int
tempC = 0x0;
160
for
(
int
i
= 0;
i
< 16; ++
i
) {
161
tempC = tempC + (myCRC[
i
] <<
i
);
162
}
163
myC = tempC;
164
return
;
165
}
mps_fire.i
i
Definition:
mps_fire.py:428
word
uint64_t word
Definition:
CTPPSTotemDataFormatter.cc:29
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition:
testProducerWithPsetDescEmpty_cfi.py:33
DTCRC.h
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition:
Factorize.h:141
dt_crc::calcCRC
void calcCRC(long, int &)
Definition:
DTCRC.cc:3
gen::C
C
Definition:
PomwigHadronizer.cc:78
Generated for CMSSW Reference Manual by
1.8.16