src
IOPool
Streamer
src
StreamerFileWriter.cc
Go to the documentation of this file.
1
#include "
IOPool/Streamer/src/StreamerFileWriter.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
3
4
namespace
edm::streamer
{
5
6
StreamerFileWriter::StreamerFileWriter
(
edm::ParameterSet
const
& ps)
7
: stream_writer_(new
StreamerOutputFile
(ps.getUntrackedParameter<
std
::
string
>(
"fileName"
),
8
ps.getUntrackedParameter<unsigned
int
>(
"padding"
))) {}
9
10
StreamerFileWriter::StreamerFileWriter
(
std::string
const
&
fileName
)
11
: stream_writer_(new
StreamerOutputFile
(
fileName
)) {}
12
13
StreamerFileWriter::~StreamerFileWriter
() {}
14
15
void
StreamerFileWriter::doOutputHeader
(
InitMsgBuilder
const
& init_message) {
16
//Let us turn it into a View
17
InitMsgView
view
(init_message.
startAddress
());
18
doOutputHeader
(
view
);
19
}
20
21
void
StreamerFileWriter::doOutputHeader
(
InitMsgView
const
& init_message) {
22
//Write the Init Message to Streamer file
23
stream_writer_
->write(init_message);
24
}
25
26
void
StreamerFileWriter::doOutputEvent
(
EventMsgView
const
&
msg
) {
27
//Write the Event Message to Streamer file
28
stream_writer_
->write(
msg
);
29
}
30
31
void
StreamerFileWriter::doOutputEvent
(
EventMsgBuilder
const
&
msg
) {
32
EventMsgView
eview(
msg
.startAddress());
33
doOutputEvent
(eview);
34
}
35
36
void
StreamerFileWriter::fillDescription
(
ParameterSetDescription
&
desc
) {
37
desc
.setComment(
"Writes events into a streamer output file."
);
38
desc
.addUntracked<
std::string
>(
"fileName"
,
"teststreamfile.dat"
)->setComment(
"Name of output file."
);
39
desc
.addUntracked<
unsigned
int
>(
"padding"
, 0)
40
->setComment(
"For testing: INIT and event block size will be rounded to this size padded with 0xff bytes."
);
41
}
42
}
// namespace edm::streamer
edm::streamer::EventMsgView
Definition:
EventMessage.h:72
edm::streamer::StreamerFileWriter::doOutputEvent
void doOutputEvent(EventMsgBuilder const &msg)
Definition:
StreamerFileWriter.cc:31
edm::streamer::InitMsgBuilder::startAddress
uint8 * startAddress() const
Definition:
InitMsgBuilder.h:24
pv::view
view
Definition:
PreparePVTrends.h:58
std
Definition:
JetResolutionObject.h:76
edm::streamer::InitMsgView
Definition:
InitMessage.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
createfilelist.int
int
Definition:
createfilelist.py:10
ParameterSetDescription.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:254
edm::streamer::StreamerFileWriter::stream_writer_
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_
Definition:
StreamerFileWriter.h:42
edm::streamer
Definition:
WatcherStreamFileReader.h:22
StreamerFileWriter.h
edm::streamer::StreamerOutputFile
Definition:
StreamerOutputFile.h:24
mps_check.msg
tuple msg
Definition:
mps_check.py:286
MillePedeFileConverter_cfg.fileName
fileName
Definition:
MillePedeFileConverter_cfg.py:32
edm::streamer::StreamerFileWriter::StreamerFileWriter
StreamerFileWriter(edm::ParameterSet const &ps)
Definition:
StreamerFileWriter.cc:6
edm::ParameterSet
Definition:
ParameterSet.h:48
edm::streamer::InitMsgBuilder
Definition:
InitMsgBuilder.h:9
edm::streamer::EventMsgBuilder
Definition:
EventMsgBuilder.h:9
edm::streamer::StreamerFileWriter::doOutputHeader
void doOutputHeader(InitMsgBuilder const &init_message)
Definition:
StreamerFileWriter.cc:15
edm::streamer::StreamerFileWriter::~StreamerFileWriter
~StreamerFileWriter()
Definition:
StreamerFileWriter.cc:13
edm::streamer::StreamerFileWriter::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition:
StreamerFileWriter.cc:36
Generated for CMSSW Reference Manual by
1.8.14