PandaRoot
PndHammingDecoder.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14  * PndHammingEncoder.h
15  *
16  * Created on: 16.09.2015
17  * Author: Stockmanns
18  */
19 
20 #ifndef MVD_MVDOFFLINETBANALYSIS_TOPIX4_PNDHAMMINGDECODER_H_
21 #define MVD_MVDOFFLINETBANALYSIS_TOPIX4_PNDHAMMINGDECODER_H_
22 
23 #include "Rtypes.h"
24 
26  public:
28  virtual ~PndHammingDecoder();
29 
30  UShort_t CheckHammingCode(ULong64_t dataword, int dataword_length);
31  ULong64_t CalculateCRCTableFast(std::vector<char> p, ULong64_t len);
32  ULong64_t ReflectBitsStream(ULong64_t crc, int bitnum);
33  std::vector<char> ConvertData(std::vector<ULong64_t> topixFrame);
34 
35  protected:
36  void GenerateCRCTable();
37 
38  private:
39  // CRC parameters :
40 
41  const UInt_t fOrder;
42  const ULong64_t fPolynom;
43  const ULong64_t fCRCXor;
44  const UInt_t fRefIn;
45  const UInt_t fRefOut;
46 
47  ULong64_t fCRCMask;
48  ULong64_t fCRCHighBit;
49  ULong64_t fCRCInit_direct;
50  ULong64_t fCRCTab[256];
51 };
52 
53 #endif /* MVD_MVDOFFLINETBANALYSIS_TOPIX4_PNDHAMMINGDECODER_H_ */
virtual ~PndHammingDecoder()
std::vector< char > ConvertData(std::vector< ULong64_t > topixFrame)
ULong64_t CalculateCRCTableFast(std::vector< char > p, ULong64_t len)
ULong64_t ReflectBitsStream(ULong64_t crc, int bitnum)
UShort_t CheckHammingCode(ULong64_t dataword, int dataword_length)