Skip to content

build: replace org.jlab.plugins:trackfitter - #1501

Merged
c-dilks merged 1 commit into
developmentfrom
mvn-rm-trackfitter
Oct 13, 2026
Merged

c-dilks merged 1 commit into
developmentfrom
mvn-rm-trackfitter

Conversation

@c-dilks

@c-dilks c-dilks commented Oct 12, 2026

Copy link
Copy Markdown
Member

We are only using its LineFitter, LineFitPars, and ProbChi2perNDF.

Here is a repository showing the decompiled JAR file (you must be signed in): https://code.jlab.org/dilks/jarchaeology-trackfitter

LineFitter & LineFitPars

These classes are only consumed by the reconstruction/dc module, which has its own versions of these classes already.

The decompiled trackfitter version is practically the same as our dc module's version; however, trackfitter's LineFitter.fitStatus method has double[] parameters, whereas our dc module's version has List<double> parameters, and both of these signatures are in use in practice in the dc. I'm not sure which one is actually called more often at runtime, but the double[] version is more commonly written in the source code calls.

I changed the dc module's LineFitter.fitStatus method to take double[] parameters, rather than List<double> parameters, and added an overload that takes List<double> parameters; this is more efficient than overloading the other way around since it avoids boxing in any hot loop.

ProbChi2perNDF

This class does not appear to be implemented anywhere in coatjava. I rewrote the decompiled version of this function using apache's common-math3 in a new local class with the same name, and put it in the common-tools/clas-tracking module. The edge-case handling remains the same, and is actually consistent with ROOT's TMath::Prob function.

For comparison, see the decompiled ProbChi2perNDF, which depends on ErrorFunction and GammaFunction (also within trackfitter).

Additional Changes

I also removed dead code and resolved some warnings; unused code that seems non-trivial is commented out, rather than removed.

@tongtongcao

Copy link
Copy Markdown
Collaborator

Use first 1000 events from RGK run 19331 for test.
For central, all tracks before and after are exactly the same.
For forward, 1571 tracks are reconstructed for both before and after update. Among them, 1567 tracks are exactly the same, while 4 tracks are different.
With valid cuts of vz [-15, 5] cm, p > 0.5 GeV and |chi2pid| < 3, 1149 valid tracks are remained for both before and after update. All valid tracks are exactly the same.
It means that the 4 different tracks are eliminated by valid cuts.

@c-dilks

c-dilks commented Oct 13, 2026 •

Copy link
Copy Markdown
Member Author

What are the differences of those 4 tracks?


@tongtongcao says:

I call back my conclusion. The 4 tracks are actually the same as well.
My analysis code compares tracks event by event.
Matched tracks require all hits are exactly the same.
But I just checked my code. There is another condition that requires matched tracks include at least 18 hits.
Hits on the 4 tracks are lower than 18. So they were regarded as unmatched.
Sorry for the confusion.

@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.

Before and after the update, we got exactly the same tracks from both forward and central reconstruction.

@baltzell baltzell added this to the Pass 3 milestone Oct 13, 2026
@c-dilks
c-dilks force-pushed the mvn-rm-trackfitter branch from 7108ff4 to 11d6a31 Compare October 13, 2026 20:20
@c-dilks
c-dilks enabled auto-merge (squash) October 13, 2026 20:20
@c-dilks
c-dilks disabled auto-merge October 13, 2026 20:32
@c-dilks
c-dilks merged commit 14510e6 into development Oct 13, 2026
25 checks passed
@c-dilks
c-dilks deleted the mvn-rm-trackfitter branch October 13, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants