#! /bin/tcsh -f #========================================================================= #Script to calculate time delay for making calibs # #author: Dustin McGivern # #notes: # # #Date: 15-07-2003 # # #========================================================================= #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/monitoring/timeDelay #get a list of creat dates for the used sets. #spools a file called used_set_delay.out that contains: #run creat_time L3, create_time prod_cdf 1, create_time prod final, passtable fill time rm ./sed.tmp rm age_$1.sql rm make_times_ntuple_$1.C # Perform the sed command : substitute the passname given to script into the sql file echo "s/INSERT_PASSNAME_HERE/$1/" > ./sed.tmp echo "s/INSERT_RUNMIN_HERE/$2/" >> ./sed.tmp echo "s/INSERT_RUNMAX_HERE/$3/" >> ./sed.tmp sed --file=./sed.tmp template_age_new.sql > age_$1.sql #now make the root macro that contains the fill commands #run the query aganst kitchensink to make a root ntuple of the output cat age_$1.sql | (./kitchensink times times timeDiffs.root > make_times_ntuple_$1.C) #now run the root macro to make the root file root -q -b make_times_ntuple_$1.C #now run the analysis script to make the plots. root -b -q main.C #and move the resulting plots to the web page. mv time_delay_profile_recent.eps time_delay_profile_recent_$1.eps mv time_delay_hist_recent.eps time_delay_hist_recent_$1.eps #tidy up a bit rm timeDiffs.root #end of the script