CMS 3D CMS Logo

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