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 |
> |
cp -r -T $HEDS_WWWAREA_TMP $HEDS_WWWAREA_TMP.tmp |
29 |
|
;; |
30 |
|
|
31 |
|
create) |
33 |
|
cat > $tableHeaderName <<EOF |
34 |
|
<table class='selectedEventsSummary'> |
35 |
|
<tr> |
36 |
< |
<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> |
36 |
> |
<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> |
37 |
|
</tr> |
38 |
|
|
39 |
|
<!-- |
47 |
|
EOF |
48 |
|
|
49 |
|
|
50 |
< |
revision=$(cat $HEDSPATH/python/CVS/Entries |grep early |awk -F/ '{print $3}') |
50 |
> |
#fileRevision=$(cat $HEDSPATH/python/CVS/Entries |grep earlyDataInterestingEvents_cff|awk -F/ '{print $3}') |
51 |
|
|
52 |
|
cat > $pageName <<EOF |
53 |
|
<html> |
71 |
|
<ul> |
72 |
|
<li> All skimmed file are copied in the castor folder: <b> $HEDS_CASTORFOLDER/skimV$HEDS_SKIMVERSION </b></li> |
73 |
|
<li> All logs from CRAB jobs are compressed in tgz files and copied in the same castor folder. |
74 |
< |
<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> |
74 |
> |
<!-- <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> --> |
75 |
|
</ul> |
76 |
|
</big> |
77 |
|
</body> |
78 |
|
</html> |
79 |
|
|
80 |
|
EOF |
81 |
< |
mv $pageName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION |
82 |
< |
mv $tableHeaderName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION |
83 |
< |
mv $tableBodyName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION |
81 |
> |
mv $pageName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION |
82 |
> |
mv $tableHeaderName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION |
83 |
> |
mv $tableBodyName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION |
84 |
|
;; |
85 |
|
|
86 |
|
add) |
87 |
|
echo "option $choice. Add entry to table" |
88 |
< |
cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
89 |
< |
simpleSummaryFile=$HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.log |
88 |
> |
cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
89 |
> |
simpleSummaryFile=$HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.log |
90 |
|
nInputEvts=`cat $simpleSummaryFile |grep "Skim_" | awk '{print $2}'|head -n 1` |
91 |
|
mergedFileCastor="rfio:$HEDS_CASTORFOLDER/skimV$HEDS_SKIMVERSION/merged_$HEDS_LABEL.root" |
92 |
|
|
93 |
|
nOutputEvents=`edmEventSize -v $mergedFileCastor |grep Events |awk '{print $4}'` |
94 |
|
|
95 |
< |
listSkimmedEventsPath=$HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents |
95 |
> |
listSkimmedEventsPath=$HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents |
96 |
|
skimmedEventPath=$HEDS_LABEL.listSkimmedEvents |
97 |
|
|
98 |
< |
runList=`cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.runinterval` |
98 |
> |
runList=`cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runinterval` |
99 |
|
|
100 |
|
|
101 |
|
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*" |
102 |
|
|
103 |
< |
|
103 |
> |
fileRevision=$(cat $HEDSPATH/python/CVS/Entries |grep earlyDataInterestingEvents_cff|awk -F/ '{print $3}') |
104 |
> |
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>" |
105 |
|
cat >> extension.html <<EOF |
106 |
|
<tr> |
107 |
< |
<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> |
107 |
> |
<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> |
108 |
|
<td><a href="$linkToDBS"> DBS entry </a> </td> <td> $nOutputEvents</td> <td><a href="$skimmedEventPath/summary.html"> link </a></td> |
109 |
|
</tr> |
110 |
|
EOF |
122 |
|
rm extension.html |
123 |
|
rm tmp.html |
124 |
|
|
125 |
< |
mv new.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
125 |
> |
mv new.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
126 |
|
;; |
127 |
|
|
128 |
|
|
129 |
|
addSpecial) |
130 |
|
echo "option $choice. Add special entry to table" |
131 |
< |
cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
132 |
< |
runList=`cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.runinterval` |
131 |
> |
cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
132 |
> |
runList=`cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runinterval` |
133 |
|
|
134 |
|
cat >> extension.html <<EOF |
135 |
|
<tr> |
151 |
|
rm extension.html |
152 |
|
rm tmp.html |
153 |
|
|
154 |
< |
mv new.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
154 |
> |
mv new.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
155 |
|
;; |
156 |
|
|
157 |
|
addComment) |
158 |
|
echo "option $choice. Add Comment entry to table" |
159 |
< |
cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
160 |
< |
runList=`cat $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.runinterval` |
159 |
> |
cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
160 |
> |
runList=`cat $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents/$HEDS_LABEL.runinterval` |
161 |
|
|
162 |
|
cat >> extension.html <<EOF |
163 |
|
<tr> |
179 |
|
rm extension.html |
180 |
|
rm tmp.html |
181 |
|
|
182 |
< |
mv new.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
182 |
> |
mv new.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
183 |
|
;; |
184 |
|
|
185 |
|
remove) |
186 |
|
echo "option $choice. Remove entry to table" |
187 |
|
case $2 in |
188 |
|
below) |
189 |
< |
head -n -4 $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
190 |
< |
mv tmp.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
189 |
> |
head -n -4 $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
190 |
> |
mv tmp.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
191 |
|
;; |
192 |
|
above) |
193 |
< |
tail -n +5 $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
194 |
< |
mv tmp.html $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
193 |
> |
tail -n +5 $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName > tmp.html |
194 |
> |
mv tmp.html $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tableBodyName |
195 |
|
;; |
196 |
|
*) |
197 |
|
echo 'ERROR: please specify with the third argument if you want to add the line "above" or "below"' |
208 |
|
#if [ $choice == 3 ] |
209 |
|
#then |
210 |
|
## --- loop over daily-skims --- |
211 |
< |
# cat $HEDS_FINALAREATmp/logs.SkimV$HEDS_SKIMVERSION/$pageName | grep -v "</body>"| grep -v "</html>" > tmp.html |
211 |
> |
# cat $HEDS_WWWAREA_TMPTmp/logs.SkimV$HEDS_SKIMVERSION/$pageName | grep -v "</body>"| grep -v "</html>" > tmp.html |
212 |
|
|
213 |
|
### HERE YOU WANT TO PUT YOUR COMMENTS (BY HAND) |
214 |
|
# cat >> tmp.html <<EOF |
215 |
|
|
216 |
|
#EOF |
217 |
< |
# mv tmp.html $HEDS_FINALAREATmp/logs.SkimV$HEDS_SKIMVERSION/$pageName |
217 |
> |
# mv tmp.html $HEDS_WWWAREA_TMPTmp/logs.SkimV$HEDS_SKIMVERSION/$pageName |
218 |
|
#fi |
219 |
|
|
220 |
|
#if [ $choice == 4 ] |
221 |
|
#then |
222 |
|
# echo "boh" |
223 |
< |
# cp $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$finalName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$finalName.BAK |
224 |
< |
# cp $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$tmpName $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/$finalName |
223 |
> |
# cp $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$finalName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$finalName.BAK |
224 |
> |
# cp $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$tmpName $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$finalName |
225 |
|
#fi |