How To - Analysis job                                                                        Kenji Hamano

Last modified : Jul14, 2005                                              Back to How To      Back to Home


A. Setup environment
   1. Use tcsh (extended C shell). To change shell
     >chsh -s /bin/tcsh
   2. To setup Babar and root environment, copy ~khamano/.cshrc to your home directory. (you need to re-login to change to this setting)
   3. Set boot file
     > cond14boot

B. Setup release directory
   1. Use newrel command, but don't have to create a symbolic link to scratch area. For example
     > newrel -t 14.5.5 analysis-23
   2. Go to the relese directory and do srtpath.
     > cd analysis-23
     > srtpath [return] [return]
   3. Get a token from SLAC to check out packages. For example
     > klog -principal khamano -cell slac.stanford.edu
   4. Check out "workdir" and do setup
     > addpkg workdir
     > cd workdir
     > gmake setup
     > cd ..

C. Submit jobs to PBS queue
   1. This is an example of submit command
       > qsub -q general -l walltime=23:59:00 -V -N BToDlnu -e log -o log yourScript.pl
       "-q" : queue to submit
       "-N" : your job name on the queue
       "-e" : error output directory
       "-o" : stdout output directory
     You cannot specify your logfile name.
     Different from SLAC (LSF) you have to submit a script (yourScript.pl).
     You cannot say something like "BetaMiniApp myJob.tcl".
   2. This is a sample script for beta jobs (yourScript.pl)
       #!/usr/bin/perl -w
       #use strict;
       chdir "/home1x/hep/khamano/releases/BToDlnu-a23_14.5.5/workdir";
       my $cmd = "../bin/Linux24SL3_i386_gcc2953/BToDlnuMiniApp myAnalysisJob.tcl";
       system($cmd);
       exit;
     For root jobs (yourScript.pl):
       #!/usr/bin/perl -w
       #use strict;
       chdir "/home1x/hep/khamano/releases/BToDlnu-a25_16.1.3/workdir";
       my $cmd = "bbrroot -b -q ./massPlot_test.C";print STDERR "'$cmd' ...\n";
       system($cmd);
       exit;
   3. Note that you may need to set LD_LIBRARY_PATH in your script when you submit Babar beta jobs.
     For analysis-23:
       $ENV{'LD_LIBRARY_PATH'} = "$ENV{'LD_LIBRARY_PATH'}:/home1x/hep/babar/package/objy7.1/linux86/lib";
     For analysis-25:
       $ENV{'LD_LIBRARY_PATH'} = "$ENV{'LD_LIBRARY_PATH'}:/home1x/hep/babar/package/objy8.0.9/linux86gcc3/lib";


D. Notes to BeataMiniUser in CM2.
   1. Unlike analysis-13 (BetaUser), you do not have to change the setting of tcl files in the BetaMiniUser directory, for example, BetaMiniUser/MyMiniAnalysis.tcl.
     These tcl files containes default settings, and if you create a tcl file in your workdir and specify some conditions, the default settings are automatically replaced.
   2. Cotrolling jobs by environment variables are not recomended in CM2.

E. To use BToDlnuMiniUser
   1. Check outBToDlnuMiniUser V01-01-02
   2. Read REDAME file and follow the steps.