#include <mimotera++/MimoteraReader.hh>
Public Member Functions | |
MimoteraReader () | |
Default constructor w/o parameters. | |
MimoteraReader (const char *filename) | |
Default constructor with a file name. | |
~MimoteraReader () | |
Destructor. | |
off_t | open (const char *filename) |
Opens the specified file. | |
bool | readNextEvent () |
Read the next event. | |
MimoteraEvent * | getEvent () |
Get the current event. | |
void | init () |
Initialize the variables. |
This class is opening a Mimotera file and can be used to get every single event contained into the file.
The standard usage of this class is well show in the provided examples and can be summarized as follow:
Definition at line 77 of file MimoteraReader.hh.
Mimotera::MimoteraReader::MimoteraReader | ( | ) |
Default constructor w/o parameters.
Definition at line 41 of file MimoteraReader.cc.
References init().
Mimotera::MimoteraReader::MimoteraReader | ( | const char * | filename | ) |
Default constructor with a file name.
Suggested constructor. This is the one that should be always used.
filename | This is the name of the Mimotera file to be opened. |
FileException | in case something goes wrong with the file opening and handling. |
Definition at line 48 of file MimoteraReader.cc.
References init(), and open().
Mimotera::MimoteraReader::~MimoteraReader | ( | ) |
MimoteraEvent * Mimotera::MimoteraReader::getEvent | ( | ) |
Get the current event.
This method returns a pointer to the current event in memory. The user must use this method to access at the data
Definition at line 107 of file MimoteraReader.cc.
References MIMOTERA_THROWX.
Referenced by Mimotera::MimoteraReader_getEvent_cpp().
void Mimotera::MimoteraReader::init | ( | ) |
Initialize the variables.
Definition at line 58 of file MimoteraReader.cc.
Referenced by MimoteraReader().
off_t Mimotera::MimoteraReader::open | ( | const char * | filename | ) |
Opens the specified file.
This method opens the specified filename and prepare it for reading by the MimoteraReader.
filename | The file name to be opened |
FileException | in case something goes wrong with the file opening and handling. |
Definition at line 115 of file MimoteraReader.cc.
References Mimotera::kEventSize, MIMOTERA_THROWX, and Mimotera::to_string().
Referenced by MimoteraReader(), and Mimotera::MimoteraReader_open_cpp().
bool Mimotera::MimoteraReader::readNextEvent | ( | ) |
Read the next event.
When this method is called, the next event in the file will be read and stored into the _mimoteraEvent data member.
To access to the event, the user must use the getEvent returning a reference to the current event in memory.
Definition at line 69 of file MimoteraReader.cc.
References Mimotera::MimoteraEvent::_areArraysReady, Mimotera::MimoteraInfo::_frameInPacket, Mimotera::MimoteraInfo::_globalFrameNo, Mimotera::MimoteraInfo::_triggeredFrameAB, Mimotera::MimoteraInfo::_triggerNo, Mimotera::MimoteraEvent::frameA(), Mimotera::MimoteraEvent::frameB(), Mimotera::MimoteraEvent::info(), Mimotera::kEventSize, Mimotera::kMimoteraInfoSize, Mimotera::kSubFrameSize, Mimotera::kTrashSize, MIMOTERA_THROWX, and Mimotera::to_string().
Referenced by Mimotera::MimoteraReader_readNextEvent_cpp().