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
 
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 137 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 18 of file FRDEventMessage.cc.

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

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

Member Function Documentation

◆ adler32()

uint32 FRDEventMsgView::adler32 ( ) const
inline

Definition at line 152 of file FRDEventMessage.h.

152 { return adler32_; }

References adler32_.

◆ crc32c()

uint32 FRDEventMsgView::crc32c ( ) const
inline

Definition at line 153 of file FRDEventMessage.h.

153 { return crc32c_; }

References crc32c_.

◆ event()

uint64 FRDEventMsgView::event ( ) const
inline

Definition at line 149 of file FRDEventMessage.h.

149 { return event_; }

References event_.

Referenced by dumpFRDEventView().

◆ eventSize()

uint32 FRDEventMsgView::eventSize ( ) const
inline

Definition at line 150 of file FRDEventMessage.h.

150 { return eventSize_; }

References eventSize_.

◆ flags()

uint16 FRDEventMsgView::flags ( ) const
inline

Definition at line 146 of file FRDEventMessage.h.

146 { return flags_; }

References flags_.

◆ isRealData()

bool FRDEventMsgView::isRealData ( ) const
inline

Definition at line 155 of file FRDEventMessage.h.

155 { return !(flags_ & FRDEVENT_MASK_ISGENDATA); }

References flags_, and FRDEVENT_MASK_ISGENDATA.

◆ lumi()

uint32 FRDEventMsgView::lumi ( ) const
inline

Definition at line 148 of file FRDEventMessage.h.

148 { return lumi_; }

References lumi_.

Referenced by dumpFRDEventView().

◆ paddingSize()

uint32 FRDEventMsgView::paddingSize ( ) const
inline

Definition at line 151 of file FRDEventMessage.h.

151 { return paddingSize_; }

References paddingSize_.

◆ payload()

void* FRDEventMsgView::payload ( ) const
inline

Definition at line 142 of file FRDEventMessage.h.

142 { return payload_; }

References payload_.

◆ run()

uint32 FRDEventMsgView::run ( ) const
inline

Definition at line 147 of file FRDEventMessage.h.

147 { return run_; }

References run_.

Referenced by dumpFRDEventView().

◆ size()

uint32 FRDEventMsgView::size ( void  ) const
inline

Definition at line 143 of file FRDEventMessage.h.

143 { return size_; }

References size_.

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

◆ startAddress()

uint8* FRDEventMsgView::startAddress ( ) const
inline

Definition at line 141 of file FRDEventMessage.h.

141 { return buf_; }

References buf_.

◆ version()

uint16 FRDEventMsgView::version ( ) const
inline

Definition at line 145 of file FRDEventMessage.h.

145 { 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 168 of file FRDEventMessage.h.

Referenced by adler32(), and FRDEventMsgView().

◆ buf_

uint8* FRDEventMsgView::buf_
private

Definition at line 158 of file FRDEventMessage.h.

Referenced by startAddress().

◆ crc32c_

uint32 FRDEventMsgView::crc32c_
private

Definition at line 169 of file FRDEventMessage.h.

Referenced by crc32c(), and FRDEventMsgView().

◆ event_

uint64 FRDEventMsgView::event_
private

Definition at line 165 of file FRDEventMessage.h.

Referenced by event(), and FRDEventMsgView().

◆ eventSize_

uint32 FRDEventMsgView::eventSize_
private

Definition at line 166 of file FRDEventMessage.h.

Referenced by eventSize(), and FRDEventMsgView().

◆ flags_

uint16 FRDEventMsgView::flags_
private

Definition at line 162 of file FRDEventMessage.h.

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

◆ lumi_

uint32 FRDEventMsgView::lumi_
private

Definition at line 164 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and lumi().

◆ paddingSize_

uint32 FRDEventMsgView::paddingSize_
private

Definition at line 167 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and paddingSize().

◆ payload_

void* FRDEventMsgView::payload_
private

Definition at line 159 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and payload().

◆ run_

uint32 FRDEventMsgView::run_
private

Definition at line 163 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and run().

◆ size_

uint32 FRDEventMsgView::size_
private

Definition at line 160 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and size().

◆ version_

uint16 FRDEventMsgView::version_
private

Definition at line 161 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and version().

FRDEventMsgView::flags_
uint16 flags_
Definition: FRDEventMessage.h:162
uint8
unsigned char uint8
Definition: MsgTools.h:11
FRDEventMsgView::run_
uint32 run_
Definition: FRDEventMessage.h:163
FRDEventMsgView::paddingSize_
uint32 paddingSize_
Definition: FRDEventMessage.h:167
uint32
unsigned int uint32
Definition: MsgTools.h:13
FRDEVENT_MASK_ISGENDATA
const uint16 FRDEVENT_MASK_ISGENDATA
Definition: FRDEventMessage.h:126
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
FRDEventMsgView::buf_
uint8 * buf_
Definition: FRDEventMessage.h:158
FRDEventMsgView::event_
uint64 event_
Definition: FRDEventMessage.h:165
uint16
unsigned short uint16
Definition: MsgTools.h:12
FRDEventMsgView::version_
uint16 version_
Definition: FRDEventMessage.h:161
FRDEventMsgView::payload_
void * payload_
Definition: FRDEventMessage.h:159
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
FRDEventMsgView::lumi_
uint32 lumi_
Definition: FRDEventMessage.h:164
FRDEventMsgView::crc32c_
uint32 crc32c_
Definition: FRDEventMessage.h:169
Exception
Definition: hltDiff.cc:245
uint64
unsigned long long uint64
Definition: MsgTools.h:14
FRDEventMsgView::size_
uint32 size_
Definition: FRDEventMessage.h:160
FRDEventMsgView::adler32_
uint32 adler32_
Definition: FRDEventMessage.h:168
FRDEventMsgView::eventSize_
uint32 eventSize_
Definition: FRDEventMessage.h:166