next up previous contents
Next: FILE INP Commands Up: Event I/O Previous: Introduction   Contents


The FILE Command

Before SNOMAN 2.09, only a single input and output event stream were supported. The event file names were recorded in the JOBP bank. Now SNOMAN can handle multiple input and output streams which the user controls with the FILE command. To maintain backward compatibility, if the user does not supply any FILE commands for a given processor, for example the input processor INP, then a default FILE command will be automatically generated using the JOBP data. However, you are strongly encouraged not to rely on this and to use the FILE command instead.

The function of the FILE command is based on the following ideas:-

SU Association

In principle, a FILE command can be used to associate a file with any Software Unit (SU), although currently only a few processors use this feature. Here we shall concentrate on INP, OUT and SHL, see sections 13.3.8 and 13.1 for the MCO usage, section 7.3.2 for TCA, section 24.2 for RLG, section 24.5 for RLO and section 18.1 for CLN.

Multiple Streams

It is possible to have more than one file open at a time to the SU. To identify them, each is given a unique, but arbitrary, stream number, in the range 1..10. The combination of the SU name and the stream number is called a STREAM. For example:-

file inp 1 input.dat
file inp 7 input2.dat

defines two streams: INP 1 and INP 7, and associates file names with each. Events are read from both files in parallel under a specified selection scheme.

Concatenated Files

It is possible to have more than one file associated with a given stream. This is done simply by having multiple FILE commands for the same stream. For example:-

file inp 1 input.dat
file inp 1 input2.dat

defines a single stream: INP 1, and associates two file names with it. Events are read from both files sequentially; after the first file has been exhausted, the second is input. The number of files that can be concatenated onto a single stream is only limited by the size of the dynamic memory (for this is used to store the commands).

File concatenation can be freely used on multiple streams.

Options

One or more options can be appended to a FILE command to qualify its processing. For example:-

file inp 1 input.dat skip=5 max=100

instructs SNOMAN to skip the first 5 events on the file and to process only the next 100 (or until the EOF, if it comes first!). A complete list of options that can be used in INP and OUT can be found in section 3.9.5

Note that, for maximum flexibilty, the code that processes the FILE command allows any option with a valid syntax. This means that:-


next up previous contents
Next: FILE INP Commands Up: Event I/O Previous: Introduction   Contents
sno Guest Acct 2009-09-09