CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
FRDEventMsgView Class Reference

#include <FRDEventMessage.h>

Public Member Functions

uint32 event () const
 
 FRDEventMsgView (void *buf)
 
uint32 lumi () const
 
uint32 run () const
 
uint32 size () const
 
uint8startAddress () const
 
uint32 version () const
 

Private Attributes

uint8buf_
 
uint32 event_len_
 

Detailed Description

Definition at line 41 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.

08-Aug-2008 - KAB - Initial Implementation 06-Oct-2008 - KAB - Added lumi block number

Format: uint32 - run number uint32 - lumi number uint32 - event number 1024 * uint32 - size values for all 1024 FED buffers variable size - FED data Constructor for the FRD event message viewer.

Definition at line 26 of file FRDEventMessage.cc.

References event_len_.

26  : buf_((uint8*)buf)
27 {
28  uint32* bufPtr = static_cast<uint32*>(buf);
29  uint32 versionNumber = *bufPtr;
30  // if the version number is rather large, then we assume that the true
31  // version number is one. (In version one of the format, there was
32  // no version number in the data, and the run number appeared first.)
33  if (versionNumber >= 32) {
34  versionNumber = 1;
35  }
36 
37  // for now, all we need to do here is calculate the full event size
38  event_len_ = 0;
39  if (versionNumber >= 2) {
40  event_len_ += sizeof(uint32); // version number
41  ++bufPtr;
42  }
43  event_len_ += sizeof(uint32); // run number
44  ++bufPtr;
45  if (versionNumber >= 2) {
46  event_len_ += sizeof(uint32); // lumi number
47  ++bufPtr;
48  }
49  event_len_ += sizeof(uint32); // event number
50  ++bufPtr;
51  for (int idx = 0; idx < 1024; idx++) {
52  event_len_ += sizeof(uint32); // FED N size
53  event_len_ += *bufPtr; // FED N data
54  ++bufPtr;
55  }
56 }
unsigned int uint32
Definition: MsgTools.h:13
unsigned char uint8
Definition: MsgTools.h:11

Member Function Documentation

uint32 FRDEventMsgView::event ( ) const

Definition at line 95 of file FRDEventMessage.cc.

References buf_, FRDEventHeader_V2::event_, FRDEventHeader_V1::event_, version(), and FRDEventHeader_V2::version_.

Referenced by dumpFRDEventView().

96 {
98  uint32 version = hdr->version_;
99  if (version >= 32) { // value looks like run number, so assume version 1
101  return hdrV1->event_;
102  }
103  else { // version 2 and above
104  return hdr->event_;
105  }
106 }
uint32 version() const
unsigned int uint32
Definition: MsgTools.h:13
uint32 FRDEventMsgView::lumi ( ) const

Definition at line 83 of file FRDEventMessage.cc.

References buf_, FRDEventHeader_V2::lumi_, version(), and FRDEventHeader_V2::version_.

Referenced by dumpFRDEventView().

84 {
86  uint32 version = hdr->version_;
87  if (version >= 32) { // value looks like run number, so assume version 1
88  return 1;
89  }
90  else { // version 2 and above
91  return hdr->lumi_;
92  }
93 }
uint32 version() const
unsigned int uint32
Definition: MsgTools.h:13
uint32 FRDEventMsgView::run ( void  ) const

Definition at line 70 of file FRDEventMessage.cc.

References buf_, FRDEventHeader_V2::run_, FRDEventHeader_V1::run_, version(), and FRDEventHeader_V2::version_.

Referenced by dumpFRDEventView().

71 {
73  uint32 version = hdr->version_;
74  if (version >= 32) { // value looks like run number, so assume version 1
76  return hdrV1->run_;
77  }
78  else { // version 2 and above
79  return hdr->run_;
80  }
81 }
uint32 version() const
unsigned int uint32
Definition: MsgTools.h:13
uint32 FRDEventMsgView::size ( void  ) const
inline

Definition at line 48 of file FRDEventMessage.h.

References event_len_.

Referenced by FRDEventFileWriter::doOutputEvent(), and dumpFRDEventView().

48 { return event_len_; }
uint8* FRDEventMsgView::startAddress ( ) const
inline

Definition at line 47 of file FRDEventMessage.h.

References buf_.

Referenced by FRDEventFileWriter::doOutputEvent().

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

Definition at line 58 of file FRDEventMessage.cc.

References buf_, and FRDEventHeader_V2::version_.

Referenced by dumpFRDEventView(), event(), lumi(), and run().

59 {
61  uint32 version = hdr->version_;
62  if (version >= 32) { // value looks like run number, so assume version 1
63  return 1;
64  }
65  else { // version 2 and above
66  return hdr->version_;
67  }
68 }
uint32 version() const
unsigned int uint32
Definition: MsgTools.h:13

Member Data Documentation

uint8* FRDEventMsgView::buf_
private

Definition at line 57 of file FRDEventMessage.h.

Referenced by event(), lumi(), run(), startAddress(), and version().

uint32 FRDEventMsgView::event_len_
private

Definition at line 58 of file FRDEventMessage.h.

Referenced by FRDEventMsgView(), and size().