java.lang.Object
simpa.acc.api.Beam
- Direct Known Subclasses:
EllipseBeam
-
Constructor Summary
ConstructorsConstructorDescriptionBeam
(List<Particle> particles, ReferenceOrbit refOrbit, PotentialProvider potProvider, String name) Low level constructor.Beam
(BeamSampler beamSampler, double nomMomentum, ReferenceOrbit refOrbit, double longiPos, PotentialProvider potProvider, double mass, double charge, int nbOfSamples, String name) Construct a beam with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.math3.geometry.euclidean.threed.Vector3D
Calculates the position vector in the global coordinate system calculated from the average particle positions.copy
(Beam b, PotentialProvider pp) getName()
double
void
void
setReferenceOrbit
(ReferenceOrbit refOrb)
-
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 thePhaseSpaceObserver
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 orbitlongiPos
- 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 providermass
- Mass of the particlescharge
- Charge of the particlesnbOfSamples
- Number of particle in the beamname
- 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
-
getParticles
-
getNominalMomentum
public double getNominalMomentum()- Returns:
- The average momentum of the particles in the beam [GeV/c]
-
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
- 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
- Returns:
- The potential provider object which is used to calculate the vector potential in the canonical momentum .
-
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
- 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.
-