SNOMAN Native Commands

The following native commands are built into SNOMAN:-

The @ Command
The DEFINE Command
The ECHO/NOECHO Command
The END Command
The FILE Command
The HELP Command
The QUIT Command
The SET BANK Command
The TITLES Command

Additional symbolic commands can be added by updating the The SNOMAN Symbol Table .


The @ Command

Syntax: @filename

Example: @my_job

This command directs SNOMAN to take subsequent commands (which can include further @ commands) from the file specified. When the file is exhausted command processing will resume in the current file. If the file name does not contain a dot then the default extension .cmd is assumed.

The search sequence for the command file is as follows:-

  1. The current directory
  2. $SNO_ROOT/snoman/$SNO_SNOMAN_VER/mcprod
  3. $SNO_ROOT/snoman/$SNO_SNOMAN_VER/prod
  4. $SNO_ROOT/snoman/$SNO_SNOMAN_VER/code

The DEFINE Command

Example:
   DEFINE event_loop
      call inp                * Input an event
      call flt(1)             * Apply filter test 1: nhits>40
      if_not_ok quit_event    * Quit event if test fails
      call ftt                * Try to fit
      if_ok goto fit_ok       * If fit successful, jump to fit_ok
      call out(3)             * Otherwise, output fit failures on stream 3
      quit_event              * Quit the event
   fit_ok:                    * A label
      call out(2)             * Output fit successes on stream 2
   END_DEF
This command is currently used for defining the programmable event loop, but may have other uses in future. An event loop program is a more versatile form of the $processor_list command. The program appears between the lines 'DEFINE event_loop' and 'END_DEF', and consists of labels, conditions and commands. Commands can be any of the following:-
   call xxx                   Call processor xxx
   call xxx(arg1,arg2,...)    Call processor xxx with arguments
   continue                   Null command
   goto label                 Goto label
   quit_event                 Quit the event
   quit_job                   Terminate SNOMAN
Commands with a preceeding condition ('if_ok' or 'if_not_ok') are only executed if the return code from the last processor call satisfies the condition.

The event filter (FLT) and the output processor (OUT) support arguments. Filter arguments specify which tests to apply (the result is passed back as the return code:- OK=true, NOT_OK=false). Tests are defined in FLTR banks and can be set up quickly with commands such as:-

   $enable_test 1
   $define_test 1 $line_1 'nhits float_equals EV+$KEV_NPM:40 999;'
Arguments to the output processor can be used to specify which streams to output the current event on. If this behaviour is required, then the command '$multi_output_sel $pel_args' must be given at some point otherwise events will be output on all open streams.

Full details of the filter and programmable event loop can be found in the User Manual.


The ECHO/NOECHO Command

These commands determine whether, after translating symbolic commands the translated line is copied to the standard output before processing. Initially echoing is on. Use echo to help learn what banks you are modifying when you use symbolic commands.

The END Command

This command terminates command processing at once, even if the command appears in a file that was invoked with the @ command.

The FILE Command

Syntax: FILE su_id stream_no file_spec options

Example: FILE INP 1 input.dat skip=5 max=100

Example: FILE INP 1 sno_0000001029_?.zdab first_subrun=4 last_subrun=9
Generate multiple FILE INP for sno_0000001029_004.dat .. sno_0000001029_009.dat

Example: FILE OUT 1 output.dat device=$disk format=$zdab_only

Example: FILE INP 1 loveboat.sno.laurentian.ca device=$mem
See the Dispatching Data section of the User Manual for details of device=$mem usage.

This command is used to associate a file with a Software Unit and in particular, INP and OUT, the event input and output processors. The following options are available:-

Option SU Position Meaning checkpoint MCO 1 A Seed checkpoint frequency i.e. if checkpoint=10, output every 10th event. Default: checkpoint=1 SHL 1 A Interactive command checking frequency Default: checkpoint=100 device INP,OUT A Type of device. $disk, $tape or $mem Default: device=$disk first_subrun INP A First subrun when file name includes wildcard ? Default: first_subrun=0 format OUT F Output format. Either $full_ds or $zdab_only Default: As set by $default_output_option last_subrun INP A Last subrun when file name includes wildcard ? Default: Last_subrun=999 max INP A Event input limit Default: max=999999999 skip INP A No. of events to skip before processing MAX events e.g. skip 10 max 10 will skip 10 and then process a further 10. Default: skip=0 weight INP F Weight to use when selecting by weight Default: weight=1.0 Where "Position" column specifies the option's use when concatenating; it is either A (for all files) or F (first file only) A discussion of the FILE command can be found in the User Manual

The HELP Command

This gives brief summary of the available SNOMAN commands.

The QUIT Command

This quits SNOMAN.

The SET BANK Command

Syntax: SET BANK bank_name bank_no WORD bank_adr {OFFSET offset} TO value value ...

Example: SET BANK JOB 1 WORD 2 TO 200

Example: SET BANK MCPI 1 WORD 67 OFFSET 9 TO 40 1. 1000000. 1.

This command can be used to change one or more words in a titles bank starting at the bank address specified. Up to 10 values can be provided which can be any of the following mixed in any order:-

The OFFSET clause is optional; if present, the offset it declares is added to the bank address. It is unlikely that user will want to use this feature directly, but it is useful in symbolic commands that access titles banks that form tables. Then the bank address can be used to select the row and the offset to select the column for that row, or vice versa.

The TITLES Command

Syntax: TITLES filename

Example: TITLES my_titles

This command directs SNOMAN to read a titles file containing one or more titles banks. If the file name does not contain a dot the default extension .dat is assumed.

The search sequence for the titles file is as follows:-

  1. The current directory
  2. $SNO_ROOT/snoman/$SNO_SNOMAN_VER/mcprod
  3. $SNO_ROOT/snoman/$SNO_SNOMAN_VER/prod
  4. $SNO_ROOT/snoman/$SNO_SNOMAN_VER/code
except for sdb_multi_file.dat which is first searched for on $CDSERV before trying the list above. This allows this special file, which describes the way certain titles banks are split across physical database files, to be decoupled from specific versions of SNOMAN.
Go Back to the Snoman Companion Top Page


Highest link so far: 9:-
The @ Command The DEFINE Command The ECHO/NOECHO Command The END Command The FILE Command The HELP Command The QUIT Command The SET BANK Command The TITLES Command Commands and Command Files