Some examples to run BFC (Big full Chain) under STAF
 
The macros mentionned below are accessible under : ~martin/public/chain.They have been tested using the SL99a version which can be selected by typing stardev. This version of Staf works better under sun than hp.
 
A macro to produce one hijing event (hijing.kumac)
* 11/18/98 K. Turner (for 98i) 
* Run BFC in following manner: 
* - must have hijev.inp in top level directory 
* - run hijing 
* - write out xdf file 
 
 
 exec $STAR/kumacs/chain/bfc _ 
   TOP=$STAR _ 
   domain=' gen/hij' _ 
   chain=' rhij egout' _ 
   no_events=1 _ 
   output_file=$SCRATCH/chain/hijing_cc _ 
   log=$SCRATCH/chain/hijing_cc.log
This macro is pretty simple, it run hijing (rhij) which is accessible by asking the domain gen/hij and write an output file (egout) which  is partly described by the  variable output_file. The full name of the file will be hijing_cc_gen.xdf.

Hijing need an input file called hijev.inp which should be in your working directory.  To produce one C+C event it should look like this :
'  ====================================================== '  
'  =====         Hijing Control file                ===== '  
'  ====================================================== '  
' Run number                      '  1  
' Event number                    '  1 
' Generator number                '  31  
' Frame/Energy                    '  'CMS'  200.  
' Projectile  type/A/Z            '  'A'  12 6  
' Target      type/Z/Z            '  'A'  12 6  
' Impact parameter min/max (fm)   '  0.   1.  
' Jet quenching (1=yes/0=no)      '  0  
' Hard scattering/pt jet          '  0   2.0  
' Max # jets per nucleon (D=10)   '  10  
' Set ihpr2(11) and ihpr2(12)     '  1   1 
' Set ihpr2(21) and ihpr2(18)     '  1   1 
' set B production                '  5.36 
The parameter ihpr2(12)  has to be set to one in order to unable the decay of Ks, lambda and anti-lambda which should be handled by geant. The output file should content one dataset evgen with only one table particle. Only the particle with the variable isthep=1 will be considered by gstar. Check that the parameter has been correctly set for Ks for exemple (idhep=310)
 
 
A macro to process one hijing event through gstar (gstar.kumac)
* Run BFC in following manner: 
* - read in event generator file (e.g. from hijing) 
* - run gstar 
* - run g2t 
* - run svt & tpc fast sim  
* - run svt & tpc tracking 
* - run global packages 
* - write xdf file containing full directories 
 exec $STAR/kumacs/chain/bfc _ 
   TOP=$STAR _ 
   tpc_sector_first=1 _ 
   tpc_sector_last=24 _ 
   gstar_settings='year_2a hadr_on' _ 
   domain=' geometry sim/gstar' _ 
   chain='  evgin rgst fzout' _ 
   skip=0 _ 
   no_events=1 _ 
   input_data_file=$SCRATCH/chain/hijing_cc_gen.xdf _ 
   output_file=$SCRATCH/chain/gstar_cc _ 
   log=$SCRATCH/chain/gstar_cc.log
This macro reads (evgin) one generated event  from the file input_data_file and process it through gstar (rgst).
The result from gstar is then written (fzout) in zebra format into the file output_file (the extension .fzd is added to the file name)
 
 
 
A macro to run a part of the analysis chain : the simulation and tracking in the tpc (g2t.kumac)
* Run BFC in following manner: 
* - read in event generator file (e.g. from hijing) 
* - run gstar 
* - run g2t 
* - run svt & tpc fast sim  
* - run svt & tpc tracking 
* - run global packages 
* - write xdf file containing full directories 
 exec $STAR/kumacs/chain/bfc _ 
   TOP=$STAR _ 
   tpc_sector_first=1 _ 
   tpc_sector_last=24 _ 
   gstar_settings='field_only' _ 
   domain=' geometry sim/g2t tpc' _ 
   chain='  fzin rg2t tpg tfs tpt tid tte_e evout' _ 
   skip=0 _ 
   no_events=1 _ 
   input_data_file=$SCRATCH/chain/gstar_cc.fzd _ 
   output_file=$SCRATCH/chain/g2t_cc _ 
   log=$SCRATCH/chain/lilian/g2t_cc.log
The macro reads (fzout) the event in zebra format, call the g2t module  and do the analysis of the tpc hits : loading of the tpc geometry (tpg), fast simulation (tfs), tracking (tpt), pid analysis (tid) and evaluation  (tte_e). The event is then written out (evout) in xdf format.

The rest of the chain can  be done by adding the call of the module in this macros or  in a separate macro. In this case the event should be read with evin. For a description of the meaning of the names which appear in the chain variable see the corresponding dictionnary.