Drift and Lens¶
The output of GPos showed that secondary particle beams overlap the primary beam longitudinally, but have lower mean energies. To spatially separate the beams, it is advantageous to propagate them in vacuum for given drift distances. That propagation leads to the slower and higher divergence secondaries being lost transversely unless a focusing lens is introduced.
This section includes the main derivation of the drift and thin lens models implemented in PartBeams::Drift ().
Warning
The S.I. system of units is applyed throughout this derivation. Conversion to the Geant4 system of units used in GPos is described in S.I. to Geant4.
The lens is tuned to deflect an ideal particle trajectory back to its original transverse position, as illustrated in Fig. 5 (green arrows). The optical object (particle initial) longitudinal position is at \(z=-d_{o}\), the lens is fixed at \(z=0\), and the image (particle final) position is at \(z=+d_{i}\).
Fig. 5 Schematics of the propagation of ideal (green arrows) and realistic (blue arrows) particles through a thin focusing lens (purple region), along the propagation (horizontal) and transverse axis (vertical).¶
Note
The particle motion follows the same principles in the two transverse directions \(x_{\perp} = x,y\), so the derivations below are generalized to \(x_{\perp}\).
The thin lens model corresponds to applying linear, transverse, discrete focusing or defocusing fields (Dirac delta functions) that can be represented by \(E_{\perp} = \frac{k x_{\perp}}{e}\). Those fields act on particles through the Lorentz force, \(F\), which can be integrated about the lens position, \([0-,0+]\), to yield:
where the particle charge, momentum, velocity and positions are labeled as \(q, p, v\) and \(x\), \(t\) is the time variable, and \(e\) is the electron unit charge.
The transverse motion of each particle can be computed from its momentum as:
The ideal particle momentum is reflected by the lens so that it reaches its initial transverse position after \(z = d_{i} = d_{o}\). Combining the previous equations for that particle allows to determine the general lens strength factor, \(k\):
Making the approximation that the initial transverse displacement is negligible, i.e. \(x_{\perp}(o) \ll x_{\perp}(0)\), and including the Lorentz relativistic factor \(v_{z} = \beta_{z} c \approx \sqrt{1-\frac{1}{\gamma^2}} c\), where \(c\) is the speed of light in vacuum, the factor \(k\) can be re-writen as:
where \(m\) is the particle mass.
The lens is then uniquely described by the longitudinal momentum of the ideal particle it is tuned to focus, \(\gamma\), and its intial distance to the particle, \(d_{o}\).
Warning
The lens implemented in GPos aims to focus positrons, so negatively charged particles (such as electrons) are defocused by it because of the \(\frac{q}{e}\) factor.
This can be easily changed by removing the minus sign in the factor definition used in PartBeams::Drift ().
Using the above equations and resorting to the matrix formalism, we can write the particles properties when they reach the lens as:
In the lens, the particle position is kept constant and the momentum is transformed according to:
Due to the lack of longitudinal forces, the longitudinal momentum is a constant of motion, \(p_{z}(0+)=p_{z}(o)\). For an ideal particle there is no energy loss or gain because the transverse momentum were simply mirrored. For the other particles, the energy is updated to account for the new transverse momentum variation, \(\gamma (0+) = \sqrt{1.0+\left(p_{x}^2+p_{y}^2+p_{z}^2\right)/m^{2}c^{2}}\) and the associated velocities become \(v (0+) =p(0+) /\gamma m\).
In GPos, particles were propagated ballistically from the lens until the fastest particle reached the user-defined drift distance, i.e. for \(t_{drift} - t_{lens} = d_{drift}/v_{z}(0+) - d_{o}/v_{z}(o)\). If, instead of capturing the particle data at that instant, we had collected all of them, for example in a detector, at a fixed distance of \(z=d_{i}\), their position and momentum would be described by:
The focal distance, \(f\), of the lens varies according to \(\gamma\) and we can find it by verifying the imaging condition of the matrix above:
which can be reduced to \(f = - \frac{v_{z}p_{z}}{k} = \frac{d_{o}}{2}\), in the case of the ideal particle.
S.I. to Geant4¶
Below is the list of correspondence between the units used in GPos (that keeps Geant4’s conventions) and S.I.:
Since the momentum is expressed in energy units in GPos, a factor of \(c\times10^{-6}\) is required in the matrix entries below:
Testing¶
Fig. 2 shows the impact of the thin lens on the trajectory of positrons in the example case studied in Sec. Results.
The validation of the drift and lens calculations implemented in the source code is done against results from the Python scripts contianed in the example folder.
Please make sure to verify and replicate changes done to the source code with those python scripts.
Warning
The drift and lens validation is done authomatically by the GitHub linux workflow for every Push and PR to the GPos repo.