MatLUT: faster phi-sector determination; reduction of divisions#12030
Merged
shahor02 merged 2 commits intoOct 20, 2023
Conversation
Following ticket https://alice.its.cern.ch/jira/browse/O2-4170, Profile analysis has shown that material budget calculations used in tracking, spent most time in (a) determination of a cylindrical layer (b) determination of a phi sector in a layer This commit proposes an improvement for (b): - Instead of using system function phi = atan2(y, x), we use a faster - approximate version. We can do this, since we never need to use the precise result of phi in a calculation. Instead, phi is merely used to lookup a slice/sector. The error of the approximate version is ~1e-5, which is enough to get the correct phi sector in 99.999 of the cases. (Rare cases, where we end up in a wrong neighbouring phi sector are probably ok ... since the material budget lookup is anyways an approximation.) In addition, we propose a smaller code mofication for ray.CrossZ to reduce the number of divisions and if statements. A previous check for ray orthogonal to z can not happen in the code since there is a previous condition `if (zID != zIDLast)`. ITS reco is shown to improve by ~15% in speed for larger PbPb MC timeframes (on Linux - tested on CC7 and Ubuntu22.04)
Collaborator
Author
|
WIP ... opened for discussion. |
Collaborator
Author
|
@shahor02 : Merge conflict resolved. Commits should be squashed when merging. |
christianreckziegel
pushed a commit
to LucasFerrandi/AliceO2
that referenced
this pull request
Nov 9, 2023
…eO2Group#12030) Following ticket https://alice.its.cern.ch/jira/browse/O2-4170, Profile analysis has shown that material budget calculations used in tracking, spent most time in (a) determination of a cylindrical layer (b) determination of a phi sector in a layer This commit proposes an improvement for (b): - Instead of using system function phi = atan2(y, x), we use a faster - approximate version. We can do this, since we never need to use the precise result of phi in a calculation. Instead, phi is merely used to lookup a slice/sector. The error of the approximate version is ~1e-5, which is enough to get the correct phi sector in 99.999 of the cases. (Rare cases, where we end up in a wrong neighbouring phi sector are probably ok ... since the material budget lookup is anyways an approximation.) In addition, we propose a smaller code mofication for ray.CrossZ to reduce the number of divisions and if statements. A previous check for ray orthogonal to z can not happen in the code since there is a previous condition `if (zID != zIDLast)`. ITS reco is shown to improve by ~15% in speed for larger PbPb MC timeframes (on Linux - tested on CC7 and Ubuntu22.04)
christianreckziegel
pushed a commit
to LucasFerrandi/AliceO2
that referenced
this pull request
Nov 9, 2023
…ns (AliceO2Group#12030)" This reverts commit 030e396.
leo-barreto
pushed a commit
to leo-barreto/AliceO2
that referenced
this pull request
Nov 16, 2023
…eO2Group#12030) Following ticket https://alice.its.cern.ch/jira/browse/O2-4170, Profile analysis has shown that material budget calculations used in tracking, spent most time in (a) determination of a cylindrical layer (b) determination of a phi sector in a layer This commit proposes an improvement for (b): - Instead of using system function phi = atan2(y, x), we use a faster - approximate version. We can do this, since we never need to use the precise result of phi in a calculation. Instead, phi is merely used to lookup a slice/sector. The error of the approximate version is ~1e-5, which is enough to get the correct phi sector in 99.999 of the cases. (Rare cases, where we end up in a wrong neighbouring phi sector are probably ok ... since the material budget lookup is anyways an approximation.) In addition, we propose a smaller code mofication for ray.CrossZ to reduce the number of divisions and if statements. A previous check for ray orthogonal to z can not happen in the code since there is a previous condition `if (zID != zIDLast)`. ITS reco is shown to improve by ~15% in speed for larger PbPb MC timeframes (on Linux - tested on CC7 and Ubuntu22.04)
leo-barreto
pushed a commit
to leo-barreto/AliceO2
that referenced
this pull request
Nov 16, 2023
…ns (AliceO2Group#12030)" This reverts commit 030e396.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following ticket https://alice.its.cern.ch/jira/browse/O2-4170,
profile analysis has shown that material budget calculations used in tracking, spent most time in
(a) determination of a cylindrical layer
(b) determination of a phi sector in a layer
This commit proposes an improvement for (b):
Instead of using system function phi = atan2(y, x), we use a faster - approximate version. We can do this, since we never need to use the precise result of phi in a calculation. Instead, phi is merely used to lookup a slice/sector. The error of the approximate version is ~1e-5, which is enough to get the correct phi sector in 99.999 of the cases.
(Rare cases, where we end up in a wrong neighbouring phi sector are probably ok ... since the material budget lookup is anyways an approximation.)
In addition, we propose a smaller code modification for ray.CrossZ to reduce the number of divisions and if statements.
A previous check for ray orthogonal to z can not happen in the code since there is a previous condition
if (zID != zIDLast).ITS reco is shown to improve by ~15% in speed for larger PbPb MC timeframes (on Linux - tested on CC7 and Ubuntu22.04)