Skip to content

Jcampos/add channel status#49

Merged
rrivera747 merged 34 commits intodevelopfrom
jcampos/AddChannelStatus
Jan 29, 2026
Merged

Jcampos/add channel status#49
rrivera747 merged 34 commits intodevelopfrom
jcampos/AddChannelStatus

Conversation

@jicampos
Copy link
Contributor

No description provided.

@rlcee
Copy link

rlcee commented Jan 15, 2026

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.

@giro94
Copy link
Contributor

giro94 commented Jan 23, 2026

First version ready to be merged

@giro94 giro94 requested a review from rrivera747 January 23, 2026 17:32
Copy link
Contributor

@rrivera747 rrivera747 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SubsystemCalorimeterParametersTable class that extends TableBase to 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.


// assume data is 1-dimensional
for(uint32_t j = 0; j < bitmap.numberOfColumns(0); j++) {
OfflineTable << mapChannels_.at(boardID * 20 + j) << ", ";
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 << ", ";

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use SS and SS_THROW exception with the find.

Copy link
Contributor

Copilot AI commented Jan 23, 2026

@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.

Copy link
Contributor

Copilot AI commented Jan 23, 2026

@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.

Copy link
Contributor

Copilot AI commented Jan 23, 2026

@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.

Copilot AI and others added 5 commits January 23, 2026 18:37
…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>
Copy link
Contributor

Copilot AI commented Jan 23, 2026

@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.

rrivera747 and others added 6 commits January 23, 2026 15:32
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we have mu2e::CaloConst::_nChPerDIRAC defined in Offline, if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use mu2e::CaloConst::_nChPerDIRAC for the 20

…etersTable_table.cc

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Jan 26, 2026

@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.

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@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.

Copilot AI and others added 6 commits January 26, 2026 15:41
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
@giro94
Copy link
Contributor

giro94 commented Jan 29, 2026

PR should be ready to be merged @rrivera747

@rrivera747 rrivera747 merged commit d5e8cc6 into develop Jan 29, 2026
7 of 9 checks passed
@rrivera747 rrivera747 deleted the jcampos/AddChannelStatus branch January 29, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants