Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:51

0001 #!/bin/bash
0002 display_usage() { 
0003     echo "This script must be run giving the following arguments." 
0004     echo -e "./testCompare.sh <name of tag> <first IOV> <last IOV> <sqlite file> \n\n"
0005     echo -e "example: \n ./testCompare.sh SiStripApvGain_FromParticles_GR10_v1_express 300577 302322 toCompare.db \n" 
0006 } 
0007 
0008 # if less than two arguments supplied, display usage 
0009         if [  $# -le 3 ] 
0010         then 
0011                 display_usage
0012                 exit 1
0013         fi 
0014  
0015 # check whether user had supplied -h or --help . If yes display usage 
0016         if [[ ( $# == "--help") ||  $# == "-h" ]] 
0017         then 
0018                 display_usage
0019                 exit 0
0020         fi 
0021 
0022 # Save current working dir so img can be outputted there later
0023 W_DIR=$(pwd);
0024 # Set SCRAM architecture var
0025 SCRAM_ARCH=slc6_amd64_gcc630;
0026 STARTIOV=$2
0027 ENDIOV=$3
0028 
0029 export SCRAM_ARCH;
0030 source /afs/cern.ch/cms/cmsset_default.sh;
0031 eval `scram run -sh`;
0032 # Go back to original working directory
0033 cd $W_DIR;
0034 
0035 plotTypes=(SiStripApvGainsComparatorSingleTag SiStripApvGainsValuesComparatorSingleTag SiStripApvGainsComparatorByRegionSingleTag SiStripApvGainsRatioComparatorByRegionSingleTag SiStripApvGainByPartition)
0036 
0037 mkdir -p $W_DIR/results_$2-$3
0038 
0039 if [ -f *.png ]; then    
0040     rm *.png
0041 fi
0042 
0043 for i in "${plotTypes[@]}" 
0044 do
0045 echo "Making plot ${i}"
0046 # Run get payload data script
0047     getPayloadData.py \
0048         --plugin pluginSiStripApvGain_PayloadInspector \
0049         --plot plot_${i} \
0050         --tag $1 \
0051         --time_type Run \
0052         --iovs  '{"start_iov": "'$STARTIOV'", "end_iov": "'$ENDIOV'"}' \
0053         --db sqlite_file:$4 \
0054         --test;
0055 
0056     mv *.png $W_DIR/results_$2-$3/${i}_$1_$2-$3.png
0057 done
0058 
0059 plotTypes2=(SiStripApvGainCompareByPartition SiStripApvGainDiffByPartition)
0060 
0061 for i in "${plotTypes2[@]}" 
0062 do
0063 echo "Making plot ${i}"
0064 # Run get payload data script
0065     getPayloadData.py \
0066         --plugin pluginSiStripApvGain_PayloadInspector \
0067         --plot plot_${i} \
0068         --tag $1 \
0069         --tagtwo $1 \
0070         --time_type Run \
0071         --iovs '{"start_iov": "'$STARTIOV'", "end_iov": "'$STARTIOV'"}' \
0072         --iovstwo '{"start_iov": "'$ENDIOV'", "end_iov": "'$ENDIOV'"}' \
0073         --db sqlite_file:$4 \
0074         --test;
0075 
0076     mv *.png $W_DIR/results_$2-$3/${i}_$1_$2-$3.png
0077 done
0078 
0079 plotTypes3=(SiStripApvGainsAvgDeviationRatioWithPreviousIOVTrackerMap SiStripApvGainsMaxDeviationRatioWithPreviousIOVTrackerMap)
0080 
0081 for i in "${plotTypes3[@]}"
0082 do
0083     for j in 1 2 3
0084     do
0085         echo "Making plot ${i} with ${j} sigmas"
0086         # Run get payload data script
0087         getPayloadData.py \
0088             --plugin pluginSiStripApvGain_PayloadInspector \
0089             --plot plot_${i} \
0090             --tag $1 \
0091             --time_type Run \
0092             --iovs  '{"start_iov": "'$STARTIOV'", "end_iov": "'$ENDIOV'"}' \
0093             --input_params '{"nsigma":"'${j}'"}' \
0094             --db sqlite_file:$4 \
0095             --test;
0096 
0097         mv *.png $W_DIR/results_$2-$3/${i}_${j}sigmas_$1_$2-$3.png
0098     done
0099 done