Accessing SK OD Info

The tutorials so far all give examples of accessing arrays of Super-K inner detector (ID) charge and time information. The outer detector (OD) information can be obtained from similar arrays in the standard SK commons (found in sktq.h.) However there is a difference in indexing between ID and OD arrays.

ID Array Indexing

ID information is best accessed in an array indexed by cable number, e.g.

               do ihit=1,nqisk

* Output hit number, cable number, charge, time                  
                  write(6,*) ihit,ihcab(ihit),qisk(ihcab(ihit)),
     &                            tisk(ihcab(ihit))


Here, nqisk is the number of ID tubes hit and qisk and tisk are the charge and time arrays, and the cable number ihcab(ihit) is the index to use in these time and charge arrays. For instance, qisk(ihcab(ihit)) is the charge for the cable corresponding to hit number ihit.

OD Array Indexing

In contrast, for the OD, the array to use is indexed by hit number. For example:

               do ihit=1,nhitaz

* Output OD hit number, cable number, charge, time
                  write(6,*) ihit,icabaz(ihit),qaskz(ihit),
     &                            taskz(ihit)

Here, nhitaz is the number of OD hits, and icabazqaskz and taskz are the cable, charge and time corresponding to each hit in the array. The main reason to treat these differently is that hits in the OD array span a wider range of time than the ID, so that more than one cable can be hit in the same event (typically, one wants only hits in time with the trigger.)

Another detail that’s different between ID and OD: cable numbers in the OD array have 20000 added to them (so it may be desirable to subtract 20000 from the cable number before use.)

$TUTEXAMPLES/example_od.F contains the source code for a sample program that looks at OD info.

Using the old rflist method

This example, example_od.F and, uses the older rflist method where a shell script produces a text file called an rflist, which is used to open files.  We prefer to use the set_rflist function, as it requires no messy text file business (and frequently eliminates the need for an extra shell script), but you will find many examples of this method being used in the Super-K code.

Note that in, we set the rflist file name to include the machine (`hostname`) and process ID number ($$).  That way, every rflist is sure to have a unique filename, even if a process is run many times in parallel.

Back to the tutorials top page