CMS 3D CMS Logo

Classes | Enumerations | Functions
TotemSampicFrame.h File Reference
#include <vector>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <bitset>
#include <iostream>
#include "EventFilter/CTPPSRawToDigi/interface/VFATFrame.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Classes

class  TotemSampicFrame
 

Enumerations

enum  TotemSampicConstant {
  hwId_Position = 0, controlBits0_Position = 1, controlBits1_Position = 2, controlBits2_Position = 3,
  controlBits3_Position = 4, controlBits4_Position = 5, controlBits5_Position = 6, fpgaTime_Position = 7,
  timestampA_Position = 12, fpgaTime_Size = timestampA_Position - fpgaTime_Position, timestampB_Position = 14, timestampA_Size = timestampB_Position - timestampA_Position,
  cellInfo_Position = 16, timestampB_Size = cellInfo_Position - timestampB_Position, planeChannelId_Position = 18, cellInfo_Size = planeChannelId_Position - cellInfo_Position,
  reserved_Position = 19, boardId_Position = 0, l1ATimestamp_Position = 1, bunchNumber_Position = 6,
  l1ATimestamp_Size = bunchNumber_Position - l1ATimestamp_Position, orbitNumber_Position = 8, bunchNumber_Size = orbitNumber_Position - bunchNumber_Position, eventNumber_Position = 12,
  orbitNumber_Size = eventNumber_Position - orbitNumber_Position, channelMap_Position = 16, eventNumber_Size = channelMap_Position - eventNumber_Position, l1ALatency_Position = 18,
  channelMap_Size = l1ALatency_Position - channelMap_Position, numberOfSamples_Position = 20, l1ALatency_Size = numberOfSamples_Position - l1ALatency_Position, offsetOfSamples_Position = 21,
  fwVersion_Position = 22, pllInfo_Position = 23, numberOfSamples = 24, controlBits3 = 0x69,
  cellInfo_Mask = 0x3F
}
 

Functions

template<typename T >
T grayToBinary (const T &gcode_data)
 

Enumeration Type Documentation

◆ TotemSampicConstant

Enumerator
hwId_Position 
controlBits0_Position 
controlBits1_Position 
controlBits2_Position 
controlBits3_Position 
controlBits4_Position 
controlBits5_Position 
fpgaTime_Position 
timestampA_Position 
fpgaTime_Size 
timestampB_Position 
timestampA_Size 
cellInfo_Position 
timestampB_Size 
planeChannelId_Position 
cellInfo_Size 
reserved_Position 
boardId_Position 
l1ATimestamp_Position 
bunchNumber_Position 
l1ATimestamp_Size 
orbitNumber_Position 
bunchNumber_Size 
eventNumber_Position 
orbitNumber_Size 
channelMap_Position 
eventNumber_Size 
l1ALatency_Position 
channelMap_Size 
numberOfSamples_Position 
l1ALatency_Size 
offsetOfSamples_Position 
fwVersion_Position 
pllInfo_Position 
numberOfSamples 
controlBits3 
cellInfo_Mask 

Definition at line 22 of file TotemSampicFrame.h.

22  {
23  hwId_Position = 0, // hwId_Size = 1,
30  fpgaTime_Position = 7, // fpgaTime_Size = 5,
31  timestampA_Position = 12, // timestampA_Size = 2,
33  timestampB_Position = 14, // timestampB_Size = 2,
35  cellInfo_Position = 16, // cellInfo_Size = 2,
37  planeChannelId_Position = 18, // planeChannelId_Size = 1,
39  reserved_Position = 19, // reserved_Size = 5,
40 
41  boardId_Position = 0, // boardId_Size = 1,
42  l1ATimestamp_Position = 1, // l1ATimestamp_Size = 5,
43  bunchNumber_Position = 6, // bunchNumber_Size = 2,
45  orbitNumber_Position = 8, // orbitNumber_Size = 4,
47  eventNumber_Position = 12, // eventNumber_Size = 4,
49  channelMap_Position = 16, // channelMap_Size = 2,
51  l1ALatency_Position = 18, // l1ALatency_Size = 2,
53  numberOfSamples_Position = 20, // numberOfSamples_Size = 1,
55  offsetOfSamples_Position = 21, // offsetOfSamples_Size = 1,
56  fwVersion_Position = 22, // fwVersion_Size = 1,
57  pllInfo_Position = 23, // pllInfo_Size = 1,
58 
59  numberOfSamples = 24,
60  controlBits3 = 0x69,
61  cellInfo_Mask = 0x3F,
62 
63 };

Function Documentation

◆ grayToBinary()

template<typename T >
T grayToBinary ( const T gcode_data)

Definition at line 66 of file TotemSampicFrame.h.

References mps_fire::i.

66  {
67  // assign b[0] = g[0]
68  T binary = gcode_data & (0x0001 << (8 * sizeof(T) - 1)); // MSB is the same
69 
70  // assign b[i] = g[i] xor b[i-1]
71  for (unsigned short int i = 1; i < 8 * sizeof(T); ++i)
72  binary |= (gcode_data ^ (binary >> 1)) & (0x0001 << (8 * sizeof(T) - i - 1));
73 
74  return binary;
75 }
long double T