A pipeline stage which sets the group and coord for the detector events.
More...
#include <DAQChannels.hpp>
|
| | DAQChannels () |
| | Constructor. More...
|
| |
| void | addGroup (DetectorEvent::group_type group, const std::string &name) |
| | Adds a new detector group. More...
|
| |
| void | setChannel (uint16_t channel, DetectorEvent::group_type group, DetectorEvent::coord_type coord, const std::string &name) |
| | Assigns a DAQ channel to a detector group and coordinate. More...
|
| |
| uint16_t | getCh (const std::string &name) const |
| | Returns channel info for given name
More...
|
| |
| uint16_t | getCh (DetectorEvent::group_type group, DetectorEvent::coord_type coord) const |
| | Returns channel info for given (group, coord) combination. More...
|
| |
| const std::map< DetectorEvent::group_type, DetectorGroup > & | getGroups () const noexcept |
| | Returns all registered groups. More...
|
| |
| const DetectorGroup & | getGroup (DetectorEvent::group_type group) const |
| | Returns registered group by its index. More...
|
| |
| const std::vector< channel_info_t > & | getChInfos () const noexcept |
| | Returns vector containing group, channel and name of all channels. More...
|
| |
| virtual void | process (std::vector< DetectorEvent > &data) noexcept |
| | Fills detector group index and coord index to the events. More...
|
| |
|
virtual | ~StageDetectorEvent () |
| | Virtual desctructor.
|
| |
A pipeline stage which sets the group and coord for the detector events.
The default values set for group and coord by the object DetectorEventGenerator are zeroes. If a given daq channel number is registered in DAQChannels to a specific group and coord, then these values are set to the DetectorEvent representing this channel.
Warning: the api of this object is likely to be changed in future updates of the pottu library.
◆ DAQChannels()
| pottu::DAQChannels::DAQChannels |
( |
| ) |
|
|
inline |
Constructor.
Initializes the object and channel information for channels [0,4095].
◆ addGroup()
| void pottu::DAQChannels::addGroup |
( |
DetectorEvent::group_type |
group, |
|
|
const std::string & |
name |
|
) |
| |
|
inline |
Adds a new detector group.
- Parameters
-
◆ getCh() [1/2]
| uint16_t pottu::DAQChannels::getCh |
( |
const std::string & |
name | ) |
const |
|
inline |
Returns channel info for given name
- Parameters
-
| name | Name of the channel to be found. |
- Returns
- DAQ channel.
Will throw runtime_error if not found.
◆ getCh() [2/2]
| uint16_t pottu::DAQChannels::getCh |
( |
DetectorEvent::group_type |
group, |
|
|
DetectorEvent::coord_type |
coord |
|
) |
| const |
|
inline |
Returns channel info for given (group, coord) combination.
Will throw runtime_error if not found.
◆ getChInfos()
| const std::vector<channel_info_t>& pottu::DAQChannels::getChInfos |
( |
| ) |
const |
|
inlinenoexcept |
Returns vector containing group, channel and name of all channels.
- Returns
- Vector containing group, channel and name of all channels.
◆ getGroup()
| const DetectorGroup& pottu::DAQChannels::getGroup |
( |
DetectorEvent::group_type |
group | ) |
const |
|
inline |
Returns registered group by its index.
- Returns
- Constant reference to a group information.
◆ getGroups()
| const std::map<DetectorEvent::group_type, DetectorGroup>& pottu::DAQChannels::getGroups |
( |
| ) |
const |
|
inlinenoexcept |
Returns all registered groups.
- Returns
- Constant reference to a map of groups. Key is the group index.
◆ process()
| virtual void pottu::DAQChannels::process |
( |
std::vector< DetectorEvent > & |
data | ) |
|
|
inlinevirtualnoexcept |
Fills detector group index and coord index to the events.
- Parameters
-
| data | Detector events whose group and coord members are to be set. There shall be no detector event having channel higher than 4095. |
Implements pottu::StageDetectorEvent.
◆ setChannel()
| void pottu::DAQChannels::setChannel |
( |
uint16_t |
channel, |
|
|
DetectorEvent::group_type |
group, |
|
|
DetectorEvent::coord_type |
coord, |
|
|
const std::string & |
name |
|
) |
| |
|
inline |
Assigns a DAQ channel to a detector group and coordinate.
- Parameters
-
| channel | DAQ channel. Must be in range [0,4095]. |
| group | Group index of the detector. Group must have been added with addGroup() before using it here. |
| coord | Coordinate of the channel in the detector group. |
| name | Name of the channel. Typically this the same as one in the tdrnames.txt. The name is checked by throwIfNotValidName(). |
A given DAQ channel can be assigned to only one group. In case of new assignment, the previous assignment is removed.
The documentation for this class was generated from the following file: