Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:57:09

0001 #!/bin/bash
0002 
0003 if [ $# -lt 2 ]
0004     then
0005     echo "Error: first and last line requested."
0006     exit
0007 fi
0008 
0009 if [ $1 -gt $2 ] 
0010     then
0011     echo "Error: the second parameter must be >= than the first."
0012     exit
0013 fi
0014 
0015 isCmsswEnv=`echo $PATH | awk -F: '{print $1}' | grep CMSSW`
0016 
0017 if [ "$isCmsswEnv" == "" ]
0018     then
0019     echo "Warning: CMSSW environment not set."
0020     echo "         Trying \"cmsenv\" here."
0021     eval `scramv1 runtime -sh`
0022     isCmsswEnv=`echo $PATH | awk -F: '{print $1}' | grep CMSSW`
0023     if [ "$isCmsswEnv" == "" ]
0024         then
0025         echo "Error: \"cmsenv\" did not work, this is not a CMSSW workarea."
0026         echo "       Move to some CMSSW workarea and type \"cmsenv\"."
0027         exit
0028     fi
0029 fi
0030 
0031 if [ $# -eq 3 ]
0032     then
0033     dir=$3
0034 else
0035     dir=""
0036 fi
0037 
0038 ii=$1
0039 #numpar=0
0040 
0041 if [ -f Values.txt ]
0042     then
0043     rm Values.txt
0044 fi
0045 
0046 if [ -f Sigmas.txt ] 
0047     then
0048     rm Sigmas.txt
0049 fi
0050 
0051 touch Sigmas.txt
0052 
0053 first=1
0054 
0055 while [ $ii -le $2 ]
0056   do
0057   ./TakeParameterFromBatch.sh $ii $dir
0058   if [ ! -f Values.txt ] 
0059       then
0060       echo "Warning: no parameters at line "$ii"."
0061   else
0062       numpar=$(sed -n "1p" Values.txt | awk '{print $2}')
0063       root -l -b -q MakePlot.C > OutputFit_param_${numpar}.txt
0064       grep sigma_final OutputFit_param_${numpar}.txt | awk '{print $2}' >> Sigmas.txt
0065 #      if [ -f plot_param_x.gif ]
0066 #         then
0067 #         mv plot_param_x.gif plot_param_${numpar}.gif
0068 #      fi
0069       rm Values.txt
0070   fi
0071   (( ii++ ))
0072 done
0073 
0074 exit
0075