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

Add bunch monitor for longitudinal coordinates #504

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

eccortes95
Copy link
Contributor

Description

Closes # .

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

@eccortes95
Copy link
Contributor Author

eccortes95 commented Jun 12, 2024

@eltos I added a carbon copy of your monitor, only with the longitudinal coordinates. Is there any setter in xtrack for the revolution frequency ?

@eltos
Copy link
Member

eltos commented Jun 12, 2024

I think the python file got mixed up with the h-file. Can you set this PR to draft for time being?

double const beta0 = LocalParticle_get_beta0(part);

// compute sample index
int64_t slot = round( harmonic * ( (at_turn-start_at_turn) - frev * zeta/beta0/C_LIGHT ));
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking maybe you could use the circumference line.get_length() instead to simplify the slot calculation.
In principle, the zeta correction is not required if the monitor is only used for bunched beams and h≥1. But I think it's good to keep to properly handle RF gymnastics like de- and re-bunching.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, maybe it could be useful in the future.

@eccortes95 eccortes95 marked this pull request as draft June 12, 2024 10:38
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