FairRoot/PandaRoot
PndCRCCalculator.h
Go to the documentation of this file.
1 
11 #ifndef MVD_MVDOFFLINETBANALYSIS_PNDCRCCALCULATOR_H_
12 #define MVD_MVDOFFLINETBANALYSIS_PNDCRCCALCULATOR_H_
13 
14 #include "Rtypes.h"
15 #include "TObject.h"
16 
17 class PndCRCCalculator : public TObject {
18 public:
20  PndCRCCalculator(UInt_t order, ULong64_t polynom, ULong64_t CRCXor, UInt_t refIn, UInt_t refOut, UInt_t CRCInit_direct);
21  //settings for ToPix: fOrder(16), fPolynom(0x8005), fCRCXor(0x0000), fRefIn(0), fRefOut(0), fCRCInit_direct(0)
22  //settings for PASTA: fOrder(16), fPolynom(0x1021), fCRCXor(0x0000), fRefIn(0), fRefOut(0), fCRCInit_direct(0x04FA)
23  virtual ~PndCRCCalculator();
24 
25  ULong64_t CalculateCRCTableFast(std::vector<char> p, ULong64_t len);
26  ULong64_t ReflectBitsStream(ULong64_t crc, int bitnum);
27 // std::vector<char> ConvertData(std::vector<ULong64_t> topixFrame);
28  void PrintCRCTable();
29 
30 
31 protected:
32  void GenerateCRCTable();
33 
34 private:
35  // CRC parameters :
36 
37  const UInt_t fOrder;
38  const ULong64_t fPolynom;
39  const ULong64_t fCRCXor;
40  const UInt_t fRefIn;
41  const UInt_t fRefOut;
42 
43  ULong64_t fCRCMask;
44  ULong64_t fCRCHighBit;
45  ULong64_t fCRCInit_direct;
46  ULong64_t fCRCTab[256];
47 
49 };
50 
51 #endif /* MVD_MVDOFFLINETBANALYSIS_TOPIX4_PNDHAMMINGDECODER_H_ */
const UInt_t fOrder
const ULong64_t fPolynom
Double_t p
Definition: anasim.C:58
const UInt_t fRefIn
ClassDef(PndCRCCalculator, 1)
ULong64_t ReflectBitsStream(ULong64_t crc, int bitnum)
ULong64_t fCRCTab[256]
const ULong64_t fCRCXor
ULong64_t CalculateCRCTableFast(std::vector< char > p, ULong64_t len)
const UInt_t fRefOut
ULong64_t fCRCInit_direct
PndCRCCalculator calculates the CRC checksum from a given vector
virtual ~PndCRCCalculator()