Skip to content

Fix DC straight-track NDF reporting - #1587

Merged
tongtongcao merged 1 commit into
developmentfrom
fix/dc-straight-track-ndf
Nov 12, 2026
Merged

tongtongcao merged 1 commit into
developmentfrom
fix/dc-straight-track-ndf

Conversation

@yugotra

@yugotra yugotra commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Successful straight DC fits currently publish TimeBasedTrkg::TBTracks.ndf = 999, which propagates to REC::Track.NDF. A downstream chi2/NDF selection therefore uses an artificially large denominator even though the ordinary fit NDF is available in TBTracks.ndf0. In run 20039, all 1,573,939 inspected exported DC seeds had this incorrect reported value; ordinary NDF ranged from 9 to 65.

This change publishes the straight fitter's ordinary NDF through the existing shared output field. It corrects reported fit quality; it is not a track-recovery or resolution-improvement change.

Defect and fix

The successful straight-fit branch of DCTBEngine calls set_FitNDF(kFZRef.NDF) but leaves _NDFDAF at its default zero. RecoBankWriter initializes the published DAF NDF to 999 and replaces it only for positive or negative _NDFDAF. DetectorData then copies TBTracks.ndf into the REC track.

Add the following next to the ordinary-NDF assignment in the straight-fit branch only:

TrackArray1.set_NDFDAF(kFZRef.NDF);

For valid positive ordinary NDF, the existing writer now publishes ndf == ndf0. The field-on branch continues to use kFZRef.getNDFDAF(). The writer's treatment of invalid/zero NDF is unchanged.

Controlled validation

Paired CLARA reconstructions with 12 threads, identical input events and frozen conditions. The data comparison used the released 14.2.0 runtime; the patched DC JAR replaced only DCTBEngine.class.

Sample Physics events per arm DC tracks per arm Result
Run 20039, zero field 500 515 All reported NDF values change from 999 to the retained ordinary NDF, range 12–49
Run 20173, field on 500 1,421 Published weighted NDF and all DC/REC bank contents are unchanged

Both samples cover all six sectors. The field-on sample includes 1,074 tracks whose weighted NDF differs from ordinary NDF. Exact event/timestamp coverage, metadata counts and decoded DC TDC/FMT ADC payloads pass. In the zero-field comparison, every other compared bank value is unchanged, including track counts, fitted coordinates, covariance and chi-square. Runtime COAT::config is excluded from the bank comparison.

The modified current-development class also compiles with Java 21 against the farm 14.2.0 classpath. git diff --check passes. A full current-development Maven build has not been run locally; the data regression above should not be mistaken for a full 14.2.4-SNAPSHOT reconstruction comparison.

Separate full-bank comparison discrepancy

The field-on comparison differs in one event, 661032: the id of one unassociated FTOF hit is 42 versus 41 in FTOF::hbhits and FTOF::rawhits. All other hit fields and all other compared banks are identical. Both affected banks are written by FTOFHB before DCTB; the writer preserves the existing rawhits bank during the TB pass.

One repeat of the same 500-event baseline reproduces the original baseline exactly, so the cause of the ID difference remains unconfirmed. The strict full-bank comparison is therefore not claimed to pass. The targeted straight-NDF correction and field-on DC/NDF checks do pass; the FTOF difference is retained as a separate finding.

The straight fitter records ordinary NDF but leaves NDFDAF unset. The
bank writer then substitutes 999 for TBTracks.ndf, which is propagated
to REC::Track.NDF and makes downstream reduced-chi2 cuts too loose.

Populate the shared output field from the straight fitter's ordinary
NDF. Keep the field-on weighted-NDF assignment unchanged.
@yugotra
yugotra marked this pull request as ready for review November 12, 2026 16:14

@tongtongcao tongtongcao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good finding. When update tracking with DAF, we updated NDF for non-straight case, but missed to do the same update for straight case.

@tongtongcao
tongtongcao merged commit 62a9385 into development Nov 12, 2026
26 checks passed
@tongtongcao
tongtongcao deleted the fix/dc-straight-track-ndf branch November 12, 2026 16:30
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.

2 participants