Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
IOPool
Streamer
src
FRDEventMessage.cc
Go to the documentation of this file.
1
21
#include "
IOPool/Streamer/interface/FRDEventMessage.h
"
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
58
uint32
FRDEventMsgView::version
()
const
59
{
60
FRDEventHeader_V2
* hdr = (
FRDEventHeader_V2
*)
buf_
;
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
70
uint32
FRDEventMsgView::run
()
const
71
{
72
FRDEventHeader_V2
* hdr = (
FRDEventHeader_V2
*)
buf_
;
73
uint32
version
= hdr->
version_
;
74
if
(version >= 32) {
// value looks like run number, so assume version 1
75
FRDEventHeader_V1
* hdrV1 = (
FRDEventHeader_V1
*)
buf_
;
76
return
hdrV1->
run_
;
77
}
78
else
{
// version 2 and above
79
return
hdr->
run_
;
80
}
81
}
82
83
uint32
FRDEventMsgView::lumi
()
const
84
{
85
FRDEventHeader_V2
* hdr = (
FRDEventHeader_V2
*)
buf_
;
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
95
uint32
FRDEventMsgView::event
()
const
96
{
97
FRDEventHeader_V2
* hdr = (
FRDEventHeader_V2
*)
buf_
;
98
uint32
version
= hdr->
version_
;
99
if
(version >= 32) {
// value looks like run number, so assume version 1
100
FRDEventHeader_V1
* hdrV1 = (
FRDEventHeader_V1
*)
buf_
;
101
return
hdrV1->
event_
;
102
}
103
else
{
// version 2 and above
104
return
hdr->
event_
;
105
}
106
}
FRDEventMsgView::buf_
uint8 * buf_
Definition:
FRDEventMessage.h:57
FRDEventHeader_V2::event_
uint32 event_
Definition:
FRDEventMessage.h:32
FRDEventHeader_V1::event_
uint32 event_
Definition:
FRDEventMessage.h:38
FRDEventMsgView::lumi
uint32 lumi() const
Definition:
FRDEventMessage.cc:83
FRDEventHeader_V1::run_
uint32 run_
Definition:
FRDEventMessage.h:37
FRDEventMsgView::FRDEventMsgView
FRDEventMsgView(void *buf)
Definition:
FRDEventMessage.cc:26
FRDEventMsgView::run
uint32 run() const
Definition:
FRDEventMessage.cc:70
FRDEventHeader_V1
Definition:
FRDEventMessage.h:35
FRDEventHeader_V2::run_
uint32 run_
Definition:
FRDEventMessage.h:30
FRDEventMsgView::event_len_
uint32 event_len_
Definition:
FRDEventMessage.h:58
FRDEventMsgView::version
uint32 version() const
Definition:
FRDEventMessage.cc:58
uint32
unsigned int uint32
Definition:
MsgTools.h:13
FRDEventHeader_V2
Definition:
FRDEventMessage.h:27
customizeTrackingMonitorSeedNumber.idx
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
Definition:
customizeTrackingMonitorSeedNumber.py:15
FRDEventHeader_V2::lumi_
uint32 lumi_
Definition:
FRDEventMessage.h:31
uint8
unsigned char uint8
Definition:
MsgTools.h:11
FRDEventMsgView::event
uint32 event() const
Definition:
FRDEventMessage.cc:95
FRDEventHeader_V2::version_
uint32 version_
Definition:
FRDEventMessage.h:29
FRDEventMessage.h
Generated for CMSSW Reference Manual by
1.8.5