Suppose we have a file of data called input.dat that we wish to process as follows:-
file inp 1 input.dat file out 1 small_events.dat file out 2 fit_fails.dat file out 3 fitted_events.dat
$define_test 1 $line_1 'nhits float_equals EV+$KEV_NPM: 10 999;' $enable_test 1 $define_test 2 $line_1 'nhits float_equals EV+$KEV_NPM: 20 999;' $enable_test 2
$multi_output_sel $pel_args
define event_loop * Start the definition
call inp * Input event
call flt(1) * Apply test 1: PMT hit < 10
if_not_ok quit_event * If it fails we quit this event
call flt(2) * Apply test 2: PMT hit < 20
if_ok goto big_event * If it passes goto big_event
call out(1) * Output event on stream 1
quit_event * and quit
big_event: * Come here if PMT hit < 20
call ftt * Try to fit
if_ok goto fit_ok * If it passes goto fit_ok
call out(2) * Output fit failures on stream 2
quit_event * and quit
fit_ok: * Come here if fit passes.
call out(3) * Output fit passes on stream 3
end_def * End the definition