Skip to content

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

Open
c-dilks wants to merge 1 commit into
developmentfrom
mvn-rm-trackfitter
Open

c-dilks wants to merge 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.

This branch has not been deployed

No deployments
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.

3 participants