12 |
|
|
13 |
|
############# preliminary part ################ |
14 |
|
choice=$1 |
15 |
< |
echo "choice: " $choice |
15 |
> |
#echo "choice: " $choice |
16 |
|
|
17 |
|
pageName=FirstPage.php |
18 |
|
tableHeaderName=tableHeader.shtm |
25 |
|
|
26 |
|
backup) |
27 |
|
echo "option $choice. Copying the whole area into a tmp one" |
28 |
< |
rm -r $HEDS_FINALAREA.tmp |
29 |
< |
cp -r $HEDS_FINALAREA $HEDS_FINALAREA.tmp |
28 |
> |
rm -r $HEDS_WWWAREA_TMP.tmp |
29 |
> |
cp -r $HEDS_WWWAREA_TMP $HEDS_WWWAREA_TMP.tmp |
30 |
|
;; |
31 |
|
|
32 |
|
create) |
34 |
|
cat > $tableHeaderName <<EOF |
35 |
|
<table class='selectedEventsSummary'> |
36 |
|
<tr> |
37 |
< |
<th> day of data taking </th> <th> run interval </th> <th> analyzed runs </th> <th> #events analyzed </th> <th> output on castor</th> <th> DBS entry</th> <th> #events output</th> <th>event type breaking</th> |
37 |
> |
<th> day of data taking </th> <th> run interval </th> <th> analyzed runs </th> <th> input datasets </th> <th> #events analyzed </th> <th> skim configuration</th> <th> output on castor</th> <th> DBS entry</th> <th> #events output</th> <th>event type breaking</th> |
38 |
|
</tr> |
39 |
|
|
40 |
|
<!-- |
48 |
|
EOF |
49 |
|
|
50 |
|
|
51 |
< |
revision=$(cat $HEDSPATH/python/CVS/Entries |grep early |awk -F/ '{print $3}') |
51 |
> |
#fileRevision=$(cat $HEDSPATH/python/CVS/Entries |grep earlyDataInterestingEvents_cff|awk -F/ '{print $3}') |
52 |
|
|
53 |
|
cat > $pageName <<EOF |
54 |
|
<html> |
72 |
|
<ul> |
73 |
|
<li> All skimmed file are copied in the castor folder: <b> $HEDS_CASTORFOLDER/skimV$HEDS_SKIMVERSION </b></li> |
74 |
|
<li> All logs from CRAB jobs are compressed in tgz files and copied in the same castor folder. |
75 |
< |
<li> The events of the files listed in the table have been selected using the skim configuration version $HEDS_SKIMVERSION in: <a href="http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/HiggsAnalysis/EarlyDataStudy/python/earlyDataInterestingEvents_cff.py?hideattic=1&revision=$revision&view=markup">link</a> </li> |
75 |
> |
<!-- <li> The events of the files listed in the table have been selected using the skim configuration revision $fileRevision in: <a href="http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/HiggsAnalysis/EarlyDataStudy/python/earlyDataInterestingEvents_cff.py?revision=$fileRevision&view=markup"> link </a> </li> --> |
76 |
|
</ul> |
77 |
|
</big> |
78 |
|
</body> |
79 |
|
</html> |
80 |
|
|
81 |
|
EOF |
82 |
< |
mv $pageName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION |
83 |
< |
mv $tableHeaderName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION |
84 |
< |
mv $tableBodyName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION |
82 |
> |
mv $pageName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION |
83 |
> |
mv $tableHeaderName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION |
84 |
> |
mv $tableBodyName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION |
85 |
|
;; |
86 |
|
|
87 |
|
add) |
88 |
|
echo "option $choice. Add entry to table" |
89 |
< |
cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
90 |
< |
simpleSummaryFile=$HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.log |
89 |
> |
cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
90 |
> |
simpleSummaryFile=$HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.log |
91 |
|
nInputEvts=`cat $simpleSummaryFile |grep "Skim_" | awk '{print $2}'|head -n 1` |
92 |
|
mergedFileCastor="rfio:$HEDS_CASTORFOLDER/skimV$HEDS_SKIMVERSION/merged_$HEDS_LABEL.root" |
93 |
|
|
94 |
|
nOutputEvents=`edmEventSize -v $mergedFileCastor |grep Events |awk '{print $4}'` |
95 |
|
|
96 |
< |
listSkimmedEventsPath=$HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents |
96 |
> |
listSkimmedEventsPath=$HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents |
97 |
|
skimmedEventPath=$HEDS_LABEL.listSkimmedEvents |
98 |
|
|
99 |
< |
runList=`cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.runinterval` |
99 |
> |
runList=`cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runinterval` |
100 |
|
|
101 |
|
|
102 |
|
linkToDBS="https://cmsweb.cern.ch/dbs_discovery/aSearch?caseSensitive=on&userMode=user&sortOrder=desc&sortName=&grid=0&method=dbsapi&dbsInst=cms_dbs_ph_analysis_02&userInput=find+dataset+where+dataset+like+*$HEDS_USERID*HiggsSimpleSkimV$HEDS_SKIMVERSION*$HEDS_LABEL*+and+dataset.status+like+VALID*" |
103 |
|
|
104 |
< |
|
104 |
> |
fileRevision=$(cat $HEDSPATH/python/CVS/Entries |grep earlyDataInterestingEvents_cff|awk -F/ '{print $3}') |
105 |
> |
linkToSkimRevision="<a href=\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/HiggsAnalysis/EarlyDataStudy/python/earlyDataInterestingEvents_cff.py?revision=$fileRevision&view=markup\"> rev $fileRevision </a>" |
106 |
|
cat >> extension.html <<EOF |
107 |
|
<tr> |
108 |
< |
<td> $HEDS_LABEL </td> <td> $runList </td> <td><a href="$HEDS_LABEL.runselection"> link </a></td> <td> $nInputEvts </td> <td> merged_$HEDS_LABEL.root</td> |
108 |
> |
<td> $HEDS_LABEL </td> <td> $runList </td> <td><a href="$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runselection"> link </a></td> <td> na </td> <td> $nInputEvts </td> <td> $linkToSkimRevision </td> <td> merged_$HEDS_LABEL.root</td> |
109 |
|
<td><a href="$linkToDBS"> DBS entry </a> </td> <td> $nOutputEvents</td> <td><a href="$skimmedEventPath/summary.html"> link </a></td> |
110 |
|
</tr> |
111 |
|
EOF |
123 |
|
rm extension.html |
124 |
|
rm tmp.html |
125 |
|
|
126 |
< |
mv new.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
126 |
> |
mv new.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
127 |
|
;; |
128 |
|
|
129 |
|
|
130 |
|
addSpecial) |
131 |
|
echo "option $choice. Add special entry to table" |
132 |
< |
cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
133 |
< |
runList=`cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.runinterval` |
132 |
> |
cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
133 |
> |
runList=`cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runinterval` |
134 |
|
|
135 |
|
cat >> extension.html <<EOF |
136 |
|
<tr> |
152 |
|
rm extension.html |
153 |
|
rm tmp.html |
154 |
|
|
155 |
< |
mv new.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
155 |
> |
mv new.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
156 |
|
;; |
157 |
|
|
158 |
|
addComment) |
159 |
|
echo "option $choice. Add Comment entry to table" |
160 |
< |
cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
161 |
< |
runList=`cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.runinterval` |
160 |
> |
cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
161 |
> |
runList=`cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runinterval` |
162 |
|
|
163 |
|
cat >> extension.html <<EOF |
164 |
|
<tr> |
180 |
|
rm extension.html |
181 |
|
rm tmp.html |
182 |
|
|
183 |
< |
mv new.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
183 |
> |
mv new.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
184 |
|
;; |
185 |
|
|
186 |
|
remove) |
187 |
|
echo "option $choice. Remove entry to table" |
188 |
|
case $2 in |
189 |
|
below) |
190 |
< |
head -n -4 $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
191 |
< |
mv tmp.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
190 |
> |
head -n -4 $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
191 |
> |
mv tmp.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
192 |
|
;; |
193 |
|
above) |
194 |
< |
tail -n +5 $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
195 |
< |
mv tmp.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
194 |
> |
tail -n +5 $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
195 |
> |
mv tmp.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
196 |
|
;; |
197 |
|
*) |
198 |
|
echo 'ERROR: please specify with the third argument if you want to add the line "above" or "below"' |
209 |
|
#if [ $choice == 3 ] |
210 |
|
#then |
211 |
|
## --- loop over daily-skims --- |
212 |
< |
# cat $HEDS_FINALAREATmp/logs.SkimV$HEDS_SKIMVERSION/$pageName | grep -v "</body>"| grep -v "</html>" > tmp.html |
212 |
> |
# cat $HEDS_WWWAREA_TMPTmp/logs.SkimV$HEDS_SKIMVERSION/$pageName | grep -v "</body>"| grep -v "</html>" > tmp.html |
213 |
|
|
214 |
|
### HERE YOU WANT TO PUT YOUR COMMENTS (BY HAND) |
215 |
|
# cat >> tmp.html <<EOF |
216 |
|
|
217 |
|
#EOF |
218 |
< |
# mv tmp.html $HEDS_FINALAREATmp/logs.SkimV$HEDS_SKIMVERSION/$pageName |
218 |
> |
# mv tmp.html $HEDS_WWWAREA_TMPTmp/logs.SkimV$HEDS_SKIMVERSION/$pageName |
219 |
|
#fi |
220 |
|
|
221 |
|
#if [ $choice == 4 ] |
222 |
|
#then |
223 |
|
# echo "boh" |
224 |
< |
# cp $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$finalName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$finalName.BAK |
225 |
< |
# cp $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tmpName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$finalName |
224 |
> |
# cp $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$finalName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$finalName.BAK |
225 |
> |
# cp $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tmpName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$finalName |
226 |
|
#fi |