CMS 3D CMS Logo

StreamerOutputFile.cc
Go to the documentation of this file.
3 
5 
7  streamerfile_->set_do_adler(true);
8 }
9 
11  EventMsgView tmpView(ineview.startAddress());
12  return write(tmpView);
13 }
14 
17  uint64 offset_to_return = streamerfile_->current_offset();
18 
19  writeEventHeader(ineview);
20  bool ret = streamerfile_->write((const char*)ineview.eventData(), ineview.size() - ineview.headerSize());
21  if (ret) {
22  throw cms::Exception("OutputFile", "write(EventMsgView)")
23  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
24  << "is full?" << std::endl;
25  }
26  return offset_to_return;
27 }
28 
29 uint64 StreamerOutputFile::writeEventFragment(uint32 fragIndex, uint32 fragCount, const char* dataPtr, uint32 dataSize) {
31  uint64 offset_to_return = streamerfile_->current_offset();
32 
33  bool ret = streamerfile_->write(dataPtr, dataSize);
34  if (ret) {
35  throw cms::Exception("OutputFile", "writeEventFragment()")
36  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
37  << "is full?" << std::endl;
38  }
39  return offset_to_return;
40 }
41 
43  bool ret = streamerfile_->write((const char*)ineview.startAddress(), ineview.headerSize());
44  if (ret) {
45  throw cms::Exception("OutputFile", "writeEventHeader")
46  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
47  << "is full?" << std::endl;
48  }
49 }
50 
52  InitMsgView tmpView(inview.startAddress());
53  return write(tmpView);
54 }
55 
57  writeStart(inview);
58  bool ret = streamerfile_->write((const char*)inview.descData(), inview.size() - inview.headerSize());
59  if (ret) {
60  throw cms::Exception("OutputFile", "write(InitMsgView)")
61  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
62  << "is full?" << std::endl;
63  }
64 }
65 
66 void StreamerOutputFile::writeInitFragment(uint32 fragIndex, uint32 fragCount, const char* dataPtr, uint32 dataSize) {
67  bool ret = streamerfile_->write((const char*)dataPtr, dataSize);
68  if (ret) {
69  throw cms::Exception("OutputFile", "writeInitFragment()")
70  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
71  << "is full?" << std::endl;
72  }
73 }
74 
76  bool ret = streamerfile_->write((const char*)inview.startAddress(), inview.headerSize());
77  if (ret) {
78  throw cms::Exception("OutputFile", "writeStart")
79  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
80  << "is full?" << std::endl;
81  }
82 }
InitMsgView::headerSize
uint32 headerSize() const
Definition: InitMessage.h:87
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
InitMsgBuilder
Definition: InitMsgBuilder.h:9
InitMsgBuilder::startAddress
uint8 * startAddress() const
Definition: InitMsgBuilder.h:24
StreamerOutputFile::~StreamerOutputFile
~StreamerOutputFile()
Definition: StreamerOutputFile.cc:4
StreamerOutputFile::streamerfile_
edm::propagate_const< std::shared_ptr< OutputFile > > streamerfile_
Definition: StreamerOutputFile.h:64
EventMsgView::startAddress
uint8 * startAddress() const
Definition: EventMessage.h:80
StreamerOutputFile::StreamerOutputFile
StreamerOutputFile(const std::string &name)
Definition: StreamerOutputFile.cc:6
InitMsgView::size
uint32 size() const
Definition: InitMessage.h:66
StreamerOutputFile.h
EventMsgView
Definition: EventMessage.h:72
uint32
unsigned int uint32
Definition: MsgTools.h:13
EventMsgBuilder
Definition: EventMsgBuilder.h:8
StreamerOutputFile::write
void write(const InitMsgBuilder &)
Definition: StreamerOutputFile.cc:51
StreamerOutputFile::writeStart
void writeStart(const InitMsgView &inview)
Definition: StreamerOutputFile.cc:75
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InitMsgView::startAddress
uint8 * startAddress() const
Definition: InitMessage.h:67
OutputFile
Definition: StreamerFileIO.h:17
EventMsgView::size
uint32 size() const
Definition: EventMessage.h:77
StreamerOutputFile::writeEventFragment
uint64 writeEventFragment(uint32 fragIndex, uint32 fragCount, const char *dataPtr, uint32 dataSize)
Definition: StreamerOutputFile.cc:29
EventMsgView::headerSize
uint32 headerSize() const
Definition: EventMessage.h:82
Exception
Definition: hltDiff.cc:246
uint64
unsigned long long uint64
Definition: MsgTools.h:14
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventMsgBuilder::startAddress
uint8 * startAddress() const
Definition: EventMsgBuilder.h:24
Exception.h
StreamerOutputFile::writeEventHeader
void writeEventHeader(const EventMsgView &ineview)
Definition: StreamerOutputFile.cc:42
InitMsgView::descData
const uint8 * descData() const
Definition: InitMessage.h:86
EventMsgView::eventData
const uint8 * eventData() const
Definition: EventMessage.h:79
StreamerOutputFile::writeInitFragment
void writeInitFragment(uint32 fragIndex, uint32 fragCount, const char *dataPtr, uint32 dataSize)
Definition: StreamerOutputFile.cc:66
InitMsgView
Definition: InitMessage.h:61