LDMX Software
SingleSubsystemPacker.cxx
1
2#include "Packing/SingleSubsystemPacker.h"
3
4namespace packing {
5
7 writer_.open(ps.getParameter<std::string>("raw_file"));
8 input_name_ = ps.getParameter<std::string>("input_name");
9 input_pass_ = ps.getParameter<std::string>("input_pass");
10}
11
13 if (!writer_) abortEvent();
14
15 auto buff{event.getCollection<uint8_t>(input_name_, input_pass_)};
16 writer_ << buff;
17}
18
19} // namespace packing
20
21DECLARE_PRODUCER_NS(packing, SingleSubsystemPacker)
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
void abortEvent()
Abort the event immediately.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
std::string input_pass_
buffer object pass on event bus
utility::Writer writer_
raw data file we are reading
void configure(framework::config::Parameters &ps) override
Configure the unpacker and open the raw data file for IO.
std::string input_name_
buffer object name on event bus
void analyze(const framework::Event &event) override
Actually do the unpacking/decoding.
void open(const std::string &file_name)
Open a file with this writer.
Definition Writer.h:35