Update CalSourceEnergyCalib table format to include ndf; add CalEnergyCalibInfo table#1718
Update CalSourceEnergyCalib table format to include ndf; add CalEnergyCalibInfo table#1718
Conversation
|
☀️ The build tests passed at 31af759.
N.B. These results were obtained from a build of this Pull Request at 31af759 after being merged into the base branch at a500268. For more information, please check the job page here. |
|
Can you describe a bit more what purpose of CalEnergyCalibInfo? The "info" in the name implies it is an "adhoc" table, but it doesn't have the adhoc flag. (example of adhoc is CalCosmicEnergyCalibInfo) It is structured and seems to have the purpose of an archive table, like CalSourceEnergyCalib, and so if the intent is to record, channel by channel, the result of combining the calib sources, I'd expect it to be named more like CalCombinedEnergyCalib to keep in more in parallel with the other archive tables. Thanks |
|
I second Ray's comments. You could call this |
|
I'll review this pull request by first loading the PR details and its changes.Let me get the actual file changes in this PR.Now let me look at the existing similar table ( PR Review: #1718This PR makes two changes: (1) adds an 🐛 Bug: Pre-existing
|
| Severity | Issue | Location |
|---|---|---|
| 🐛 Bug (pre-existing, fixed here) | rowToCsv was missing frFull, frFirst, frSecond fields — this is a behavior change that should be documented |
CalSourceEnergyCalib.hh |
status_message string in CSV can break parsing if it contains commas |
CalEnergyCalibInfo.hh |
|
std::string passed by value instead of by const-ref or moved |
CalEnergyCalibInfo.hh Row constructor |
|
| 💡 Nit | Inconsistent code style with existing tables | CalEnergyCalibInfo.hh |
The most important item to address is Issue 1 (the status_message CSV safety concern). The pre-existing rowToCsv bug fix is a welcome improvement but should be called out in the PR description since it changes behavior beyond just adding ndf.
|
📝 The HEAD of |
Quote/escape status_message in rowToCsv and unquote on read in addRow. Also treat trailing columns as part of the last field so messages with commas round-trip correctly instead of breaking CSV parsing.
The purpose of it is to store extra information from the combination algorithm such as the error on the ADCtoMeV constant and the source of this constant (such as "only using cosmic" or "averaging cosmic and source"). I have flagged it as an adhoc table. I named it a "CalEnergyCalibInfo" table because it is meant to be a table to complement the information in the "CalEnergyCalib" table, just like how "CalCosmicEnergyCalibInfo" is meant to complement "CalCosmicEnergyCalib" table. |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 71d1484: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 71d1484.
N.B. These results were obtained from a build of this Pull Request at 71d1484 after being merged into the base branch at 3e5e0e6. For more information, please check the job page here. |
@zwl0331 adhoc tables work a bit differently as each commit is added as a row. We should make this a standard archive table (which has nothing different wrt a production table except for how we commit it to the database). |
This pull request introduces a new calibration metadata table for per-SiPM energy calibration and updates the source calibration table to include additional statistical information. It also ensures these changes are integrated with the table factory for proper instantiation. The main themes are the addition of a new table and enhancements to an existing table.
New calibration metadata table:
CalEnergyCalibInfoclass inDbTables/inc/CalEnergyCalibInfo.hhto store combined ADC/MeV calibration constants, uncertainties, and status flags for each SiPM, including handling of different calibration status codes.CalEnergyCalibInfoin the table factory by updatingDbTables/src/DbTableFactory.ccto include the header and add creation logic for the new table. [1] [2]Enhancements to source calibration table:
CalSourceEnergyCalib::Rowclass inDbTables/inc/CalSourceEnergyCalib.hhto include a newndf(number of degrees of freedom) field, and updated all relevant methods, CSV serialization, and constructor to handle this new field. [1] [2] [3] [4] [5]