Class AlgorithmFactory
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.
- Since:
- Oct 25, 2012
- Author:
- Christopher K. Allen
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic EnvelopeBacktracker
Convenience method: Creates a newEnvelopeBacktracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static EnvelopeTracker
createEnvelopeTracker
(AcceleratorSeq smfSeq) Convenience method: Creates a newEnvelopeTracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static EnvelopeTrackerPmqDipole
Convenience method: Creates a newEnvelopeTrackerPmqDipole
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static EnvTrackerAdapt
createEnvTrackerAdapt
(AcceleratorSeq smfSeq) Convenience method: Creates a newEnvTrackerAdapt
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static ParticleTracker
createParticleTracker
(AcceleratorSeq smfSeq) Convenience method: Creates a newParticleTracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static SynchronousTracker
Convenience method: Creates a newSynchronousTracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static Trace3dTracker
createTrace3dTracker
(AcceleratorSeq smfSeq) Convenience method: Creates a newTrace3dTracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static <T extends Tracker>
TcreateTrackerFor
(AcceleratorSeq smfSeq, Class<T> clsTkr) Creates a newTracker
derived algorithm instance and initializes it with parameters specified in the edit context of the given accelerator sequence object.static TransferMapTracker
Convenience method: Creates a newTransferMapTracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static TwissTracker
createTwissTracker
(AcceleratorSeq smfSeq) Convenience method: Creates a newTwissTracker
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
static TwissTrackerPmq
createTwissTrackerPmq
(AcceleratorSeq smfSeq) Convenience method: Creates a newTwissTrackerPmq
instance by calling the class method
with the returned class type.createTrackerFor(AcceleratorSeq, Class)
-
Field Details
-
NODETAG_ALG
data node label for algorithm data- See Also:
-
ATTRTAG_TYPE
attribute label for type string identifier- See Also:
-
-
Method Details
-
createSynchronousTracker
public static SynchronousTracker createSynchronousTracker(AcceleratorSeq smfSeq) throws 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 aSynchronousProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to constructor access violation or the class has no nullary constructor- Since:
- Oct 26, 2012
- See Also:
-
createParticleTracker
public static ParticleTracker createParticleTracker(AcceleratorSeq smfSeq) throws 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 aParticleProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to constructor access violation or the class has no nullary constructor- Since:
- Oct 26, 2012
- See Also:
-
createTransferMapTracker
public static TransferMapTracker createTransferMapTracker(AcceleratorSeq smfSeq) throws 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 aTransferMapProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to constructor access violation or the class has no nullary constructor- Since:
- Oct 26, 2012
- See Also:
-
createTwissTracker
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 aTwissProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to constructor access violation or the class has no nullary constructor- Since:
- Oct 26, 2012
- See Also:
-
createTwissTrackerPmq
public static TwissTrackerPmq createTwissTrackerPmq(AcceleratorSeq smfSeq) throws 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 aTwissProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to constructor access violation or the class has no nullary constructor- Since:
- Oct 29, 2012
- See Also:
-
createTrace3dTracker
public static Trace3dTracker createTrace3dTracker(AcceleratorSeq smfSeq) throws 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 anEnvelopeProbe
object.NOTES:
· The
Trace3dTracker
algorithm is all but deprecated. Use of this method is discouraged except for benchmarking purposes.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to access violation or the class has no nullary constructor- Since:
- Oct 25, 2012
- See Also:
-
createEnvelopeTracker
public static EnvelopeTracker createEnvelopeTracker(AcceleratorSeq smfSeq) throws 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 anEnvelopeProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to access violation or the class has no nullary constructor- Since:
- Oct 24, 2012
- See Also:
-
createEnvelopeBacktracker
public static EnvelopeBacktracker createEnvelopeBacktracker(AcceleratorSeq smfSeq) throws 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 anEnvelopeProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to access violation or the class has no nullary constructor- Since:
- Oct 24, 2012
- See Also:
-
createEnvTrackerAdapt
public static EnvTrackerAdapt createEnvTrackerAdapt(AcceleratorSeq smfSeq) throws 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 anEnvelopeProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to access violation or the class has no nullary constructor- Since:
- Oct 24, 2012
- See Also:
-
createEnvelopeTrackerPmqDipole
public static EnvelopeTrackerPmqDipole createEnvelopeTrackerPmqDipole(AcceleratorSeq smfSeq) throws 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 anEnvelopeProbe
object.- Parameters:
smfSeq
- Accelerator sequence object indirectly containing the edit context through its associated accelerator- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the object due to access violation or the class has no nullary constructor- Since:
- Oct 24, 2012
- See Also:
-
createTrackerFor
public static <T extends Tracker> T createTrackerFor(AcceleratorSeq smfSeq, Class<T> clsTkr) throws InstantiationException Creates a newTracker
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".- Type Parameters:
T
- Type of the algorithm to be instantiated, must be derived fromTracker
- Parameters:
smfSeq
- accelerator sequence object indirectly containing the edit context through its associated acceleratorclsTkr
- the class type of the algorithm to be instantiated- Returns:
- newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
- Throws:
InstantiationException
- unable to instantiate the tracker object due to access violation or the class has no nullary constructor- Since:
- Oct 24, 2012
- See Also:
-