java.lang.Object
simpa.acc.api.track.TurnObserver
- All Implemented Interfaces:
TrackingObserver
An observer that counts the amount of turns a particle makes in the machine.
-
Nested Class Summary
Nested classes/interfaces inherited from interface simpa.core.api.track.TrackingObserver
TrackingObserver.ObserverBehaviour
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finishes the tracking of the given particle.getDisk()
long
int
Gets the amount of turns before information is logged to the console.void
Observe the particle using this observer.void
setMaximumTurns
(long maximumTurns) Set the maximum number of turns.void
setPrintPerTurns
(int printPerTurns) Sets the amount of turns before information is logged to the console.
-
Constructor Details
-
TurnObserver
- Parameters:
refOrbit
- - A reference orbit belonging to a circular machine or a transfer line.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.backward
- If true, the observer is placed at the first point of the orbit. This should be set true when tracking backward.
-
-
Method Details
-
observe
Description copied from interface:TrackingObserver
Observe the particle using this observer.- Specified by:
observe
in interfaceTrackingObserver
- Parameters:
p
- - Particle to observe
-
getDisk
- Returns:
- The observer disk
-
finish
Description copied from interface:TrackingObserver
Finishes the tracking of the given particle.- Specified by:
finish
in interfaceTrackingObserver
- Parameters:
p
- the particle to stop tracking
-
getPrintPerTurns
public int getPrintPerTurns()Gets the amount of turns before information is logged to the console.- Returns:
- The amount of turns before information is logged to the console.
-
setPrintPerTurns
public void setPrintPerTurns(int printPerTurns) Sets the amount of turns before information is logged to the console.- Parameters:
printPerTurns
- The amount of turns before information is logged to the console.
-
getMaximumTurns
public long getMaximumTurns()- Returns:
- Returns the maximum number of turns after which the particle tracking
ends. By default it is
Long.MAX_VALUE
-
setMaximumTurns
public void setMaximumTurns(long maximumTurns) Set the maximum number of turns. After this number the observer will set the terminated flag and the tracking for the particle ends.- Parameters:
maximumTurns
-
-