ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HiggsAnalysis/EarlyDataStudy/scripts/parseDumperOutput.sh
Revision: 1.2
Committed: Thu May 6 17:55:14 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.1: +2 -2 lines
Log Message:
change destination folder for WWW pages

File Contents

# User Rev Content
1 mangano 1.1 #!/bin/bash
2    
3     ##########################################
4     # $1 option
5     # 1 --> make parsing
6     # 2 --> move files
7     ##########################################
8     option=$1
9    
10    
11     case $option in
12     1)
13     foundRecordBegin=0
14     counter=0
15     #
16     IFS=$'\n'
17     grep -v "Begin processing" $HEDS_LABEL.dumperLog| \
18     grep -v "Closed file" > lighter.log
19    
20     for line in $(cat lighter.log);
21     do
22    
23     if [[ "$line" =~ "RUN.*LS.*EVENT" ]] #found new event block
24     then
25     counter=`expr $counter + 1`
26     echo "found new event block. Total: " $counter;
27     foundRecordBegin=1
28    
29     run=$(echo $line |awk '{print $3}')
30     ls=$(echo $line |awk '{print $5}')
31     evt=$(echo $line |awk '{print $7}')
32    
33     fi
34     if [ $foundRecordBegin == 1 ]
35     then
36     echo $line >> $run.$ls.$evt.log
37     fi
38    
39     if [[ "$line" =~ "RECORD SEPARATOR" ]]
40     then
41     foundRecordBegin=0
42     fi
43    
44     # if [ $counter == 10 ]
45     # then
46     # break
47     # fi
48     done
49    
50     rm lighter.log
51     if [ -d $HEDS_LABEL.dumperLogs ]
52     then rm -r $HEDS_LABEL.dumperLogs
53     fi
54     mkdir $HEDS_LABEL.dumperLogs
55     mv *.log $HEDS_LABEL.dumperLogs
56     ;;
57    
58     2)
59 mangano 1.2 echo "..copying detailed dumps to " $HEDS_WWWAREA_TMP
60 mangano 1.1 mv $HEDS_LABEL.dumperLogs \
61 mangano 1.2 $HEDS_WWWAREA_TMP/logs.SkimV$HEDS_SKIMVERSION/${HEDS_LABEL}.listSkimmedEvents
62 mangano 1.1 ;;
63     esac