src
IOPool
Streamer
src
FRDEventMessage.cc
Go to the documentation of this file.
1
12
#include "
IOPool/Streamer/interface/FRDEventMessage.h
"
13
#include "
FWCore/Utilities/interface/Exception.h
"
14
15
using namespace
edm::streamer
;
16
20
FRDEventMsgView::FRDEventMsgView
(
void
*
buf
)
21
: buf_((
uint8
*)
buf
),
22
payload_(nullptr),
23
size_(0),
24
version_(0),
25
flags_(0),
26
run_(0),
27
lumi_(0),
28
event_(0),
29
eventSize_(0),
30
paddingSize_(0),
31
adler32_(0),
32
crc32c_(0) {
33
uint32
* bufPtr =
static_cast<
uint32
*
>
(
buf
);
34
35
// In version one of the format, there was no version number in the data,
36
// and the run number (32-bit) appeared first.
37
// This format is no longer supported
38
version_
= *(
uint16
*)bufPtr;
39
40
if
(version_ < 2 || version_ > 6) {
41
throw
cms::Exception
(
"FRDEventMsgView"
) <<
"FRD version "
<<
version_
<<
" is not supported"
;
42
}
43
44
// Version 6 repurposes unused high 16-bits of 32-bit version
45
// assuming we no longer need version 1 support
46
flags_
= *((
uint16
*)bufPtr + 1);
47
48
if
(
version_
< 6 &&
flags_
) {
49
throw
cms::Exception
(
"FRDEventMsgView"
) <<
"FRD flags can not be used in version "
<<
version_
;
50
}
51
52
size_
=
sizeof
(
uint32
);
53
++bufPtr;
54
55
// run number
56
run_
= *bufPtr;
57
size_
+=
sizeof
(
uint32
);
58
++bufPtr;
59
60
// lumi number
61
if
(
version_
>= 2) {
62
lumi_
= *bufPtr;
63
size_
+=
sizeof
(
uint32
);
64
++bufPtr;
65
}
66
67
// event number
68
if
(
version_
== 4) {
69
uint64
eventLow = *bufPtr;
70
size_
+=
sizeof
(
uint32
);
71
++bufPtr;
72
73
uint64
eventHigh = *bufPtr;
74
size_
+=
sizeof
(
uint32
);
75
++bufPtr;
76
77
event_
= (eventHigh << 32) | eventLow;
78
79
}
else
{
80
event_
= *bufPtr;
81
size_
+=
sizeof
(
uint32
);
82
++bufPtr;
83
}
84
85
if
(
version_
>= 3) {
86
// event size
87
eventSize_
= *bufPtr;
88
size_
+=
sizeof
(
uint32
) +
eventSize_
;
89
++bufPtr;
90
91
if
(
version_
>= 5) {
92
crc32c_
= *bufPtr;
93
size_
+=
sizeof
(
uint32
);
94
++bufPtr;
95
}
else
{
96
// padding size up to V4
97
paddingSize_
= *bufPtr;
98
size_
+=
sizeof
(
uint32
) +
paddingSize_
;
99
++bufPtr;
100
101
adler32_
= *bufPtr;
102
size_
+=
sizeof
(
uint32
);
103
++bufPtr;
104
}
105
}
else
{
106
for
(
int
idx
= 0;
idx
< 1024;
idx
++) {
107
size_
+=
sizeof
(
uint32
);
// FED N size
108
size_
+= *bufPtr;
// FED N data
109
eventSize_
+= *bufPtr;
110
++bufPtr;
111
}
112
}
113
114
payload_
= (
void
*)bufPtr;
115
}
Exception
Definition:
hltDiff.cc:245
edm::streamer::FRDEventMsgView::size_
uint32 size_
Definition:
FRDEventMessage.h:161
heavyIonCSV_trainingSettings.idx
idx
Definition:
heavyIonCSV_trainingSettings.py:5
edm::streamer::FRDEventMsgView::version_
uint16 version_
Definition:
FRDEventMessage.h:162
edm::streamer::FRDEventMsgView::FRDEventMsgView
FRDEventMsgView(void *buf)
Definition:
FRDEventMessage.cc:20
edm::streamer::FRDEventMsgView::run_
uint32 run_
Definition:
FRDEventMessage.h:164
edm::streamer::FRDEventMsgView::eventSize_
uint32 eventSize_
Definition:
FRDEventMessage.h:167
edm::streamer::FRDEventMsgView::paddingSize_
uint32 paddingSize_
Definition:
FRDEventMessage.h:168
edm::streamer::FRDEventMsgView::crc32c_
uint32 crc32c_
Definition:
FRDEventMessage.h:170
visDQMUpload.buf
buf
Definition:
visDQMUpload.py:153
edm::streamer::uint8
unsigned char uint8
Definition:
MsgTools.h:12
edm::streamer
Definition:
WatcherStreamFileReader.h:22
Exception.h
edm::streamer::FRDEventMsgView::adler32_
uint32 adler32_
Definition:
FRDEventMessage.h:169
edm::streamer::FRDEventMsgView::flags_
uint16 flags_
Definition:
FRDEventMessage.h:163
edm::streamer::uint64
unsigned long long uint64
Definition:
MsgTools.h:15
edm::streamer::uint16
unsigned short uint16
Definition:
MsgTools.h:13
edm::streamer::FRDEventMsgView::payload_
void * payload_
Definition:
FRDEventMessage.h:160
edm::streamer::FRDEventMsgView::event_
uint64 event_
Definition:
FRDEventMessage.h:166
edm::streamer::FRDEventMsgView::lumi_
uint32 lumi_
Definition:
FRDEventMessage.h:165
edm::streamer::uint32
unsigned int uint32
Definition:
MsgTools.h:14
FRDEventMessage.h
Generated for CMSSW Reference Manual by
1.8.14