Skip to content

Commit

Permalink
add additional check
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Aug 24, 2023
1 parent 07ebe5b commit 49d933c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/TRestRawReadoutMetadataProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ void TRestRawReadoutMetadata::InitializeFromReadout(TRestDetectorReadout* readou
}
}
}

// verify names are unique
map<string, int> namesCount;
for (const auto& channel : fChannelInfo) {
const auto& info = channel.second;
namesCount[info.name]++;
}
for (const auto& name : namesCount) {
if (name.second > 1) {
cerr << "TRestRawReadoutMetadata::InitializeFromReadout: channel name " << name.first
<< " is not unique" << endl;
exit(1);
}
}
}

void TRestRawReadoutMetadataProcess::InitProcess() {
Expand Down

0 comments on commit 49d933c

Please sign in to comment.