5 #include "TRestRawReadoutMetadata.h"
11 void TRestRawReadoutMetadata::PrintMetadata()
const {
12 cout <<
"Number of channels: " << fChannelInfo.size() << endl;
13 map<string, int> typesCount;
14 for (
const auto& channel : fChannelInfo) {
15 const auto& info = channel.second;
16 typesCount[info.type]++;
18 cout <<
"Channel types: ";
19 for (
const auto& type : typesCount) {
20 cout << type.first <<
" (" << type.second <<
"), ";
24 for (
const auto& [channelDaqId, info] : fChannelInfo) {
25 cout <<
" - Channel DAQ ID: " << channelDaqId <<
", channel ID: " << info.channelId
26 <<
", type: " << info.type <<
", name: " << info.name << endl;
30 std::string TRestRawReadoutMetadata::GetTypeForChannelDaqId(UShort_t channel)
const {
31 if (fChannelInfo.find(channel) == fChannelInfo.end()) {
32 cerr <<
"TRestRawReadoutMetadata::GetTypeForChannelDaqId: channel " << channel <<
" not found"
36 return fChannelInfo.at(channel).type;
39 std::string TRestRawReadoutMetadata::GetNameForChannelDaqId(UShort_t channel)
const {
40 if (fChannelInfo.find(channel) == fChannelInfo.end()) {
41 cerr <<
"TRestRawReadoutMetadata::GetNameForChannelDaqId: channel " << channel <<
" not found"
45 return fChannelInfo.at(channel).name;
48 std::vector<UShort_t> TRestRawReadoutMetadata::GetChannelDaqIDsForType(
const std::string& type)
const {
49 std::vector<UShort_t> result;
50 for (
const auto& channel : fChannelInfo) {
51 if (channel.second.type == type) {
52 result.push_back(channel.first);