Class to manage the file and the outputing of data in a DAQEvent instance.
More...
#include <readWD.hh>
|
| using | MAP = std::map< int, std::map< int, std::vector< float > > > |
| | Alias for data structure.
|
| |
|
| std::string | filename_ |
| | The name of the file.
|
| |
| std::ifstream | in_ |
| | The input file to read.
|
| |
| char | o_ |
| | The initial letter of the previous tag read.
|
| |
| char | n_ |
| | The initial letter of the newest tag read.
|
| |
| bool | initialization_ |
| | Flag to store if DAQFile::Initialise() was already called.
|
| |
| MAP | times_ |
| | Struct to hold \( \Delta t\) read from the TIMEpart of the file.
|
| |
| bool | is_lab_ |
| | Flag to check if the board is from LAB or not.
|
| |
| std::string | type_ |
| | Flag to store the type of the board.
|
| |
| int | first_evt_pos_ |
| | Position of first event header.
|
| |
Class to manage the file and the outputing of data in a DAQEvent instance.
- Examples
- main0.cc, main1.cc, and main3.cc.
Definition at line 213 of file readWD.hh.
◆ MAP
| using DAQFile::MAP = std::map<int, std::map<int, std::vector<float> >> |
|
private |
Alias for data structure.
Definition at line 215 of file readWD.hh.
◆ DAQFile()
◆ ~DAQFile()
◆ Close()
◆ GetEvent()
| DAQFile & DAQFile::GetEvent |
( |
int |
evt_id | ) |
|
Method to select what event must be read next.
If the user wants to look at one specific event, given the event serial nuber, this method will bring the file to the exact location of that event. A print of the found event header is performed to double check. The method does some checks on file boundaries, event size and file integrity. Then file >> event must be called to read the selected event.
- Parameters
-
| evt_id | The event serial number. The method considers the different numbering system between DRS (events start from 1) and WDB (events start from 0). |
- Returns
- DAQFile&
Definition at line 1234 of file readWD.cc.
◆ GetTimeMap()
| const MAP & DAQFile::GetTimeMap |
( |
| ) |
|
|
inline |
◆ Initialise()
Initialise the file reading the TIME block.
- Returns
- DAQFile&
Definition at line 1084 of file readWD.cc.
◆ Open()
| DAQFile & DAQFile::Open |
( |
const std::string & |
| ) |
|
◆ operator bool()
| DAQFile::operator bool |
( |
| ) |
|
|
private |
The evaluation of boolean for the class DAQFile.
This method evaluates all the valid possible combinations of consecutive tags to determine if the value to return is 1 or 0. It uses the same principle of a finite state machine with the usage of a map named header, where the combinations of key-value match the possible configurations of consecutive non-equal tags that can be found in the binary file.
- Returns
- true
-
false
Definition at line 1523 of file readWD.cc.
◆ operator>>() [1/4]
| bool DAQFile::operator>> |
( |
DRSEvent & |
event | ) |
|
Read into a DRSEvent.
This method reads exactly one event from the file to de DRSEvent class. A first check is made to check if the DAQConfig class has been initialised, otherwise a call to DAQEvent::MakeConfig() is made. In the nested while two things are done, the former is to ignore the time scaler if the DRS board is of type LAB-DRS (see The Binary Output), the latter is to read and convert volts and to perform a time calibration. These data are stored in the DAQEvent::times_ and DAQEvent::volts_ maps.
- Parameters
-
- Returns
- true
-
false
Definition at line 1329 of file readWD.cc.
◆ operator>>() [2/4]
◆ operator>>() [3/4]
| bool DAQFile::operator>> |
( |
TAG & |
t | ) |
|
|
private |
Read into a TAG.
- Parameters
-
- Returns
- true
-
false
Definition at line 1291 of file readWD.cc.
◆ operator>>() [4/4]
| bool DAQFile::operator>> |
( |
WDBEvent & |
event | ) |
|
◆ Read() [1/2]
Read an event header.
- Parameters
-
Definition at line 1474 of file readWD.cc.
◆ Read() [2/2]
| void DAQFile::Read |
( |
TAG & |
t | ) |
|
|
private |
Read a tag.
- Parameters
-
Definition at line 1462 of file readWD.cc.
◆ Reset()
Method to reset the file.
This method checks for file initialisation, in case it is not a warning is printed on screen. Otherwise the file goes back to first event header.
- Returns
- DAQFile&
Definition at line 1213 of file readWD.cc.
◆ ResetTag()
| void DAQFile::ResetTag |
( |
| ) |
|
|
inlineprivate |
◆ DAQConfig
◆ filename_
| std::string DAQFile::filename_ |
|
private |
The name of the file.
Definition at line 245 of file readWD.hh.
◆ first_evt_pos_
| int DAQFile::first_evt_pos_ |
|
private |
Position of first event header.
Definition at line 253 of file readWD.hh.
◆ in_
| std::ifstream DAQFile::in_ |
|
private |
The input file to read.
Definition at line 246 of file readWD.hh.
◆ initialization_
| bool DAQFile::initialization_ |
|
private |
◆ is_lab_
Flag to check if the board is from LAB or not.
Definition at line 251 of file readWD.hh.
◆ n_
The initial letter of the newest tag read.
Definition at line 248 of file readWD.hh.
◆ o_
The initial letter of the previous tag read.
Definition at line 247 of file readWD.hh.
◆ times_
Struct to hold \( \Delta t\) read from the TIMEpart of the file.
Definition at line 250 of file readWD.hh.
◆ type_
| std::string DAQFile::type_ |
|
private |
Flag to store the type of the board.
Definition at line 252 of file readWD.hh.
The documentation for this class was generated from the following files: