Skip to content

Retrieve t0 errors from LC relations #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2025

Conversation

mgignac
Copy link
Collaborator

@mgignac mgignac commented Aug 12, 2025

The t0Errs from the refit were clearly plagued with issues, and the logic as it stood would return in bogus time errors being propagated downstream. In various situations, the time error would be 1e8, infinity, etc...

In this PR, the fitted pulses are instead retrieved from an LC relations table. This makes consistent the errors with the t0 value. From quick tests, this seems to yield very reasonable numbers.

The previous code also ignored layer 0. It's unclear to me why that was done. The errors look fine to me from local tests.

Note, this will affect the track time as computed using the inverse time variance calculations:
#1089

@mgignac
Copy link
Collaborator Author

mgignac commented Aug 12, 2025

Originally noticed when looking into the track extension and checking hits and their errors:

Printing hit information...  Tstate is at : -34.699842112823376  Hit time -34.298499726411684  Hit time error 55.93156983549061
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -34.53685271271447  Hit time error 111.85676119564134
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -33.66232487287219  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -57.19257081424433  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -51.574242689211346  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -54.07755489252881  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -7.748431861866855  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -44.76704700843666  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -36.88944695023965  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -51.87961698908642  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -36.832175289909976  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -54.19200384563813  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.699842112823376  Hit time -34.298499726411684  Hit time error 55.93156983549061
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -34.53685271271447  Hit time error 111.85676119564134
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -33.66232487287219  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -57.19257081424433  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.63295171508809  Hit time -51.574242689211346  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -54.07755489252881  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -7.748431861866855  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -44.76704700843666  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -36.88944695023965  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -51.87961698908642  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -36.832175289909976  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.494290737628674  Hit time -54.19200384563813  Hit time error Infinity
 Printing hit information...  Tstate is at : -34.73104166724895  Hit time -36.82200219971874  Hit time error 7.916560917904031
 Printing hit information...  Tstate is at : -34.73104166724895  Hit time -9.954720167543615  Hit time error 0.11568914537169564
 Printing hit information...  Tstate is at : -34.73104166724895  Hit time -22.172193969459457  Hit time error 160.13898247866203
 Printing hit information...  Tstate is at : -34.73104166724895  Hit time -34.298499726411684  Hit time error 55.93156983549061
 Printing hit information...  Tstate is at : -35.512319721822145  Hit time -36.97799997184661  Hit time error Infinity
 Printing hit information...  Tstate is at : -35.512319721822145  Hit time -33.66232487287219  Hit time error Infinity
 Printing hit information...  Tstate is at : -35.512319721822145  Hit time -57.19257081424433  Hit time error Infinity
 Printing hit information...  Tstate is at : -35.512319721822145  Hit time -51.574242689211346  Hit time error Infinity
 Printing hit information...  Tstate is at : -35.20398724699715  Hit time -32.76978724491614  Hit time error 1.0E8
 Printing hit information...  Tstate is at : -34.856244389557006  Hit time -34.298499726411684  Hit time error 55.93156983549061```

@mgignac
Copy link
Collaborator Author

mgignac commented Aug 12, 2025

Comparing the original and new fits from the old code, they are quite different even when the refit doesn't fail:

Looping over raw tracker hits...
 Module layer: 2
  Original t0err  2.277134673929652 and new fit 2.9774530383716638
  Original t0  -42.85155892272291 and new fit -10.867559438112039
Looping over raw tracker hits...
 Module layer: 2
  Original t0err  2.4851667077374486 and new fit 11.04859308205198
  Original t0  24.515507608275026 and new fit 56.36173420972466
Looping over raw tracker hits...
 Module layer: 2
  Original t0err  2.495147108527078 and new fit 3.6181348521507743
  Original t0  57.84276135225685 and new fit 89.81746139395909
Looping over raw tracker hits...
 Module layer: 2
  Original t0err  2.497681912671055 and new fit 8.967356983446109
  Original t0  1.9998987345970456 and new fit 33.154906171853554
Looping over raw tracker hits...
 Module layer: 2
  Original t0err  9.977315159460375 and new fit 20.67615928931434
  Original t0  4.905591449833387 and new fit 36.22349706714897
Looping over raw tracker hits...
 Module layer: 2
  Original t0err  3.2573238773829587 and new fit 6.78073306097059
  Original t0  -37.292077410498656 and new fit -6.173285865266394
 Module layer: 2
  Original t0err  7.643859983091033 and new fit 15.540570251445843
  Original t0  -24.015504653638324 and new fit 7.002890080876682```

@rodwyer100
Copy link
Contributor

Hey Matt. One thing is that the global fit t0 may have been carried correctly. I never had a problem getting hit times to work and be carried over; I did get hit time errors having a problem and on my end I had some janky stuff I did (which I never pushed) to circumvent it. So you are right; the default would have bungled t0err and this is the proper fix for the errors. The issue I see with the times is that all the times are shifted by some default value (something close to 32 maybe) which I believe could very well be some global time shifting done in earlier steps that the lcio read in times does not do. In RawHitFitterDriver there are like 6 different timing corrections that are somewhat complicated (though typically come out to a net 30 ish ns) that you may skip by not using the original time. Nothing touches the time error in this, but I think it would be appropriate to use original time because I think that is propagated correctly. I would need to do some tests, but a simple test is plotting the track times and seeing what that looks like now

@rodwyer100
Copy link
Contributor

Looks like you didn't change how it draws time, so that should be fine I believe. I was just dubious about that new time list you gave for t0.

@rodwyer100
Copy link
Contributor

Wait something does modify the errors somewhere; I did some error changes to get the layer dependent chi squared distributions to look correct. That may bungle stuff here in ways similarly complicated to how t0 would be bungled if you used early versions of it.

@rodwyer100
Copy link
Contributor

rodwyer100 commented Aug 18, 2025

Looking at #1088, it seems that all the changes are done in RawFitHitterDriver and prior to clustering or later steps, and the fact you draw from "SVTFittedRawTrackerHits" (which I believe is the collection you get after this processor and not before) means it should be fine. Thats the only thing I think fiddles with time error stuff so I believe you can draw from it without concern that some fix wasn't applied (unlike the t0 thing).

@mgignac mgignac merged commit 6d23ae5 into JeffersonLab:master Aug 18, 2025
1 of 4 checks passed
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.

4 participants