Repository navigation
R4-20: unused GetConstant overloads with off-by-one indexing (FDC, SC, TOF) - #1271
Conversation
…SC, TOF) - `libraries/FDC/DFDCHit_factory.cc`, two overloads: the element bound is `the_table[gPlane-1].size()`. One more hunk corrects the error message of the wire-count check in `BeginRun`, which printed the size of another chamber's entry (message only). - `libraries/START_COUNTER/DSCHit_factory.cc`, two overloads: sectors are checked as 1..`MAX_SECTORS` and read at `sector-1`. - `libraries/TOF/DTOFHit_factory.cc`, the plane, bar, end overload: planes are checked as 0..`TOF_NUM_PLANES`-1 and bars read at `bar-1`. The indexing then matches the factories' own processing paths. These overloads have no callers in halld_recon today. Split from #1236, which now carries only the CDC part (the CDC overloads are removed there). Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test status for this pull request: SUCCESS Summary: summary.txt Build log: make_auto-hunt_getconstant-r4-20.log |
|
in DFDCHit_factory.cc and DFDCHit_factory.h the method GetConstant() and all its overloaded methods are not use at all anywhere, so it can simply be removed from the code base. same in DSCHit_factory.cc and DSCHit_factory.h, the method GetConstat() and all its overloaded methods are never used anywhere, so it can be removed. in DTOFHit_factory.cc and DTOFHit_factory.h the GetConstant() method is used in all cases where the overloded method only takes two input parameters. The case where GetConstant() requires four input parameters is not used anywhere in the code base and can be removed. |
… unused 4-argument TOF overload As the TOF expert asked in #1271: no code calls them. Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you. Done in 32ec53e, as you suggested:
No other code calls the removed methods. The three files pass a compile check; nothing was run. Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
|
Test status for this pull request: SUCCESS Summary: summary.txt Build log: make_auto-hunt_getconstant-r4-20.log |
zihlmann
left a comment
There was a problem hiding this comment.
the changes look as expected.
Some GetConstant overloads index their tables off by one:
DFDCHit_factory::GetConstant(gPlane, element) and (DFDCHit): the element bound readsthe_table[gPlane]while the value is read atthe_table[gPlane-1]. One more hunk fixes theBeginRunwire-count error message, which printed the size of another chamber's entry (message only).DSCHit_factory::GetConstant(DSCDigiHit) and (DSCHit): sectors are checked as 0..MAX_SECTORS-1 and read atsector, while sectors are numbered 1..MAX_SECTORS. Now checked as 1..MAX_SECTORS and read atsector-1.DTOFHit_factory::GetConstant(plane, bar, end): planes are now checked as 0..TOF_NUM_PLANES-1 and bars read atbar-1.The indexing then matches the factories' own processing paths.
None of these overloads has a caller in halld_recon. Every
GetConstanthit in the three factories is a definition, a declaration or an error message, except the TOF calls with a digihit, which use other overloads that this PR does not touch:Nothing in the tree calls a GetConstant through an object or pointer:
No output changes. The fix is kept so that a future caller gets the right element.
This was split from #1236 at the CDC expert's request: that PR now changes only CDC code, and there the unused
DCDCHit_factory_Calib::GetConstantoverloads are removed instead of fixed.Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)
🤖 Generated with Claude Code