Exemple #1
0
  /**
   * Get the base probe for configuration. It should never be run! Instead use makeProbe() to make a
   * copy which you can run.
   *
   * @return the base probe generating it if necessary or null if one cannot be generated (e.g. no
   *     selected sequence)
   */
  Probe<?> getBaseProbe() {
    // if there is no base probe and the sequence is not null then generate a new base probe for the
    // sequence
    if (_baseProbe == null && _sequence != null) {
      try {
        if (_sequence instanceof Ring) {
          final TransferMapTracker tracker = AlgorithmFactory.createTransferMapTracker(_sequence);
          _baseProbe = ProbeFactory.getTransferMapProbe(_sequence, tracker);

        } else {
          final ParticleTracker tracker = AlgorithmFactory.createParticleTracker(_sequence);
          _baseProbe = ProbeFactory.createParticleProbe(_sequence, tracker);
        }
      } catch (Exception exception) {
        throw new RuntimeException("Exception making a new probe.", exception);
      }
    }

    return _baseProbe;
  }
Exemple #2
0
  protected static TransferMapProbe getProbe(final AcceleratorSeq sequence) {
    try {

      return ProbeFactory.getTransferMapProbe(
          sequence, AlgorithmFactory.createTransferMapTracker(sequence));

    } catch (InstantiationException exception) {
      System.err.println("Instantiation exception creating probe.");
      exception.printStackTrace();
      return null;
    }
  }
Exemple #3
0
  /** get a new probe */
  protected TransferMapProbe getProbe() {

    TransferMapProbe probe = null;

    try {

      probe =
          ProbeFactory.getTransferMapProbe(
              _sequence, AlgorithmFactory.createTransferMapTracker(_sequence));

    } catch (InstantiationException exception) {
      System.err.println("Instantiation exception creating probe.");
      exception.printStackTrace();
    }

    probe.setKineticEnergy(840.e6);
    return probe;
  }