#!/bin/csh ############################################################### # # use this file to run run_db.csh # # usage : bsub [options] run_db_batch.job # # you can submit this script from any directory and # you can write the results to any directory # seen by the batch machines # # ############################################################### ############################################################### #----- SELECT YOUR INPUT HERE --------------------------------- ############################################################### #--- computing center [ cern | fnal ] setenv PLACE cern #--- owner in federation (e.g. 1034Pileup | lumi1030) setenv OWNER 1034Pileup #--- filename at owner (e.g. hlt1015 | jm_pi_pt30 ) setenv FILEGROUP hlt1015 #--- run number ( if zero, then all the runs are selected ) setenv RUN_NUM 0 #--- number of events to jump setenv JUMP_EV 0 #--- number of events to process setenv NUM_OF_EVENTS 4 ############################################################### #----- REPLACE THESE VARIABLES -------------------------------- ############################################################### switch ( $PLACE ) case cern: #----- the place where you want your output written ---- setenv MYSCRATCH $LS_SUBCWD #----- the place where you have orca checked out ------- setenv CHECKTOP $SCRATCH breaksw case fnal: #----- the place where you want your output written ---- setenv MYSCRATCH $PWD setenv WORKDIR $SCRATCH/nt_prod/$FILEGROUP/$RUN_NUM rm -rf $WORKDIR mkdir -p $WORKDIR #----- the place where you have orca checked out ------- setenv CHECKTOP $SCRATCH breaksw endsw ############################################################### # orca and operating system version ############################################################### setenv ORCAVERSION 'ORCA_4_5_0' setenv OPSYSVERSION `scram arch` ############################################################### # path and jobnames ############################################################### setenv RUNPATH $CHECKTOP/$ORCAVERSION/bin/$OPSYSVERSION setenv ANALPATH $CHECKTOP/$ORCAVERSION/src/Workspace setenv MYID {$FILEGROUP}_{$RUN_NUM} ############################################################### # copying the stuff to temporary area of the batch machines ############################################################### rm -f $MYSCRATCH/$MYID.date date > $MYSCRATCH/$MYID.date echo copying to batch working directory >> $MYSCRATCH/$MYID.date cd $WORKDIR rcp -r $CHECKTOP/$ORCAVERSION . ls -la $WORKDIR >> $MYSCRATCH/$MYID.date cd $ORCAVERSION/bin/$OPSYSVERSION ls -la >> $MYSCRATCH/$MYID.date date >> $MYSCRATCH/$MYID.date echo copying done, running >> $MYSCRATCH/$MYID.date ############################################################### # running ############################################################### #source clear.csh ### on db files echo running on db files >> $MYSCRATCH/$MYID.date rehash source run_db.csh $PLACE $OWNER $FILEGROUP $RUN_NUM $JUMP_EV $NUM_OF_EVENTS date >> $MYSCRATCH/$MYID.date ls -la >> $MYSCRATCH/$MYID.date echo run finished, copying the result back >> $MYSCRATCH/$MYID.date ############################################################### # copying back the results to user's own area ############################################################### switch ( $PLACE ) case cern: rfcp *.txt $MYSCRATCH rfcp *.ntup $MYSCRATCH breaksw case fnal: rcp *.txt $MYSCRATCH rcp *.ntup $MYSCRATCH breaksw endsw date >> $MYSCRATCH/$MYID.date echo done >> $MYSCRATCH/$MYID.date