CMS 3D CMS Logo

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

#include <FRDEventMessage.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 107 of file FRDEventMessage.h.

Constructor & Destructor Documentation

◆ FRDEventMsgView()

FRDEventMsgView::FRDEventMsgView ( void *  buf)

This class is used to view the contents of "FED Raw Data" (FRD) events. Initially, the only time that such events are created is when an error occurs in the HLT. So, in the beginning, "error event" == "FRD event". However, if new ways of creating events of this type are added to the HLT, hopefully this class can be used or upgraded to handle those events as well. Constructor for the FRD event message viewer.

Definition at line 17 of file FRDEventMessage.cc.

18  : buf_((uint8*)buf),
19  payload_(nullptr),
20  size_(0),
21  version_(0),
22  run_(0),
23  lumi_(0),
24  event_(0),
25  eventSize_(0),
26  paddingSize_(0),
27  adler32_(0),
28  crc32c_(0) {
29  uint32* bufPtr = static_cast<uint32*>(buf);
30  version_ = *bufPtr;
31  // if the version number is rather large, then we assume that the true
32  // version number is one. (In version one of the format, there was
33  // no version number in the data, and the run number appeared first.)
34  if (version_ >= 32) {
35  version_ = 1;
36  }
37 
38  size_ = 0;
39 
40  // version number
41  if (version_ >= 2) {
42  size_ += sizeof(uint32);
43  ++bufPtr;
44  }
45 
46  // run number
47  run_ = *bufPtr;
48  size_ += sizeof(uint32);
49  ++bufPtr;
50 
51  // lumi number
52  if (version_ >= 2) {
53  lumi_ = *bufPtr;
54  size_ += sizeof(uint32);
55  ++bufPtr;
56  }
57 
58  // event number
59  if (version_ == 4) {
60  uint64 eventLow = *bufPtr;
61  size_ += sizeof(uint32);
62  ++bufPtr;
63 
64  uint64 eventHigh = *bufPtr;
65  size_ += sizeof(uint32);
66  ++bufPtr;
67 
68  event_ = (eventHigh << 32) | eventLow;
69 
70  } else {
71  event_ = *bufPtr;
72  size_ += sizeof(uint32);
73  ++bufPtr;
74  }
75 
76  if (version_ >= 3) {
77  // event size
78  eventSize_ = *bufPtr;
79  size_ += sizeof(uint32) + eventSize_;
80  ++bufPtr;
81 
82  if (version_ >= 5) {
83  crc32c_ = *bufPtr;
84  size_ += sizeof(uint32);
85  ++bufPtr;
86  } else {
87  // padding size up to V4
88  paddingSize_ = *bufPtr;
89  size_ += sizeof(uint32) + paddingSize_;
90  ++bufPtr;
91 
92  adler32_ = *bufPtr;
93  size_ += sizeof(uint32);
94  ++bufPtr;
95  }
96  } else {
97  for (int idx = 0; idx < 1024; idx++) {
98  size_ += sizeof(uint32); // FED N size
99  size_ += *bufPtr; // FED N data
100  eventSize_ += *bufPtr;
101  ++bufPtr;
102  }
103  }
104 
105  payload_ = (void*)bufPtr;
106 }

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

Member Function Documentation

◆ adler32()

uint32 FRDEventMsgView::adler32 ( ) const
inline

Definition at line 121 of file FRDEventMessage.h.

121 { return adler32_; }

References adler32_.

◆ crc32c()

uint32 FRDEventMsgView::crc32c ( ) const
inline

Definition at line 122 of file FRDEventMessage.h.

122 { return crc32c_; }

References crc32c_.

◆ event()

uint64 FRDEventMsgView::event ( ) const
inline

Definition at line 118 of file FRDEventMessage.h.

118 { return event_; }

References event_.

Referenced by dumpFRDEventView().

◆ eventSize()

uint32 FRDEventMsgView::eventSize ( ) const
inline

Definition at line 119 of file FRDEventMessage.h.

119 { return eventSize_; }

References eventSize_.

◆ lumi()

uint32 FRDEventMsgView::lumi ( ) const
inline

Definition at line 117 of file FRDEventMessage.h.

117 { return lumi_; }

References lumi_.

Referenced by dumpFRDEventView().

◆ paddingSize()

uint32 FRDEventMsgView::paddingSize ( ) const
inline

Definition at line 120 of file FRDEventMessage.h.

120 { return paddingSize_; }

References paddingSize_.

◆ payload()

void* FRDEventMsgView::payload ( ) const
inline

Definition at line 112 of file FRDEventMessage.h.

112 { return payload_; }

References payload_.

◆ run()

uint32 FRDEventMsgView::run ( ) const
inline

Definition at line 116 of file FRDEventMessage.h.

116 { return run_; }

References run_.

Referenced by dumpFRDEventView().

◆ size()

uint32 FRDEventMsgView::size ( void  ) const
inline

Definition at line 113 of file FRDEventMessage.h.

113 { return size_; }

References size_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and dumpFRDEventView().

◆ startAddress()

uint8* FRDEventMsgView::startAddress ( ) const
inline

Definition at line 111 of file FRDEventMessage.h.

111 { return buf_; }

References buf_.

◆ version()

uint32 FRDEventMsgView::version ( ) const
inline

Definition at line 115 of file FRDEventMessage.h.

115 { return version_; }

References version_.

Referenced by validation.Sample::datasetpattern(), dumpFRDEventView(), and validation.Sample::filename().

Member Data Documentation

◆ adler32_

uint32 FRDEventMsgView::adler32_
private

Definition at line 134 of file FRDEventMessage.h.

Referenced by adler32(), and FRDEventMsgView().

◆ buf_

uint8* FRDEventMsgView::buf_
private

Definition at line 125 of file FRDEventMessage.h.

Referenced by startAddress().

◆ crc32c_

uint32 FRDEventMsgView::crc32c_
private

Definition at line 135 of file FRDEventMessage.h.

Referenced by crc32c(), and FRDEventMsgView().

◆ event_

uint64 FRDEventMsgView::event_
private

Definition at line 131 of file FRDEventMessage.h.

Referenced by event(), and FRDEventMsgView().

◆ eventSize_

uint32 FRDEventMsgView::eventSize_
private

Definition at line 132 of file FRDEventMessage.h.

Referenced by eventSize(), and FRDEventMsgView().

◆ lumi_

uint32 FRDEventMsgView::lumi_
private

Definition at line 130 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and lumi().

◆ paddingSize_

uint32 FRDEventMsgView::paddingSize_
private

Definition at line 133 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and paddingSize().

◆ payload_

void* FRDEventMsgView::payload_
private

Definition at line 126 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and payload().

◆ run_

uint32 FRDEventMsgView::run_
private

Definition at line 129 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and run().

◆ size_

uint32 FRDEventMsgView::size_
private

Definition at line 127 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and size().

◆ version_

uint32 FRDEventMsgView::version_
private

Definition at line 128 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and version().

uint8
unsigned char uint8
Definition: MsgTools.h:11
FRDEventMsgView::run_
uint32 run_
Definition: FRDEventMessage.h:129
FRDEventMsgView::paddingSize_
uint32 paddingSize_
Definition: FRDEventMessage.h:133
training_settings.idx
idx
Definition: training_settings.py:16
uint32
unsigned int uint32
Definition: MsgTools.h:13
FRDEventMsgView::buf_
uint8 * buf_
Definition: FRDEventMessage.h:125
FRDEventMsgView::event_
uint64 event_
Definition: FRDEventMessage.h:131
FRDEventMsgView::payload_
void * payload_
Definition: FRDEventMessage.h:126
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
FRDEventMsgView::version_
uint32 version_
Definition: FRDEventMessage.h:128
FRDEventMsgView::lumi_
uint32 lumi_
Definition: FRDEventMessage.h:130
FRDEventMsgView::crc32c_
uint32 crc32c_
Definition: FRDEventMessage.h:135
uint64
unsigned long long uint64
Definition: MsgTools.h:14
FRDEventMsgView::size_
uint32 size_
Definition: FRDEventMessage.h:127
FRDEventMsgView::adler32_
uint32 adler32_
Definition: FRDEventMessage.h:134
FRDEventMsgView::eventSize_
uint32 eventSize_
Definition: FRDEventMessage.h:132