#! /bin/tcsh -f # ----------------------------------------------------------------------------- # # Name : define_new_pass_and_fill.tcsh # # Purpose : Define a new pass based on 09FIXEDLER but with fixed beamlines for a certain run range # # Usage : define_new_pass_and_fill.tcsh # # Options : Go home. # # Arguements : I've got a few. # # Created : Ben Cooper 20/01/2004 (my birthday - sad isn't it) # # --------------------------------------------------------------------------------------------------------- #look for any other processes with the same name and exit if you find them #(we don't want multiple copies of the same script) ps -fN -p $$ | grep $USER | grep $0 | grep -v grep && exit 5 #setup the software source ~cdfsoft/cdf2.cshrc setup cdfsoft2 4.11.2 set aaaaa_oracle_dir = `echo $ORACLE_CLIENT_DIR` setup cdfdb #is the database working? if not exit with no output dbPing -dcdfonprd -s > /dev/null || exit 6 #move to the right place cd /data1/cdfcalib/cron_scripts/fill_passtable #sqlplus -s cdf_reader/reader@cdfonprd @get_prob_runs.sql if (! -z runs.lst) then #checking have defined the necessary files #==================================== #add the new beamlines - PAD_PHYSICS_SVXBEAM pass 08, PAD_PHYSICS_COTBEAM pass 07 #==================================== # Check that all runs in list are numeric. foreach r ( `grep . runs.lst` ) # Loop over runs. @ n = 0 # Default. @ n = `echo $r | awk '{print int($1)}'` # Numeric run. if ( $n == 0 ) then # If non-numeric run translated to zero. echo "Error: Exit because of non-numeric run $r" echo "Will not process any runs." exit 4 # Exit. endif # if ( $n == 0 ) end # foreach r ( `grep . runs.lst` ) #loop over runs and merge in the beamlines using jobset of PAD_PHYSICS_CDF 09FIXEDLER as base foreach r (`grep . runs.lst`) echo "in loop" echo "run = $r" #find the jobsets to be merged #@ prod_13_jobset = `sqlplus -s cdf_reader/reader@cdfonprd @get_jobsets.sql $r PROD_PHYSICS_CDF 13` #now make version4 of PROD_PHYSICS_CDF merging in the new svxalign valid set for 5.1.x echo "/cdf/people2/snihur/DBSetMerge.exe/DBSetMerge.20020111 TESTMODE OTL /@cdfonprd used $r PROD_PHYSICS_CDF PROD_PHYSICS_CDF PROD_PHYSICS_TOF" /cdf/people2/snihur/DBSetMerge.exe/DBSetMerge.20020111 TESTMODE OTL /@cdfonprd used $r PROD_PHYSICS_CDF PROD_PHYSICS_CDF PROD_PHYSICS_TOF >& db_testmode_out cat db_testmode_out rm db_testmode_out /cdf/people2/snihur/DBSetMerge.exe/DBSetMerge.20020111 OTL /@cdfonprd used $r PROD_PHYSICS_CDF PROD_PHYSICS_CDF PROD_PHYSICS_TOF >& db_out cat db_out rm db_out end echo "finished making new versions for runs.lst" #=============================================================================================== endif