-
Notifications
You must be signed in to change notification settings - Fork 29
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 a "turn" input to atpass #376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this is necessary!
I have a question: what happens if we input the wrong counter, i.e. if |
Wouldn't it be more convenient to have an input argument |
The way the absolute path length is computed is:
The location of the cavity along the circumference does not matter when β=1: the time reference for a cavity at any location is the passage of the reference particle. So if you enter a wrong turn number,
Looking at the examples given for DA computation or Hassinski, a |
Added a So now one can choose between: for turn in range(100):
lattice_pass(ring, particle, nturns=1, turn=turn) and: lattice_pass(ring, particle, nturns=1)
for turn in range(1,100):
lattice_pass(ring, particle, nturns=1, keep_counter=True) |
Any more comment ? |
All good for me |
Until now, the default passmethod for cavities is
CavityPass
. #372 (pending) will change it forRFCavityPass
.Unlike
CavityPass
,RFCavityPass
can handle multi-turn tracking with a RF frequency different from nominal. For this, it has to compute the total path length since the beginning of tracking ("turn 0"). This is done by internally maintaining a "turn counter". This has a drawback: since the turn counter is set to zero on each call toatpass
, splitting a long tracking is wrong. A statement like:is correct, but the sequence:
is wrong because the turn counter is reset to zero, thus re-synchronising the particle with the RF on each turn. The same applies to the Matlab equivalent
ringpass
. In such a case, we are back to the behaviour ofCavityPass
!This PR adds a new keyword
turn
tolattice_pass
, allowing to handle the "turn counter" externally, so that the sequence:is now correct.