File indexing completed on 2024-04-06 11:59:43
0001
0002 CreateIndex ()
0003 {
0004 COUNTER=0
0005 LASTUPDATE=`date`
0006
0007 for Plot in `ls *.png`; do
0008 if [[ $COUNTER%3 -eq 0 ]]; then
0009 cat >> index_gain.html << EOF
0010 <TR> <TD align=center> <a href="$Plot"><img src="$Plot"hspace=5 vspace=5 border=0 style="width: 80%" ALT="$Plot"></a>
0011 <br> $Plot </TD>
0012 EOF
0013 else if [[ $COUNTER%3 -eq 1 ]]; then
0014 cat >> index_gain.html << EOF
0015 <TD align=center> <a href="$Plot"><img src="$Plot"hspace=5 vspace=5 border=0 style="width: 80%" ALT="$Plot"></a>
0016 <br> $Plot </TD>
0017 EOF
0018 else
0019 cat >> index_gain.html << EOF
0020 <TD align=center> <a href="$Plot"><img src="$Plot"hspace=5 vspace=5 border=0 style="width: 80%" ALT="$Plot"></a>
0021 <br> $Plot </TD> </TR>
0022 EOF
0023 fi
0024 fi
0025
0026 let COUNTER++
0027 done
0028
0029 cat /afs/cern.ch/cms/tracker/sistrvalidation/WWW/template_index_foot.html | sed -e "s@insertDate@$LASTUPDATE@g" >> index_gain.html
0030
0031 mv -f index_gain.html index.html
0032 }
0033
0034
0035 if [ "$#" != '1' ]; then
0036
0037 echo "Running: cmsRun Gains_Compute_cfg.py"
0038 cmsRun Gains_Compute_cfg.py
0039 root -l -b -q KeepOnlyGain.C+
0040
0041
0042 if [[ $1 != *"PCL"* ]]; then
0043 echo "Running: cmsRun Validation_Compute_cfg.py"
0044 cmsRun Validation_Compute_cfg.py
0045 fi
0046
0047 if [ "$#" == '0' ]; then
0048 sh PlotMacro.sh
0049 fi
0050
0051 if [ "$#" == '3' ]; then
0052 sh PlotMacro.sh "\"$2\"" "\"$3\""
0053 fi
0054 else
0055 WORKDIR=$PWD
0056 DIRPATH=/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/ParticleGain/$1
0057 echo "Creating directories"
0058 mkdir $DIRPATH
0059 mkdir $DIRPATH/cfg
0060 mkdir $DIRPATH/log
0061 mkdir $DIRPATH/sqlite
0062 mkdir $DIRPATH/plots_gain
0063 mkdir $DIRPATH/plots_validation
0064 echo "Move results to the respective directories"
0065 cp Gains_Compute_cfg.py $DIRPATH/cfg/.
0066 cp Validation_Compute_cfg.py $DIRPATH/cfg/.
0067 cp FileList_cfg.py $DIRPATH/cfg/.
0068 cp Gains_Sqlite.db $DIRPATH/sqlite/.
0069 cp Gains.root $DIRPATH/sqlite/.
0070 cp Gains_ASCII.txt $DIRPATH/log/.
0071 cp Validation_ASCII.txt $DIRPATH/log/.
0072 cp Pictures/*.txt $DIRPATH/log/.
0073 cp Pictures/Gains_*.png $DIRPATH/plots_gain/.
0074 rm $DIRPATH/plots_gain/Gains_Charge.png
0075 rm $DIRPATH/plots_gain/Gains_MPVs.png
0076 rm $DIRPATH/plots_gain/Gains_MPVsSubDet.png
0077 rm $DIRPATH/plots_gain/Gains_MPVsSubDetAndStat.png
0078 cp Pictures/Validation_*.png $DIRPATH/plots_validation/.
0079 rm $DIRPATH/plots_validation/Validation_Charge.png
0080 rm $DIRPATH/plots_validation/Validation_MPVs.png
0081 rm $DIRPATH/plots_validation/Validation_MPVsSubDet.png
0082 rm $DIRPATH/plots_validation/Validation_MPVsSubDetAndStat.png
0083 CASTORPATH=/castor/cern.ch/cms/store/group/tracker/strip/calibration/validation/ParticleGain/$1
0084 rfmkdir $CASTORPATH
0085 rfcp Gains_Tree.root $CASTORPATH/.
0086 rfcp Validation_Tree.root $CASTORPATH/.
0087
0088
0089
0090 echo "Publish the validation plots on the web"
0091 INDEXPATH=/afs/cern.ch/cms/tracker/sistrvalidation/WWW
0092 cd $DIRPATH/plots_gain
0093 cat $INDEXPATH/template_index_header.html | sed -e "s@insertPageName@Validation Plots --- Particle Gain Calibration --- $1@g" > index_gain.html
0094 CreateIndex
0095 cd $DIRPATH/plots_validation
0096 cat $INDEXPATH/template_index_header.html | sed -e "s@insertPageName@Validation Plots --- Particle Gain Validation --- $1@g" > index_gain.html
0097 CreateIndex
0098 cd $WORKDIR
0099 fi