Module simpa.acc

Class TurnObserver

java.lang.Object
simpa.acc.api.track.TurnObserver
All Implemented Interfaces:
TrackingObserver

public class TurnObserver extends Object implements TrackingObserver
An observer that counts the amount of turns a particle makes in the machine.
  • Constructor Details

    • TurnObserver

      public TurnObserver(ReferenceOrbit refOrbit, double radius, boolean backward)
      Parameters:
      refOrbit - - A reference orbit belonging to a circular machine or a transfer line.
      radius - - Radius of the observation plane. This should be big enough to cover the aperture, but smaller than the diameter of the machine, otherwise the particle trajectory would traverse two times the observation plane.
      backward - If true, the observer is placed at the first point of the orbit. This should be set true when tracking backward.
  • Method Details

    • observe

      public void observe(Particle p)
      Description copied from interface: TrackingObserver
      Observe the particle using this observer.
      Specified by:
      observe in interface TrackingObserver
      Parameters:
      p - - Particle to observe
    • getDisk

      public ObserverDisk getDisk()
      Returns:
      The observer disk
    • finish

      public void finish(Particle p)
      Description copied from interface: TrackingObserver
      Finishes the tracking of the given particle.
      Specified by:
      finish in interface TrackingObserver
      Parameters:
      p - the particle to stop tracking
    • getPrintPerTurns

      public int getPrintPerTurns()
      Gets the amount of turns before information is logged to the console.
      Returns:
      The amount of turns before information is logged to the console.
    • setPrintPerTurns

      public void setPrintPerTurns(int printPerTurns)
      Sets the amount of turns before information is logged to the console.
      Parameters:
      printPerTurns - The amount of turns before information is logged to the console.
    • getMaximumTurns

      public long getMaximumTurns()
      Returns:
      Returns the maximum number of turns after which the particle tracking ends. By default it is Long.MAX_VALUE
    • setMaximumTurns

      public void setMaximumTurns(long maximumTurns)
      Set the maximum number of turns. After this number the observer will set the terminated flag and the tracking for the particle ends.
      Parameters:
      maximumTurns -