next up previous contents
Next: Calling a Support System Up: Using the Standard User Previous: Example 1: Writing Selected   Contents

Example 2: Analysing a Data File

Having a created a file of events using with the program described above, you are now ready to analyse it with this second example which:-

This example will not be given in detail as it forms the basis of the set of user routines that is example 2 in the examples directory. Again the routine USER_DEFINE_MEMORY_SIZE is not required, and for USER_DEFINE_TASK you now needs the SUs:- INP Event Input
HBK HBOOK Support One point to watch is the that the event loop now consists purely of event input. So the insertion point for USER_EXE has to be changed in USER to:-

 
        if (             i_su_id .eq. KSU_INP
       +    .and.      i_process .eq. KSU_PROCESS
       +    .and.  i_call-status .eq. KSU_AFTER_CALL ) call user_exe
USER_INI, USER_EXE and USER_TRM can be coded to book and fill histograms as required. The command file now looks like this:-

$event_limit 0
FILE INP 1 'my_event_output.dat'
titles job_control.dat
end
Setting the event limit to zero, effectively sets it to infinity, so that processing will proceed until EOF. This time only the titles file job_control.dat is needed. It contains the JOBP bank, which will be ignored, and the only word of the JOB bank that is used (assuming there are no store fulls) is the number of events to process and this is overridden in the command file making the JOB bank nothing more than a scratch pad on which to pass data from the command file to SNOMAN. Of course, job_control.dat also contains other essential titles bank that cannot be stored in the database, see section 3.8


next up previous contents
Next: Calling a Support System Up: Using the Standard User Previous: Example 1: Writing Selected   Contents
sno Guest Acct 2009-09-09