2#include "Packing/SingleSubsystemUnpacker.h"
4#include "Packing/LDMXRoRHeader.h"
5#include "Packing/RogueFrameHeader.h"
11 auto subsystem_name{ps.
get<std::string>(
"subsystem_name")};
12 if (subsystem_name.empty()) {
18 EXCEPTION_RAISE(
"BadName",
19 "Subsystem name '" + subsystem_name +
20 "' not 'ts', 'tdaq', 'tracker', 'ecal', 'hcal'.");
39 const auto frame_end =
reader_.
tell() + frame_header.size();
41 if (frame_header.channel() != 0 or frame_header.probablyYaml()) {
71 std::vector<uint8_t> buff;
75 "MalForm",
"Raw file provided was unable to read entire data frame.");
81 event.getEventHeader().setIntParameter(
"RoR Timestamp",
82 ror_header.timestamp());
#define DECLARE_PRODUCER(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.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
This producer unpacks the data from the a single subsystem into a single buffer for a downstream proc...
utility::Reader reader_
raw data file we are reading
int subsystem_
subsystem ID to filter for
int frame_offset_
number of frames to skip before sending data
std::string output_name_
destination object name
void produce(framework::Event &event) override
Actually do the unpacking/decoding.
int contributor_
contributor ID to filter for
void configure(framework::config::Parameters &ps) override
Configure the unpacker and open the raw data file for IO.
int frame_count_
frame count from beginning of file for frame_offset_
void open(const std::string &file_name)
Open a file with this reader.
bool eof()
check if file is done
int tell()
Tell us where the reader is.
Reader & read(WordType *w, std::size_t count)
Read the next 'count' words into the input handle.
void seek(int off, std::ios_base::seekdir dir=std::ios::beg)
Go ("seek") a specific position in the file.