Skip to content

Conversation

@lnevay
Copy link
Contributor

@lnevay lnevay commented Nov 11, 2025

The ring distribution is a spatial ring only with no xp, yp distribution. Here, I'm adding the ability to optionally give a lower and upper rp and a uniform ring of angles will be created. Can be used for a single value also by setting both min and max to the same value. By default, it's 0 and it reproduces the old behaviour with the same number of random number generator calls as before so it will be reproducible. Beam class data version updated too.

stewartboogert

This comment was marked as duplicate.

Copy link
Collaborator

@stewartboogert stewartboogert left a comment

Choose a reason for hiding this comment

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

Not really sure of the logic of nonZeroRp and generateRp

Rest of the code looks good. Just seems a little complex to understand this important aspect

rpMin = beam.Rpmin * CLHEP::rad;
rpMax = beam.Rpmax * CLHEP::rad;
nonZeroRp = rpMin > 0 || rpMax > 0;
generateRp = rpMin != rpMax;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this generate if rpMin and rpMax are non-zero and equal

If only one single, non-zero, value of Rp is required, both Rpmin and Rpmax
should be set to the same value.

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