CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TotemSampicFrame Class Reference

#include <TotemSampicFrame.h>

Public Member Functions

uint16_t getBunchNumber () const
 
uint16_t getCellInfo () const
 
uint16_t getChannelMap () const
 
int getDetChannel () const
 
int getDetPlane () const
 
uint8_t getEventHardwareId () const
 
uint32_t getEventNumber () const
 
uint64_t getFPGATimestamp () const
 
uint8_t getFWVersion () const
 
uint8_t getHardwareId () const
 
uint16_t getL1ALatency () const
 
uint64_t getL1ATimestamp () const
 
unsigned int getNumberOfSamples () const
 
uint8_t getNumberOfSentSamples () const
 
uint8_t getOffsetOfSamples () const
 
uint32_t getOrbitNumber () const
 
uint8_t getPLLInfo () const
 
const std::vector< uint8_t > getSamples () const
 
uint16_t getTimestampA () const
 
uint16_t getTimestampB () const
 
void print () const
 
void printRaw (bool binary=false) const
 
 TotemSampicFrame (const uint8_t *chInfoPtr, const uint8_t *chDataPtr, const uint8_t *eventInfoPtr)
 
bool valid () const
 
 ~TotemSampicFrame ()
 

Protected Member Functions

void printRawBuffer (const uint16_t *buffer, const bool binary=false, const unsigned int size=12) const
 

Protected Attributes

int status_
 
const uint8_t * totemSampicDataPtr_
 
const uint8_t * totemSampicEventInfoPtr_
 
const uint8_t * totemSampicInfoPtr_
 

Detailed Description

This class is intended to handle the timing infromation of SAMPIC in the TOTEM implementation

Definition at line 69 of file TotemSampicFrame.h.

Constructor & Destructor Documentation

◆ TotemSampicFrame()

TotemSampicFrame::TotemSampicFrame ( const uint8_t *  chInfoPtr,
const uint8_t *  chDataPtr,
const uint8_t *  eventInfoPtr 
)
inline

Definition at line 71 of file TotemSampicFrame.h.

71  :
72  TotemSampicFrame(const uint8_t* chInfoPtr, const uint8_t* chDataPtr, const uint8_t* eventInfoPtr)
73  : totemSampicInfoPtr_(chInfoPtr),
74  totemSampicDataPtr_(chDataPtr),
75  totemSampicEventInfoPtr_(eventInfoPtr),
76  status_(0) {
77  if (chInfoPtr != nullptr && chDataPtr != nullptr && eventInfoPtr != nullptr &&
79  status_ = 1;

References controlBits3, controlBits3_Position, status_, and totemSampicInfoPtr_.

◆ ~TotemSampicFrame()

TotemSampicFrame::~TotemSampicFrame ( )
inline

Definition at line 80 of file TotemSampicFrame.h.

81 {}

Member Function Documentation

◆ getBunchNumber()

uint16_t TotemSampicFrame::getBunchNumber ( ) const
inline

Definition at line 198 of file TotemSampicFrame.h.

199  {
200  uint16_t tmp = 0;
201  if (status_)
203  return tmp;

References bunchNumber_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getCellInfo()

uint16_t TotemSampicFrame::getCellInfo ( ) const
inline

Definition at line 149 of file TotemSampicFrame.h.

150  {
151  uint16_t tmp = 0;
152  if (status_)

References cellInfo_Mask, cellInfo_Position, status_, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ getChannelMap()

uint16_t TotemSampicFrame::getChannelMap ( ) const
inline

Definition at line 219 of file TotemSampicFrame.h.

220  {
221  uint16_t tmp = 0;
222  if (status_)
224  return tmp;

References channelMap_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getDetChannel()

int TotemSampicFrame::getDetChannel ( ) const
inline

Definition at line 163 of file TotemSampicFrame.h.

164  {
165  int tmp = 0;
166  if (status_)
168  return tmp;

References planeChannelId_Position, status_, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ getDetPlane()

int TotemSampicFrame::getDetPlane ( ) const
inline

Definition at line 156 of file TotemSampicFrame.h.

157  {
158  int tmp = 0;
159  if (status_)
161  return tmp;

References planeChannelId_Position, status_, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ getEventHardwareId()

uint8_t TotemSampicFrame::getEventHardwareId ( ) const
inline

Definition at line 183 of file TotemSampicFrame.h.

184  {
185  uint8_t tmp = 0;
186  if (status_)
188  return tmp;

References boardId_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getEventNumber()

uint32_t TotemSampicFrame::getEventNumber ( ) const
inline

Definition at line 212 of file TotemSampicFrame.h.

213  {
214  uint32_t tmp = 0;
215  if (status_)
217  return tmp;

References eventNumber_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getFPGATimestamp()

uint64_t TotemSampicFrame::getFPGATimestamp ( ) const
inline

Definition at line 124 of file TotemSampicFrame.h.

125  {
126  uint64_t tmp = 0;
127  if (status_) {
129  }
130  return tmp;

References fpgaTime_Position, status_, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ getFWVersion()

uint8_t TotemSampicFrame::getFWVersion ( ) const
inline

Definition at line 254 of file TotemSampicFrame.h.

255  {
256  uint8_t tmp = 0;
257  if (status_)
259  return tmp;

References fwVersion_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getHardwareId()

uint8_t TotemSampicFrame::getHardwareId ( ) const
inline

Definition at line 117 of file TotemSampicFrame.h.

118  {
119  uint8_t tmp = 0;
120  if (status_)
122  return tmp;

References hwId_Position, status_, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ getL1ALatency()

uint16_t TotemSampicFrame::getL1ALatency ( ) const
inline

Definition at line 226 of file TotemSampicFrame.h.

227  {
228  uint16_t tmp = 0;
229  if (status_)
231  return tmp;

References l1ALatency_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getL1ATimestamp()

uint64_t TotemSampicFrame::getL1ATimestamp ( ) const
inline

Definition at line 190 of file TotemSampicFrame.h.

191  {
192  uint64_t tmp = 0;
193  if (status_) {
195  }
196  return tmp;

References l1ATimestamp_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getNumberOfSamples()

unsigned int TotemSampicFrame::getNumberOfSamples ( ) const
inline

Definition at line 180 of file TotemSampicFrame.h.

References numberOfSamples, and status_.

◆ getNumberOfSentSamples()

uint8_t TotemSampicFrame::getNumberOfSentSamples ( ) const
inline

Definition at line 233 of file TotemSampicFrame.h.

234  {
235  uint8_t tmp = 0;
236  if (status_)
238  return tmp;

References numberOfSamples_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getOffsetOfSamples()

uint8_t TotemSampicFrame::getOffsetOfSamples ( ) const
inline

Definition at line 240 of file TotemSampicFrame.h.

241  {
242  uint8_t tmp = 0;
243  if (status_)
245  return tmp;

References offsetOfSamples_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getOrbitNumber()

uint32_t TotemSampicFrame::getOrbitNumber ( ) const
inline

Definition at line 205 of file TotemSampicFrame.h.

206  {
207  uint32_t tmp = 0;
208  if (status_)
210  return tmp;

References orbitNumber_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getPLLInfo()

uint8_t TotemSampicFrame::getPLLInfo ( ) const
inline

Definition at line 247 of file TotemSampicFrame.h.

248  {
249  uint8_t tmp = 0;
250  if (status_)
252  return tmp;

References pllInfo_Position, status_, createJobs::tmp, and totemSampicEventInfoPtr_.

Referenced by print().

◆ getSamples()

const std::vector<uint8_t> TotemSampicFrame::getSamples ( ) const
inline

Definition at line 170 of file TotemSampicFrame.h.

171  {
172  std::vector<uint8_t> samples;
173  if (status_) {
175  for (auto it = samples.begin(); it != samples.end(); ++it)
176  *it = grayToBinary<uint8_t>(*it);
177  }
178  return samples;

References numberOfSamples, EgammaValidation_cff::samples, status_, and totemSampicDataPtr_.

◆ getTimestampA()

uint16_t TotemSampicFrame::getTimestampA ( ) const
inline

Definition at line 132 of file TotemSampicFrame.h.

133  {
134  uint16_t tmp = 0;
135  if (status_) {
137  }
138  tmp = 0xFFF - tmp;
139  return grayToBinary<uint16_t>(tmp);

References status_, timestampA_Position, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ getTimestampB()

uint16_t TotemSampicFrame::getTimestampB ( ) const
inline

Definition at line 141 of file TotemSampicFrame.h.

142  {
143  uint16_t tmp = 0;
144  if (status_) {
146  }
147  return grayToBinary<uint16_t>(tmp);

References status_, timestampB_Position, createJobs::tmp, and totemSampicInfoPtr_.

Referenced by print().

◆ print()

void TotemSampicFrame::print ( void  ) const
inline

Definition at line 95 of file TotemSampicFrame.h.

96  {
97  std::bitset<16> bitsChannelMap(getChannelMap());
98  std::bitset<16> bitsPLLInfo(getPLLInfo());
99  edm::LogInfo("TotemSampicFrame") << "\nEvent:"
100  << "\nHardwareId (Event):\t" << std::hex << (unsigned int)getEventHardwareId()
101  << "\nL1A Timestamp:\t" << std::dec << getL1ATimestamp() << "\nL1A Latency:\t"
102  << std::dec << getL1ALatency() << "\nBunch Number:\t" << std::dec
103  << getBunchNumber() << "\nOrbit Number:\t" << std::dec << getOrbitNumber()
104  << "\nEvent Number:\t" << std::dec << getEventNumber() << "\nChannels fired:\t"
105  << std::hex << bitsChannelMap.to_string() << "\nNumber of Samples:\t" << std::dec
106  << getNumberOfSentSamples() << "\nOffset of Samples:\t" << std::dec
107  << (int)getOffsetOfSamples() << "\nFW Version:\t" << std::hex
108  << (int)getFWVersion() << "\nChannel:\nHardwareId:\t" << std::hex
109  << (unsigned int)getHardwareId() << "\nFPGATimestamp:\t" << std::dec
110  << getFPGATimestamp() << "\nTimestampA:\t" << std::dec << getTimestampA()
111  << "\nTimestampB:\t" << std::dec << getTimestampB() << "\nCellInfo:\t" << std::dec
112  << getCellInfo() << "\nPlane:\t" << std::dec << getDetPlane() << "\nChannel:\t"
113  << std::dec << getDetChannel() << "\nPLL Info:\t" << bitsPLLInfo.to_string()
114  << "\n\n";

References TauDecayModes::dec, getBunchNumber(), getCellInfo(), getChannelMap(), getDetChannel(), getDetPlane(), getEventHardwareId(), getEventNumber(), getFPGATimestamp(), getFWVersion(), getHardwareId(), getL1ALatency(), getL1ATimestamp(), getNumberOfSentSamples(), getOffsetOfSamples(), getOrbitNumber(), getPLLInfo(), getTimestampA(), getTimestampB(), and createfilelist::int.

◆ printRaw()

void TotemSampicFrame::printRaw ( bool  binary = false) const
inline

Prints the frame. If binary is true, binary format is used.

Definition at line 84 of file TotemSampicFrame.h.

85  {
86  edm::LogInfo("TotemSampicFrame") << "Event Info: \n";
88 
89  edm::LogInfo("TotemSampicFrame") << "Channel Info: \n";
91 
92  edm::LogInfo("TotemSampicFrame") << "Channel Data: \n";

◆ printRawBuffer()

void TotemSampicFrame::printRawBuffer ( const uint16_t *  buffer,
const bool  binary = false,
const unsigned int  size = 12 
) const
inlineprotected

Definition at line 270 of file TotemSampicFrame.h.

271  {
272  for (unsigned int i = 0; i < size; i++) {
273  if (binary) {
274  std::bitset<16> bits(*(buffer++));
275  edm::LogInfo("TotemSampicFrame") << bits.to_string() << "\n";
276  } else
277  edm::LogInfo("TotemSampicFrame") << std::setfill('0') << std::setw(4) << std::hex << *(buffer++) << "\n";
278  }

References edmScanValgrind::buffer, mps_fire::i, and findQualityFiles::size.

◆ valid()

bool TotemSampicFrame::valid ( ) const
inline

Definition at line 261 of file TotemSampicFrame.h.

262 { return status_ != 0; }

References status_.

Member Data Documentation

◆ status_

int TotemSampicFrame::status_
protected

◆ totemSampicDataPtr_

const uint8_t* TotemSampicFrame::totemSampicDataPtr_
protected

Definition at line 265 of file TotemSampicFrame.h.

Referenced by getSamples().

◆ totemSampicEventInfoPtr_

const uint8_t* TotemSampicFrame::totemSampicEventInfoPtr_
protected

◆ totemSampicInfoPtr_

const uint8_t* TotemSampicFrame::totemSampicInfoPtr_
protected
mps_fire.i
i
Definition: mps_fire.py:428
numberOfSamples_Position
Definition: TotemSampicFrame.h:48
TotemSampicFrame::getOffsetOfSamples
uint8_t getOffsetOfSamples() const
Definition: TotemSampicFrame.h:240
l1ALatency_Position
Definition: TotemSampicFrame.h:47
TotemSampicFrame::totemSampicEventInfoPtr_
const uint8_t * totemSampicEventInfoPtr_
Definition: TotemSampicFrame.h:266
boardId_Position
Definition: TotemSampicFrame.h:41
TotemSampicFrame::getTimestampB
uint16_t getTimestampB() const
Definition: TotemSampicFrame.h:141
orbitNumber_Position
Definition: TotemSampicFrame.h:44
fpgaTime_Position
Definition: TotemSampicFrame.h:34
TotemSampicFrame::getPLLInfo
uint8_t getPLLInfo() const
Definition: TotemSampicFrame.h:247
TotemSampicFrame::getTimestampA
uint16_t getTimestampA() const
Definition: TotemSampicFrame.h:132
TotemSampicFrame::getFPGATimestamp
uint64_t getFPGATimestamp() const
Definition: TotemSampicFrame.h:124
eventNumber_Position
Definition: TotemSampicFrame.h:45
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
TotemSampicFrame::TotemSampicFrame
TotemSampicFrame(const uint8_t *chInfoPtr, const uint8_t *chDataPtr, const uint8_t *eventInfoPtr)
Definition: TotemSampicFrame.h:71
TotemSampicFrame::getFWVersion
uint8_t getFWVersion() const
Definition: TotemSampicFrame.h:254
timestampB_Position
Definition: TotemSampicFrame.h:36
TotemSampicFrame::getEventHardwareId
uint8_t getEventHardwareId() const
Definition: TotemSampicFrame.h:183
TotemSampicFrame::getL1ATimestamp
uint64_t getL1ATimestamp() const
Definition: TotemSampicFrame.h:190
l1ATimestamp_Position
Definition: TotemSampicFrame.h:42
TotemSampicFrame::getNumberOfSentSamples
uint8_t getNumberOfSentSamples() const
Definition: TotemSampicFrame.h:233
bunchNumber_Position
Definition: TotemSampicFrame.h:43
timestampA_Position
Definition: TotemSampicFrame.h:35
hwId_Position
Definition: TotemSampicFrame.h:27
TotemSampicFrame::getDetChannel
int getDetChannel() const
Definition: TotemSampicFrame.h:163
fwVersion_Position
Definition: TotemSampicFrame.h:50
TotemSampicFrame::getL1ALatency
uint16_t getL1ALatency() const
Definition: TotemSampicFrame.h:226
cellInfo_Mask
Definition: TotemSampicFrame.h:55
createfilelist.int
int
Definition: createfilelist.py:10
TotemSampicFrame::getOrbitNumber
uint32_t getOrbitNumber() const
Definition: TotemSampicFrame.h:205
pllInfo_Position
Definition: TotemSampicFrame.h:51
TotemSampicFrame::getHardwareId
uint8_t getHardwareId() const
Definition: TotemSampicFrame.h:117
TotemSampicFrame::printRawBuffer
void printRawBuffer(const uint16_t *buffer, const bool binary=false, const unsigned int size=12) const
Definition: TotemSampicFrame.h:270
TotemSampicFrame::getCellInfo
uint16_t getCellInfo() const
Definition: TotemSampicFrame.h:149
TotemSampicFrame::getEventNumber
uint32_t getEventNumber() const
Definition: TotemSampicFrame.h:212
TotemSampicFrame::getChannelMap
uint16_t getChannelMap() const
Definition: TotemSampicFrame.h:219
TotemSampicFrame::getBunchNumber
uint16_t getBunchNumber() const
Definition: TotemSampicFrame.h:198
offsetOfSamples_Position
Definition: TotemSampicFrame.h:49
TotemSampicFrame::totemSampicInfoPtr_
const uint8_t * totemSampicInfoPtr_
Definition: TotemSampicFrame.h:264
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
channelMap_Position
Definition: TotemSampicFrame.h:46
TotemSampicFrame::status_
int status_
Definition: TotemSampicFrame.h:268
controlBits3
Definition: TotemSampicFrame.h:54
controlBits3_Position
Definition: TotemSampicFrame.h:31
planeChannelId_Position
Definition: TotemSampicFrame.h:38
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
numberOfSamples
Definition: TotemSampicFrame.h:53
cellInfo_Position
Definition: TotemSampicFrame.h:37
TotemSampicFrame::getDetPlane
int getDetPlane() const
Definition: TotemSampicFrame.h:156
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
TotemSampicFrame::totemSampicDataPtr_
const uint8_t * totemSampicDataPtr_
Definition: TotemSampicFrame.h:265