Skip to content

auto-hunt: CDC - 4 fixes (S3 2, S4 2) - #1236

Merged
nsjarvis merged 7 commits into
masterfrom
auto-hunt/cdc
Dec 2, 2026
Merged

nsjarvis merged 7 commits into
masterfrom
auto-hunt/cdc

Conversation

@DraTeots

@DraTeots DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

These fixes come from the Hall D bug hunt, an autonomous campaign that read the GlueX software, built a test for every suspect line, and kept only findings confirmed by a measurement: a test run of the program on data or simulation, or a direct call of the code against a known answer. Each commit below fixes one finding and is named by its finding id and grade (S1 most serious, S4 least). Every commit has a comment in this pull request with the finding's card: what is wrong, the code, the measured effect, who is affected and the fix. Full cards with plots are on the campaign pages (JLab login): https://pages.jlab.org/halld/auto-hunt/index.html, by library: https://pages.jlab.org/halld/auto-hunt/libraries.html

Overall gains

4 confirmed bugs fixed in this pull request (S3 2, S4 2), one commit each, in the order of the commits (most serious first).

finding grade what was wrong the fix
R4-3 S3 An option, on by default, says "remove hits correlated in time with saturation hits". The code finds the hits 16 to 40 ns after a saturated hit on the same readout connector and flags them, then never reads the flags: every flagged hit stays. One step earlier, a separate afterpulse filter removes the small hits in that window. Release 5.9.0 has the same lines. For the CDC experts: retire the option and its flagging, or skip the flagged hits. Skipping as coded tests only hits on higher channels than the saturated one, so its result would depend on the channel order; that patch is held.
R4-9a S3 At each run start the CDC hit step adds the drift-time table (78 rows, 0.01 cm apart) to a list that is never emptied. In the second run of a job the list holds two tables, and a hit beyond the table's last time gets a distance 0.78 cm too large. The CDC dE/dx drops hits beyond 1 cm, so such a hit leaves its track's dE/dx. Release 5.9.0 has the same lines. Empty the list before reading the table.
R4-18 S4 The CDC hit step removes afterpulses, small hits after a saturated hit on the same board. It scales raw amplitude and pedestal by two words of the f125 readout configuration, which hold 0xffff when the data lack them. The main hit code replaces 0xffff by the defaults 3 and 0; the afterpulse code does not, and shifts by 0xffff bits, which C++ leaves undefined. In real data this branch never runs: the finder looks for the configuration on the hit, and the raw-data reader attaches it to the pulse. Release 5.9.0 has the same lines. Replace 0xffff by 3 and 0, as the main hit code does.
R4-20 S4 The CDC, FDC, start-counter and TOF hit steps each have helper functions that check a channel number and return its calibration constant. Channels count from 1 and tables from 0, and these helpers mix the two: the start-counter and TOF helpers return the next channel's constant, and the CDC and FDC helpers check the channel against the size of the next ring or plane, so they reject a valid channel or read past the table. Nothing calls these helpers; the steps' own code indexes the tables right. Release 5.9.0 has the same lines. Subtract one where the channel number indexes a table, in all four detectors.

Related findings and commits that belong together

  • R4-26 and R4-3: alternatives for the same code (repair the correlated-hit removal, R4-3, or delete it, R4-26); only one can be merged.
  • R4-26: not in this pull request: R4-26 deletes the correlated-hit removal of DCDCHit_factory (switched off upstream and replaced by the afterpulse filter of DCDCHit_factory_Calib), while R4-3, committed in this pull request, repairs that removal so that it removes the hits it marks. The two are alternatives; the authors choose one. R4-3 is the smaller change; R4-26's patch is in its card.

How it was tested

Each finding's card says how it was confirmed (a run of the program before and after the fix on the same events, or a direct call of the function). The commits were rebased on the current default branch; every changed source file compiles (syntax check against the release headers). A full build and a physics benchmark of this combination of commits has not been run on the new base.


Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

DraTeots and others added 4 commits November 30, 2026 22:08
…moves them

The package is held (reference: worse): the patch applies the removal as the loop is written, testing only hits
later in the list (higher channels) than the saturated one, so its result depends on the hit order, which today's
output does not. The issue reports the mismatch of option and code and asks the CDC experts to choose: retire the
option (no output change) or apply it to hits on both sides. `patches/master.patch` is kept as the reference of the
measured effect.
Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-3-cdc-correlated-hits-never-removed/index.html
Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-3-cdc-correlated-hits-never-removed

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One line in `libraries/CDC/DCDCTrackHit_factory.cc`, `BeginRun`: `cdc_drift_table.clear();` before the CCDB table is
read into it, so a run's table replaces the previous run's. Nothing else changes. `patches/master.patch` applies
unchanged to release 5.9.0.
Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-9a-cdc-drift-table-appended-per-run/index.html
Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-9a-cdc-drift-table-appended-per-run

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…et_amp unsigned wrap

`libraries/CDC/DCDCHit_factory_Calib.cc`, `FindRogueHits`: `ABIT` and `PBIT` take the defaults 3 and 0 when the config
word is `0xffff`, the same mapping `Process` already uses (`:293-294`). Two lines. The patch applies to release 5.9.0
without offset.
Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-18-cdc-rogue-hits-config-bits-unguarded/index.html
Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-18-cdc-rogue-hits-config-bits-unguarded

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…FDC, SC, TOF)

- `libraries/CDC/DCDCHit_factory_Calib.cc`, three overloads: the straw bound is `Nstraws[ring-1]`.
- `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. `patches/master.patch` applies unchanged to release
5.9.0.
Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-20-getconstant-overloads-off-by-one/index.html
Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-20-getconstant-overloads-off-by-one

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DraTeots

DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

R4-3 S3 (commit 8de0fb9)

A CDC option to remove hits after a saturated hit is on by default and removes nothing

What is wrong. An option, on by default, says "remove hits correlated in time with saturation hits". The code
finds the hits 16 to 40 ns after a saturated hit on the same readout connector and flags them, then never reads the flags: every flagged hit stays. One step earlier, a separate afterpulse filter removes the small hits in that window. Release 5.9.0 has the same lines.

The code. Shortened (on GitHub):

vector<bool> Mark4Removal(hit_info_vec.size(), false);
if (RemoveCorrelationHits && ...) {
  ...
      if ( std::fabs(dt+CorrelatedHitPeak)<CorrelationHitsCut) {
        Mark4Removal[n] = true;              // flagged ...
...
for (int k=0 ;k<(int) hits.size(); k++){     // ... and every hit is kept:
  ...                                        // <-- Mark4Removal is never read
  Insert( const_cast<DCDCHit*>(hit) );

What it does. Run 132404 (2025-01), 998 events; "fixed" skips the flagged hits:

now fixed
CDC hits 74 649 74 341 (-0.41%); 178 events change
hits flagged and kept now 308, median amplitude 6926 (calibrated units) 0
small afterpulses the earlier filter removes 5730, median amplitude 641 (calibrated units) same

Plot: CDC hits on the connector of a saturated hit, by time after it

Who is affected. Anyone who relies on the option: the flagged hits are in every output today. If the removal is
applied, analyses with charged tracks in data: tracks change in 11% of events; omega -> pi+ pi- pi0 selected in 1M events goes 7996 -> 7964 (change -1.55 times its error). Which side is
better was not shown.

Who is not. Simulation (0 of 1041 simulated eta -> gamma gamma events change).

The fix. For the CDC experts: retire the option and its flagging, or skip the flagged hits. Skipping as coded tests only hits on higher channels than
the saturated one, so its result would depend on the channel order; that patch is held.

Grade S3 (third of four levels, S1 the widest), measured with the removal applied: hits change in 18% of events,
no count or yield by 1%. Retiring the option changes nothing.


Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-3-cdc-correlated-hits-never-removed/index.html
Evidence folder (tests, patches, review): https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-3-cdc-correlated-hits-never-removed

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@DraTeots

DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

R4-9a S3 (commit 291fe5a)

In a job over two runs, the CDC drift table of the second run is appended to the first

What is wrong. At each run start the CDC hit step adds the drift-time table (78 rows, 0.01 cm apart) to a list
that is never emptied. In the second run of a job the list holds two tables, and a hit beyond the table's last time
gets a distance 0.78 cm too large. The CDC dE/dx drops hits beyond 1 cm, so such a hit leaves its track's dE/dx.
Release 5.9.0 has the same lines.

The code, shortened (on GitHub):

// at every run start:
if (jcalib->Get("CDC/cdc_drift_table", tvals)==false){
    for(unsigned int i=0; i<tvals.size(); i++){
        ...
        cdc_drift_table.push_back(1000.*iter->second);   // <-- appended; the old run's rows stay
    }
}
...
cdc_drift_table_max = cdc_drift_table[cdc_drift_table.size()-1];

Fixed, before the loop:

cdc_drift_table.clear();

What it does (simulated events: 300 of run 132404 read after 300 of another run, against run 132404 alone):

today with the fix
CDC hits with another distance 14 of 6701, in 13 events 0
example hit 1.551 cm 0.771 cm

In those 13 events the tracks are unchanged (the fit computes its own distance); the dE/dx particle-ID chi2
differs from the run alone in 7 (dE/dx was not printed with the fix).

Plot: BH-927: in a two-run job 14 CDC hits get a distance 0.78 cm too large today, none with the fix

BH-927. Two-run job minus run alone, per CDC hit.

Who is affected. Jobs over several runs that rebuild CDC hits: CDC dE/dx of some tracks.

Who is not.

  • Jobs over one run: production, the 2025-01 pass, benchmark jobs (0 of 998 events change).
  • Jobs that read reduced (REST) files.

The fix. Empty the list before reading the table.

Grade S3 (third of four) on jobs over several runs: CDC hits change in 13 of the job's 600 events, dE/dx in
7. A benchmark job holds one run and cannot reach the fix.


Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-9a-cdc-drift-table-appended-per-run/index.html
Evidence folder (tests, patches, review): https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-9a-cdc-drift-table-appended-per-run

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@DraTeots

DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

R4-18 S4 (commit dd09d8d)

CDC afterpulse removal goes wrong when the readout's scale words are missing

What is wrong. The CDC hit step removes afterpulses, small hits after a saturated hit on the same board. It scales
raw amplitude and pedestal by two words of the f125 readout configuration, which hold 0xffff when the data lack them.
The main hit code replaces 0xffff by the defaults 3 and 0; the afterpulse code does not, and shifts by 0xffff bits,
which C++ leaves undefined. In real data this branch never runs: the finder looks for the
configuration on the hit, and the raw-data reader attaches it to the pulse. Release 5.9.0 has the same lines.

The code, shortened (on GitHub):

if(config) {
    ABIT = config->ABIT;                  // <-- 0xffff when the word is missing
    PBIT = config->PBIT;
} else {
    ABIT = 3;
    PBIT = 0;
}
...
uint32_t amp = cp->first_max_amp<<ABIT;   // <-- a shift by 0xffff bits: undefined

Fixed, as the main hit code already does:

    ABIT = config->ABIT == 0xffff ? 3 : config->ABIT;
    PBIT = config->PBIT == 0xffff ? 0 : config->PBIT;

What it does (the afterpulse finder called directly; one x86 build):

two hits on one board words 3 and 0 words missing, today with the fix
saturated hit, small hit 50 ns later small hit removed kept removed
hit of amplitude 101, small hit nothing removed small hit removed nothing removed

On 1000 raw events of a 2025-01 run the finder finds no configuration and uses 3 and 0: 0 of 998 events change.

Plot: BH-955: with the scale words missing, today an afterpulse is kept and a good hit removed; with the fix both right

BH-955. The afterpulse finder on test hits, with and without the scale words.

Who is affected. Nobody with today's raw-data reader. The guard matters only if the finder ever gets the
configuration, as in the test.

Who is not.

  • Raw data as read today, the 2025-01 pass and the physics benchmarks among them.
  • Simulation: no readout configuration, so the defaults.

The fix. Replace 0xffff by 3 and 0, as the main hit code does.

Grade S4 (lowest of four): the branch runs in no sample (0 of 998 events).


Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-18-cdc-rogue-hits-config-bits-unguarded/index.html
Evidence folder (tests, patches, review): https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-18-cdc-rogue-hits-config-bits-unguarded

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@DraTeots

DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

R4-20 S4 (commit cd686a5)

Unused calibration look-ups of four hit steps read the neighbouring channel or past the table

What is wrong. The CDC, FDC, start-counter and TOF hit steps each have helper functions that check a channel
number and return its calibration constant. Channels count from 1 and tables from 0, and these helpers mix the two:
the start-counter and TOF helpers return the next channel's constant, and the CDC and FDC helpers check the channel
against the size of the next ring or plane, so they reject a valid channel or read past the table. Nothing calls these
helpers; the steps' own code indexes the tables right. Release 5.9.0 has the same lines.

The code, start counter, shortened (on GitHub):

if ( (in_digihit->sector < 0) || (in_digihit->sector >= MAX_SECTORS))   // <-- allows 0 to 29; sectors are 1 to 30
...
return the_table[in_digihit->sector];          // <-- sector 1 gets the constant of sector 2

Fixed:

if ( (in_digihit->sector <= 0) || (in_digihit->sector > MAX_SECTORS))
...
return the_table[in_digihit->sector-1];

The TOF helper lacks the same "minus one"; the CDC and FDC helpers lack it where they read a ring or plane size.

What it does (each helper called directly with tables that hold their own channel number):

request today with the fix
start counter, sector 1 value of sector 2 value of sector 1
FDC, plane 1, strip 150 of 192 rejected value of strip 150
all 19 test cases, 4 detectors 16 wrong 0 wrong

Plot: BH-956: 16 of 19 test cases wrong today, 0 with the fix; one case per detector shown

BH-956. The look-ups called directly, one case per detector shown.

Who is affected. Nobody today. Code written later that calls one of these helpers would get the neighbour's
constant, an error for the last channel, or a value from outside the table.

Who is not. Every output: nothing calls these helpers, no sample executed them, and no benchmark can reach
them.

The fix. Subtract one where the channel number indexes a table, in all four detectors.

Grade S4 (lowest of four): no caller, so no event reaches the defect.


Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-20-getconstant-overloads-off-by-one/index.html
Evidence folder (tests, patches, review): https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-20-getconstant-overloads-off-by-one

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@gluex

gluex commented Dec 1, 2026

Copy link
Copy Markdown

Build status for this pull request: FAILURE

Build log: make_auto-hunt_cdc.log
Build report: report_auto-hunt_cdc.txt

@zihlmann

zihlmann commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

R4-20 S4 : YES, the method GetConstant() is not used at all in CDC, FDC and Start_Counter, but it is used in TOF. While all the corrections to the code are legit, fortunately non of that code is actually used in the main classes.
in the case of CDC, FDC and Start_Counter non of the code is used and for the TOF the code that is used is fine and does not require fixes, while the one instant of the overloaded method GetConstant() that requires a fix is also not used in the main class code.

@nsjarvis

nsjarvis commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

R4-9a S3 (commit 291fe5a):
"In a job over two runs, the CDC drift table of the second run is appended to the first"
Yes.

@nsjarvis

nsjarvis commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

R4-3 S3 (commit 8de0fb9)
"A CDC option to remove hits after a saturated hit is on by default and removes nothing"

Could you remove this commit please? We do need to retire the older afterpulse filter, but I cannot see that that's what the commit does. Oh. I see that that must be in R4-26 but it's not included in this PR, so we need that one instead, please.

@nsjarvis

nsjarvis commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

R4-18 S4 (commit dd09d8d)
"CDC afterpulse removal goes wrong when the readout's scale words are missing"

Yes.

@zihlmann

zihlmann commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

R4-3 S3 This code correction is
a) fixing bug of losing synchronization of the CDC HIT list, which would only happen if the translation table can not find the corresponding ring/straw information for MC data. This is very unlikely to happen at all.
b) and then actually apply the marked hit list for removal.
If this removal is not desired anymore then the whole code that creates the Mark4Removal vector should be removed.

…rt asked

The older afterpulse filter in DCDCHit_factory::RemoveCorrelationHits is to be retired, and this commit did not do
that. The file is back to master for this function; R4-9a, R4-18 and R4-20 are unchanged.

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DraTeots

DraTeots commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

R4-3: removed, as you asked. Commit dcaf0bf reverts 8de0fb9, so RemoveCorrelationHits is back to master. The history is not rewritten. R4-9a, R4-18 and R4-20 stay as they were.

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@gluex

gluex commented Dec 2, 2026

Copy link
Copy Markdown

Test status for this pull request: SUCCESS

Summary: summary.txt
Logs: results/log

Build log: make_auto-hunt_cdc.log
Build report: report_auto-hunt_cdc.txt

@nsjarvis

nsjarvis commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Where is R4-26 ?

@nsjarvis

nsjarvis commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

R4-20 S4 - Beni pointed out above that the incorrect function DCDCHit_factory_Calib::GetConstant is not used anywhere. I would prefer to remove this function.

Is there a separate PR to fix the GetConstant function for the TOF? Changes to the TOF code should not be in the CDC PR.

DraTeots and others added 2 commits December 2, 2026 15:05
…e CDC correlated-hit removal is dead

Retires the old correlated-hit (afterpulse) removal of DCDCHit_factory.
The removal was switched off in 600d779 and deleted in 07ea0e0. The
JANA2 port brought the block back without the code that read Mark4Removal,
so it ran on every event and changed nothing. The afterpulse filter of
DCDCHit_factory_Calib (CDC:ECHO_OPT) does this job.

- Removes the Mark4Removal loop and the hit_info_vec it was built from.
- Removes the options CDCHit:RemoveCorrelationHits, CDCHit:CorrelationHitsCut
  and CDCHit:CorrelatedHitPeak, the cdchit_info_t struct and the ttab member.
- Removes event->Get(ttab) from BeginRun. ttab grew on every run change and
  ttab[0] then pointed to a deleted table (ASan heap-use-after-free at
  DCDCHit_factory.cc:134).

Output is unchanged.

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and TOF parts move to their own pull request

- Removes the three DCDCHit_factory_Calib::GetConstant overloads from the .cc
  and their declarations (and one commented-out declaration) from the .h.
  Nothing in halld_recon calls them. This replaces the indexing fix of
  cd686a5 for the CDC.
- Reverts the FDC, SC and TOF parts of cd686a5. They move to a separate
  pull request, so this one changes only CDC code.

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DraTeots

DraTeots commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

R4-26 is now in this PR as commit 6b813fa. It retires the old correlated-hit (afterpulse) removal in DCDCHit_factory: the Mark4Removal loop and the hit info it was built from, the options CDCHit:RemoveCorrelationHits, CDCHit:CorrelationHitsCut and CDCHit:CorrelatedHitPeak, and the translation-table lookup that only fed it. The afterpulse filter in DCDCHit_factory_Calib (CDC:ECHO_OPT) stays. Output does not change. It also removes a read of a deleted translation table after a run change.

The unused DCDCHit_factory_Calib::GetConstant overloads are removed in commit 187e0a5. Nothing in halld_recon calls them.

The FDC, SC and TOF fixes are reverted here and moved to a separate PR, #1271. This PR now changes only CDC code.

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@gluex

gluex commented Dec 2, 2026

Copy link
Copy Markdown

Test status for this pull request: SUCCESS

Summary: summary.txt
Logs: results/log

Build log: make_auto-hunt_cdc.log
Build report: report_auto-hunt_cdc.txt

@nsjarvis nsjarvis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is fine.

@nsjarvis
nsjarvis merged commit 0b07339 into master Dec 2, 2026
2 checks passed
jase231 pushed a commit to jase231/halld_recon that referenced this pull request Dec 3, 2026
…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 JeffersonLab#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants