next up previous contents index
Next: Utility Statements Up: Language Elements Previous: VME I/O   Contents   Index

EVENT I/O

The CODA 2.0 Readout Controller allows a secondary readout list to be downloaded. Its purpose is to accept events from the primary readout list and perform any user specific task such as compression, sparsification, or partial analysis. This type of list is specified by event readout keywords at the top of the file. The Event List is always a polling list as it will execute its trigger routine only if there is an event on its input queue (output queue of primary list). The following crl functions are available to Event Lists only:
get event            # get an event from input 
copy event           # copy event from input to output
                     # using a Event pool buffer 
pass event           # pass an event pointer from input
                     # to output. (fastest)
Normally the user would execute the get event command first in the Event List trigger routine. This function gets an event from the input queue, and sets the global variables EVTYPE (the event type i.e. 1-15 for Physics) and EVENT_LENGTH ( in number of longwords). It also sets up an array INPUT[] in which INPUT[0] points to the first data word of the event. It is left to the user to determine what is to be done with the event. At a minimum a pass event or copy event must be issued for the event to be passed on to the ROCs output unchanged. As a non-trivial example, the user could open a new event buffer and selectively copy data words from INPUT into the new event buffer:
begin trigger eventtrig 

variable ii 
get event 
open event type EVTYPE of BT_UI4
 %%

for (ii=0;ii<EVENT_LENGTH;ii++) {

     if((INPUT[ii]&0xfff) > 300) /*Check if over pedestal*/

     *rol->dabufp++ = INPUT[ii]; } 
%% 
close event 
end trigger


next up previous contents index
Next: Utility Statements Up: Language Elements Previous: VME I/O   Contents   Index
Mohammad Ahmed 2003-07-23