Super-K Code: Example 1

A First Super-K Code Example

Here is a first Super-K program example. It's in Fortran (not exactly the language of the future) but should serve well to illustrate some of the ideas and tools.

All this program does is to take a raw Super-K data file, and dump to the screen a list of events; for each event, it then loops through the ID PMT hits and writes to the screen: hit number, cable number, charge, time.


You'll need to have run the same two setup lines as for the superscan tutorial (preferably, have put them in your .tcshrc), which should have set up a bunch of SK-related environment variables:
setenv PROJECT /var/phy/project/hep/neutrino
source $PROJECT/soft-SL6/SK-Duke.login

Files for this example

Create some working directory for yourself, either in your home directory or in the /var/phy/project/hep/neutrino/work/youruserid area. Copy the following files from

into that directory:

First, before doing anything else, take a look at example1.F, and see if you can follow generally what it's doing. I've put numerous comments in it (labeled by "*" in the first column) which I hope will help somewhat.

Now look at This is a shell script that you run in order to run the program. It uses a package called "rflists" to specify filenames. It may look a bit cryptic to you if you're not a Unix shell script expert, but the key thing to note right now is that the second to last line is the executable to run, and the stuff inside the "{{ }}" specifies information about the input file. In this example, there is only one input file (entered as a command line argument for this particular script), but in general one can specify output files too.

Finally, look at the GNUmakefile. This is a file which contains information for compiling and linking the program. Needed libraries and includes are linked against automatically using information specifed in $(SKOFL_ROOT)/config.gmk. The OBJS line of this file specifies programs to compile.

Running this example

Next example will be to make some histograms.