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

Correct observable definitions #44

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

JPorron
Copy link
Contributor

@JPorron JPorron commented Apr 10, 2024

JPorron Ok: 8 Powered by Pull Request Badge

Corrected way to find some observables.

These observables are found using the function (example for the first of the changes) XZ_YZ_SigmaXYBalance, that previously used as input energiesY[0].first. This can, however, differ as the map energiesY is sorted and these values will change (energiesY[0].first can be 4, for example). The way the function is defined XZ_YZ_SigmaXYBalance[i] = (XZ_SigmaX[energiesX[i].first] - YZ_SigmaY[energiesY[i].first]) / (XZ_SigmaX[energiesX[i].first] + YZ_SigmaY[energiesY[i].first]); i will be 4 in this example and will call XZ_SigmaX[energiesX[4].first] instead of the desired XZ_SigmaX[energiesX[0].first] that will correspond to the highest energy track, while XZ_SigmaX[energiesX[4].first] is the 4th highest energy one. This gives a wrong result for the MaxTrack and problems can arise when there is a different number of tracks in X and Y.

@JPorron JPorron requested a review from DavidDiezIb April 10, 2024 08:21
@DavidDiezIb
Copy link
Member

Are you sure these EnergiesY is not sorted in energy? I used this to extract the ID of the signal with EnergiesY[].first, so if the map is sorted, in EnergiesY[0] you have the maximum energy.

@JPorron
Copy link
Contributor Author

JPorron commented Apr 10, 2024

EnergiesY is sorted in energy, then when you do energiesY[0].first you get the trackID of the maximum energy track (4 in my example). The thing is, the observable was defined as "SetObservableValue("MaxTrack_XZ_YZ_SigmaXYBalance", XZ_YZ_SigmaXYBalance[energiesY[0].first]);", so XZ_YZ_SigmaXYBalance[4] but the XZ_YZ_SigmaXYBalance map that was found before has a certain dimension depending on the number of tracks in X and Y (the smaller of both) that is also sorted in energy, but the maximum energy track is the index 0 of the map XZ_YZ_SigmaXYBalance[0].

@DavidDiezIb
Copy link
Member

DavidDiezIb commented Apr 10, 2024

A, yes, definitely, you are right! The problem is in the computation of "balance" observables, I see

@JPorron JPorron merged commit ba87193 into master Apr 10, 2024
63 checks passed
@JPorron JPorron deleted the jporron-tracks2D-observable-correction branch April 16, 2024 10:28
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.

2 participants