Fix: Small change to phi difference calculation in seed charge determination #1214
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.
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 atphi = + 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 have0.86%
seed charge misidentification now, compared to0.87%
previously.Thanks to @veprbl for pointing this out.
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
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