A typical example is that the user may have two runs of event-by-event data which were performed with different parameters, for example, the beam energy may have been different.
Instead of hard-coding these parameters in the sort code, the user may place them in a set of variables which may be altered at run time, and may be changed between the reading of different runs.
To do this, the user declares the variables in the
*vars
section of the sort
code. An entry like this is typical:
5 ebeam 75.0The number is used inside the sort code to access the variable. The name is there to help the user remember what the variable does, and the value listed on the right is a default value used whenever the sort code is loaded.
At any time when Sunsort is not sorting data, the user can change the values of these variables. When sorting commences, the sort code will be able to see these values and take appropriate action. The user can change these variables through either the GUI or at the command line.
Select the variable you wish to modify from the scroll list, enter the new value in the field marked Value and press the button marked modify.
var variable_number new_valueFor reasons which are too complex to explore here, changes in variables made at the command line are not visible from the variables window until you type the command update.
An example batch file may read:
var 5 56.4 update open tape run03 sort 0 -1 close save all run03 sdb 1 var 5 65.3 update open tape run04 sort 0 -1 close save all run04 sdb 1
If you want to get a list of all variables when you are at the command line, then type vars or printvars. Both commands are the same.