Module simpa.acc
Package simpa.acc.api

Class ParticleFactory

java.lang.Object
simpa.acc.api.ParticleFactory

public class ParticleFactory extends Object
Factory for creating particles from Phase space coordinate data.
  • Constructor Details

    • ParticleFactory

      public ParticleFactory(ReferenceOrbit corbit)
      Sets up the factory with a reference orbit.
      Parameters:
      corbit - the reference orbit.
  • Method Details

    • getParticle

      public Particle getParticle(double p0InGeV, PhaseSpaceCoordinates phs, double longiPos, PotentialProvider afp, double mass, double charge) throws OutOfApertureException, KnownFatalException
      Gets a particle with the given data. We generate particles in a flat 5D beam, all particles are on the same longitudinal position.
      Parameters:
      p0InGeV - Momentum in GeV/c
      phs - Phase space coordinates.
      longiPos - The longitudinal position in meters along the orbit counted from the beginning of the orbit.
      afp - A potential provider to get the vector potential at the position of the particle
      mass - Mass [kg]
      charge - Charge [Coulumb]
      Returns:
      The particle created.
      Throws:
      OutOfApertureException - when the particle is out of aperture
      KnownFatalException - when an internal error happens.
    • getParticle

      public Particle getParticle(double p0InGeV, PhaseSpaceCoordinates phs, double longiPos, PotentialProvider pp, ParticleType type) throws OutOfApertureException, KnownFatalException
      Gets a particle with the given data. We generate particles in a flat 5D beam, all particles are on the same longitudinal position.
      Parameters:
      p0InGeV - Momentum in GeV/c
      phs - Phase space coordinates.
      longiPos - The longitudinal position in meters along the orbit counted from the beginning of the orbit.
      pp - A potential provider to get the vector potential at the position of the particle
      type - A pre-defined particle type.
      Returns:
      The particle created.
      Throws:
      OutOfApertureException - when the particle is out of aperture
      KnownFatalException - when an internal error happens.
    • getFromFile

      public List<Particle> getFromFile(double p0InGeV, String fileName, double longiPos, PotentialProvider afp, double mass, double charge) throws FileNotFoundException, KnownFatalException
      Generate particles in a flat 5D beam, all particles are on the same longitudinal position. The phase space coordinates are taken from a file.
      Parameters:
      p0InGeV - Momentum in GeV/c
      fileName - File containing the phase space coordinates. x,x',y,y',s,dp/p
      longiPos - The longitudinal position in meters along the orbit counted from the beginning of the orbit.
      afp - A potential provider to get the vector potential at the position of the particle
      mass - Mass [kg]
      charge - Charge [Coulumb]
      Returns:
      The particle created.
      Throws:
      FileNotFoundException - when the file is not found.
      KnownFatalException - when an internal error happens.