Skip to content

Adding protection for straight MFT tracks, to prevent divison by zero#7762

Merged
jgrosseo merged 3 commits intoAliceO2Group:devfrom
sarahherrmann:branchSarah
Dec 3, 2021
Merged

Adding protection for straight MFT tracks, to prevent divison by zero#7762
jgrosseo merged 3 commits intoAliceO2Group:devfrom
sarahherrmann:branchSarah

Conversation

@sarahherrmann
Copy link
Copy Markdown
Contributor

No description provided.

@sarahherrmann sarahherrmann requested a review from a team as a code owner November 29, 2021 13:09
Copy link
Copy Markdown
Member

@ktf ktf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgrosseo and @aalkin should probably comment, but shouldn't we just avoid the division in that case and multiply by the provided 1/Pt? Where is this used?

@jgrosseo
Copy link
Copy Markdown
Collaborator

jgrosseo commented Dec 2, 2021

This is in principle fine. Of course alternatively we could consider to fill 1/pt with a very large number for straight tracks instead of 0. What do you think about this?
Tagging also @rpezzi

@sarahherrmann
Copy link
Copy Markdown
Contributor Author

Hi ! Anton and Rafael are actually already aware of this proposal of modification (they were the ones that suggested me to do that for MFT tracks), and I don't know for the provided 1/Pt question sorry

@rpezzi
Copy link
Copy Markdown
Collaborator

rpezzi commented Dec 2, 2021

Hi, I am OK with the current implementation.

@jgrosseo
Copy link
Copy Markdown
Collaborator

jgrosseo commented Dec 2, 2021

OK, thanks.

Last question: did you try to use Almost0 instead of the hard-coded small float value? Is Almost0 too small? Do we need a second constant?

@sarahherrmann
Copy link
Copy Markdown
Contributor Author

I didn't try Almost0, I didn't know it existed. I will try it

@rpezzi
Copy link
Copy Markdown
Collaborator

rpezzi commented Dec 2, 2021

Indeed Almost0 is more appropriate. It is safe for a floating point division by Almost0:

1.f/o2::constants::math::Almost0
(float) 8.50709e+37f

@jgrosseo jgrosseo enabled auto-merge (squash) December 2, 2021 15:43
@jgrosseo jgrosseo merged commit 8f162c2 into AliceO2Group:dev Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants