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
{
5
StreamerFileWriter::StreamerFileWriter
(
edm::ParameterSet
const
& ps)
6
: stream_writer_(new
StreamerOutputFile
(ps.getUntrackedParameter<
std
::
string
>(
"fileName"
))) {}
7
8
StreamerFileWriter::StreamerFileWriter
(
std::string
const
&
fileName
)
9
: stream_writer_(new
StreamerOutputFile
(
fileName
)) {}
10
11
StreamerFileWriter::~StreamerFileWriter
() {}
12
13
void
StreamerFileWriter::doOutputHeader
(
InitMsgBuilder
const
& init_message) {
14
//Let us turn it into a View
15
InitMsgView
view(init_message.
startAddress
());
16
doOutputHeader
(view);
17
}
18
19
void
StreamerFileWriter::doOutputHeader
(
InitMsgView
const
& init_message) {
20
//Write the Init Message to Streamer file
21
stream_writer_
->write(init_message);
22
}
23
24
void
StreamerFileWriter::doOutputEvent
(
EventMsgView
const
&
msg
) {
25
//Write the Event Message to Streamer file
26
stream_writer_
->write(
msg
);
27
}
28
29
void
StreamerFileWriter::doOutputEvent
(
EventMsgBuilder
const
&
msg
) {
30
EventMsgView
eview(
msg
.startAddress());
31
doOutputEvent
(eview);
32
}
33
34
void
StreamerFileWriter::fillDescription
(
ParameterSetDescription
&
desc
) {
35
desc
.setComment(
"Writes events into a streamer output file."
);
36
desc
.addUntracked<
std::string
>(
"fileName"
,
"teststreamfile.dat"
)->setComment(
"Name of output file."
);
37
}
38
}
//namespace edm
InitMsgBuilder
Definition:
InitMsgBuilder.h:9
InitMsgBuilder::startAddress
uint8 * startAddress() const
Definition:
InitMsgBuilder.h:24
edm::StreamerFileWriter::doOutputEvent
void doOutputEvent(EventMsgBuilder const &msg)
Definition:
StreamerFileWriter.cc:29
StreamerFileWriter.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::StreamerFileWriter::doOutputHeader
void doOutputHeader(InitMsgBuilder const &init_message)
Definition:
StreamerFileWriter.cc:13
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
mps_check.msg
tuple msg
Definition:
mps_check.py:285
MillePedeFileConverter_cfg.fileName
fileName
Definition:
MillePedeFileConverter_cfg.py:32
EventMsgView
Definition:
EventMessage.h:72
EventMsgBuilder
Definition:
EventMsgBuilder.h:8
StreamerOutputFile
Definition:
StreamerOutputFile.h:23
edm::StreamerFileWriter::stream_writer_
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_
Definition:
StreamerFileWriter.h:41
ParameterSetDescription.h
edm::StreamerFileWriter::~StreamerFileWriter
~StreamerFileWriter()
Definition:
StreamerFileWriter.cc:11
edm::StreamerFileWriter::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition:
StreamerFileWriter.cc:34
edm::ParameterSet
Definition:
ParameterSet.h:47
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
std
Definition:
JetResolutionObject.h:76
edm::StreamerFileWriter::StreamerFileWriter
StreamerFileWriter(edm::ParameterSet const &ps)
Definition:
StreamerFileWriter.cc:5
InitMsgView
Definition:
InitMessage.h:61
Generated for CMSSW Reference Manual by
1.8.16