gov.sns.tools.phasespaceanalysis
Class PhasePlaneEllipse

java.lang.Object
  |
  +--gov.sns.tools.phasespaceanalysis.PhasePlaneEllipse

public class PhasePlaneEllipse
extends java.lang.Object

This class keeps the emittance and twiss parameters to define ellipse in the phase plane. It also can generate a curve ( CurveData class) to show graphics image of the ellipse. The ellipse equation is emitt/PI = gamma*x^2+2*alpha*x*xp+beta*xp^2.


Constructor Summary
PhasePlaneEllipse()
          The phase plane ellipse constructor.
PhasePlaneEllipse(double emitt, double alpha, double beta)
          The phase plane ellipse constructor.
 
Method Summary
 void calcCurvePoints()
          Calculates (x,xp) points for graphic presentation.
 void calcCurvePoints(int N)
          Calculates (x,xp) points for graphic presentation.
 double getAlpha()
          Returns the alpha parameter.
 double getBeta()
          Returns the alpha parameter.
 double getBoundedEmittance(double x, double xp)
          Returns value of the emittance if the (x,xp) point is on the boudary of this ellipse.
 CurveData getCurveData()
          Returns the reference to the CurveData.
 double getEmittance()
          Returns the emittance parameter.
 PhasePlaneEllipse getNewPhasePlaneEllipse()
          Returns the new instance of the PhasePlaneEllipse (this) class with the same parameters (emittance, alpha, and beta).
 PhasePlaneEllipse getNewPhasePlaneEllipse(double emmitNew)
          Returns the new instance of the PhasePlaneEllipse (this) class with the new emmitance and the same others parameters.
 int getNumberCurvePoints()
          Returns the number of graphics points.
 double getX(double phi)
          Calculates x on the ellipse for angle phi in polar coordinate.
 double getXP(double phi)
          Calculates x on the ellipse for angle phi in polar coordinate.
 boolean isInside(double x, double xp)
          Returns true is the (x,xp) is inside this ellipse.
 void setAlpha(double alpha)
          Sets the alpha parameter.
 void setBeta(double beta)
          Sets the alpha parameter.
 void setEmittance(double emitt)
          Sets the emittance parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhasePlaneEllipse

public PhasePlaneEllipse()
The phase plane ellipse constructor. By default emittance = 0, alfa = 0, beta = 1.


PhasePlaneEllipse

public PhasePlaneEllipse(double emitt,
                         double alpha,
                         double beta)
The phase plane ellipse constructor.

Method Detail

setEmittance

public void setEmittance(double emitt)
Sets the emittance parameter.


setAlpha

public void setAlpha(double alpha)
Sets the alpha parameter.


setBeta

public void setBeta(double beta)
Sets the alpha parameter.


getEmittance

public double getEmittance()
Returns the emittance parameter.


getAlpha

public double getAlpha()
Returns the alpha parameter.


getBeta

public double getBeta()
Returns the alpha parameter.


isInside

public boolean isInside(double x,
                        double xp)
Returns true is the (x,xp) is inside this ellipse.


getBoundedEmittance

public double getBoundedEmittance(double x,
                                  double xp)
Returns value of the emittance if the (x,xp) point is on the boudary of this ellipse.


calcCurvePoints

public void calcCurvePoints()
Calculates (x,xp) points for graphic presentation.


getX

public double getX(double phi)
Calculates x on the ellipse for angle phi in polar coordinate.


getXP

public double getXP(double phi)
Calculates x on the ellipse for angle phi in polar coordinate.


calcCurvePoints

public void calcCurvePoints(int N)
Calculates (x,xp) points for graphic presentation. N - number of graphics points. N = 150 by default.


getNumberCurvePoints

public int getNumberCurvePoints()
Returns the number of graphics points. N = 150 by default. This number will be the same as number of points of the CurveData instance delivered by getCurveData() method of this class;


getCurveData

public CurveData getCurveData()
Returns the reference to the CurveData. To get correct curve data points the method calcCurvePoints should be called first.


getNewPhasePlaneEllipse

public PhasePlaneEllipse getNewPhasePlaneEllipse(double emmitNew)
Returns the new instance of the PhasePlaneEllipse (this) class with the new emmitance and the same others parameters. The CurveData is ready to use.


getNewPhasePlaneEllipse

public PhasePlaneEllipse getNewPhasePlaneEllipse()
Returns the new instance of the PhasePlaneEllipse (this) class with the same parameters (emittance, alpha, and beta). The CurveData is ready to use.