CMS 3D CMS Logo

RawDataUnpacker.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of the TOTEM offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 * Nicola Minafra
7 *
8 ****************************************************************************/
9 
10 #ifndef EventFilter_CTPPSRawToDigi_RawDataUnpacker
11 #define EventFilter_CTPPSRawToDigi_RawDataUnpacker
12 
14 
17 
21 
22 namespace pps {
25  public:
26  typedef uint64_t word;
27 
29  enum { vmCluster = 0x80, vmRaw = 0x90, vmDiamondCompact = 0xB0 };
30 
31  // list of headers for all words encountered in diamond data frames
32  static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_2 = 0x7800;
33  static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_3 = 0x7000;
34  static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_5 = 0x6800;
35  static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_7 = 0x6000;
36  static constexpr unsigned int VFAT_HEADER_OF_EC = 0xC000;
37 
39 
41 
43  int run(int fedId,
44  const FEDRawData &data,
45  std::vector<TotemFEDInfo> &fedInfoColl,
46  SimpleVFATFrameCollection &coll) const;
47 
49  int processOptoRxFrame(const word *buf,
50  unsigned int frameSize,
51  TotemFEDInfo &fedInfo,
52  SimpleVFATFrameCollection *fc) const;
53 
55  int processOptoRxFrameSerial(const word *buffer, unsigned int frameSize, SimpleVFATFrameCollection *fc) const;
56 
59  unsigned int frameSize,
60  TotemFEDInfo &fedInfo,
61  SimpleVFATFrameCollection *fc) const;
62 
65  unsigned int frameSize,
66  TotemFEDInfo &fedInfo,
67  SimpleVFATFrameCollection *fc) const;
68 
70  int processVFATDataParallel(const uint16_t *buf,
71  unsigned int maxWords,
72  unsigned int OptoRxId,
73  SimpleVFATFrameCollection *fc) const;
74 
75  private:
76  unsigned char verbosity;
77  };
78 } // namespace pps
79 
80 #endif
OptoRx headers and footers.
Definition: TotemFEDInfo.h:17
static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_7
static constexpr unsigned int VFAT_HEADER_OF_EC
int processOptoRxFrame(const word *buf, unsigned int frameSize, TotemFEDInfo &fedInfo, SimpleVFATFrameCollection *fc) const
Process one Opto-Rx (or LoneG) frame.
int processOptoRxFrameSampic(const word *buffer, unsigned int frameSize, TotemFEDInfo &fedInfo, SimpleVFATFrameCollection *fc) const
Process one Opto-Rx frame that contains SAMPIC frames.
static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_5
int processVFATDataParallel(const uint16_t *buf, unsigned int maxWords, unsigned int OptoRxId, SimpleVFATFrameCollection *fc) const
Process data from one VFAT in parallel (new) format.
uint64_t word
static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_3
static constexpr unsigned int VFAT_DIAMOND_HEADER_OF_WORD_2
unsigned char verbosity
int run(int fedId, const FEDRawData &data, std::vector< TotemFEDInfo > &fedInfoColl, SimpleVFATFrameCollection &coll) const
Unpack data from FED with fedId into ‘coll’ collection.
unsigned long long uint64_t
Definition: Time.h:13
Collection of code for unpacking of TOTEM raw-data.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int processOptoRxFrameSerial(const word *buffer, unsigned int frameSize, SimpleVFATFrameCollection *fc) const
Process one Opto-Rx frame in serial (old) format.
int processOptoRxFrameParallel(const word *buffer, unsigned int frameSize, TotemFEDInfo &fedInfo, SimpleVFATFrameCollection *fc) const
Process one Opto-Rx frame in parallel (new) format.