Merlin logoThe Merlin++ accelerator simulation program library

Quickstart Guide

Writing your own program - Merlin++ user script fundamentals

Merlin++ follows a relatively simple overarching design in that a user script can be thought of in just five parts.

  1. Defining the lattice
  2. Defining the beam
  3. Defining the tracker
  4. Running the simulation
  5. Post-processing & output of results

The following provides a code snippet corresponding to each part. Note that this is simply an example of the most basic implementation and more advanced methods can be found in the tutorials.

For a more in-depth look at how to write user scripts for varying use-cases, please continue on to the tutorials .