Step 5: Monte Carlo Simulation

Super-K Monte Carlo: Detector Simulation

Monte Carlo Simulations

Particle physics experiments make frequent use of Monte Carlo: detailed simulations of particle interactions and the resulting detector signals, incorporating known physical processes. Super-K is no exception. In Super-K, we simulate both neutrino interactions and background events in order to compare real data to expectation.

In general, particle physics experiment simulations take place in two steps.

  1. The first step employs a generator, or an “interaction generator”. A generator simulates the interaction you are interested in, in the relevant material. For instance, for neutrino experiments, “neutrino generator” software simulates the charged particles that result from interactions of neutrinos with the detector material (say, water), given an input flux of neutrinos. Super-K uses a few different generator codes.  Usually NEUT, but sometimes NUANCE or GENIE. The output of a neutrino generator is a list of “vectors“: it’s basically a list of the particles that come out of a simulated interaction. For each outgoing particle, the list contains, at least: particle type, energy, direction, position (and sometimes other info). This list of generated particles is also referred to as a kinematics file.
  2. The second step is detector simulation. This takes kinematics files as input, and then simulates what the charged particles in each event would look like in the actual detector you have. Detector simulation software often makes use of packages like Geant (old, Fortran-based code), and Geant4 (a newer, C++ based package). Simulation of a particle in a detector is sometimes referred to as tracking, since the software tracks the particle’s energy loss and trajectory in the detector.Super-K’s standard detector simulation software is called skdetsim and it employs old Geant 3.

In this example you will start at the detector simulation step, and create by hand some kinematics files, and run them through skdetsim to create some SK MC events.


Before starting, make sure the login script stuff is taken care of.

Files for this example

Copy the following files from


to your working directory:

  • a shell script to run skdetsim.
  • sk4_odtune.card: a “card file”. This contains a list of parameters and options to be used by skdetsim.
  • test.kin: a sample kinematics file.

Look at test.kin. This will be used as input to skdetsim. This contains the kinematics information (a “vector”) for one event to be simulated, in Nuance format. It has:

$ begin
$ vertex 0. 0.  0. 0
$ track 13 5000. 0. 0. -1. 0
$ end
  • The $ begin and $ end lines tell skdetsim where an event begins and ends (you can add more events to the same kinematics file).
  • The $ vertex line indicates where the interaction happened in the detector (and so is where the charged particles should begin their trajectories– their “tracks”). The first three arguments are the x, y, z coordinates of this vertex. In the Super-K spatial coordinate system (0,0,0) is the center of the tank. So in the sample event to be simulated, the track originates at the center of the detector. (The last argument is time, which you can ignore for the moment.)
  • The $ track line indicates the type and momentum of the particle to be tracked. In this example, there is just one track (one particle in the event), but there can be more than one particle per event.
    • The first argument is the particle type. This is according to a numbering scheme defined by the Particle Data Group. In this example, the 13 means a negative muon.
    • The next argument is the total mass-energy of the particle, in MeV. In this case we have a 5 GeV muon.
    • The next three arguments are the three components of the (normalized) direction vector of the particle. In SK coordinates, z goes up/down and the x-y plane is horizontal. So in this example, the particle is going straight down (-z direction).
    • The last argument should be 0 if you want the particle to be simulated.

Running this example is the script to use to run skdetsim in this example. It takes several arguments to indicate the input and output files.

If running on the Duke neutrino computers, it should just work without modification.  If running on the Kamioka computers, open the shell script in a text editor and edit the following path (so that it knows where to find the compiled skdetsim):

set DIR="$SKOFL_ROOT/../skdetsim/"

should be replaced with

set DIR="$SKOFL_ROOT/../skdetsim-v12p80"

Run it as follows:

./ sk4_odtune.card test.zbs test.kin
  • The first argument is the card file with options to skdetsim.
  • The second argument is the output file. In this example you will be creating test.zbs containing the simulated event in ZBS format. Note: if the output file exists already when skdetsim is run, by default new simulated events are added to the end of it. So you may want to delete it first, if you want a fresh output file.
  • The third argument is the input kinematics file.

After you have run this (it may take a bit of time to run), look at the generated output file test.zbs with superscan. Check that it indeed looks like a muon starting at the center of the tank and going straight down.

Stuff to try

  • Create a new kinematics file and run it through skdetsim. Try modifying the vertex, energy and direction of the muon simulated, and check with superscan that your output file makes sense (e.g. try 10,100, 500, 50000 MeV; try straight up, horizontal, at an intermediate angle; try at various positions inside the tank).
  • Try adding new particles of different types to the event: electrons, pions, protons, neutrons, gammas. Check with superscan that the output makes sense.
  • Try adding more events to the file.
  • Look at the card file.  You’ll see that one of the parameters, VECT-NEVT, is for the maximum number of events to generate.  It is set to 25 by default.  If you want to make more events than this, go ahead and modify this parameter!