Skip to content
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

Patching to ECAL lin-reg tracking #1407

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Patching to ECAL lin-reg tracking #1407

merged 1 commit into from
Aug 29, 2024

Conversation

tvami
Copy link
Member

@tvami tvami commented Aug 25, 2024

I am updating ldmx-sw, here are the details.

What are the issues that this addresses?

This resolves #1405
Several approaches were tried, in the end I'm cleaning up the input to the matrix to be decomposed, and making sure that the determinant is non-zero.
While digging into this I denote many potential improvements in the code.

Check List

  • I successfully compiled ldmx-sw with my developments
  • I ran my developments and the following shows that they are successful.

@tvami
Copy link
Member Author

tvami commented Aug 25, 2024

OK, I'll move this back to "draft", the signal (right) looks way to much like background (left) now.
So I'll have to look into this in more details
Screenshot 2024-08-25 at 16 34 27

@tvami tvami marked this pull request as draft August 25, 2024 23:35
@tvami
Copy link
Member Author

tvami commented Aug 26, 2024

I'm getting there, still not the best
Screenshot 2024-08-26 at 08 35 34

@tomeichlersmith
Copy link
Member

How are you defining best? If you are cutting out singular matrices, could there be some lin-reg tracks "found" that were just "found" due to numerical instability of a singular matrix? I could see this effect being very distinct in the signal case where the ECal as a whole is fairly quiet.

@tvami
Copy link
Member Author

tvami commented Aug 26, 2024

Yes but we have more tracks now in signal! (blue is new red is old, right?)
So the changes seeing here are a bit counter-intuitive, how does removing singular matrices lead to more tracks?
Also I want to measure how it affect the other masses, I have a student Jihoon looking into that part now.

@tomeichlersmith
Copy link
Member

ah yes, you're right - that is suspicious.

@tvami tvami force-pushed the iss1405-TDecompSVD-Err branch from 1de8fe3 to 63bb707 Compare August 28, 2024 19:33
@tvami tvami force-pushed the iss1405-TDecompSVD-Err branch from 1fef2d9 to e6c6935 Compare August 29, 2024 17:50
@tvami tvami changed the title Fix TDecompSVD convergence in EcalVeto Patching to ECAL lin-reg tracking Aug 29, 2024
@tvami tvami marked this pull request as ready for review August 29, 2024 17:51
@tvami
Copy link
Member Author

tvami commented Aug 29, 2024

Gosh... I'm ready for review, but there is waaay to many things to improve on this part of the code. My approach is to make something minimally sensible now, and add // TODO to the point that needs to be improved. This can be a project for an undergrad (I'm sure we'll find somebody at UCSB).

As for the physics in the version pushed now:
Screenshot 2024-08-29 at 10 55 09

Looks pretty good: we loose tracks (that were anyway nonsensical [hits from the same layer, exactly the same hits, inverting singular matrices....]), but we still have move tracks in the background case.

@tvami
Copy link
Member Author

tvami commented Aug 29, 2024

This can be a project for an undergrad

I'll make a reminder issue about this after we merged this

Copy link
Member

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

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

Looks good to me, I just have a cleanup 🧹 and a technical question 🤔

Ecal/src/Ecal/EcalVetoProcessor.cxx Show resolved Hide resolved
Ecal/src/Ecal/EcalVetoProcessor.cxx Show resolved Hide resolved
@tvami tvami requested a review from tomeichlersmith August 29, 2024 18:10
@tvami
Copy link
Member Author

tvami commented Aug 29, 2024

Funny thing is that the KS score is not big enough for the signal to even flag the change:

Screenshot 2024-08-29 at 12 22 20

@tomeichlersmith
Copy link
Member

tomeichlersmith commented Aug 29, 2024

Yea, KS testing is somewhat weighted by the bin content and so the fact that 0 lin-reg tracks are very close for a vast majority of events means that the KS test value will be above our arbitrary threshold.

(In a perfect world, we would do a full comparison of the events with something like root-diff and then make histograms if any change cropped up there. The limiting thing in this case is storing the golden event files or implementing the complex workflow to re-generate them everytime.)

Edit: The N Lin-Reg Tracks distribution is also closer in the PR validation sample. Not sure why this is but could be from using different samples.
EcalMipTrackingFeatures_EcalMipTrackingFeatures_n_linreg_tracks

@tvami
Copy link
Member Author

tvami commented Aug 29, 2024

The N Lin-Reg Tracks distribution is also closer in the PR validation sample.

Ahh no sorry, I think I introduced a mistake in the last push regarding the initialization of the r2

@tvami
Copy link
Member Author

tvami commented Aug 29, 2024

The N Lin-Reg Tracks distribution is also closer in the PR validation sample.

Ahh no sorry, I think I introduced a mistake in the last push regarding the initialization of the r2

False alarm
https://github.com/LDMX-Software/ldmx-sw/blob/117acb437eabca116030524eee056eefe1385228/Ecal/src/Ecal/EcalVetoProcessor.cxx#L1075C15-L1079
the requiremenet on r_corr > .6 makes it ok

@tvami tvami merged commit 9088c67 into trunk Aug 29, 2024
4 of 9 checks passed
@tvami tvami deleted the iss1405-TDecompSVD-Err branch August 29, 2024 20:42
@tvami tvami mentioned this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in <TDecompSVD::Diagonalize>: no convergence after XX steps
3 participants