CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::streamer::FRDEventMsgView Class Reference

#include <FRDEventMessage.h>

Public Member Functions

uint32 adler32 () const
 
uint32 crc32c () const
 
uint64 event () const
 
uint32 eventSize () const
 
uint16 flags () const
 
 FRDEventMsgView (void *buf)
 
bool isRealData () const
 
uint32 lumi () const
 
uint32 paddingSize () const
 
void * payload () const
 
uint32 run () const
 
uint32 size () const
 
uint8startAddress () const
 
uint16 version () const
 

Private Attributes

uint32 adler32_
 
uint8buf_
 
uint32 crc32c_
 
uint64 event_
 
uint32 eventSize_
 
uint16 flags_
 
uint32 lumi_
 
uint32 paddingSize_
 
void * payload_
 
uint32 run_
 
uint32 size_
 
uint16 version_
 

Detailed Description

Definition at line 138 of file FRDEventMessage.h.

Constructor & Destructor Documentation

◆ FRDEventMsgView()

FRDEventMsgView::FRDEventMsgView ( void *  buf)

Constructor for the FRD event message viewer.

Definition at line 20 of file FRDEventMessage.cc.

References adler32_, visDQMUpload::buf, crc32c_, event_, eventSize_, Exception, flags_, heavyIonCSV_trainingSettings::idx, lumi_, paddingSize_, payload_, run_, size_, and version_.

21  : buf_((uint8*)buf),
22  payload_(nullptr),
23  size_(0),
24  version_(0),
25  flags_(0),
26  run_(0),
27  lumi_(0),
28  event_(0),
29  eventSize_(0),
30  paddingSize_(0),
31  adler32_(0),
32  crc32c_(0) {
33  uint32* bufPtr = static_cast<uint32*>(buf);
34 
35  // In version one of the format, there was no version number in the data,
36  // and the run number (32-bit) appeared first.
37  // This format is no longer supported
38  version_ = *(uint16*)bufPtr;
39 
40  if (version_ < 2 || version_ > 6) {
41  throw cms::Exception("FRDEventMsgView") << "FRD version " << version_ << " is not supported";
42  }
43 
44  // Version 6 repurposes unused high 16-bits of 32-bit version
45  // assuming we no longer need version 1 support
46  flags_ = *((uint16*)bufPtr + 1);
47 
48  if (version_ < 6 && flags_) {
49  throw cms::Exception("FRDEventMsgView") << "FRD flags can not be used in version " << version_;
50  }
51 
52  size_ = sizeof(uint32);
53  ++bufPtr;
54 
55  // run number
56  run_ = *bufPtr;
57  size_ += sizeof(uint32);
58  ++bufPtr;
59 
60  // lumi number
61  if (version_ >= 2) {
62  lumi_ = *bufPtr;
63  size_ += sizeof(uint32);
64  ++bufPtr;
65  }
66 
67  // event number
68  if (version_ == 4) {
69  uint64 eventLow = *bufPtr;
70  size_ += sizeof(uint32);
71  ++bufPtr;
72 
73  uint64 eventHigh = *bufPtr;
74  size_ += sizeof(uint32);
75  ++bufPtr;
76 
77  event_ = (eventHigh << 32) | eventLow;
78 
79  } else {
80  event_ = *bufPtr;
81  size_ += sizeof(uint32);
82  ++bufPtr;
83  }
84 
85  if (version_ >= 3) {
86  // event size
87  eventSize_ = *bufPtr;
88  size_ += sizeof(uint32) + eventSize_;
89  ++bufPtr;
90 
91  if (version_ >= 5) {
92  crc32c_ = *bufPtr;
93  size_ += sizeof(uint32);
94  ++bufPtr;
95  } else {
96  // padding size up to V4
97  paddingSize_ = *bufPtr;
98  size_ += sizeof(uint32) + paddingSize_;
99  ++bufPtr;
100 
101  adler32_ = *bufPtr;
102  size_ += sizeof(uint32);
103  ++bufPtr;
104  }
105  } else {
106  for (int idx = 0; idx < 1024; idx++) {
107  size_ += sizeof(uint32); // FED N size
108  size_ += *bufPtr; // FED N data
109  eventSize_ += *bufPtr;
110  ++bufPtr;
111  }
112  }
113 
114  payload_ = (void*)bufPtr;
115 }
unsigned char uint8
Definition: MsgTools.h:12
unsigned long long uint64
Definition: MsgTools.h:15
unsigned short uint16
Definition: MsgTools.h:13
unsigned int uint32
Definition: MsgTools.h:14

Member Function Documentation

◆ adler32()

uint32 edm::streamer::FRDEventMsgView::adler32 ( ) const
inline

Definition at line 153 of file FRDEventMessage.h.

References adler32_.

153 { return adler32_; }

◆ crc32c()

uint32 edm::streamer::FRDEventMsgView::crc32c ( ) const
inline

Definition at line 154 of file FRDEventMessage.h.

References crc32c_.

154 { return crc32c_; }

◆ event()

uint64 edm::streamer::FRDEventMsgView::event ( ) const
inline

Definition at line 150 of file FRDEventMessage.h.

References event_.

Referenced by edm::streamer::dumpFRDEventView().

150 { return event_; }

◆ eventSize()

uint32 edm::streamer::FRDEventMsgView::eventSize ( ) const
inline

Definition at line 151 of file FRDEventMessage.h.

References eventSize_.

◆ flags()

uint16 edm::streamer::FRDEventMsgView::flags ( ) const
inline

Definition at line 147 of file FRDEventMessage.h.

References flags_.

147 { return flags_; }

◆ isRealData()

bool edm::streamer::FRDEventMsgView::isRealData ( ) const
inline

Definition at line 156 of file FRDEventMessage.h.

References flags_, and edm::streamer::FRDEVENT_MASK_ISGENDATA.

156 { return !(flags_ & FRDEVENT_MASK_ISGENDATA); }
const uint16 FRDEVENT_MASK_ISGENDATA

◆ lumi()

uint32 edm::streamer::FRDEventMsgView::lumi ( ) const
inline

Definition at line 149 of file FRDEventMessage.h.

References lumi_.

Referenced by edm::streamer::dumpFRDEventView().

149 { return lumi_; }

◆ paddingSize()

uint32 edm::streamer::FRDEventMsgView::paddingSize ( ) const
inline

Definition at line 152 of file FRDEventMessage.h.

References paddingSize_.

◆ payload()

void* edm::streamer::FRDEventMsgView::payload ( ) const
inline

Definition at line 143 of file FRDEventMessage.h.

References payload_.

143 { return payload_; }

◆ run()

uint32 edm::streamer::FRDEventMsgView::run ( ) const
inline

Definition at line 148 of file FRDEventMessage.h.

References run_.

Referenced by edm::streamer::dumpFRDEventView().

148 { return run_; }

◆ size()

uint32 edm::streamer::FRDEventMsgView::size ( void  ) const
inline

◆ startAddress()

uint8* edm::streamer::FRDEventMsgView::startAddress ( ) const
inline

Definition at line 142 of file FRDEventMessage.h.

References buf_.

142 { return buf_; }

◆ version()

uint16 edm::streamer::FRDEventMsgView::version ( ) const
inline

Member Data Documentation

◆ adler32_

uint32 edm::streamer::FRDEventMsgView::adler32_
private

Definition at line 169 of file FRDEventMessage.h.

Referenced by adler32(), and FRDEventMsgView().

◆ buf_

uint8* edm::streamer::FRDEventMsgView::buf_
private

Definition at line 159 of file FRDEventMessage.h.

Referenced by startAddress().

◆ crc32c_

uint32 edm::streamer::FRDEventMsgView::crc32c_
private

Definition at line 170 of file FRDEventMessage.h.

Referenced by crc32c(), and FRDEventMsgView().

◆ event_

uint64 edm::streamer::FRDEventMsgView::event_
private

Definition at line 166 of file FRDEventMessage.h.

Referenced by event(), and FRDEventMsgView().

◆ eventSize_

uint32 edm::streamer::FRDEventMsgView::eventSize_
private

Definition at line 167 of file FRDEventMessage.h.

Referenced by eventSize(), and FRDEventMsgView().

◆ flags_

uint16 edm::streamer::FRDEventMsgView::flags_
private

Definition at line 163 of file FRDEventMessage.h.

Referenced by flags(), FRDEventMsgView(), and isRealData().

◆ lumi_

uint32 edm::streamer::FRDEventMsgView::lumi_
private

Definition at line 165 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and lumi().

◆ paddingSize_

uint32 edm::streamer::FRDEventMsgView::paddingSize_
private

Definition at line 168 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and paddingSize().

◆ payload_

void* edm::streamer::FRDEventMsgView::payload_
private

Definition at line 160 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and payload().

◆ run_

uint32 edm::streamer::FRDEventMsgView::run_
private

Definition at line 164 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and run().

◆ size_

uint32 edm::streamer::FRDEventMsgView::size_
private

Definition at line 161 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and size().

◆ version_

uint16 edm::streamer::FRDEventMsgView::version_
private

Definition at line 162 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and version().