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.
setenv PROJECT /var/phy/project/hep/neutrino source $PROJECT/soft-SL6/SK-Duke.login
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
/var/phy/project/hep/neutrino/work/schol/superk/examplesinto 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.
do ihit=1,nqisk * Output hit number, cable number, charge, time write(6,*) ihit,ihcab(ihit),qisk(ihcab(ihit)), & tisk(ihcab(ihit)) enddoihit is the hit number, ihcab(ihit) is the tube number, and qisk and tisk are the charge and time, respectively, for that tube.
Now look at example1.sh. 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.
gmake example1This compiles and links the source code according to the GNUMakefile instructions. The resulting executable is created in your working directory.
./example1.sh filenamewhere the filename argument is the SK data file you want to run on. For this test, I suggest you do
./example1.sh /var/phy/project/hep/neutrino/work/schol/superk/data/ofl_run024646.052.000256.000258This file is a nearly unprocessed raw data file, without any reconstructed information and all triggers.
./example1.sh /var/phy/project/hep/neutrino/work/schol/superk/data/ofl_run024646.052.000256.000258 | lessand hit the space bar for paging output, "b" to go back.
Next example will be to make some histograms.