atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

Bug fix in atdisable_6d: keep the Energy field in cavities. #654

Closed lfarv closed 10 months ago

lfarv commented 10 months ago

atdisable_6d removes the Energy field in all elements, including RF cavities. The Energy field is not used in cavity processing, however it is taken as the definition of the ring energy if there is no RingParam element. So this creates problems for rings without RinpParam element.

In this PR, the Energy field is kept only in RF cavities.

simoneliuzzo commented 10 months ago

I have tested atenable_6d and atdisable_6d with and without ringparam element. the command atenergy works. atlinopt/atlinopt6 also work.