Updated CRV coincidence cluster finder#1772
Conversation
|
Hi @ehrlich-uva,
which require these tests: build. @Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main. ⌛ The following tests have been triggered for 98c3b17: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 98c3b17.
N.B. These results were obtained from a build of this Pull Request at 98c3b17 after being merged into the base branch at c570352. For more information, please check the job page here. |
|
I'll review this pull request by examining its details and the code changes.Here is my detailed review of PR #1772. This is a significant refactoring of the CRV coincidence cluster finder that changes the algorithm for pairing hits from both readout sides of CRV counters. Below are the issues I found, organized by severity. 🔴 Bugs / Potential Correctness Issues1. Operator precedence bug in
|
| Severity | Issue | Location |
|---|---|---|
| 🔴 Bug | float map keys can split same-counter hits |
clusterProperties |
| 🔴 Bug | filterHits PE threshold now only checks one side |
filterHits |
| 🔴 Bug | Deleted CrvCoincidence.hh still forward-declared |
HlPrint.hh |
| 🟡 Logic | One-side fallback can silently overwrite avgHitTime |
clusterProperties |
| 🟡 Logic | Multi-counter clusters use only first/last map entry | clusterProperties |
| 🟡 Perf | Repeated _sectorMap scans per sector type |
produce() |
| 🟢 Style | Typos in comments ("diving", "orign", "overconstraint") | Throughout |
| 🟢 Style | Inconsistent float/double mixing |
Throughout |
|
Responses:
|
|
I'll review this pull request by examining its details and the code changes.Here is my review of PR #1772 — "Updated CRV coincidence cluster finder" by @ehrlich-uva. This is a substantial refactor (+174 / −425 across 9 files) that changes the algorithm for pairing hits from both readout sides of CRV counters. I've identified several issues and concerns: 🔴 Potential Bugs1. Operator precedence bug in
|
| Severity | Issue | Location |
|---|---|---|
| 🔴 Bug | Boundary check hitPosOrigin>hitPos0 && hitPosOrigin<hitPos1 assumes coordinate ordering |
CrvCoincidenceFinder_module.cc, clusterProperties |
| 🔴 Bug | Sign convention for SiPM position offset needs geometry verification | CrvCoincidenceFinder_module.cc, clusterProperties |
| 🟡 Design | Silent fallback when hit origin is outside counter — no flag/warning | CrvCoincidenceFinder_module.cc, clusterProperties |
| 🟡 Design | Removed CrvCoincidence class — verify no downstream dependencies |
RecoDataProducts/ |
| 🟡 Design | float vs double mixed precision |
CrvCoincidenceFinder_module.cc |
| 🟢 Minor | O(n²) inner loop in filterHits iterates wrong-side hits |
CrvCoincidenceFinder_module.cc |
The core algorithm change (separating readout sides for initial clustering, then recombining for final clustering using fiber signal travel time) is sound in concept, but the coordinate-ordering assumption in the hitPosOrigin boundary check (issue #3) is the most likely source of real bugs.
|
Responses:
|
|
I'll review the pull request to find any issues. Let me start by examining the PR details and its changes.Let me look at the actual changed files on the head branch to review the code.Let me now look at the actual changed source files in the PR branch to do a proper code review.Now I can see the key file — it's been renamed from PR Summary: This is a draft PR by @ehrlich-uva with 8 commits, 11 changed files (+223/−433 lines). It renames the old two-step Issues Found1. 🔴 Potential Division-by-Zero in Slope Calculationdouble slope=(PEs*sumXY-sumX*sumY)/(PEs*sumYY-sumY*sumY);If all hits in a cluster are at the same 2. 🔴 Division-by-Zero in
|
| Severity | Count | Description |
|---|---|---|
| 🔴 High | 2 | Potential division-by-zero in slope calculations |
| 🟡 Medium | 4 | Assert in production code, signed/unsigned mismatches, FCL compatibility issues |
| 🟢 Low | 2 | Typos in comments |
The most important items to address before merging are the division-by-zero risks in the slope calculations and ensuring FCL backward compatibility with older prolog/epilog files that still reference the removed module types and parameters.
|
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for f7edd99: build (Build queue - API unavailable) |
|
☀️ The build tests passed at f7edd99.
N.B. These results were obtained from a build of this Pull Request at f7edd99 after being merged into the base branch at 5b02c13. For more information, please check the job page here. |
Update cluster finder algorithm.