Conversation
|
From the offline point of view, the name "cal.channelstatus" is internal to the conditions system, so I didn't expect to see it here. We would expect the table is only referenced with the public name "CalChannelStatus". I can't follow what the code is doing so I can't comment in any more detail. |
…tion coherence, added few comments
|
First version ready to be merged |
There was a problem hiding this comment.
Pull request overview
This pull request adds a new SubsystemCalorimeterParametersTable plugin that generates calorimeter-specific configuration files for the online trigger system. The implementation reads channel mapping and status information from configuration tables and exports them as CSV files and JSON structures.
Changes:
- Adds new
SubsystemCalorimeterParametersTableclass that extendsTableBaseto handle calorimeter parameter configuration - Implements CSV file generation for channel maps and status tables that are written to the filesystem
- Adds JSON export functionality for configuration data visualization
- Integrates the new TablePlugins directory into the CMake build system
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 18 comments.
| File | Description |
|---|---|
| SubsystemCalorimeterParametersTable.h | Header file defining the table plugin class with methods for CSV and JSON generation |
| SubsystemCalorimeterParametersTable_table.cc | Implementation of channel map and status table conversion to CSV and JSON formats |
| TablePlugins/CMakeLists.txt | Build configuration for the new table plugin |
| otsdaq-mu2e-calorimeter/CMakeLists.txt | Adds TablePlugins subdirectory to the build |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Outdated
Show resolved
Hide resolved
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Outdated
Show resolved
Hide resolved
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Outdated
Show resolved
Hide resolved
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Show resolved
Hide resolved
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Outdated
Show resolved
Hide resolved
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Show resolved
Hide resolved
|
|
||
| // assume data is 1-dimensional | ||
| for(uint32_t j = 0; j < bitmap.numberOfColumns(0); j++) { | ||
| OfflineTable << mapChannels_.at(boardID * 20 + j) << ", "; |
There was a problem hiding this comment.
Using mapChannels_.at() will throw an std::out_of_range exception if the key boardID * 20 + j doesn't exist. This could happen if the channel map and status tables are inconsistent. Consider using find() with proper error handling, or document that the tables must be consistent.
| OfflineTable << mapChannels_.at(boardID * 20 + j) << ", "; | |
| const uint32_t onlineId = boardID * 20 + j; | |
| auto it = mapChannels_.find(onlineId); | |
| if(it == mapChannels_.end()) { | |
| __COUT_WARN__ << "No channel map entry found for online ID " << onlineId | |
| << " (boardID=" << boardID << ", channel=" << j | |
| << "); skipping status entry." << __E__; | |
| continue; | |
| } | |
| OfflineTable << it->second << ", "; |
There was a problem hiding this comment.
@copilot use SS and SS_THROW exception with the find.
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Show resolved
Hide resolved
otsdaq-mu2e-calorimeter/TablePlugins/SubsystemCalorimeterParametersTable_table.cc
Outdated
Show resolved
Hide resolved
|
@rrivera747 I've opened a new pull request, #51, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@rrivera747 I've opened a new pull request, #52, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@rrivera747 I've opened a new pull request, #53, to work on those changes. Once the pull request is ready, I'll request review from you. |
…d rethrow in catch block Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Replace silent failures with __SS__ / __SS_THROW__ in offline table generation
|
@rrivera747 I've opened a new pull request, #54, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
…etersTable_table.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…etersTable_table.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replace magic number with CHANNELS_PER_BOARD constant
| const static std::string PATH_TO_TRIGGER_OFFLINE_DB; | ||
| const static std::string CHANNEL_STATUS_TABLE; | ||
| const static std::string CHANNEL_MAP_TABLE; | ||
| const static uint32_t CHANNELS_PER_BOARD = 20; |
There was a problem hiding this comment.
Note that we have mu2e::CaloConst::_nChPerDIRAC defined in Offline, if you prefer.
There was a problem hiding this comment.
@copilot use mu2e::CaloConst::_nChPerDIRAC for the 20
…etersTable_table.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@rrivera747 I've opened a new pull request, #55, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@rrivera747 I've opened a new pull request, #56, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Fix field naming inconsistency in ColChannelThreshold struct
Replace hardcoded channel count with mu2e::CaloConst::_nChPerDIRAC
…rd. Also, added throw exception if channel not found in map
|
PR should be ready to be merged @rrivera747 |
No description provided.