next up previous contents
Next: Elements of a program Up: Programming the Event Loop Previous: Programming the Event Loop   Contents

What Does a Program Look Like?

A simple example is given here to indicate how an event loop program is set up. The command:-

$processor_list 'INP FTT OUT END'
tells SNOMAN to input, fit, and output each event in turn. Now, suppose we only want to apply the fitter to those events with greater than 50 hits and output these to a separate file. This may be acheived by replacing the $processor_list command with the following lines inside a command file:-
define event_loop
   call inp              * Input an event.
   call flt(1)           * Apply test 1: true if Nhit>50
   if_ok goto big_event  * If test 1 ok, jump to big_event
   call out(1)           * Output event on stream 1.
   quit_event            * Quit and go on to next event
big_event:  
   call ftt              * Fit event.
   call out(2)           * Output on stream 2.
end_def
The details of the structure and available commands are given in the next section.



sno Guest Acct 2009-09-09