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 voidaddElementToCalculate(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.StringgetName()JMadPlanegetPlane()voidsetEndSegmentMonitor(Element element)Set the monitor at the ending of the segmentvoidsetIsCycleStartSegment(boolean isCycleStartSegment)Define that this segments contains the start and end element of the circular machine.voidsetStartSegmentMonitor(Element element)Set the monitor at the beginning of the segmentbooleanupdate(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:OrbitSegmentCalculatorSet the monitor at the beginning of the segment- Specified by:
setStartSegmentMonitorin interfaceOrbitSegmentCalculator- Parameters:
element- theElementdescribing the monitor
-
setEndSegmentMonitor
public void setEndSegmentMonitor(Element element)
Description copied from interface:OrbitSegmentCalculatorSet the monitor at the ending of the segment- Specified by:
setEndSegmentMonitorin interfaceOrbitSegmentCalculator- Parameters:
element- theElementdescribing the monitor
-
addElementToCalculate
public void addElementToCalculate(Element element)
Description copied from interface:OrbitSegmentCalculatorAdd an element to this calculator. For each update with a new monitor reading the orbit will be calculated.- Specified by:
addElementToCalculatein interfaceOrbitSegmentCalculator- Parameters:
element- the element to add to the calculations in this segment
-
update
public boolean update(Optic optic)
Description copied from interface:OrbitSegmentCalculatorUpdate the internal transfer matrices according to the optic provided.- Specified by:
updatein interfaceOrbitSegmentCalculator- Parameters:
optic- the optic to update from- Returns:
trueif update was successful
-
calculate
public java.util.Map<Element,java.util.Map<MadxTwissVariable,java.lang.Double>> calculate(Orbit orbit)
Description copied from interface:OrbitSegmentCalculatorInterpolate the orbit for all defined elements. In case something goes wrong an empty map is returned.- Specified by:
calculatein 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:
getNamein interfaceOrbitSegmentCalculator- Returns:
- the name of the calculator.
-
getPlane
public JMadPlane getPlane()
- Specified by:
getPlanein interfaceOrbitSegmentCalculator- Returns:
- the
JMadPlanethis orbit segment calculator works on
-
setIsCycleStartSegment
public void setIsCycleStartSegment(boolean isCycleStartSegment)
Description copied from interface:OrbitSegmentCalculatorDefine that this segments contains the start and end element of the circular machine.- Specified by:
setIsCycleStartSegmentin interfaceOrbitSegmentCalculator- Parameters:
isCycleStartSegment- set totrueif segment contains start and end element.
-
-