Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-25 10:58:18

0001 #! /usr/bin/env bash
0002 # makeHtml.sh: makes simple HTML file using *.png files in direcotory
0003 
0004 
0005 
0006 #directory=${1-`pwd`}
0007 #  Defaults to current working directory,
0008 #+ if not otherwise specified.
0009 #  Equivalent to code block below.
0010 # ----------------------------------------------------------
0011 # ARGS=1                 # Expect one command-line argument.
0012 #
0013 # if [ $# -ne "$ARGS" ]  # If not 1 arg...
0014 # then
0015 #   directory=`pwd`      # current working directory
0016 # else
0017 #   directory=$1
0018 # fi
0019 # ----------------------------------------------------------
0020 
0021 compDir1=$1
0022 compDir2=$2
0023 
0024 #compStr1=sed -e 's/.*.\///' $compDir1
0025 #compStr2=sed -e 's/.*.\///' $compDir2
0026 
0027 directory=`pwd`
0028 agreeDirectory=`pwd`/inAgrement
0029 mkdir $agreeDirectory
0030 
0031 ## convert all the .pdf files to .png
0032 find . -type f -name '*.pdf' -print0 |
0033   while IFS= read -r -d '' file
0034       do convert -verbose "${file}" "${file%.*}.png"
0035   done
0036 
0037 # move all the plots in agreement in separate directory
0038 mv agree* $agreeDirectory
0039 
0040 sleep 1
0041 
0042 tempDate=`date "+%Y-%m-%d"`;
0043 
0044 # Make webpage for plots in agreement
0045 outputFileAgreement=inAgrement/inAgreement_$tempDate.htm
0046 >$outputFileAgreement
0047 cat <<EOF >>$outputFileAgreement
0048 
0049 <HTML>
0050 
0051 <HEAD><TITLE> Result WebPages for $tempDate</TITLE></HEAD>
0052 
0053 <BODY link="Red">
0054 <FONT color="Black">
0055 <h2><A name="EB"><FONT color="Black"> Results  Web Pages for $tempDate</FONT></A><BR></h2>
0056 <h3><A name="EB"><FONT color="Blue">Result Agreeing Histograms: </FONT></A><BR></h3>
0057 <h3><A name="EB"><FONT color="Blue">comparing </FONT><FONT color="Black">$compDir1 (line)</FONT> <FONT color="Blue"> and </FONT> <FONT color="Black">$compDir2 (points)</FONT></A><BR></h3>
0058 
0059 EOF
0060 
0061 for file in `ls $agreeDirectory | grep png` ; 
0062 #for file in "$( find $directory -name "*.png" )"   # -type l = symbolic links
0063 do
0064   echo "$file"
0065 cat <<EOF >>$outputFileAgreement
0066 <A HREF=$file> <img height="300" src="$file"> </A>
0067 <h3><A name="EB"><FONT color="Black">Plot: $file </FONT></A><BR></h3>
0068 <h3><A name="EB"><FONT color="Black">----------------------</FONT></A><BR></h3>
0069 
0070 EOF
0071 done | sort
0072 
0073 # Make main webpage for plots with discrepancies
0074 outputFile=plots_$tempDate.htm
0075 >$outputFile
0076 
0077 cat <<EOF >>$outputFile
0078 
0079 <HTML>
0080 
0081 <HEAD><TITLE> Result WebPages for $tempDate</TITLE></HEAD>
0082 
0083 <BODY link="Red">
0084 <FONT color="Black">
0085 <h2><A name="EB"><FONT color="Black"> Results  Web Pages for $tempDate</FONT></A><BR></h2>
0086 <h2><A name="EB"><FONT color="Blue">Compare </FONT><FONT color="Black">$compDir1</FONT> <FONT color="Blue"> and </FONT> <FONT color="Black">$compDir2</FONT></A><BR></h3>
0087 
0088 <A HREF=diff_menu_a_vs_menu_b.txt> diff_menu_a_vs_menu_b.txt </A>
0089 <h3><A name="EB"><FONT color="Black">----------------------</FONT></A><BR></h3>
0090 
0091 <A HREF=$outputFileAgreement> Plots In Agreement </A>
0092 <h3><A name="EB"><FONT color="Blue">----------------------</FONT></A><BR></h3>
0093 
0094 <A> Plots In Disagrement </A>
0095 <h3><A name="EB"><FONT color="Blue">----------------------</FONT></A><BR></h3>
0096 <h3><A name="EB"><FONT color="Blue">Result Discrepancy Histograms: </FONT></A><BR></h3>
0097 <h3><A name="EB"><FONT color="Blue">comparing </FONT><FONT color="Black">$compDir1 (line)</FONT> <FONT color="Blue"> and </FONT> <FONT color="Black">$compDir2 (points)</FONT></A><BR></h3>
0098 EOF
0099 
0100 for file in `ls $directory | grep png` ; 
0101 #for file in "$( find $directory -name "*.png" )"   # -type l = symbolic links
0102 do
0103   echo "$file"
0104 cat <<EOF >>$outputFile
0105 <A HREF=$file> <img height="300" src="$file"> </A>
0106 <h3><A name="EB"><FONT color="Black">Plot: $file </FONT></A><BR></h3>
0107 <h3><A name="EB"><FONT color="Black">----------------------</FONT></A><BR></h3>
0108 
0109 EOF
0110 
0111 done | sort
0112 ln -s $outputFile index.html