NSCL DDAS
1.0
Support for XIA DDAS at the NSCL
|
A parser for the modevtlen.txt file. More...
#include <ModEvtFileParser.h>
Public Member Functions | |
void | parse (std::istream &input, Configuration &config) |
Parse and store the contents of the modevtlen.txt file in a configuration object. More... | |
A parser for the modevtlen.txt file.
The modevtlen.txt contains the length of each event to expect from each module. For each channel in a digitizer, the assumption is that the of the same length will be emitted. That implies that each channel will be configured to have the same settngs for trace capture, qdc, energy summing, and external clock. If that is not the case, Readout programs will fail miserably!
The structure of the file is very simple. There should be a line for each module in the crate with a single integer value representing the length of the event in units of 32-bit integers. The minimum value any line can have is 4, because that is the minimum length of data a module can output for each channel.
It is not an error for the file to contain more lines than there are modules in the system. It IS an error for the file to contain fewer lines than there are in the system.
void DAQ::DDAS::ModEvtFileParser::parse | ( | std::istream & | input, |
Configuration & | config | ||
) |
Parse and store the contents of the modevtlen.txt file in a configuration object.
input | the stream from which the contents of the file are read |
config | the configuration to store the results in |
std::runtime_error | if fewer lines than there are modules are found |
std::runtime_error | if a line is encountered with a value less than 4 |
The parser will read in as many lines as the value returned by config.getNumberOfModules(). For that reason, the caller must have already set the number of modules in the configuration object.