## 2 Deflecting Cavity Design
### Particle Tracking Simulation  
Figure 5 shows the design of the beamline to measure the electron beam bunch length of the miniaturized 150 kV DC photocathode gun. To evaluate the performance of the deflecting cavity, the simulation of bunch length measurement is carried out in General Particle Tracer (GPT) [23]. In this paper, the integrated deflecting voltage is calculated as  
\[V_{def}=\frac{\Delta p\times v}{q}=\int\ [E_{y}(z)e^{ikz/\beta}+j\beta cH_{x}(z)e^{ikz/ \beta}]dz \tag{5}\]  
where \(E_{y}\) is the electric field intensity in vertical direction, \(H_{x}\) is the magnetic field intensity in horizonal direction. As the electron bunch energy is so low, the bunch is susceptible to the deflecting field and the longitudinal electric field when it is passing through the deflecting cavity. The former deflects the bunch as expected, but the later complicates the measurements. As the electron bunch has a finite transverse dimension of which the center is located along the cavity axis at the entrance, its upper and lower part sees the longitudinal electric field in opposite directions resulting in the increase of the energy spread and bunch lengthening. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Design Value** \\ \hline Beam energy \(E\) [keV] & 150 \\ Operation frequency\(f\) [MHz] & 1300 \\ Transverse shunt impedance \(R_{\perp}\) [M\(\Omega\)] & 0.98 \\ Quality factor \(Q_{0}\) & 19,500 \\ RF input power \(P\) [kW] & 2.6 \\ Deflecting voltage \(V_{def}\) [kV] & 50 \\ Expected temporal resolution \(\Delta_{\text{f}}\) [fs] & \textless{}200 \\ The frequency of \(\pi\)-mode in y-direction [MHz] & 1299.93 \\ The frequency of \(\pi\)/2-mode in y-direction [MHz] & 1312.69 \\ The frequency of 0-mode in y-direction [MHz] & 1335.19 \\ The frequency of \(\pi\)-mode in x-direction [MHz] & 1311.33 \\ The frequency of \(\pi\)/2-mode in x-direction [MHz] & 1317.71 \\ The frequency of 0-mode in x-direction [MHz] & 1352.87 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Design parameters of the deflecting cavity. Figure 5: The design of the bunch length measurement beamline. In addition, this effect will be aggravated with the space charge effect (SCE) making the transverse and longitudinal size larger and the electron bunch being kicked up as well as having a transverse offset. However, under the situation of low charge the SCE has little effect on result. The electron beam distribution in 6D phase space generated by ASTRA [24] is used as the source for the GPT simulation. According to the ASTRA internal plateau distribution model, the bunch is generated from initial conditions set and the initial average kinetic energy of the total electron bunch is 0.9 eV with energy spread 0.63 eV. The initial RMS length of the plateau bunch is 6.05 ps with 0.42 mm transverse diameter after driving laser shaping. The normalized emittance calculated value of a cesium potassium antimonide photocathode is \(\sim\)0.134 mm-mrad according to the thermal emittance measurement result of 0.56 mm-mrad/mm (@532 nm) at JLab [25]. Electron bunch with certain low charges are simulated and Table 3 shows the plateau bunch simulation results. The simulated bunch length without SCE is 6.05 ps at the center of the cavity which is basically consistent to original value. According to Table 3, when the charge is lower than 100 fC, the SCE can be basically ignored. Therefore, to accurately measure the bunch length with low energy of 150 keV, the electron beam should be with a low charge density in the situation of low charge. Furthermore, the best resolution of the system is 590 fs with bunch charge of 50 fC and solenoid focus intensity of 214 Gauss. From the simulation with different charge, when the electron bunch enters the cavity center at zero phase, all the transverse offsets of the average trajectory at the exit of cavity is about 2.79 mm. With the transverse offset, the average kinetic energy is increased from 150 keV to 151.5 keV due to the longitudinal electric field.