Repository navigation
Add time calibration to reco digis - #2030
Conversation
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2030
Reviewed at head bec92d2048e3178c59e599d1fdf92f43ed1f8c3c. first pass
Decision
- 🟡 comment only, for now. The code is ready to approve: the per-SiPM time offset from
CalCalibis now applied to the reco-digi time, with the sign that the calibration producing the table assumes. No FNALbuild run exists at this head, so I'm triggering one and will approve once it is green.
Scope understood
CaloRecoDigiMakerreadscalCalib.timeoffset(SiPMID)and subtracts it from each reco-digi time:time = waveformProcessor_->time(i) - pbtOffset - timeOffset. Until nowCalCalib::timeoffset()had no caller in Offline, so the loadedCalTimeCalibvalues never reached any calo time.- One file, +2/−1, on
mainafter #2029.
Findings
-
🟡 [S2] The trigger and online hit makers do not apply the offset, and the online one would add it
- Evidence:
CaloHitMakerFast(trigger) has noCalCalibat all.DAQ/src/CaloHitsFromDTCEvents_module.cc:329and:404addtimeCalib_[SiPMID]to the hit time. That array is set to 0 at:131and never filled.
- Impact: none today, because every table in use is zero (see the 🟢 below). Once real offsets are loaded, offline reco times, trigger times and online times will differ per channel. If
timeCalib_were filled from the same table, it would also have the opposite sign. - Suggested fix: a follow-up that gives
CaloHitMakerFastthe same subtraction and either fillstimeCalib_fromCalCalibwith a minus sign or removes it. Not needed for this PR.
- Evidence:
-
⚪ [S3] Two small items:
- The PR description is empty. One line on intent, plus "offsets are all zero in current tables, so no output change today", would help the next reader.
- The edit drops the comment
// correct to time since protonsfrom thetimeline. Consider keeping it, and documenting the sign next to it, for example// minus per-SiPM offset (CalTimeCalib::tcorr).
🟢 Verified at this head:
- Sign. CaloCalibration's cosmic T0 alignment (
CosmicsCalib/src/caloT0alig_module.cc:367,404) forms corrected channel times asrecoDigi->time() - Tcor[SiPMID], and its last iteration writesTcoras the table to upload. Subtractingtcorrtherefore matches how the constants are derived. The correction is indexed bySiPMIDon both sides. - Applied per SiPM, before the two SiPMs are merged.
CaloHitMakermerges reco digis bytime()withintime4Merge(6 ns). So a relative offset between the two SiPMs of a crystal is corrected before that comparison, not after. - No output change with the tables in use today.
- MC and default reco use
CalCalibfrom fcl:useDb: false,timeoffset: 0.0inCaloConditions/fcl/prolog.fcl. - The only configurations that set
calCalib.useDb : trueare PassNCombined_Pass1.fclandCalo/Calo_CRR_pass1.fcl. Both loadCaloConditions/data/TimeCalib_example.txt, which has 2720 rows, all 0. - So every current reco time is unchanged; the change takes effect when a measured table is loaded.
- MC and default reco use
- Compiles.
g++ -std=c++20 -fsyntax-onlyofCaloRecoDigiMaker_module.ccat this head passes. Script:claude-scratch/pr2030_review/syntax.sh.
Validation check
- Build/tests run:
- Locally:
-fsyntax-onlyonly. - FNALbuild: no run at this head.
- No events run. With all-zero offsets,
ceSimRecoand PassN output should be identical tomain.
- Locally:
- Config contract check: pass. No fcl change; the accessor already existed.
- Cross-repo consistency: pass. The table format is unchanged.
Residual risk
- Not checked: whether any private or DB-hosted
cal.timecalibset with non-zero values is already in use. If so, its reco times shift bytcorrper SiPM with this change, which is the intent.
Author follow-ups
- Add a one-line description (finding 2).
- Consider the follow-up for the trigger and online hit makers (finding 1).
|
@FNALbuild run build test |
|
❌ Those tests have already run or are running for bec92d2 (build) |
|
☀️ The build tests passed at bec92d2.
N.B. These results were obtained from a build of this Pull Request at bec92d2 after being merged into the base branch at 24a1aa5. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2030
Reviewed at head bec92d2048e3178c59e599d1fdf92f43ed1f8c3c. first pass
Decision
- 🟢 approve. The per-SiPM time offset from
CalCalibis now applied to the reco-digi time, with the sign that the calibration producing the table assumes. FNALbuild passes at this head.
Scope understood
CaloRecoDigiMakerreadscalCalib.timeoffset(SiPMID)and subtracts it from each reco-digi time:time = waveformProcessor_->time(i) - pbtOffset - timeOffset. Until nowCalCalib::timeoffset()had no caller in Offline, so the loadedCalTimeCalibvalues never reached any calo time.- One file, +2/−1, on
mainafter #2029.
Findings
-
🟡 [S2] The trigger and online hit makers do not apply the offset, and the online one would add it
- Evidence:
CaloHitMakerFast(trigger) has noCalCalibat all.DAQ/src/CaloHitsFromDTCEvents_module.cc:329and:404addtimeCalib_[SiPMID]to the hit time. That array is set to 0 at:131and never filled.
- Impact: none today, because every table in use is zero (see the 🟢 below). Once real offsets are loaded, offline reco times, trigger times and online times will differ per channel. If
timeCalib_were filled from the same table, it would also have the opposite sign. - Suggested fix: a follow-up that gives
CaloHitMakerFastthe same subtraction and either fillstimeCalib_fromCalCalibwith a minus sign or removes it. Not needed for this PR.
- Evidence:
-
⚪ [S3] Two small items:
- The PR description is empty. One line on intent, plus "offsets are all zero in current tables, so no output change today", would help the next reader.
- The edit drops the comment
// correct to time since protonsfrom thetimeline. Consider keeping it, and documenting the sign next to it, for example// minus per-SiPM offset (CalTimeCalib::tcorr).
🟢 Verified at this head:
- Sign. CaloCalibration's cosmic T0 alignment (
CosmicsCalib/src/caloT0alig_module.cc:367,404) forms corrected channel times asrecoDigi->time() - Tcor[SiPMID], and its last iteration writesTcoras the table to upload. Subtractingtcorrtherefore matches how the constants are derived. The correction is indexed bySiPMIDon both sides. - Applied per SiPM, before the two SiPMs are merged.
CaloHitMakermerges reco digis bytime()withintime4Merge(6 ns). So a relative offset between the two SiPMs of a crystal is corrected before that comparison, not after. - No output change with the tables in use today.
- MC and default reco use
CalCalibfrom fcl:useDb: false,timeoffset: 0.0inCaloConditions/fcl/prolog.fcl. - The only configurations that set
calCalib.useDb : trueare PassNCombined_Pass1.fclandCalo/Calo_CRR_pass1.fcl. Both loadCaloConditions/data/TimeCalib_example.txt, which has 2720 rows, all 0. - So every current reco time is unchanged; the change takes effect when a measured table is loaded.
- MC and default reco use
- Compiles.
g++ -std=c++20 -fsyntax-onlyofCaloRecoDigiMaker_module.ccat this head passes. Script:claude-scratch/pr2030_review/syntax.sh.
Validation check
- Build/tests run:
- Config contract check: pass. No fcl change; the accessor already existed.
- Cross-repo consistency: pass. The table format is unchanged.
Residual risk
- Not checked: whether any private or DB-hosted
cal.timecalibset with non-zero values is already in use. If so, its reco times shift bytcorrper SiPM with this change, which is the intent.
Author follow-ups
- Add a one-line description (finding 2).
- Consider the follow-up for the trigger and online hit makers (finding 1).
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 5c0bc8e: build (Build queue - API unavailable) |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 80044dc: build (Build queue - API unavailable) |
|
☔ The build tests failed for 80044dc.
N.B. These results were obtained from a build of this Pull Request at 80044dc after being merged into the base branch at 24a1aa5. For more information, please check the job page here. |
|
☀️ The build tests passed at 5c0bc8e.
N.B. These results were obtained from a build of this Pull Request at 5c0bc8e after being merged into the base branch at 24a1aa5. For more information, please check the job page here. |
|
@FNALbuild run build test with Mu2e/mu2e-trig-config#174 |
|
⌛ The following tests have been triggered for 80044dc: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 80044dc.
N.B. These results were obtained from a build of this Pull Request at 80044dc after being merged into the base branch at 24a1aa5. For more information, please check the job page here. |
|
@bechenard @rlcee just letting you know I have expanded the use of proditions @oksuzian this is ready to be merged |
| const ProtonBunchTime& pbt(*pbtH); | ||
| double pbtOffset = pbt.pbtime_; | ||
| CalCalib const& calCalib = calCalibHandle_.get(event.id()); | ||
|
|
There was a problem hiding this comment.
AArgh, the better style is obviously const CalCalib&....
There was a problem hiding this comment.
Totally agree, I copied the style somewhere...
Will fix once for all
There was a problem hiding this comment.
grep "const&" */*/*.cc | wc -l
2825
No I will not
|
I merged this to restore the trigger and Offline CI functionality |
No time calibration was applied to reco digis.
Also, added energy and time calibration via proditions to online/trigger modules