Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:49

0001 #! /bin/bash 
0002 
0003 # commands to run a comparison
0004 
0005 RELEASE1=$1
0006 RELEASE2=$2
0007 
0008 echo About to compare $RELEASE1 and $RELEASE2
0009 
0010 #-------------------------------------------------------------------------------
0011 
0012 # Set Some useful variables ----------------------------------------------------
0013 echo "Set Some useful variables..."
0014 
0015 # The output directory name
0016 COMPDIR="$RELEASE1"VS"$RELEASE2"
0017 
0018 # The base directory on AFS
0019 RELMONAFSBASE=/afs/cern.ch/cms/offline/dqm/ReleaseMonitoring
0020 RELMONAFS="$RELMONAFSBASE"/"$COMPDIR"
0021 
0022 # The base directory on Castor
0023 RELMONCASTOR=/castor/cern.ch/user/d/dpiparo/TestRelMonOnCastor/"$COMPDIR"
0024 
0025 # The number of simultaneous processes
0026 NPROCESSES=6
0027 
0028 # Fetch Files and Organise them ------------------------------------------------
0029 
0030 # Full and FastSim: Get them from the GUI
0031 echo "Fetching MC datasets..."
0032 fetchall_from_DQM.py  $RELEASE1 -mc --p2 "START" 2>&1 |tee step_1_fetch_MC_rel1.log
0033 fetchall_from_DQM.py  $RELEASE2 -mc --p2 "START" 2>&1 |tee step_1_fetch_MC_rel2.log
0034 
0035 # Make directories and copy into them
0036 mkdir FastSim
0037 mv *FastSim*root FastSim
0038 mkdir FullSim
0039 mv *root FullSim
0040 
0041 # Arrange files for a FullSimFastSim comparison
0042 # create and enter the directory
0043 FULLSIMFASTISMDIR=FullSimFastSim;
0044 mkdir $FULLSIMFASTISMDIR;
0045 cd  $FULLSIMFASTISMDIR;
0046 # link all fastsim files
0047 for FASTSIMFILE in `ls ../FastSim|grep "$RELEASE1"`; do 
0048   ln -s ../FastSim/"$FASTSIMFILE" .;
0049   done
0050 
0051 # Link only those files that correspond to the FSim ones
0052 # Isolate the dataset name
0053 for DSET in `ls ../FastSim|sed 's/__/ /g'| cut -f2 -d " "`;do
0054   # The datasets can be more than one: e.g. pt10 or pt100
0055   FULLSIMFILES=`echo ../FullSim/*"$DSET"*"$RELEASE1"*`;
0056   # therefore loop on them
0057   for FULLSIMFILE in `echo $FULLSIMFILES`; do
0058     if [ -f $FULLSIMFILE ]; then
0059       ln -s $FULLSIMFILE .;
0060       fi;
0061     done; # end loop on fullsim datasets files matching the particular fastsim dataset
0062   done; # end loop on datasets
0063  get out of the dir
0064 cd -
0065 
0066 # Data: Get them from the GUI
0067 echo "Fetching Data datasets..."
0068 fetchall_from_DQM.py  $RELEASE1 -data 2>&1 |tee step_2_fetch_DATA_rel1.log
0069 fetchall_from_DQM.py  $RELEASE2 -data 2>&1 |tee step_2_fetch_DATA_rel2.log
0070 
0071 # Make directories and copy into them
0072 mkdir Data
0073 mv *root Data
0074 
0075 # Creating dir on AFS -----------------------------------------------------------
0076 echo "Creating directory on AFS"
0077 mkdir $RELMONAFS
0078 
0079 # Run the Comparisons, make the reports and copy them----------------------------
0080 echo "Creating Reports"
0081 
0082 echo " @@@ FastSim"
0083 ValidationMatrix.py -a FastSim -o FastSimReport -N $NPROCESSES 2>&1 |tee step_3_reports_FastSim.log
0084 echo "Compressing report for web"
0085 dir2webdir.py FastSimReport 2>&1 |tee step_4_compress_FastSim.log
0086 echo "Copying report on the web"
0087 cp -r FastSimReport $RELMONAFS
0088 
0089 echo " @@@ FastSim HLT"
0090 ValidationMatrix.py -a FastSim -o FastSimReport_HLT -N $NPROCESSES --HLT 2>&1 |tee step_3_reports_FastSim_HLT.log
0091 echo "Compressing report for web"
0092 dir2webdir.py FastSimReport_HLT 2>&1 |tee step_4_compress_FastSim_HLT.log
0093 echo "Copying report on the web"
0094 cp -r FastSimReport_HLT $RELMONAFS
0095 
0096 echo " @@@ FullSim"
0097 ValidationMatrix.py -a FullSim -o FullSimReport -N $NPROCESSES 2>&1 |tee step_3_reports_FullSim.log
0098 echo "Compressing report for web"
0099 dir2webdir.py FullSimReport 2>&1 |tee step_4_compress_FullSim.log
0100 echo "Copying report on the web"
0101 cp -r FullSimReport $RELMONAFS
0102 
0103 echo " @@@ FullSim_HLT"
0104 ValidationMatrix.py -a FullSim -o FullSimReport_HLT -N $NPROCESSES --HLT 2>&1 |tee step_3_reports_FullSim_HLT.log
0105 echo "Compressing report for web"
0106 dir2webdir.py FullSimReport_HLT 2>&1 |tee step_4_compress_FullSim_HLT.log
0107 echo "Copying report on the web"
0108 cp -r FullSimReport_HLT $RELMONAFS
0109 
0110 echo " @@@ FullSimFastSim"
0111 FULLSIMFASTSIMREPORTDIR="$RELEASE1"_FullSimFastSimReport
0112 ValidationMatrix.py -a $FULLSIMFASTISMDIR -o $FULLSIMFASTSIMREPORTDIR -N $NPROCESSES 2>&1 |tee step_3_reports_FullSimFastSim.log
0113 echo "Compressing report for web"
0114 dir2webdir.py $FULLSIMFASTSIMREPORTDIR 2>&1 |tee step_4_compress_FullSimFastSim.log
0115 echo "Copying report on the web"
0116 cp -r $FULLSIMFASTSIMREPORTDIR $RELMONAFSBASE
0117 
0118 echo " @@@ FullSimFastSim"
0119 FULLSIMFASTSIMREPORTDIR_HLT="$RELEASE1"_FullSimFastSimReport_HLT
0120 ValidationMatrix.py -a $FULLSIMFASTISMDIR -o $FULLSIMFASTSIMREPORTDIR_HLT -N $NPROCESSES --HLT 2>&1 |tee step_3_reports_FullSimFastSim.log
0121 echo "Compressing report for web"
0122 dir2webdir.py $FULLSIMFASTSIMREPORTDIR_HLT 2>&1 |tee step_4_compress_FullSimFastSim_HLT.log
0123 echo "Copying report on the web"
0124 cp -r $FULLSIMFASTSIMREPORTDIR_HLT $RELMONAFSBASE
0125 
0126 echo " @@@ FullSimFastSim_HLT"
0127 export FULLSIMFASTSIMREPORTDIR_HLT="$RELEASE1"_FullSimFastSimReport_HLT
0128 ValidationMatrix.py -a $FULLSIMFASTSIMDIR -o $FULLSIMFASTSIMREPORTDIR_HLT -N $NPROCESSES --HLT 2>&1 |tee step_3_reports_FullSimFastSim_HLT.log
0129 echo "Compressing report for web"
0130 dir2webdir.py $FULLSIMFASTSIMREPORTDIR_HLT 2>&1 |tee step_4_compress_FullSimFastSim_HLT.log
0131 echo "Copying report on the web"
0132 cp -r $FULLSIMFASTSIMREPORTDIR_HLT $RELMONAFSBASE
0133 
0134 echo " @@@ Data"
0135 ValidationMatrix.py -a Data -o DataReport -N $NPROCESSES 2>&1 |tee step_3_reports_Data.log
0136 echo "Compressing report for web"
0137 dir2webdir.py DataReport 2>&1 |tee step_4_compress_Data.log
0138 echo "Copying report on the web"
0139 cp -r DataReport $RELMONAFS
0140 
0141 
0142 # copy everything on castor ----------------------------------------------------
0143 echo "Backup of the material"
0144 BACKUPDIR="$COMPDIR"Reports_HLT
0145 mkdir $BACKUPDIR
0146 mv *Report* $BACKUPDIR
0147 tar -cvf - $BACKUPDIR | gzip > "$BACKUPDIR".tar.gz
0148 /usr/bin/rfmkdir $RELMONCASTOR
0149 /usr/bin/rfcp "$BACKUPDIR".tar.gz $RELMONCASTOR
0150 
0151