-
Notifications
You must be signed in to change notification settings - Fork 1
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
NaN Values in rzChiSquared Variables #95
Comments
Yes, I think it is known because if a track lays exactly on one line, we cannot build circles and calculate radius according to it, so the helix r-z chi2 returns NaN. There is some special treatment for the NaN tracks if pT>100. There could be still remaining tiny portion of tracks having NaN, but won't affect much I think.
|
The code that you linked though is "or" though right, not "and"? So even if the inner_pt is under 100 but the rzChisquared is NaN then it would still trigger that if statement? So the NaN tracks must be dealt with somewhere else if some are getting through? |
I guess if it falls into one of these if statements afterwards then the track is not rejected? Since the if statement with a NaN will return false always and that's probably how these NaN tracks are getting through? This doesn't seem like well defined behavior though. Edit: Or I guess the tightCutFlag would be false still, so these tracks would get rejected still? If that's the case, I'm confused how any NaN values could get through. Looking at the code you linked, I see any NaN's prior to that if statement would return false so it must occur after? cmssw/RecoTracker/LSTCore/src/alpaka/Quintuplet.h Lines 662 to 666 in ff8446c
|
@slava77 Does it make sense to allow numbers to go NaN in our code and handle it through the is_nan check? Or should we always check before relevant division etc. that it won't produce nan? |
checking everywhere will have a cost. For DNN purposes it makes sense to go upstream and fix NaNs if possible. If NaNs are problematic for training, it's more practical to clamp all values to something sensible. |
I just checked and there are no NaN's being passed to addQuintupletToMemory. It's only when the results are being read in write_lst_ntuple.cc that the NaN's show up, so something must be going wrong...:
|
As a follow-up on the skype conversation, the reason this occurs is that when fast math is enabled the is_nan checks in Quintuplet.h are disabled, leading to NaN's in the output ntuple. |
On an 1000 event sample from the PU200RelVal sample I noticed that there were some NaN values for the t5_rzChiSquared and pt5_rzChiSquared variables in the output ntuple. @YonsiG or anyone else, is this expected?
The text was updated successfully, but these errors were encountered: