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

Check energiesX #50

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Check energiesX #50

merged 3 commits into from
Nov 13, 2024

Conversation

JPorron
Copy link
Contributor

@JPorron JPorron commented Nov 11, 2024

JPorron Ok: 12 Powered by Pull Request Badge

@JPorron
Copy link
Contributor Author

JPorron commented Nov 11, 2024

In https://github.com/rest-for-physics/tracklib/pull/47/files a new observable "MaxTrack_XZ_OK" (same for YZ) was created to check if the max track and second max track had both X and Y contributions. Then, some observables were created:

image
Fig 1: Creation of the MaxTrack_XZ_OK observable and creation of new ones.

The condition to consider as OK or not the MaxTrack (same for SecondMaxTrack) is to check if energiesX is empty. However, this will never happen as energiesX will add a 0 if an element is added to energiesY (that way both will have the same dimension) and even if there are only energiesY, energiesX will be populated.

An example of where this has effect is here:

image
Fig 2: Observables of a event where MaxTrack_XZ_OK should be false.

MaxTrack_XZ_OK is set to be true, but we can see that there are no X-hits and, thus, no X-tracks and energiesX will not have any meaningful entry, but as energiesY does, then it is created and set to 0:

image
Fig 3: Two events, the first one is the one in Figure 2. We can see how energiesX (or Y) are filled with 0 if there is an element in energiesY (or X).

To solve the issue we must check if energiesX has a meaningful value, different to 0. In that case, there will be at least one hit in X and so at least one track.

@JPorron
Copy link
Contributor Author

JPorron commented Nov 11, 2024

It is checked if the final entry in energiesX (and Y) is different to 0. As they are sorted this final entry will be the biggest value, there might be several 0s due to tracks in Y, but if there is 1 different to 0 value there is at least 1 X-tracks.

For the secondMaxTrack the same logic is applied, checking if there are 2 different to 0 entries in energiesX (and Y)

@JPorron
Copy link
Contributor Author

JPorron commented Nov 11, 2024

For the same event, now the MaxTrackOK observable gives the expected FALSE, as there are no X-hits in the event:

image
Fig 4: New value of the observables.

@JPorron JPorron requested a review from lobis November 11, 2024 14:18
@JPorron
Copy link
Contributor Author

JPorron commented Nov 13, 2024

There was an error, the last value of the vector energiesX (and Y) was being inspected when the MaxTrack corresponds to the first value and the secondMaxTrack to the second. Adding some debugging print statements, for a certain event:

image
Fig 5: Values for a certain event.

image
Fig 6: Observables for this event. We can see how the OK observables are now correctly set, being FALSE tckAna2D_SecondMaxTrack_YZ_OK and tckAna2D_SecondMaxTrack_XZ_YZ_OK as there are no second Y-hits.

@lobis lobis merged commit 7808b06 into master Nov 13, 2024
64 checks passed
@lobis lobis deleted the jporron-TrackOK-observable-issue branch November 13, 2024 12:51
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