Class SimpleOrbitSegmentCalculator
- java.lang.Object
-
- cern.accsoft.steering.jmad.tools.interpolate.SimpleOrbitSegmentCalculator
-
- All Implemented Interfaces:
OrbitSegmentCalculator
public class SimpleOrbitSegmentCalculator extends java.lang.Object implements OrbitSegmentCalculator
This class does the actual interpolation of the orbit in one plane for one segment defined by two adjacent monitors.
-
-
Constructor Summary
Constructors Constructor Description SimpleOrbitSegmentCalculator(JMadPlane plane)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addElementToCalculate(Element element)
Add an element to this calculator.java.util.Map<Element,java.util.Map<MadxTwissVariable,java.lang.Double>>
calculate(Orbit orbit)
Interpolate the orbit for all defined elements.java.lang.String
getName()
JMadPlane
getPlane()
void
setEndSegmentMonitor(Element element)
Set the monitor at the ending of the segmentvoid
setIsCycleStartSegment(boolean isCycleStartSegment)
Define that this segments contains the start and end element of the circular machine.void
setStartSegmentMonitor(Element element)
Set the monitor at the beginning of the segmentboolean
update(Optic optic)
Update the internal transfer matrices according to the optic provided.
-
-
-
Constructor Detail
-
SimpleOrbitSegmentCalculator
public SimpleOrbitSegmentCalculator(JMadPlane plane)
-
-
Method Detail
-
setStartSegmentMonitor
public void setStartSegmentMonitor(Element element)
Description copied from interface:OrbitSegmentCalculator
Set the monitor at the beginning of the segment- Specified by:
setStartSegmentMonitor
in interfaceOrbitSegmentCalculator
- Parameters:
element
- theElement
describing the monitor
-
setEndSegmentMonitor
public void setEndSegmentMonitor(Element element)
Description copied from interface:OrbitSegmentCalculator
Set the monitor at the ending of the segment- Specified by:
setEndSegmentMonitor
in interfaceOrbitSegmentCalculator
- Parameters:
element
- theElement
describing the monitor
-
addElementToCalculate
public void addElementToCalculate(Element element)
Description copied from interface:OrbitSegmentCalculator
Add an element to this calculator. For each update with a new monitor reading the orbit will be calculated.- Specified by:
addElementToCalculate
in interfaceOrbitSegmentCalculator
- Parameters:
element
- the element to add to the calculations in this segment
-
update
public boolean update(Optic optic)
Description copied from interface:OrbitSegmentCalculator
Update the internal transfer matrices according to the optic provided.- Specified by:
update
in interfaceOrbitSegmentCalculator
- Parameters:
optic
- the optic to update from- Returns:
true
if update was successful
-
calculate
public java.util.Map<Element,java.util.Map<MadxTwissVariable,java.lang.Double>> calculate(Orbit orbit)
Description copied from interface:OrbitSegmentCalculator
Interpolate the orbit for all defined elements. In case something goes wrong an empty map is returned.- Specified by:
calculate
in interfaceOrbitSegmentCalculator
- Parameters:
orbit
- the orbit to interpolate from- Returns:
- the mapping between [element, value mapping] for all elements defined in the segment for the plane
defined by
OrbitSegmentCalculator.getPlane()
. where value mapping may contain orbit and angle
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceOrbitSegmentCalculator
- Returns:
- the name of the calculator.
-
getPlane
public JMadPlane getPlane()
- Specified by:
getPlane
in interfaceOrbitSegmentCalculator
- Returns:
- the
JMadPlane
this orbit segment calculator works on
-
setIsCycleStartSegment
public void setIsCycleStartSegment(boolean isCycleStartSegment)
Description copied from interface:OrbitSegmentCalculator
Define that this segments contains the start and end element of the circular machine.- Specified by:
setIsCycleStartSegment
in interfaceOrbitSegmentCalculator
- Parameters:
isCycleStartSegment
- set totrue
if segment contains start and end element.
-
-