-
Notifications
You must be signed in to change notification settings - Fork 33
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 atBunchLength #585
base: master
Are you sure you want to change the base?
Fix atBunchLength #585
Conversation
U0 = ringdata.eloss; | ||
sigdelta = ringdata.espread; | ||
bl0 = ringdata.blength; | ||
BL = bl0 * blgrowth(Ib,Zn,Vrf,U0,E0,h,alpha,sigdelta); |
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.
There are some possible optimizations here:
alpha -> mcf(disable_6d(ring))
energy, vrf, h -> atGetRingProperties
sigdelta, bl0 -> ohmi_envelope
U0 -> atgetU0(ring, 'method', 'tracking')
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.
On top of @swhite2401 proposal:
is6d
and alpha
are also available through atGetRingProperties
. Asking for is6d
, Vrf
, E0
, h
, alpha
and circ
in one call (before the if
test) minimises the number of passes through the lattice. Be careful to use the "single cell" attributes: cell_rf_voltage
, cell_harmnumber
, cell_length
.
You could also get both bl0
and sigdelta
from ringpara
and completely forget BunchLength
.
I was thinking to use mcf for alpha, but then it would be the on-energy value and I think here we need the off-energy one in case of off-energy lattice. |
@carmignani : |
@lfarv : I tried atx with a 6D lattice on-energy and with Delta frequency of 300 Hz and alpha returned by atx is exactly the same. |
@carmignani : I confirm, there is a bug in |
The problem, for a given 6D lattice, is to derive its off-momentum More: if the 6d lattice results from a Up top now, (in linopt6 I think) this was approximated by simply computing the 6d closed orbit and taking out the |
@lfarv, I would implement the correction at the lowest level such if similar issue exist in other function they are fixed as well. |
This means all functions needing the |
Ok understood, it would be nice to have this list of functions, and if they are used in core AT functions... double computations could be acceptable in ringparam that does need to be particularly fast for example but not in find_orbit |
Yes, of course… But I even ignored the existence of
|
atBunchLength now checks if the ring is 4D or 6D. If it is 4D, the needed parameters are computed with ringpara, if it is 6D they are computed with atx.
The function blgrowth has been separated from BunchLength, so it can be used by both BunchLength and atBunchLength.