CMS 3D CMS Logo

Classes | Enumerations | Functions
TotemSampicFrame.h File Reference
#include <vector>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <bitset>
#include "EventFilter/CTPPSRawToDigi/interface/VFATFrame.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 20 of file TotemSampicFrame.h.

21 {
22  hwId_Position = 0, // hwId_Size = 1,
29  fpgaTime_Position = 7, // fpgaTime_Size = 5,
30  timestampA_Position = 12, // timestampA_Size = 2,
31  timestampB_Position = 14, // timestampB_Size = 2,
32  cellInfo_Position = 16, // cellInfo_Size = 2,
33  planeChannelId_Position = 18, // planeChannelId_Size = 1,
34  reserved_Position = 19, // reserved_Size = 5,
35 
36  boardId_Position = 0, // boardId_Size = 1,
37  l1ATimestamp_Position = 1, // l1ATimestamp_Size = 5,
38  bunchNumber_Position = 6, // bunchNumber_Size = 2,
39  orbitNumber_Position = 8, // orbitNumber_Size = 4,
40  eventNumber_Position = 12, // eventNumber_Size = 4,
41  channelMap_Position = 16, // channelMap_Size = 2,
42  l1ALatency_Position = 18, // l1ALatency_Size = 2,
43  numberOfSamples_Position = 20, // numberOfSamples_Size = 1,
44  offsetOfSamples_Position = 21, // offsetOfSamples_Size = 1,
45  fwVersion_Position = 22, // fwVersion_Size = 1,
46  pllInfo_Position = 23, // pllInfo_Size = 1,
47 
48  numberOfSamples = 24,
49  controlBits3 = 0x69,
50  cellInfo_Mask = 0x3F,
51 
52 };

Function Documentation

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

Definition at line 55 of file TotemSampicFrame.h.

References mps_fire::i.

56 {
57  //b[0] = g[0]
58  T binary = gcode_data & ( 0x0001 << ( 8*sizeof(T) - 1 ) ); // MSB is the same
59 
60  //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