diff --git a/src/particles/elements/RFCavity.H b/src/particles/elements/RFCavity.H index 41ca1d946..f0337aed3 100644 --- a/src/particles/elements/RFCavity.H +++ b/src/particles/elements/RFCavity.H @@ -377,6 +377,14 @@ namespace RFCavityData zlen*sin_data[j]*cos(j*2*pi*z/zlen)/(j*2*pi); } } + else // endpoint of the RF, outsize zlen + { + efieldint = std::copysign(z, z)*zmid*0.5_prt*cos_data[0];; + for (int j=1; j < m_ncoef; ++j) + { + efieldint = efieldint - zlen*sin_data[j]*cos(j*pi)/(j*2*pi); + } + } return std::make_tuple(efield, efieldp, efieldint); }