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, timestampB_Position = 14, cellInfo_Position = 16, planeChannelId_Position = 18,
  reserved_Position = 19, boardId_Position = 0, l1ATimestamp_Position = 1, bunchNumber_Position = 6,
  orbitNumber_Position = 8, eventNumber_Position = 12, channelMap_Position = 16, l1ALatency_Position = 18,
  numberOfSamples_Position = 20, 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

Enumerator
hwId_Position 
controlBits0_Position 
controlBits1_Position 
controlBits2_Position 
controlBits3_Position 
controlBits4_Position 
controlBits5_Position 
fpgaTime_Position 
timestampA_Position 
timestampB_Position 
cellInfo_Position 
planeChannelId_Position 
reserved_Position 
boardId_Position 
l1ATimestamp_Position 
bunchNumber_Position 
orbitNumber_Position 
eventNumber_Position 
channelMap_Position 
l1ALatency_Position 
numberOfSamples_Position 
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,
32  timestampB_Position = 14, // timestampB_Size = 2,
33  cellInfo_Position = 16, // cellInfo_Size = 2,
34  planeChannelId_Position = 18, // planeChannelId_Size = 1,
35  reserved_Position = 19, // reserved_Size = 5,
36 
37  boardId_Position = 0, // boardId_Size = 1,
38  l1ATimestamp_Position = 1, // l1ATimestamp_Size = 5,
39  bunchNumber_Position = 6, // bunchNumber_Size = 2,
40  orbitNumber_Position = 8, // orbitNumber_Size = 4,
41  eventNumber_Position = 12, // eventNumber_Size = 4,
42  channelMap_Position = 16, // channelMap_Size = 2,
43  l1ALatency_Position = 18, // l1ALatency_Size = 2,
44  numberOfSamples_Position = 20, // numberOfSamples_Size = 1,
45  offsetOfSamples_Position = 21, // offsetOfSamples_Size = 1,
46  fwVersion_Position = 22, // fwVersion_Size = 1,
47  pllInfo_Position = 23, // pllInfo_Size = 1,
48 
49  numberOfSamples = 24,
50  controlBits3 = 0x69,
51  cellInfo_Mask = 0x3F,
52 
53 };

Function Documentation

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

Definition at line 56 of file TotemSampicFrame.h.

References mps_fire::i.

56  {
57  // assign b[0] = g[0]
58  T binary = gcode_data & (0x0001 << (8 * sizeof(T) - 1)); // MSB is the same
59 
60  // assign b[i] = g[i] xor b[i-1]
61  for (unsigned short int i = 1; i < 8 * sizeof(T); ++i)
62  binary |= (gcode_data ^ (binary >> 1)) & (0x0001 << (8 * sizeof(T) - i - 1));
63 
64  return binary;
65 }
long double T