CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamerFileWriter.cc
Go to the documentation of this file.
3 
4 namespace edm {
6  stream_writer_(new StreamerOutputFile(
7  ps.getUntrackedParameter<std::string>("fileName")))
8  {
9  }
10 
12  stream_writer_(new StreamerOutputFile(fileName))
13  {
14  }
15 
17  }
18 
20  //Let us turn it into a View
21  InitMsgView view(init_message.startAddress());
22  doOutputHeader(view);
23  }
24 
25  void StreamerFileWriter::doOutputHeader(InitMsgView const& init_message) {
26  //Write the Init Message to Streamer file
27  stream_writer_->write(init_message);
28  }
29 
31  //Write the Init Message to Streamer file
32  stream_writer_->writeInitFragment(hdrParams.fragmentIndex,
33  hdrParams.fragmentCount,
34  hdrParams.dataPtr,
35  hdrParams.dataSize);
36  }
37 
39  //Write the Event Message to Streamer file
40  stream_writer_->write(msg);
41  }
42 
44  EventMsgView eview(msg.startAddress());
45  doOutputEvent(eview);
46  }
47 
49  //Write the Event Message to Streamer file
50  stream_writer_->writeEventFragment(evtParams.fragmentIndex,
51  evtParams.fragmentCount,
52  evtParams.dataPtr,
53  evtParams.dataSize);
54  }
55 
57  desc.setComment("Writes events into a streamer output file.");
58  desc.addUntracked<std::string>("fileName", "teststreamfile.dat")->setComment("Name of output file.");
59  }
60 } //namespace edm
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void doOutputHeaderFragment(StreamerFileWriterHeaderParams const &)
uint8 * startAddress() const
StreamerFileWriter(edm::ParameterSet const &ps)
void setComment(std::string const &value)
void doOutputHeader(InitMsgBuilder const &init_message)
static void fillDescription(ParameterSetDescription &desc)
uint8 * startAddress() const
void doOutputEvent(EventMsgBuilder const &msg)
void doOutputEventFragment(StreamerFileWriterEventParams const &)
std::auto_ptr< StreamerOutputFile > stream_writer_