TrkPatRec: Add detailed code review document#1790
Conversation
Agent-Logs-Url: https://github.com/Mu2e/Offline/sessions/1cd4187d-9c04-4a32-bdcd-243be1983ccc Co-authored-by: oksuzian <48927306+oksuzian@users.noreply.github.com>
|
Hi @Copilot,
which require these tests: build. @Mu2e/fnalbuild-users, @Mu2e/write have access to CI actions on main. 📝 The author of this pull request is not a member of the Mu2e github organisation. |
…ram fill, fix typos, remove dead code, clean includes - Remove REVIEW.md (review content moved to PR description) - Fix duplicate nseeds histogram fill in RobustHelixFinderDiag_tool.cc - Replace C-style cast with static_cast in RobustHelixFinderDiag_tool.cc - Remove duplicate #include fhiclcpp/ParameterSet.h from diag tools - Remove unnecessary #include EDAnalyzer.h from diag tools - Fix typos: algorhithm, FitCirclestrategy, unrecognixed, veccctor, llok, fot - Remove duplicate CaloClusterWeight key in prolog.fcl - Remove dead code file KalSeedFit_types.hh and its CMakeLists.txt entry Agent-Logs-Url: https://github.com/Mu2e/Offline/sessions/c5bd8c31-be93-4ec7-b9db-c6d87aa92206 Co-authored-by: oksuzian <48927306+oksuzian@users.noreply.github.com>
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 0540140: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 0540140.
N.B. These results were obtained from a build of this Pull Request at 0540140 after being merged into the base branch at 5ec09f9. For more information, please check the job page here. |
brownd1978
left a comment
There was a problem hiding this comment.
These are innocuous changes.
TrkPatRec: Code Review Fixes
Review Summary
Full review of all TrkPatRec source files, headers, FCL configs, and build system files. Issues found are categorized below. This PR addresses the safely fixable issues; remaining items are documented for future work.
Changes Made (fixes in this PR)
Bug Fix
RobustHelixFinderDiag_tool.cc:278-279):nseeds[k]was filled twice per helicity iteration — removed the duplicate lineCode Quality
RobustHelixFinderDiag_tool.cc:267): Changed(Data_t*) Datatostatic_cast<Data_t*>(Data)for type safetyRobustMultiHelixFinderDiag_tool.ccandTimeAndPhiClusterFinderDiag_tool.cchad duplicate#include "fhiclcpp/ParameterSet.h"art/Framework/Core/EDAnalyzer.hwhich is not needed (these areart::tool, notEDAnalyzer)Dead Code Removal
KalSeedFit_types.hhremoved: The entire file was wrapped in/* */(all dead code) — deleted and removed from CMakeLists.txtFCL Fix
prolog.fcl):CaloClusterWeightwas set twice inTimeClusterFinderconfig (lines 32 and 35) — removed the duplicateTypo Fixes
"algorhithm"→"algorithm"inRobustMultiHelixFinder_module.ccfhicl comment"unrecognixed FitCirclestrategy"→"unrecognized FitCircleStrategy"in exception message"veccctor"→"vector"and"llok"→"look"inflagComptoncomment"fot"→"for"inRobustMultiHelixFinder_types.hhandTimeAndPhiClusterFinder_types.hhRemoved from repo
REVIEW.md: Review content belongs in this PR description, not committed to the repositoryIssues Found But NOT Changed (for future work)
High Priority
RobustMultiHelixFinder_module.cc:346chi2dXYrepurposed asdz/dtslope — thechi2dXYfield storesfita_zt_(dz/dt slope) instead of actual chi2. This is a documented "dirty hack" that corrupts the data model semantics. Requires a data product change to fix properly.RobustHelixFinder_module.cc:1212-1227updateStereois a no-op — the method always returnsfalseand contains only a FIXME comment. Either implement or remove.Medium Priority
RobustHelixFinder_module.cc:94-97HelixHitMVA._hrhoaliases_dtrans— both reference_pars[0], likely unintended after MVA variable reduction. The commented-out constructor had them at separate indices (7 and 8).6.2831,6.28318,6.283185,6.2832used across files. Should useM_PIor a namedconstexpr.RobustMultiHelixFinder_types.hhData_tarrays (128 helices, 8192 hits). Could overflow in busy events.dids[0]access without checking vector is non-empty infillStrawDigiIndicesusageTimeClusterFinder_module.cc_cccoldereferenced without verifying handle validity when_useccis trueLow Priority (Code Quality)
RobustHelixFinder_module.cc,TimeClusterFinder_module.ccusing namespace stdat file scopeRobustHelixFinder_module.ccstaticlocal variables in member functions (thread-safety concern if ever modified)RobustHelixFinder_module.cc_printfreqmember_membervs trailingmember_)(0)instead ofnullptrRobustHelixFinder_module.cc:64#include <float.h>should be<cfloat>RobustMultiHelixFinder_module.cc:580unsigned iWorst(-1)wraps to UINT_MAX as sentinelPositive Observations
ModuleHistToolBasediagnostic toolsRobustMultiHelixFinderandTimeAndPhiClusterFinderhave clean, modern designconsumes/produces,ProductToken,art::Ptr)