gov.sns.xal.tools.extlatgen
Class MadGenerator

java.lang.Object
  |
  +--gov.sns.xal.tools.extlatgen.MadGenerator

public class MadGenerator
extends java.lang.Object

MadGenerator generates MAD input file from XAL lattice view. Usage: create a MadGenerator object with an XAL lattice as input, then call the method createMadInput() which one can specify either DESIGN or LIVE data as argument.


Field Summary
protected  double[] beamci
          beam initial condition
protected  java.lang.String myLatticeName
           
protected  EnvelopeProbe myProbe
          Probe for initial condition
protected  java.util.List mySeqList
           
static int PARAMSRC_DESIGN
          for design values
static int PARAMSRC_LIVE
          for live data from the machine
protected  double Q
          particle charge in e.u.
 
Constructor Summary
MadGenerator(java.util.List seqList, EnvelopeProbe envProbe)
           
MadGenerator(java.lang.String latticeName, java.util.List seqList, EnvelopeProbe envProbe)
           
 
Method Summary
 Lattice createLattice(AcceleratorSeq accSeq)
          create an XAL intermediate lattice
 void createMadInput(java.lang.String srcSelector)
          generate the MAD input file
 java.lang.String formatName(java.lang.String name)
          replace any "-" or ":" with "_" in the device name or beamline name
 void setBeamCI(double[] newBeamCI)
          set the beam initial condition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myProbe

protected EnvelopeProbe myProbe
Probe for initial condition


mySeqList

protected java.util.List mySeqList

PARAMSRC_DESIGN

public static final int PARAMSRC_DESIGN
for design values

See Also:
Constant Field Values

PARAMSRC_LIVE

public static final int PARAMSRC_LIVE
for live data from the machine

See Also:
Constant Field Values

myLatticeName

protected java.lang.String myLatticeName

Q

protected double Q
particle charge in e.u.


beamci

protected double[] beamci
beam initial condition

Constructor Detail

MadGenerator

public MadGenerator(java.util.List seqList,
                    EnvelopeProbe envProbe)
Parameters:
seqList - sequence list
envProbe - envelope probe

MadGenerator

public MadGenerator(java.lang.String latticeName,
                    java.util.List seqList,
                    EnvelopeProbe envProbe)
Parameters:
latticeName - lattice name (if there is one)
seqList - sequence list
envProbe - envelope probe
Method Detail

setBeamCI

public void setBeamCI(double[] newBeamCI)
set the beam initial condition


createMadInput

public void createMadInput(java.lang.String srcSelector)
                    throws java.io.IOException
generate the MAD input file

Parameters:
srcSelector - select the data source: design (PARAMSRC_DESIGN) or live (PARAMSRC_LIVE) data
java.io.IOException

formatName

public java.lang.String formatName(java.lang.String name)
replace any "-" or ":" with "_" in the device name or beamline name


createLattice

public Lattice createLattice(AcceleratorSeq accSeq)
create an XAL intermediate lattice

Parameters:
accSeq - accelerator sequence for the lattice
Returns:
XAL intermediate lattice