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

Fix: Small change to phi difference calculation in seed charge determination #1214

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

bschmookler
Copy link
Contributor

Briefly, what does this PR introduce?

Essentially changes this line

if(dphi > M_PI) dphi = 2.*M_PI - dphi;

to
if(dphi > M_PI) dphi = dphi - 2.*M_PI;

This will affect a seed where, for example, the first hit is at phi = - 179.5 degrees and the second hit is at phi = + 179.5 degrees. In the prior version, dphi = 360 - 359 = +1 degrees, returning a positive charge. Now it will correctly return a negative charge.

This has a very small overall effect. For 10k single muons generated from (x,y,z) = (0,0,0) with eta [-4,4] and p = [0.5,20] GeV/c, we have 0.86% seed charge misidentification now, compared to 0.87% previously.

Thanks to @veprbl for pointing this out.

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No

Does this PR change default behavior?

Yes, change affects seed charge calculation for a small number of seeds

@github-actions github-actions bot added the topic: tracking Relates to tracking reconstruction label Jan 11, 2024
Copy link
Contributor

@osbornjd osbornjd left a comment

Choose a reason for hiding this comment

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

No suggestions, looks good

@osbornjd osbornjd added this pull request to the merge queue Jan 11, 2024
Merged via the queue into main with commit 5c34f24 Jan 11, 2024
73 checks passed
@osbornjd osbornjd deleted the seed_charge_phidiff branch January 11, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: tracking Relates to tracking reconstruction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants