Main Page
Namespaces
Classes
Package Documentation
EventFilter
ESRawToDigi
interface
ESCrcKchipFast.h
Go to the documentation of this file.
1
#ifndef ESCrcKchipFast_H
2
#define ESCrcKchipFast_H
3
4
#include <cstdint>
5
6
class
ESCrcKchipFast
{
7
8
private
:
9
10
uint32_t
crc
;
11
12
public
:
13
14
ESCrcKchipFast
() {
15
init
();
16
reset
() ;
17
};
18
19
void
init
() {
20
crc = 0x0ffff ;
21
}
22
23
void
reset
() {
24
crc = 0x0ffff ;
25
} ;
26
27
void
add
(
unsigned
int
data
) {
28
for
(
int
i
=0;
i
<16;
i
++)
29
{
30
if
((crc&0x0001) == (data&0x0001))
31
crc=crc>>1;
32
else
33
crc=(crc>>1)^0x8408;
// flipped 0x1021;
34
data=(data>>1);
35
}
36
};
37
38
uint32_t
get_crc
() {
39
return
crc
;
40
};
41
42
bool
isCrcOk
(
unsigned
int
crcin=0x0000) {
43
return
((
get_crc
()==crcin) ?
true
:
false
);
44
};
45
46
~ESCrcKchipFast
() { } ;
47
48
};
49
50
#endif
mps_fire.i
i
Definition:
mps_fire.py:330
ESCrcKchipFast
Definition:
ESCrcKchipFast.h:6
ESCrcKchipFast::crc
uint32_t crc
Definition:
ESCrcKchipFast.h:10
ESCrcKchipFast::isCrcOk
bool isCrcOk(unsigned int crcin=0x0000)
Definition:
ESCrcKchipFast.h:42
ESCrcKchipFast::add
void add(unsigned int data)
Definition:
ESCrcKchipFast.h:27
ESCrcKchipFast::init
void init()
Definition:
ESCrcKchipFast.h:19
ESCrcKchipFast::get_crc
uint32_t get_crc()
Definition:
ESCrcKchipFast.h:38
ESCrcKchipFast::reset
void reset()
Definition:
ESCrcKchipFast.h:23
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
ESCrcKchipFast::~ESCrcKchipFast
~ESCrcKchipFast()
Definition:
ESCrcKchipFast.h:46
ESCrcKchipFast::ESCrcKchipFast
ESCrcKchipFast()
Definition:
ESCrcKchipFast.h:14
Generated for CMSSW Reference Manual by
1.8.11