CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FRDEventMessage.cc
Go to the documentation of this file.
1 
22 
26 FRDEventMsgView::FRDEventMsgView(void* buf): 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 }
57 
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 }
69 
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 }
82 
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 }
94 
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 lumi() const
FRDEventMsgView(void *buf)
uint32 run() const
uint32 version() const
unsigned int uint32
Definition: MsgTools.h:13
unsigned char uint8
Definition: MsgTools.h:11
uint32 event() const