RFCavity can be applied twice in ParallelCyclotronTracker
@frey_m and I have seen that sometimes a particle can see the same cavity twice in two consecutive steps. The cavity is applied if the particle crossed the cavity. If so then the last step is recalculated with the RF kick added. However, then it can happen that the new step doesn't cross the cavity completely and then the cavity is applied again. Example:
OPAL> ( -904.91 , -2521.4 , 0 ) OPAL> dist to cav before: 0.00073554 after: -6.3257e-07 OPAL> * Cavity FT1 Phase= 208.053 [deg] transit time factor= 0.892176 dE= -0.390086 [MeV] E_kin= 135.409 [MeV] Time dep freq = 1 OPAL> ( -904.21 , -2521.7 , 0 ) OPAL> dist to cav before: 2.7412e-07 after: -0.000735 OPAL> * Cavity FT1 Phase= 208.334 [deg] transit time factor= 0.891931 dE= -0.388959 [MeV] E_kin= 135.02 [MeV] Time dep freq = 1
We propose to add a flag such that the same cavity is not applied again in the next time step.