SegmentLinking / TrackLooper

Apache License 2.0
5 stars 15 forks source link

Negative pT estimations messing up final TC pT #226

Closed VourMa closed 1 year ago

VourMa commented 1 year ago

As discussed briefly in our chat, I have noticed negative pT values for track candidates. Even though people said that this was a known "feature", just resulting in a opposite sign for the pT, indicating the charge of the track, I think this is not the case.

Taking a look at the code for pT5, I see that we take the average of two different pT estimations: https://github.com/SegmentLinking/TrackLooper/blob/master/code/core/write_sdl_ntuple.cc#L263-L265

Depending on the configuration of the hits on the modules, both pT estimations can be positive or negative and that is consistent with the initial explanation of the "feature". However, it can also be that one is positive and one is negative, leading to an average that makes no sense. Discussing with Slava on this effect, it turns out that it is significant starting at ~10 GeV.

A potential fix to this was introduced in PR #224, where the absolute of each pT estimation is taken. Cross-checking the results, the pT values are the same for previously positive pT values but can vastly differ for previously negative pT values. I double-checked that there is no other bug injected in these calculations by inverting my fix, and I get 100% agreement for all pT values.

Once PR #224 is reviewed and if the fix is deemed to be appropriate, I think we should propagate it to the standalone code as well. I know the topic of pT estimations is something that @bsathian is currently investigating, so we should probably coordinate on this.

VourMa commented 1 year ago

Taken care of in #212