Module simpa.acc
Package simpa.acc.api

Class Beam

java.lang.Object
simpa.acc.api.Beam
Direct Known Subclasses:
EllipseBeam

public class Beam extends Object
  • Constructor Details

    • Beam

      public Beam(List<Particle> particles, ReferenceOrbit refOrbit, PotentialProvider potProvider, String name)
      Low level constructor. Makes the caller fully responsible that the data is coherent and makes sense. Use this only if absolutely necessary !! Construct a beam from a list of particles and the given nominal momentum. The nominal momentum is used during tracking by the PhaseSpaceObserver to calculate the dp/p.
      Parameters:
      particles - List of particles in the beam.
      refOrbit - The reference orbit. It should be the same which was used to create the particles.
      potProvider - The potential provider. It should be the same which was used to create the particles.
      name - Name of the beam. Each particle will be named using the beam name ad a number concatenated after. This can be modified later if needed. It is also used to create a directory in which the phase space coordinates are written during tracking.
    • Beam

      public Beam(BeamSampler beamSampler, double nomMomentum, ReferenceOrbit refOrbit, double longiPos, PotentialProvider potProvider, double mass, double charge, int nbOfSamples, String name) throws KnownFatalException
      Construct a beam with the given parameters.
      Parameters:
      beamSampler - A beam sampler object.
      nomMomentum - The momentum of the beam [GeV/c]
      refOrbit - The reference orbit
      longiPos - The longitudinal position of the beam along the reference orbit [m]. At the moment until no RF fields are implemented all particles have this position initially.
      potProvider - The potential provider
      mass - Mass of the particles
      charge - Charge of the particles
      nbOfSamples - Number of particle in the beam
      name - Name of the beam. Each particle will be named using the beam name ad a number concatenated after. This can be modified later if needed. It is also used to create a directory in which the phase space coordinates are written during tracking.
      Throws:
      KnownFatalException - If something goes wrong.
  • Method Details

    • setName

      public void setName(String name)
    • getParticles

      public List<Particle> getParticles()
    • getNominalMomentum

      public double getNominalMomentum()
      Returns:
      The average momentum of the particles in the beam [GeV/c]
    • getReferenceOrbit

      public ReferenceOrbit getReferenceOrbit()
      Returns:
      Reference orbit of the sequence to which the beam belongs. This might change when the beam is transfered from one sequence to another.
    • setReferenceOrbit

      public void setReferenceOrbit(ReferenceOrbit refOrb)
      Parameters:
      refOrb - Reference orbit of the sequence to which the beam belongs. This must be updated when the beam is transfered from one sequence to another.
    • getPotentialProvider

      public PotentialProvider getPotentialProvider()
      Returns:
      The potential provider object which is used to calculate the vector potential in the canonical momentum .
    • getName

      public String getName()
      Returns:
      name of the beam
    • calculateBeamPosition

      public org.apache.commons.math3.geometry.euclidean.threed.Vector3D calculateBeamPosition()
      Calculates the position vector in the global coordinate system calculated from the average particle positions. It can be used to determine the longitudinal position along the reference orbit. @see PathUtils#getClosestIndex getClosestIndex
      Returns:
      Absolute position vector.
    • copy

      public Beam copy(Beam b, PotentialProvider pp)
      Returns:
      A Deep copy of of all particles in the beam, but the tracking state is freshly created. The vector potential updated according to the potential provider. Creates the copy with the given potential provider.