1 |
#!/bin/bash
|
2 |
############# preliminary part ################
|
3 |
choice=$1
|
4 |
#echo "choice: " $choice
|
5 |
###
|
6 |
|
7 |
|
8 |
dailySkim=$HEDS_NAMEPREFIX$HEDS_LABEL-v$HEDS_TASKATTEMPT
|
9 |
|
10 |
################################################
|
11 |
#possible options:
|
12 |
# choice:
|
13 |
# clean --> clean up the folder of detailed logs in AFS
|
14 |
# add --> add new entries for new daily-skim
|
15 |
################################################
|
16 |
|
17 |
case $choice in
|
18 |
clean)
|
19 |
cd $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents
|
20 |
if ((! $?)); then
|
21 |
rm *.html
|
22 |
rm configFiles/*
|
23 |
rmdir configFiles
|
24 |
fi
|
25 |
;;
|
26 |
|
27 |
add)
|
28 |
mergedFileCastor="rfio:$HEDS_CASTORFOLDER/skimV$HEDS_SKIMVERSION/merged_$HEDS_LABEL.root"
|
29 |
|
30 |
listSkimmedEventsPath=$HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents
|
31 |
|
32 |
if [ ! -d $listSkimmedEventsPath/configFiles ];then
|
33 |
mkdir $listSkimmedEventsPath/configFiles
|
34 |
fi
|
35 |
cp $HEDSPATH/scripts/extractEvent.php $listSkimmedEventsPath/configFiles/
|
36 |
listSkims=`ls $listSkimmedEventsPath|grep -v summary|grep -v html|grep -v configFiles|grep -v dumperLogs \
|
37 |
|grep ${HEDS_LABEL}_Skim`
|
38 |
# --- loop over skim paths ---
|
39 |
for j in $listSkims
|
40 |
do
|
41 |
nSkimmed=`cat $listSkimmedEventsPath/$j|wc -l`
|
42 |
skimName=`echo $j|sed s/^[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9][0-9][0-9]\_//g`
|
43 |
|
44 |
cat > $j.html <<EOF
|
45 |
<html>
|
46 |
<head>
|
47 |
<title>Skim Path Details</title>
|
48 |
<link rel="stylesheet" type="text/css" href="../../fromGiovanni.css" />
|
49 |
</head>
|
50 |
<body>
|
51 |
<h1>Skim Path Details</h1>
|
52 |
<table class='selectedEventsSummary'>
|
53 |
<tr>
|
54 |
<th>Run</th> <th> LumiSection </th> <th> event </th> <th> date & time</th> <th> event summary </th> <th> event display shots </th> <th> extract event </th>
|
55 |
</tr>
|
56 |
EOF
|
57 |
IFS=$'\n'
|
58 |
for line in $(cat $listSkimmedEventsPath/$j);
|
59 |
do
|
60 |
run=`echo $line|awk '{print $1}'`
|
61 |
ls=`echo $line|awk '{print $2}'`
|
62 |
evt=`echo $line|awk '{print $3}'`
|
63 |
date=`echo $line|awk '{print $4" "$5" "$6" "$7" "$8}'`
|
64 |
|
65 |
cat >> $j.html <<EOF
|
66 |
<tr>
|
67 |
<td> $run </td> <td> $ls </td> <td> $evt </td> <td> $date</td> <td><a href="$HEDS_LABEL.dumperLogs/$run.$ls.$evt.log"> link </a></td> <td><a
|
68 |
href="../$HEDS_LABEL.shots/?match=${run}_${evt}_${ls}_*.png"> link </a></td> <td><a href="configFiles/extractEvent.php?input=$mergedFileCastor&run=$run&ls=$ls&evt=$evt"> extractEvent.py </a></td>
|
69 |
</tr>
|
70 |
EOF
|
71 |
done
|
72 |
cat >> $j.html <<EOF
|
73 |
</table>
|
74 |
|
75 |
</body>
|
76 |
</html>
|
77 |
|
78 |
EOF
|
79 |
mv $j.html $listSkimmedEventsPath/
|
80 |
done
|
81 |
;;
|
82 |
*)
|
83 |
echo "option " $1 " not defined"
|
84 |
;;
|
85 |
|
86 |
esac
|
87 |
|
88 |
|