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 118 of file FRDEventMessage.h.

Constructor & Destructor Documentation

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.

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

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

Member Function Documentation

uint32 FRDEventMsgView::adler32 ( ) const
inline

Definition at line 134 of file FRDEventMessage.h.

134 { return adler32_; }
uint32 FRDEventMsgView::crc32c ( ) const
inline

Definition at line 135 of file FRDEventMessage.h.

References FRDEventHeader_V5::crc32c_.

135 { return crc32c_; }
uint64 FRDEventMsgView::event ( ) const
inline

Definition at line 131 of file FRDEventMessage.h.

References event_().

Referenced by dumpFRDEventView().

131 { return event_; }
uint32 FRDEventMsgView::eventSize ( ) const
inline

Definition at line 132 of file FRDEventMessage.h.

References FRDEventHeader_V5::eventSize_.

132 { return eventSize_; }
uint32 FRDEventMsgView::lumi ( void  ) const
inline

Definition at line 130 of file FRDEventMessage.h.

References FRDEventHeader_V5::lumi_.

Referenced by dumpFRDEventView().

130 { return lumi_; }
uint32 FRDEventMsgView::paddingSize ( ) const
inline

Definition at line 133 of file FRDEventMessage.h.

References FRDEventHeader_V5::paddingSize_.

133 { return paddingSize_; }
void* FRDEventMsgView::payload ( ) const
inline

Definition at line 125 of file FRDEventMessage.h.

125 { return payload_; }
uint32 FRDEventMsgView::run ( void  ) const
inline

Definition at line 129 of file FRDEventMessage.h.

References FRDEventHeader_V5::run_.

Referenced by dumpFRDEventView().

129 { return run_; }
uint32 FRDEventMsgView::size ( void  ) const
inline
uint8* FRDEventMsgView::startAddress ( ) const
inline

Definition at line 124 of file FRDEventMessage.h.

Referenced by RawEventFileWriterForBU::doOutputEvent().

124 { return buf_; }
uint32 FRDEventMsgView::version ( ) const
inline

Member Data Documentation

uint32 FRDEventMsgView::adler32_
private

Definition at line 148 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint8* FRDEventMsgView::buf_
private

Definition at line 139 of file FRDEventMessage.h.

uint32 FRDEventMsgView::crc32c_
private

Definition at line 149 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint64 FRDEventMsgView::event_
private

Definition at line 145 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint32 FRDEventMsgView::eventSize_
private

Definition at line 146 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint32 FRDEventMsgView::lumi_
private

Definition at line 144 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint32 FRDEventMsgView::paddingSize_
private

Definition at line 147 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

void* FRDEventMsgView::payload_
private

Definition at line 140 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint32 FRDEventMsgView::run_
private

Definition at line 143 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint32 FRDEventMsgView::size_
private

Definition at line 141 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().

uint32 FRDEventMsgView::version_
private

Definition at line 142 of file FRDEventMessage.h.

Referenced by FRDEventMsgView().