Module simpa.acc

Class PhaseSpaceObserver

java.lang.Object
simpa.acc.api.track.PhaseSpaceObserver
All Implemented Interfaces:
TrackingObserver
Direct Known Subclasses:
TLPhaseSpaceObserver

public class PhaseSpaceObserver extends Object implements TrackingObserver
Observer that can be added to a particle tracking task for observation of the phase space coordinates when it passes the observer disk.
  • Constructor Details

    • PhaseSpaceObserver

      public PhaseSpaceObserver(ReferenceOrbit orbit, int orbitIndex, double radius, double nominalMomentum, boolean backward)
      Constructs a disk with the given radius at the given index of the reference orbit and writes the particle's phase space coordinates into the given file each time it is going through the disk.
      Parameters:
      orbit - The reference orbit.
      orbitIndex - The index of the orbit point at which the observer will be added.
      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.
      nominalMomentum - The nominal momentum.
      backward - Must be set true when tracking backward.
    • PhaseSpaceObserver

      public PhaseSpaceObserver(double longitudinalPos, double radius, double nominalMomentum, ReferenceOrbit orbit, boolean backward)
      Constructs a disk with the given radius at the longitudinal position and writes the particle's phase space coordinates into the given file each time it is going through the disk.
      Parameters:
      longitudinalPos - Longitudinal position of the observation plane
      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.
      nominalMomentum - The nominal momentum in [GeV/c].
      orbit - The reference orbit.
      backward - Must be set true when tracking backward.
  • Method Details

    • getFlushPerTurns

      public static int getFlushPerTurns()
      Gets the amount of turns between flushes.
      Returns:
      The amount of turns between flushes.
    • setFlushPerTurns

      public static void setFlushPerTurns(int fpt)
      Updates/sets the amount of turns between flushes.
      Parameters:
      fpt - The amount of turns per flush.
    • observe

      public void observe(Particle p)
      Observes the location and angle of the particle as it passes through the disk.
      Specified by:
      observe in interface TrackingObserver
      Parameters:
      p - Particle to observe
    • 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
    • getDisk

      public ObserverDisk getDisk()
      Gets the disk of this PhaseSpaceObserver
      Returns:
      ObserverDisk
    • getOutDirectory

      public String getOutDirectory()
      Gets the output directory.
      Returns:
      Local path of the output directory.
    • setOutDirectory

      public void setOutDirectory(String outDirectory)
      Sets the output directory.
      Parameters:
      outDirectory - The output directory.
    • getLongitudinalPosition

      public double getLongitudinalPosition()
      Returns:
      The longitudinal position of the observer along the reference orbit [m].
    • getPhaseSpaceCoordinates

      public PhaseSpaceCoordinates getPhaseSpaceCoordinates(org.apache.commons.math3.geometry.euclidean.threed.Vector3D is, Particle p)
      Gets the phase space coordinates.
      Parameters:
      is -
      p - particle
      Returns:
      The phase space coordinates.