ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HiggsAnalysis/EarlyDataStudy/scripts/createTableSkimDetails.sh
Revision: 1.3
Committed: Fri May 7 13:24:43 2010 UTC (14 years, 11 months ago) by mangano
Content type: application/x-sh
Branch: MAIN
CVS Tags: V00-02-00, V00-01-03, V00-01-02, V00-01-01, V00-01-00, V00-00-01, V00-00-00, HEAD
Changes since 1.2: +9 -6 lines
Log Message:
made scripts more robust and improve print-out

File Contents

# User Rev Content
1 mangano 1.1 #!/bin/bash
2     ############# preliminary part ################
3     choice=$1
4 mangano 1.3 #echo "choice: " $choice
5 mangano 1.1 ###
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 mangano 1.2 cd $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents
20 mangano 1.3 if ((! $?)); then
21     rm *.html
22     rm configFiles/*
23     rmdir configFiles
24     fi
25 mangano 1.1 ;;
26    
27     add)
28     mergedFileCastor="rfio:$HEDS_CASTORFOLDER/skimV$HEDS_SKIMVERSION/merged_$HEDS_LABEL.root"
29    
30 mangano 1.2 listSkimmedEventsPath=$HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/$HEDS_LABEL.listSkimmedEvents
31 mangano 1.1
32 mangano 1.3 if [ ! -d $listSkimmedEventsPath/configFiles ];then
33 mangano 1.1 mkdir $listSkimmedEventsPath/configFiles
34     fi
35     cp $HEDSPATH/scripts/extractEvent.php $listSkimmedEventsPath/configFiles/
36 mangano 1.3 listSkims=`ls $listSkimmedEventsPath|grep -v summary|grep -v html|grep -v configFiles|grep -v dumperLogs \
37     |grep ${HEDS_LABEL}_Skim`
38 mangano 1.1 # --- 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&amp;run=$run&amp;ls=$ls&amp;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