Skip to content

Added new reco table for Calorimeter baselines and new archive table …#1863

Open
giro94 wants to merge 4 commits into
Mu2e:mainfrom
giro94:DBTables
Open

Added new reco table for Calorimeter baselines and new archive table …#1863
giro94 wants to merge 4 commits into
Mu2e:mainfrom
giro94:DBTables

Conversation

@giro94

@giro94 giro94 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

…for time calibration with cosmics

@FNALbuild

Copy link
Copy Markdown
Collaborator

Hi @giro94,
You have proposed changes to files in these packages:

  • DbTables

which require these tests: build.

@Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main.

⌛ The following tests have been triggered for a5f5574: build (Build queue - API unavailable)

About FNALbuild. Code review on Mu2e/Offline.

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at a5f5574.

Test Result Details
test with Command did not list any other PRs to include
merge Merged a5f5574 at 27e994d
build (prof) Log file. Build time: 04 min 15 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 2 files
clang-tidy 0 errors 0 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at a5f5574 after being merged into the base branch at 27e994d.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@giro94

giro94 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for 2c0ebf2: build (Build queue - API unavailable)

@FNALbuild

Copy link
Copy Markdown
Collaborator

☔ The build is failing at 2c0ebf2.

scons: *** [build/al9-prof-e29-p101/Offline/tmp/DbTables/src/DbTableFactory.os] Error 1
Test Result Details
test with Command did not list any other PRs to include
merge Merged 2c0ebf2 at 27e994d
build (prof) Log file.
ceSimReco 〰️ Log file.
g4test_03MT 〰️ Log file.
transportOnly 〰️ Log file.
POT 〰️ Log file.
g4study 〰️ Log file.
cosmicSimReco 〰️ Log file.
cosmicOffSpill 〰️ Log file.
ceSteps 〰️ Log file.
ceDigi 〰️ Log file.
muDauSteps 〰️ Log file.
ceMix 〰️ Log file.
rootOverlaps 〰️ Log file.
g4surfaceCheck 〰️ Log file.
trigger Log file.
check_cmake 〰️ Log file.
FIXME, TODO TODO (0) FIXME (0) in 3 files
clang-tidy ➡️ 1 errors 0 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at 2c0ebf2 after being merged into the base branch at 27e994d.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@giro94

giro94 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for b091f88: build (Build queue - API unavailable)

@giro94

giro94 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

@rlcee

CalBaselines will be a reco (production) table that gets information from the run_info dump (Cat 3 table)
CalCosmicTimeCalib will be an archive table for producing time calibrations with cosmic rays. Not sure if I will ad an adhoc Info table later on

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at b091f88.

Test Result Details
test with Command did not list any other PRs to include
merge Merged b091f88 at 27e994d
build (prof) Log file. Build time: 08 min 42 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 3 files
clang-tidy 0 errors 0 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at b091f88 after being merged into the base branch at 27e994d.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@rlcee rlcee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, I think a couple of typos

Comment thread DbTables/inc/CalCosmicTimeCalib.hh Outdated
Comment thread DbTables/inc/CalCosmicTimeCalib.hh Outdated
Comment thread DbTables/inc/CalCosmicTimeCalib.hh Outdated
@giro94

giro94 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for 8398fb7: build (Build queue - API unavailable)

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 8398fb7.

Test Result Details
test with Command did not list any other PRs to include
merge Merged 8398fb7 at 27e994d
build (prof) Log file. Build time: 08 min 36 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 3 files
clang-tidy 0 errors 0 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at 8398fb7 after being merged into the base branch at 27e994d.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@rlcee rlcee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@oksuzian

Copy link
Copy Markdown
Collaborator

1. CalBaselines::row() uses unchecked operator[] — out-of-bounds risk 🔴

const Row& row(CaloSiPMId id) const {
            return _rows[id.id()];
}

_rows[id.id()] is unchecked. Since the table can hold fewer rows than _nChannelDB (addRow only enforces contiguity, not full population), a valid-but-absent channel ID silently reads out of bounds. The sibling table CalCosmicTimeCalib uses the safer _rows.at(roid.id())CalBaselines should too. (Note: CalTimeCalib/CalEnergyCalib have the same legacy bug, so this matches some old code, but .at() is the correct choice.)

2. Inconsistent index validation between the two tables 🟡

CalCosmicTimeCalib validates the upper bound:

if (index >= CaloConst::_nChannelDB  || index != _rows.size()) {

but CalBaselines only checks ordering, not the upper bound:

if (index!=int(_rows.size())) {

Combined with issue #1, nothing prevents CalBaselines from growing beyond _nChannelDB. Recommend matching the CalCosmicTimeCalib check.

3. Type mismatch: ctor params vs. members in CalCosmicTimeCalib 🟡

The current head (8398fb7) takes float params, but members and accessors are float while the constructor stores them — consistent now. However, reviewer rlcee flagged in a comment "these should be float?" on the older double version. ✅ This appears addressed in the latest commit (params are now float). Worth confirming the setprecision(5) is still appropriate for these.

4. Leftover signed/unsigned comparison 🟡

std::uint16_t index = std::stoul(columns[0]);
if (index!=int(_rows.size())) {

index is uint16_t and _rows.size() is cast to int — a -Wsign-compare style mismatch carried over from the older tables. Comparing against _rows.size() directly (as CalCosmicTimeCalib does) is cleaner.

@FNALbuild

Copy link
Copy Markdown
Collaborator

📝 The HEAD of main has changed to 9c47505. Tests are now out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants