gov.sns.xal.model.elem
Class IdealMagQuad

java.lang.Object
  |
  +--gov.sns.xal.model.elem.Element
        |
        +--gov.sns.xal.model.elem.ThickElement
              |
              +--gov.sns.xal.model.elem.IdealMagQuad
All Implemented Interfaces:
IComponent, IElectromagnet, IElement

public class IdealMagQuad
extends ThickElement
implements IElectromagnet

Represents an ideal magnetic quadrupole magnet for a beam transport/accelerator system.


Field Summary
static java.lang.String s_strParamField
           
static java.lang.String s_strParamOrient
          Parameters for XAL MODEL LATTICE dtd
static java.lang.String s_strType
          string type identifier for all IdealMagQuad objects
 
Fields inherited from interface gov.sns.xal.model.elem.IElectromagnet
ORIENT_HOR, ORIENT_NONE, ORIENT_VER
 
Fields inherited from interface gov.sns.xal.model.IElement
LightSpeed, Permeability, Permittivity, UnitCharge
 
Constructor Summary
IdealMagQuad()
          JavaBean constructor - creates a new unitialized instance of IdealMagQuad BE CAREFUL
IdealMagQuad(java.lang.String strId, int enmOrient, double dblFld, double dblLen)
          Creates a new instance of IdealMagQuad
 
Method Summary
 double elapsedTime(IProbe probe, double dblLen)
          Returns the time taken for the probe to drift through part of the element.
 double energyGain(IProbe probe, double dblLen)
          Return the energy gain imparted to a particular probe.
 double getMagField()
          Get the magnetic field strength of the electromagnet
 int getOrientation()
          Return the orientation enumeration code.
 void print(java.io.PrintWriter os)
          Dump current state and content to output stream.
 void setMagField(double dblField)
          Set the magnetic field strength of the electromagnet.
 void setOrientation(int enmOrient)
          Set the magnet orientation
 PhaseMap transferMap(IProbe probe, double dblLen)
          Compute the partial transfer map of an ideal quadrupole for the particular probe.
 
Methods inherited from class gov.sns.xal.model.elem.ThickElement
getLength, setLength
 
Methods inherited from class gov.sns.xal.model.elem.Element
compDriftingTime, getId, getType, getUID, initializeFrom, propagate, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_strType

public static final java.lang.String s_strType
string type identifier for all IdealMagQuad objects

See Also:
Constant Field Values

s_strParamOrient

public static final java.lang.String s_strParamOrient
Parameters for XAL MODEL LATTICE dtd

See Also:
Constant Field Values

s_strParamField

public static final java.lang.String s_strParamField
See Also:
Constant Field Values
Constructor Detail

IdealMagQuad

public IdealMagQuad(java.lang.String strId,
                    int enmOrient,
                    double dblFld,
                    double dblLen)
Creates a new instance of IdealMagQuad

Parameters:
strId - identifier for this IdealMagQuad object
enmOrient - enumeration specifying the quadrupole orientation (ORIENT_HOR or ORIENT_VER)
dblFld - field gradient strength (in Tesla/meter)
dblLen - length of the quadrupole

IdealMagQuad

public IdealMagQuad()
JavaBean constructor - creates a new unitialized instance of IdealMagQuad BE CAREFUL

Method Detail

getOrientation

public int getOrientation()
Return the orientation enumeration code.

Specified by:
getOrientation in interface IElectromagnet
Returns:
ORIENT_HOR - dipole has steering action in x (horizontal) plane ORIENT_VER - dipole has steering action in y (vertical) plane ORIENT_NONE - error

getMagField

public double getMagField()
Get the magnetic field strength of the electromagnet

Specified by:
getMagField in interface IElectromagnet
Returns:
magnetic field (in Tesla).

setOrientation

public void setOrientation(int enmOrient)
Set the magnet orientation

Specified by:
setOrientation in interface IElectromagnet
Parameters:
enmOrient - magnet orientation enumeration code
See Also:
getOrientation()

setMagField

public void setMagField(double dblField)
Set the magnetic field strength of the electromagnet.

Specified by:
setMagField in interface IElectromagnet
Parameters:
dblField - magnetic field (in Tesla).

elapsedTime

public double elapsedTime(IProbe probe,
                          double dblLen)
Returns the time taken for the probe to drift through part of the element.

Specified by:
elapsedTime in interface IElement
Specified by:
elapsedTime in class Element
Parameters:
probe - propagating probe
dblLen - length of subsection to propagate through meters
Returns:
the elapsed time through sectionUnits: seconds

energyGain

public double energyGain(IProbe probe,
                         double dblLen)
Return the energy gain imparted to a particular probe. For an ideal quadrupole magnet this value is always zero.

Specified by:
energyGain in interface IElement
Specified by:
energyGain in class ThickElement
Parameters:
dblLen - dummy argument
probe - dummy argument
Returns:
returns a zero value

transferMap

public PhaseMap transferMap(IProbe probe,
                            double dblLen)
                     throws ModelException
Compute the partial transfer map of an ideal quadrupole for the particular probe. Computes transfer map for a section of quadrupole dblLen meters in length.

Specified by:
transferMap in interface IElement
Specified by:
transferMap in class ThickElement
Parameters:
dblLen - compute transfer matrix for section of this length
probe - uses the rest and kinetic energy parameters from the probe
Returns:
transfer map of ideal quadrupole for particular probe
Throws:
ModelException - unknown quadrupole orientation

print

public void print(java.io.PrintWriter os)
Dump current state and content to output stream.

Overrides:
print in class Element
Parameters:
os - output stream object