java.lang.Object
simpa.acc.api.ParticleFactory
Factory for creating particles from Phase space coordinate data.
-
Constructor Summary
ConstructorsConstructorDescriptionParticleFactory(ReferenceOrbit corbit) Sets up the factory with a reference orbit. -
Method Summary
Modifier and TypeMethodDescriptiongetFromFile(double p0InGeV, String fileName, double longiPos, PotentialProvider afp, double mass, double charge) Generate particles in a flat 5D beam, all particles are on the same longitudinal position.getParticle(double p0InGeV, PhaseSpaceCoordinates phs, double longiPos, PotentialProvider afp, double mass, double charge) Gets a particle with the given data.getParticle(double p0InGeV, PhaseSpaceCoordinates phs, double longiPos, PotentialProvider pp, ParticleType type) Gets a particle with the given data.
-
Constructor Details
-
ParticleFactory
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/cphs- 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 particlemass- Mass [kg]charge- Charge [Coulumb]- Returns:
- The particle created.
- Throws:
OutOfApertureException- when the particle is out of apertureKnownFatalException- 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/cphs- 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 particletype- A pre-defined particle type.- Returns:
- The particle created.
- Throws:
OutOfApertureException- when the particle is out of apertureKnownFatalException- 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/cfileName- File containing the phase space coordinates. x,x',y,y',s,dp/plongiPos- 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 particlemass- Mass [kg]charge- Charge [Coulumb]- Returns:
- The particle created.
- Throws:
FileNotFoundException- when the file is not found.KnownFatalException- when an internal error happens.
-