public final class AlgorithmFactory
extends java.lang.Object
Factory class for instantiating and initializing algorithm objects for the
XAL online model. Algorithm classes are typically derived from the
Tracker base class and must expose the IAlgorithm interface.
We take the initialization parameters from the XAL "model.params" file, using
the edit context mechanism in XAL. (An EditContext object is
associated with each Accelerator object.)
The file contains data tables which are structured for the different types of
algorithms. Each algorithm may have many different tables, typically different
parameters for different locations along the beamline. The table label
data is typically defined in the source file for the algorithm, whereas the
specific table name is given by the accelerator sequence identifier where the
algorithm starts.
Each algorithm will support the propagation of one type of simulation probe, however, each probe class may accept multiple types of algorithms for its propagation. It is the responsibility of the developer to create and use the appropriate algorithm object for the given probe type.
EditContext,
IAlgorithm,
Accelerator.editContext(),
AcceleratorNode.getId()| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRTAG_TYPE
attribute label for type string identifier
|
static java.lang.String |
NODETAG_ALG
data node label for algorithm data
|
| Constructor and Description |
|---|
AlgorithmFactory() |
| Modifier and Type | Method and Description |
|---|---|
static EnvelopeBacktracker |
createEnvelopeBacktracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
EnvelopeBacktracker instance by calling the
class method with the
returned class type. |
static EnvelopeTracker |
createEnvelopeTracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
EnvelopeTracker instance by calling the
class method with the
returned class type. |
static EnvelopeTrackerPmqDipole |
createEnvelopeTrackerPmqDipole(AcceleratorSeq smfSeq)
Convenience method: Creates a new
EnvelopeTrackerPmqDipole instance by calling the
class method with the
returned class type. |
static EnvTrackerAdapt |
createEnvTrackerAdapt(AcceleratorSeq smfSeq)
Convenience method: Creates a new
EnvTrackerAdapt instance by calling the
class method with the
returned class type. |
static ParticleTracker |
createParticleTracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
ParticleTracker instance by calling the
class method with the
returned class type. |
static SynchronousTracker |
createSynchronousTracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
SynchronousTracker instance by calling the
class method with the
returned class type. |
static Trace3dTracker |
createTrace3dTracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
Trace3dTracker instance by calling the
class method with the
returned class type. |
static <T extends Tracker> |
createTrackerFor(AcceleratorSeq smfSeq,
java.lang.Class<T> clsTkr)
Creates a new
Tracker derived algorithm instance and initializes
it with parameters specified in the edit context of the given accelerator
sequence object. |
static TransferMapTracker |
createTransferMapTracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
TransferMapTracker instance by calling the
class method with the
returned class type. |
static TwissTracker |
createTwissTracker(AcceleratorSeq smfSeq)
Convenience method: Creates a new
TwissTracker instance by calling the
class method with the
returned class type. |
static TwissTrackerPmq |
createTwissTrackerPmq(AcceleratorSeq smfSeq)
Convenience method: Creates a new
TwissTrackerPmq instance by calling the
class method with the
returned class type. |
public static final java.lang.String NODETAG_ALG
public static final java.lang.String ATTRTAG_TYPE
public static SynchronousTracker createSynchronousTracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new SynchronousTracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned SynchronousTracker algorithm will
propagate a SynchronousProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to constructor access violation
or the class has no nullary constructorEnvelopeProbepublic static ParticleTracker createParticleTracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new ParticleTracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned ParticleTracker algorithm will
propagate a ParticleProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to constructor access violation
or the class has no nullary constructorEnvelopeProbepublic static TransferMapTracker createTransferMapTracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new TransferMapTracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned TransferMapTracker algorithm will
propagate a TransferMapProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to constructor access violation
or the class has no nullary constructorEnvelopeProbepublic static TwissTracker createTwissTracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new TwissTracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned TwissTracker algorithm will
propagate a TwissProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to constructor access violation
or the class has no nullary constructorEnvelopeProbepublic static TwissTrackerPmq createTwissTrackerPmq(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new TwissTrackerPmq instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned TwissTrackerPmq algorithm will
propagate a TwissProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to constructor access violation
or the class has no nullary constructorEnvelopeProbepublic static Trace3dTracker createTrace3dTracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new Trace3dTracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned Trace3dTracker algorithm will
propagate an EnvelopeProbe object.
Trace3dTracker algorithm is all but deprecated. Use of this
method is discouraged except for benchmarking purposes.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to access violation
or the class has no nullary constructorEnvelopeProbepublic static EnvelopeTracker createEnvelopeTracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new EnvelopeTracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned EnvelopeTracker algorithm will
propagate an EnvelopeProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to access violation
or the class has no nullary constructorEnvelopeProbepublic static EnvelopeBacktracker createEnvelopeBacktracker(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new EnvelopeBacktracker instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned EnvelopeBacktracker algorithm will
propagate an EnvelopeProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to access violation
or the class has no nullary constructorEnvelopeProbepublic static EnvTrackerAdapt createEnvTrackerAdapt(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new EnvTrackerAdapt instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned EnvTrackerAdapt algorithm will
propagate an EnvelopeProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to access violation
or the class has no nullary constructorEnvelopeProbepublic static EnvelopeTrackerPmqDipole createEnvelopeTrackerPmqDipole(AcceleratorSeq smfSeq) throws java.lang.InstantiationException
Convenience method: Creates a new EnvelopeTrackerPmqDipole instance by calling the
class method with the
returned class type.
createTrackerFor(AcceleratorSeq, Class)
The new algorithm instance is initialized
with parameters specified in the edit context of the given accelerator
sequence object. The returned EnvelopeTrackerPmq algorithm will
propagate an EnvelopeProbe object.
smfSeq - Accelerator sequence object indirectly containing the edit context through
its associated acceleratorjava.lang.InstantiationException - unable to instantiate the object due to access violation
or the class has no nullary constructorEnvelopeProbepublic static <T extends Tracker> T createTrackerFor(AcceleratorSeq smfSeq, java.lang.Class<T> clsTkr) throws java.lang.InstantiationException
Tracker derived algorithm instance and initializes
it with parameters specified in the edit context of the given accelerator
sequence object. These parameters are located in the "model.params"
file which is part of the XAL configuration initialization. Within the file are
data tables for initializing algorithms, the labels of these tables are particular
to the algorithm type being instantiated (typically they are defined within the
algorithm source file). The actual table name from which the initialization parameters
are taken is given by the sequence id of the provided accelerator sequence. If there are no
tables with that name then the mechanism automatically defers
to the table named "default".T - Type of the algorithm to be instantiated, must be derived from TrackersmfSeq - accelerator sequence object indirectly containing the edit context through
its associated acceleratorclsTkr - the class type of the algorithm to be instantiatedjava.lang.InstantiationException - unable to instantiate the tracker object due to access violation
or the class has no nullary constructorTracker