File indexing completed on 2024-04-06 11:59:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 CreateIndex ()
0030 {
0031 LASTUPDATE=`date`
0032
0033 cat >> index_new.html << EOF
0034 <TR> <TD align=center> <a href="SiStripHitEffTKMapBad.png"><img src="SiStripHitEffTKMapBad.png"hspace=5 vspace=5 border=0 style="width: 90%" ALT="SiStripHitEffTKMapBad.png"></a>
0035 <br> SiStripHitEffTKMapBad.png </TD>
0036 EOF
0037
0038 cat >> index_new.html << EOF
0039 <TD align=center> <a href="SiStripHitEffTKMap.png"><img src="SiStripHitEffTKMap.png"hspace=5 vspace=5 border=0 style="width: 90%" ALT="SiStripHitEffTKMap.png"></a>
0040 <br> SiStripHitEffTKMap.png </TD> </TR>
0041 EOF
0042
0043 cat >> index_new.html << EOF
0044 <TR><TD align=center> <a href="Summary.png"><img src="Summary.png"hspace=5 vspace=5 border=0 style="width: 90%" ALT="Summary.png"></a>
0045 <br> Summary.png </TD> </TR>
0046 EOF
0047
0048 cat /afs/cern.ch/cms/tracker/sistrvalidation/WWW/template_index_foot.html | sed -e "s@insertDate@$LASTUPDATE@g" >> index_new.html
0049
0050 mv -f index_new.html index.html
0051 }
0052
0053 if [ $
0054 echo "Usage: $0 CalibTreeFullPath"
0055 echo "Runs the Hit Efficiency Study"
0056 exit 0;
0057 fi
0058
0059 fullpath=$1
0060 echo "The full file path is $fullpath"
0061
0062
0063 rm -f run_extract.C
0064 echo '{' >> run_extract.C
0065
0066 echo 'TFile* f = TFile::Open("'rfio:$1'");' >> run_extract.C
0067 echo 'f->cd("anEff");' >> run_extract.C
0068 echo 'CalibTree = (TTree*)(gDirectory->Get("traj"));' >> run_extract.C
0069 echo 'TLeaf* runLf = CalibTree->GetLeaf("run");' >> run_extract.C
0070 echo 'CalibTree->GetEvent(1);' >> run_extract.C
0071 echo 'double runno = (double)runLf->GetValue();' >> run_extract.C
0072 echo 'cout << runno << endl;' >> run_extract.C
0073 echo '}'>> run_extract.C
0074
0075 root -b -l << EOF >& runnumber1.txt
0076 .x run_extract.C
0077 .q
0078 EOF
0079
0080 runnumber=`cat runnumber1.txt`
0081 echo "The run number is $runnumber"
0082
0083 rm -f runnumber1.txt
0084
0085 cp dbfile_31X_IdealConditions.db dbfile.db
0086
0087
0088 cp SiStripHitEff_template.py "SiStripHitEff_run$runnumber.py"
0089 sed -i "s/newrun/$runnumber/g" "SiStripHitEff_run$runnumber.py"
0090 sed -i "s|newfilelocation|$fullpath|g" "SiStripHitEff_run$runnumber.py"
0091
0092
0093
0094
0095
0096 cmsRun "SiStripHitEff_run$runnumber.py" >& "run_$runnumber.log"
0097
0098
0099 cat run_$runnumber.log | awk 'BEGIN{doprint=0}{if(match($0,"New IOV")!=0) doprint=1;if(match($0,"%MSG")!=0) {doprint=0;} if(match($0,"Message")!=0) {doprint=0;} if(doprint==1) print $0}' > InefficientModules_$runnumber.txt
0100 cat run_$runnumber.log | awk 'BEGIN{doprint=0}{if(match($0,"occupancy")!=0) doprint=1;if(match($0,"efficiency")!=0) doprint=1; if(match($0,"%MSG")!=0) {doprint=0;} if(match($0,"tempfilename")!=0) {doprint=0;} if(match($0,"New IOV")!=0) {doprint=0;} if(match($0,"generation")!=0) {doprint=0;} if(doprint==1) print $0}' > EfficiencyResults_$runnumber.txt
0101
0102
0103
0104 rm -f run_extract.C
0105
0106
0107
0108 mkdir "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERCALIB/SiStrip/CalibrationValidation/HitEfficiency/run_$runnumber"
0109 mkdir "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber"
0110 mkdir "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/cfg"
0111 mkdir "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/Plots"
0112 mkdir "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/sqlite"
0113 mkdir "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/QualityLog"
0114
0115
0116 mv "SiStripHitEff_run$runnumber.py" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/cfg"
0117
0118
0119
0120 mv "InefficientModules_$runnumber.txt" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/QualityLog"
0121 mv "EfficiencyResults_$runnumber.txt" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/QualityLog"
0122
0123
0124 mv "SiStripHitEffHistos_run$runnumber.root" "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERCALIB/SiStrip/CalibrationValidation/HitEfficiency/run_$runnumber"
0125
0126
0127 cat /afs/cern.ch/cms/tracker/sistrvalidation/WWW/template_index_header.html | sed -e "s@insertPageName@Validation Plots --- Hit Efficiency Study --- Tracker Maps@g" > index_new.html
0128 CreateIndex
0129
0130 mv index.html "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/Plots"
0131 mv "SiStripHitEffTKMapBad.png" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/Plots"
0132 mv "SiStripHitEffTKMap.png" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/Plots"
0133 mv "Summary.png" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/Plots/Summary.png"
0134
0135
0136 echo "Preparing the sqlite and metadata files"
0137
0138 ID1=`uuidgen -t`
0139 cp dbfile.db SiStripHitEffBadModules@${ID1}.db
0140 cat template_SiStripHitEffBadModules.txt | sed -e "s@insertFirstRun@$runnumber@g" -e "s@insertIOV@$runnumber@" > SiStripHitEffBadModules@${ID1}.txt
0141
0142 mv "SiStripHitEffBadModules@${ID1}.db" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/sqlite"
0143 mv "SiStripHitEffBadModules@${ID1}.txt" "/afs/cern.ch/cms/tracker/sistrvalidation/WWW/CalibrationValidation/HitEfficiency/run_$runnumber/sqlite"