LDMX Software
RawIO.cxx
1
2#include "Packing/RawIO.h"
3
4namespace packing {
5
7 raw_file_ = std::make_unique<rawdatafile::File>(
9}
10
12 raw_file_->writeRunHeader(header);
13}
14
16 raw_file_->connect(event);
17 if (not raw_file_->nextEvent()) {
18 abortEvent();
19 }
20}
21
22void RawIO::onProcessEnd() { raw_file_->close(); }
23
24} // namespace packing
25
26DECLARE_PRODUCER_NS(packing, RawIO)
#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
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:54
std::unique_ptr< rawdatafile::File > raw_file_
raw data file we are reading
Definition RawIO.h:54
void onProcessEnd() override
Close up ROOT file with raw data in it.
Definition RawIO.cxx:22
void produce(framework::Event &event) override
Actually do the unpacking/decoding.
Definition RawIO.cxx:15
void configure(framework::config::Parameters &ps) override
Configure the unpacker and open the raw data file for IO.
Definition RawIO.cxx:6
void beforeNewRun(ldmx::RunHeader &header) override
We are given a non-const reference to a new RunHeader so we can add parameters unpacked from the raw ...
Definition RawIO.cxx:11