LDMX Software
|
The raw data file object. More...
#include <File.h>
Public Member Functions | |
File (const framework::config::Parameters ¶ms) | |
General file constructor. | |
bool | connect (framework::Event &event) |
Connect the passed event bus to this event file. | |
bool | nextEvent () |
Load the next event into our connected event bus. | |
void | writeRunHeader (ldmx::RunHeader &header) |
Write the run header. | |
void | close () |
close this file | |
Private Attributes | |
bool | is_output_ |
are we reading or writing? | |
std::string | ecal_object_name_ |
the event bus object name of the ECal encoded data | |
std::string | hcal_object_name_ |
the event bus object name of the HCal encoded data | |
std::string | tracker_object_name_ |
the event bus object name of the Tracker encoded data | |
std::string | triggerpad_object_name_ |
the event bus object name of the Trigger Pad encoded data | |
std::string | pass_name_ |
for writing, we also should be able to specify a pass name | |
bool | skip_unavailable_ |
for writing, do we skip subsystems if their raw object is unavailable | |
uint32_t | entries_ {0} |
number of entries in the file | |
uint32_t | i_entry_ {0} |
current entry index (may not be same as event number) | |
framework::Event * | event_ {nullptr} |
handle to the event bus we are reading from or writing to | |
uint32_t | run_ |
run number corresponding to this file of raw data | |
utility::Reader | reader_ |
utility class for reading binary data files | |
utility::Writer | writer_ |
utility class for writing binary data files | |
utility::CRC | crc_ |
crc calculator for output mode | |
packing::rawdatafile::File::File | ( | const framework::config::Parameters & | params | ) |
General file constructor.
[in] | params | parameters use to configure this file |
[in] | filename | name of the file to read/write |
Definition at line 11 of file File.cxx.
References ecal_object_name_, entries_, packing::utility::CRC::get(), framework::config::Parameters::getParameter(), hcal_object_name_, i_entry_, is_output_, packing::utility::Reader::open(), packing::utility::Writer::open(), pass_name_, reader_, run_, packing::utility::Reader::seek(), skip_unavailable_, packing::utility::Reader::tell(), tracker_object_name_, triggerpad_object_name_, and writer_.
void packing::rawdatafile::File::close | ( | ) |
close this file
Definition at line 144 of file File.cxx.
References crc_, entries_, event_, packing::utility::CRC::get(), is_output_, and writer_.
bool packing::rawdatafile::File::connect | ( | framework::Event & | event | ) |
bool packing::rawdatafile::File::nextEvent | ( | ) |
Load the next event into our connected event bus.
Definition at line 76 of file File.cxx.
References framework::Event::add(), crc_, ecal_object_name_, entries_, event_, framework::Event::exists(), framework::Event::getCollection(), framework::Event::getEventHeader(), framework::Event::getEventNumber(), hcal_object_name_, i_entry_, is_output_, pass_name_, reader_, ldmx::EventHeader::setEventNumber(), skip_unavailable_, tracker_object_name_, triggerpad_object_name_, and writer_.
void packing::rawdatafile::File::writeRunHeader | ( | ldmx::RunHeader & | header | ) |
Write the run header.
Definition at line 129 of file File.cxx.
References crc_, ldmx::RunHeader::getRunNumber(), is_output_, run_, ldmx::RunHeader::setIntParameter(), and writer_.
|
private |
crc calculator for output mode
Definition at line 75 of file File.h.
Referenced by close(), nextEvent(), and writeRunHeader().
|
private |
the event bus object name of the ECal encoded data
Definition at line 49 of file File.h.
Referenced by File(), and nextEvent().
|
private |
number of entries in the file
Definition at line 63 of file File.h.
Referenced by close(), File(), and nextEvent().
|
private |
handle to the event bus we are reading from or writing to
Definition at line 67 of file File.h.
Referenced by close(), connect(), and nextEvent().
|
private |
the event bus object name of the HCal encoded data
Definition at line 51 of file File.h.
Referenced by File(), and nextEvent().
|
private |
current entry index (may not be same as event number)
Definition at line 65 of file File.h.
Referenced by File(), and nextEvent().
|
private |
are we reading or writing?
Definition at line 47 of file File.h.
Referenced by close(), File(), nextEvent(), and writeRunHeader().
|
private |
for writing, we also should be able to specify a pass name
Definition at line 57 of file File.h.
Referenced by File(), and nextEvent().
|
private |
utility class for reading binary data files
Definition at line 71 of file File.h.
Referenced by File(), and nextEvent().
|
private |
run number corresponding to this file of raw data
Definition at line 69 of file File.h.
Referenced by File(), and writeRunHeader().
|
private |
for writing, do we skip subsystems if their raw object is unavailable
Definition at line 59 of file File.h.
Referenced by File(), and nextEvent().
|
private |
the event bus object name of the Tracker encoded data
Definition at line 53 of file File.h.
Referenced by File(), and nextEvent().
|
private |
the event bus object name of the Trigger Pad encoded data
Definition at line 55 of file File.h.
Referenced by File(), and nextEvent().
|
private |
utility class for writing binary data files
Definition at line 73 of file File.h.
Referenced by close(), File(), nextEvent(), and writeRunHeader().