First  session

To run simulations of the STAR detector, user has to run staf program. If you have a working version of STAR software, type


to start your first session.  You will be asked about the type of staf session that you wish to run:

Workstation type (?=HELP) <CR=1 :

Answer 1 to have an interactive session (with graphics) or 0  for a background one (without graphics). As staf is built with PAW, for the same purpose one can use the command:

staf  -w 1  / staf  -w 0

Before loading geometry description into memory for the first session it would be a good idea to have a possibility to track what happens. Staf has a special working regime for this purpose.  One should  use commands

debug on  / debug off

in order to switch this mode on and off.

You can get some short reference about any command that can be used in staf. To read it type:

help command_name

Use q to quit help page.

The geometry of each STAR detector in GSTAR is described in a single module. Modules are written in the GEANT language and translated by the parser into conventional, well commented FORTRAN subroutines compiled and linked with the rest of GSTAR libraries. A module consists of the module header, the data definition part and a number of blocks, each describing one GEANT elementary volume and its content.

For a first run one can use command:

make geometry

in order to run a default version of detector geometry. At this moment the program code contained in


file will be executed.

If you run your first session in debugging mode, you will see a viewgraph of STAR detector in your graphic window and full information about loading modules (with full paths) as well as values of the most important flags and parameters on your terminal.
       Besides a possibility to make a setup step-by-step with your own hands (described in the next section) you can use one of the standard configuration, that can be loaded using geometry.g, mention above. To obtain information about all possible flags, which switch between different versions, type

detp geometry help
make geometry

You'll get the following table:

Configurations: complete,tpc_only,field_only
                : year_1a,s,b,h,c;  year_2a
Geant Physics  : Hadr_on, Hadr_off, Decay_Only
Geometry Detail: mwc_off, pse_off, 4th_off
Magnetic Field : Field_on/off, field=value
Auxillary keys : Debug_on/off, Split_on/off
Default: complete STAR with hadr_on

For the time being the following keywords may be used to select specific
STAR detector configuration, GEANT physics or a run mode. There are a few possible keywords to switch between different configurations:

Using  special flags for geometry.g code you can define type of physics processes for event simulation: Three following flags defines specific geometry detail: Another keys can be used for magnetic field settings. There are And last for keywords help to setup some auxiliary modes: As one can see from the help message, default settings include the complete STAR with all geant physics on. To change default settings by means of keywords described above, one should use detp command  before running geometry.g. For instance:

detp geometry year_2a field_off

This command line contains a list of parameters (keywords) which will be passed to the module  geometry.g .

Even if you didn't turn on debugging mode before running geometry.g you can check what has been loaded. For interactive access to this information, one can use the following command (for output see fig.1)

disp detm

Here "disp" means "display", "detm" means "detector main bank". As a parameter for disp command one can use any name of existing bank, for instance: disp svtt. During displaying any bank it is possible to navigate through all components. Click right button of your mouse on the bank name, which you are interested in, and the contents of this bank will be displayed.

Figure 1. Interactive navigation through data banks.

Each branch is a separate module. Each module has it's own detm (detector main bank), flags, and parameters. If you click left mouse button on the name of the bank (blue rectangles), you'll get  information about internal modules of this bank. To receive full information about bank parameters and their values, click left button above the green rectangle. It'll be printed out on your terminal. For advanced users it can probably be useful to check just values of bank parameters (without names and commentaries). For this one can click into the green rectangle with the bank description.  Because of numerous modules describing  STAR detector in GSTAR, one can see just a part of them in the graphic window. To see the rest you'll need to choose field "continue" in the right upper menu.  Click the upper field named "NONE" to quit your interactive bank inspection.

For the "first time user" it would be better to print out contents of banks and get some information about "what this parameter means". One can create a bank manual, save it into a file for easy reading. One can do it for all modules together as well as for individual module. Use the command

drawone detm                        // Click here to see the output

to print out full information about any bank (you'll have to specify bank name after entering this command, for complete manual about everything type NONE as a bank name). To get more specific information (with parameter values) about one chosen bank there is a command

gdump bank_name

Pay attention that you have to define the full path of the bank that interests you. For instance,

gdump //detm/svtt/svtg    // Click here for output

As a default settings this command uses screen output, but it's possible to send all information into a file too. Use option F for file output (try help gdump for more information).

Next step. Now that you are able to obtain all information about data banks, created in GSTAR for simulation, you can specify values of flags and parameters for your needs.
User can specify the set of input flags and parameters to work with any special configuration. The default settings have been defined in the geometry.g code. Besides there are two other different ways to make settings of variable values:

Let's first define the difference between "parameters" and "flags". Every  bank has 15 specific parameters (same set for each bank) which define the common behavior of the system.  They are Each flag can usually have one of three values 0, 1 or 2. Where the usual meanings are: 0 - option is inactive (no print, no debug, no histograms etc.), 1 - normal (standard or default) versions, 2 - enhanced (if exists). In particular

for PRIN:  0 - quiet running
                  1 - announcing module
                  2 - give some info about module parameters
                   3 - print a comprehensive info
                  4,5 etc. - add more info (starting real debug)

for SIMU:  0 - no hits are produced
                   1 - default geant hits, i.e. with a reference to a
                          PREVIOUSLY existed KINE track
                   2 - save actual track which produced a hit in this
                          detector in KINE (as secondary) and make the hit
                           refer to it.

for GRAF:  0 - default (code driven) graphics
                    1 - upper level volumes only
                    2 - some details drawn
                    3 - more details drawn

All other parameters, which describe, for example, material of detector, its geometry etc. are different for each module, so, in this manual we call them just parameters in order to distinguish them from flags.
One can change values of each parameter or flag using detp. This command provides a way to modify the content of parameter banks.

detp module_name bank_name.parameter_name=new_value

The content of a "detp module_name ...." command is saved in the //detm/module_name/detp bank. Only one detp command per detector is kept in the program, the consequent detp commands are not added to each other but overwrite the previously issued detp command for this detector.
 Typing rules for  detp parameters are the following:

We provide some examples of detp command usage.
For instance, to change the value of  variable RMAX from bank SFPA, module SVTT  from 28 (default) to 20, type:


In case of a few internal banks with the same name in one module (for instance, banks describing SDD wafers inside of each SVT ladder), one has to specify in addition the number of bank:

detp SVTT SVTL(layer=6).Nwafer=8

Any number of banks and their variable can be changed by single command:

detp SVTT SVTL(layer=6).Nwafer=8 Radius=0.2

It is important to note, that if you wish to apply your own configuration, you have to setup parameter values before running geometry.g. Otherwise your values will not be applied. It is possible to re-run geometry.g in order to adopt new values. It can be done by this way:

gdrop all                                                    /to clear the memory
detp module_name bank_name.parameter_name=new_value          /to define a new value
make geometry                                                /to build a new configuration

Using this command it is possible to change flag values too. But sometimes it is necessary to change some flags during one session (for instance, in order to draw every second event). For this purpose one can use the following command:

mode module_name flag_name value

For example,

mode SVTT HIST 0          will immediately change default mode 1 to 0.

If you are working in debug on session then using the same command you can easy check the current flag values for all banks as well as for one of them:

mode all          / to print out flags values for all banks or

mode SVTT         / to get flags of SVTT module