#! /bin/tcsh -f # ----------------------------------------------------------------------------- # # Name : validate_passtable.tcsh # # Purpose : For a given passtable, make plots of table cid verses run number # for each calibration table in the global used_set PROD_PHYSICS_CDF # # Usage : validate_passtable.tcsh # # Arguements : = name of passtable to be validated. will take the highest un-retired passindex of this passname # # Created : 16/09/2003 # # # Author : a very bored Dustin McGivern # # ----------------------------------------------------------------------------- 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. #???? where am i going to run this? cd /cdf/onln/data/cdfcalib/cron_scripts/monitoring/validate_passtable/ #we use this fantastic bit of code from Randy (via rob) to turn the output of any sql query into a root file. #first step is to make a root macro that contains all the sql output in commands to fill a root file #uses the passname provided to the script! ($1) #passname is the name of the tree i think (or it might be T? or both?) #passname.root is the name of the output file you get when you run the resulting macro make_passname$1.C # Perform the sed command : substitute the passname given to script into the sql file echo "s/INSERT_PASSNAME_HERE/$1/" > ./sed.tmp sed --file=./sed.tmp template.sql > passname_$1.sql cat passname_$1.sql | (./kitchensink T passname passname.root > make_passname_$1_plots.C) #now run the root macro to make the root file root -q -b make_passname_$1_plots.C #if the output root file looks ok (or it at least exists) then remove the macro to save space. rm make_passname_$1_plots.C #now run the analysis macro to make a rootfile containing the TGraphs of cid vs run# for each of the calib tables root -q -b main.C mv plotted_graphs.root plotted_graphs_$1.root ##2do: #compare the resulting plots to another passname?